File: version.c

package info (click to toggle)
madplay 0.15.2b-9
  • links: PTS
  • area: main
  • in suites: bullseye, sid
  • size: 3,208 kB
  • sloc: ansic: 17,882; sh: 9,397; makefile: 503; yacc: 288; sed: 16
file content (119 lines) | stat: -rw-r--r-- 3,598 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
 * madplay - MPEG audio decoder and player
 * Copyright (C) 2000-2004 Robert Leslie
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * $Id: version.c,v 1.18 2004/01/23 09:41:32 rob Exp $
 */

# ifdef HAVE_CONFIG_H
#  include "config.h"
# endif

# include "global.h"

# include <stdio.h>
# include <string.h>
# include <mad.h>
# include <id3tag.h>

# include "gettext.h"

# include "version.h"

# define STRINGIZE(str)	#str
# define STRING(str)	STRINGIZE(str)

# define COPYRIGHT	"Copyright (C)"

char const madplay_version[]   = "madplay " MADPLAY_VERSION;
char const madplay_copyright[] = COPYRIGHT " " MADPLAY_PUBLISHYEAR
                                 " " MADPLAY_AUTHOR;
char const madplay_author[]    = MADPLAY_AUTHOR " <" MADPLAY_EMAIL ">";

char const madplay_build[] = ""
# if defined(DEBUG)
  "DEBUG "
# elif defined(NDEBUG)
  "NDEBUG "
# endif

# if defined(EXPERIMENTAL)
  "EXPERIMENTAL "
# endif

  "AUDIO_DEFAULT=" STRING(AUDIO_DEFAULT) " "

# if defined(ENABLE_NLS)
  "ENABLE_NLS "
# endif
;

void ver_banner(FILE *stream)
{
  fprintf(stream, "%s %s - %s %s %s et al.\n", _("MPEG Audio Decoder"),
	  MADPLAY_VERSION,
	  _("Copyright (C)"), MADPLAY_PUBLISHYEAR, MADPLAY_AUTHOR);

  fflush(stream);
}

void copyright(FILE *stream, char const *str)
{
  if (strstr(str, COPYRIGHT) == str)
    fprintf(stream, "  %s%s\n", _(COPYRIGHT), &str[sizeof(COPYRIGHT) - 1]);
  else
    fprintf(stream, "  %s\n", str);
}

void ver_version(FILE *stream)
{
  fprintf(stream, "%s\n", mad_version);
  copyright(stream, mad_copyright);
  fprintf(stream, "  %s: %s\n\n", _("Build options"), mad_build);

  fprintf(stream, "%s\n", id3_version);
  copyright(stream, id3_copyright);
  fprintf(stream, "  %s: %s\n\n", _("Build options"), id3_build);

  fprintf(stream, "%s\n", madplay_version);
  copyright(stream, madplay_copyright);
  fprintf(stream, "  %s: %s\n\n", _("Build options"), madplay_build);
}

void ver_license(FILE *stream)
{
  fputc('\n', stream);
  fprintf(stream,
  _("This program is free software; you can redistribute it and/or modify it\n"
    "under the terms of the GNU General Public License as published by the\n"
    "Free Software Foundation; either version 2 of the License, or (at your\n"
    "option) any later version.\n\n"

    "This program is distributed in the hope that it will be useful, but\n"
    "WITHOUT ANY WARRANTY; without even the implied warranty of\n"
    "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n"
    "General Public License for more details.\n\n"

    "You should have received a copy of the GNU General Public License along\n"
    "with this program; if not, write to the Free Software Foundation, Inc.,\n"
    "59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n\n"

    "Some portions of this program may be licensable under different terms.\n"
    "To inquire about alternate licensing, contact: %s\n"), madplay_author);

  fputc('\n', stream);
}