~ubuntu-branches/ubuntu/feisty/cproto/feisty

« back to all changes in this revision

Viewing changes to cproto.h

  • Committer: Bazaar Package Importer
  • Author(s): Kenneth J. Pronovici
  • Date: 2004-03-30 19:58:33 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040330195833-loh9sgce2as79j67
Tags: 4.7c-1
* New upstream release.
  - Includes equivalent of patch as used to close #228801 (see below).
  - Supports -X option to filter out unwanted definitions (closes: #235824).
* Now configure using --enable-llib option, so we don't need lint installed.
* Added gcc to Depends: line since -X option requires GCC to work; I assume
  most users will already have gcc installed anyway, if they are developers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: cproto.h,v 4.6 1998/01/19 00:49:16 cthuang Exp $
 
1
/* $Id: cproto.h,v 4.6.1.4 2004/03/24 21:08:29 tom Exp tom $
2
2
 *
3
3
 * Declarations for C function prototype generator
4
4
 */
9
9
#include "config.h"
10
10
#endif
11
11
 
 
12
#ifndef BISON_HAS_YYTNAME
 
13
#define BISON_HAS_YYTNAME 0
 
14
#endif
 
15
 
 
16
#ifndef YACC_HAS_YYNAME
 
17
#define YACC_HAS_YYNAME 0
 
18
#endif
 
19
 
 
20
#ifndef YACC_HAS_YYTOKS
 
21
#define YACC_HAS_YYTOKS 0
 
22
#endif
 
23
 
 
24
#ifndef YACC_HAS_YYTOKS_2
 
25
#define YACC_HAS_YYTOKS_2 0
 
26
#endif
 
27
 
 
28
#ifndef HAVE_POPEN_PROTOTYPE
 
29
#define HAVE_POPEN_PROTOTYPE 0
 
30
#endif
 
31
 
 
32
#ifndef HAVE_LIBDBMALLOC
 
33
#define HAVE_LIBDBMALLOC 0
 
34
#endif
 
35
 
 
36
#ifndef HAVE_LIBDMALLOC
 
37
#define HAVE_LIBDMALLOC 0
 
38
#endif
 
39
 
12
40
#include "system.h"
13
41
 
14
42
#if HAVE_LIBDMALLOC || HAVE_LIBDBMALLOC || defined(DOALLOC)
58
86
#define DS_CHAR         4       /* contains "char" type specifier */
59
87
#define DS_SHORT        8       /* contains "short" type specifier */
60
88
#define DS_FLOAT        16      /* contains "float" type specifier */
61
 
#define DS_JUNK         32      /* we're not interested in this declaration */
 
89
#define DS_INLINE       32      /* contains "inline" specifier */
 
90
#define DS_JUNK         64      /* we're not interested in this declaration */
62
91
 
63
92
/* This structure stores information about a declaration specifier. */
64
93
typedef struct decl_spec {
165
194
/* Program options */
166
195
extern boolean extern_out;
167
196
extern Scope scope_out;
 
197
extern boolean inline_out;
168
198
#if OPT_LINTLIBRARY
169
199
extern boolean types_out;
170
200
extern boolean lint_shadowed;
189
219
extern int varargs_num;         /* supports varargs-comment */
190
220
extern char *varargs_str;       /* additional info, such as PRINTFLIKEnn */
191
221
extern int extern_in;           /* supports "LINT_EXTERNnn" */
 
222
extern int do_tracking;         /* supports "-X" option */
192
223
extern int exitlike_func;       /* supports noreturn-attribute */
193
224
extern int in_include;          /* current include-level */
194
225
extern int debug_trace;
196
227
 
197
228
/* cproto.c */
198
229
#if HAVE_LIBDBMALLOC
199
 
extern void ExitProgram     ARGS((int code));
 
230
extern void ExitProgram     (int code);
200
231
#define exit(code) ExitProgram(code)
201
232
#endif
202
233
#if !HAVE_LIBDMALLOC
203
234
#ifdef NO_LEAKS
204
 
extern char *xMalloc        ARGS((unsigned n, char *f, int l));
205
 
extern char *xStrdup        ARGS((char *s,    char *f, int l));
 
235
extern char *xMalloc        (unsigned n, char *f, int l);
 
236
extern char *xStrdup        (char *s,    char *f, int l);
206
237
#define xmalloc(n)          xMalloc(n, __FILE__, __LINE__)
207
238
#define xstrdup(s)          xStrdup(s, __FILE__, __LINE__)
208
239
#else
209
 
extern char *xmalloc        ARGS((unsigned n));
210
 
extern char *xstrdup        ARGS((char *src));
 
240
extern char *xmalloc        (unsigned n);
 
241
extern char *xstrdup        (char *src);
211
242
#endif
212
243
#endif /* !HAVE_LIBDMALLOC */
213
 
extern void put_error       ARGS((void));
214
 
extern int is_path_sep      ARGS((int ch));
215
 
extern char *trim_path_sep  ARGS((char *s));
 
244
extern void put_error       (void);
 
245
extern int is_path_sep      (int ch);
 
246
extern char *trim_path_sep  (char *s);
216
247
 
217
248
/* lintlibs.c */
218
249
#if OPT_LINTLIBRARY
219
 
extern void put_string      ARGS((FILE *outf, char *s));
220
 
extern void put_char        ARGS((FILE *outf, int c));
221
 
extern void put_newline     ARGS((FILE *outf));
222
 
extern void put_blankline   ARGS((FILE *outf));
223
 
extern void put_padded      ARGS((FILE *outf, char *s));
224
 
extern void fmt_library     ARGS((int code));
225
 
extern void begin_tracking  ARGS((void));
226
 
extern int already_declared ARGS((char *name));
227
 
extern void track_in        ARGS((void));
228
 
extern int want_typedef     ARGS((void));
229
 
extern void begin_typedef   ARGS((void));
230
 
extern void copy_typedef    ARGS((char *s));
231
 
extern void end_typedef     ARGS((void));
232
 
extern void imply_typedef   ARGS((char *s));
233
 
extern char *implied_typedef ARGS((void));
234
 
extern void indent          ARGS((FILE *outf));
235
 
extern int lint_ellipsis    ARGS((Parameter *p));
 
250
extern void put_string      (FILE *outf, char *s);
 
251
extern void put_char        (FILE *outf, int c);
 
252
extern void put_newline     (FILE *outf);
 
253
extern void put_blankline   (FILE *outf);
 
254
extern void put_padded      (FILE *outf, char *s);
 
255
extern void fmt_library     (int code);
 
256
extern void begin_tracking  (void);
 
257
extern int already_declared (char *name);
 
258
extern void track_in        (void);
 
259
extern int want_typedef     (void);
 
260
extern void begin_typedef   (void);
 
261
extern void copy_typedef    (char *s);
 
262
extern void end_typedef     (void);
 
263
extern void imply_typedef   (char *s);
 
264
extern char *implied_typedef (void);
 
265
extern void indent          (FILE *outf);
 
266
extern int lint_ellipsis    (Parameter *p);
236
267
#if OPT_LINTLIBRARY
237
 
extern void flush_varargs   ARGS((void));
 
268
extern void flush_varargs   (void);
238
269
#else
239
270
#define flush_varargs() /* nothing */
240
271
#endif
241
 
extern void ellipsis_varargs ARGS((Declarator *d));
242
 
extern char *supply_parm    ARGS((int count));
243
 
extern int is_actual_func   ARGS((Declarator *d));
244
 
extern void put_body        ARGS((FILE *outf, DeclSpec *decl_spec, Declarator *declarator));
 
272
extern void ellipsis_varargs (Declarator *d);
 
273
extern char *supply_parm    (int count);
 
274
extern int is_actual_func   (Declarator *d);
 
275
extern void put_body        (FILE *outf, DeclSpec *decl_spec, Declarator *declarator);
245
276
# ifdef NO_LEAKS
246
 
extern void free_lintlibs   ARGS((void));
 
277
extern void free_lintlibs   (void);
247
278
# endif
248
279
#else
249
280
#define put_string(fp,S)    fputs(S, fp)
259
290
#endif
260
291
 
261
292
/* strkey.c */
262
 
extern char *strkey         ARGS((char *src, char *key));
263
 
extern void strcut          ARGS((char *src, char *key));
 
293
extern char *strkey         (char *src, char *key);
 
294
extern void strcut          (char *src, char *key);
264
295
 
265
296
/* grammar.y */
266
 
extern boolean is_typedef_name ARGS((char *name));
267
 
extern char *cur_file_name  ARGS((void));
268
 
extern unsigned cur_line_num ARGS((void));
269
 
extern FILE *cur_tmp_file   ARGS((void));
270
 
extern void cur_file_changed ARGS((void));
271
 
extern long cur_begin_comment ARGS((void));
272
 
extern char *cur_text       ARGS((void));
273
 
extern void pop_file        ARGS((int closed));
274
 
extern void init_parser     ARGS((void));
275
 
extern void process_file    ARGS((FILE *infile, char *name));
 
297
extern boolean is_typedef_name (char *name);
 
298
extern char *cur_file_name  (void);
 
299
extern unsigned cur_line_num (void);
 
300
extern FILE *cur_tmp_file   (void);
 
301
extern void cur_file_changed (void);
 
302
extern long cur_begin_comment (void);
 
303
extern char *cur_text       (void);
 
304
extern void pop_file        (int closed);
 
305
extern void init_parser     (void);
 
306
extern void process_file    (FILE *infile, char *name);
276
307
#ifdef NO_LEAKS
277
 
extern void free_parser     ARGS((void));
 
308
extern void free_parser     (void);
 
309
#endif
 
310
 
 
311
/* workaround for one of the bugs in bison 1.875 */
 
312
#ifdef YYBISON
 
313
#define YYSTYPE YYSTYPE
278
314
#endif
279
315
 
280
316
#endif /* CPROTO_H */