File: core.h

package info (click to toggle)
shntool 3.0.7-1.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,052 kB
  • ctags: 959
  • sloc: ansic: 8,422; sh: 3,729; makefile: 81
file content (129 lines) | stat: -rw-r--r-- 3,328 bytes parent folder | download | duplicates (2)
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
120
121
122
123
124
125
126
127
128
129
/*  core.h - private type definitions, defines and macros
 *  Copyright (C) 2000-2008  Jason Jordan <shnutils@freeshell.org>
 *
 *  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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

/*
 * $Id: core.h,v 1.91 2008/02/18 23:25:13 jason Exp $
 */

#ifndef __CORE_H__
#define __CORE_H__

/* program info */
#define RELEASE   VERSION
#define COPYRIGHT "Copyright (C) 2000-2008"
#define AUTHOR    "Jason Jordan <shnutils@freeshell.org>"
#define URL1      "http://www.etree.org/shnutils/"
#define URL2      "http://shnutils.freeshell.org/"

/* options reserved for global use - modes cannot use these */
#define GLOBAL_OPTS        "DHP:hi:qr:vw"
#define GLOBAL_OPTS_OUTPUT "O:a:d:o:z:"
#define GLOBAL_OPTS_CORE   "fhjmv"

/* set this environment variable to enable debugging.  can also use -D, but this enables it earlier */
#define SHNTOOL_DEBUG_ENV "ST_DEBUG"

/* various buffer sizes */
#define PROGNAME_SIZE 256

#ifdef HAVE_VSNPRINTF
#define st_vsnprintf(a,b,c,d) vsnprintf(a,b,c,d)
#else
#define st_vsnprintf(a,b,c,d) vsprintf(a,c,d)
#endif

#ifndef HAVE_STRERROR
extern char *sys_errlist[];
#define strerror(x) sys_errlist[x]
#endif

/* macro for natural filename sorting */
#ifndef PARAMS
#  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
#    define PARAMS(Args) Args
#  else
#    define PARAMS(Args) ()
#  endif
#endif

/* ID3v2 definitions */
#define ID3V2_MAGIC "ID3"

/* id3v2 header */
typedef struct _id3v2_header {
  char magic[3];
  unsigned char version[2];
  unsigned char flags[1];
  unsigned char size[4];
} id3v2_header;

/* file clobber actions */
typedef enum {
  CLOBBER_ACTION_ASK,
  CLOBBER_ACTION_ALWAYS,
  CLOBBER_ACTION_NEVER
} clobber_action_types;

/* progress indicator types */
typedef enum {
  PROGRESS_NONE,
  PROGRESS_PERCENT,
  PROGRESS_DOT,
  PROGRESS_SPIN,
  PROGRESS_FACE
} progress_types;

/* argument sources */
typedef enum {
  ARGSRC_FORMAT,
  ARGSRC_CMDLINE,
  ARGSRC_ENV
} argument_sources;

/* mode and format module arrays */
extern mode_module *st_modes[];
extern format_module *st_formats[];

/* private global options */
typedef struct _private_opts {
  char *progname;
  char *progmode;
  char  fullprogname[PROGNAME_SIZE];
  int   debug_level;
  int   clobber_action;
  int   reorder_type;
  int   progress_type;
  bool  is_aliased;
  bool  show_hmmss;
  bool  suppress_warnings;
  bool  suppress_stderr;
  bool  screen_dirty;
  mode_module *mode;
} private_opts;

extern private_opts st_priv;

/* miscellaneous functions */

/* generic version printing function */
void st_version(void);

/* functions for building argument lists in format modules */
void arg_init(format_module *);

#endif