aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/genksyms/genksyms.h
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2006-03-12 17:26:29 -0500
committerSam Ravnborg <sam@mars.ravnborg.org>2006-03-12 17:26:29 -0500
commitce560686947fd50b30eaf42045554797f53949dd (patch)
treeae04b6c366eec6c6ff9726a8034ffd61c269ce1b /scripts/genksyms/genksyms.h
parent78c041530ac2e65c9290137bfe3004340e0840d2 (diff)
kbuild: clean-up genksyms
o remove all inlines o declare everything static which is only used by genksyms.c o delete unused functions o delete unused variables o delete unused stuff in genksyms.h o properly ident genksyms.h Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/genksyms/genksyms.h')
-rw-r--r--scripts/genksyms/genksyms.h57
1 files changed, 17 insertions, 40 deletions
diff --git a/scripts/genksyms/genksyms.h b/scripts/genksyms/genksyms.h
index f09af47ab281..ab6f34f38735 100644
--- a/scripts/genksyms/genksyms.h
+++ b/scripts/genksyms/genksyms.h
@@ -20,74 +20,51 @@
20 along with this program; if not, write to the Free Software Foundation, 20 along with this program; if not, write to the Free Software Foundation,
21 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 21 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
22 22
23
24#ifndef MODUTILS_GENKSYMS_H 23#ifndef MODUTILS_GENKSYMS_H
25#define MODUTILS_GENKSYMS_H 1 24#define MODUTILS_GENKSYMS_H 1
26 25
27#include <stdio.h> 26#include <stdio.h>
28 27
29 28enum symbol_type {
30enum symbol_type 29 SYM_NORMAL, SYM_TYPEDEF, SYM_ENUM, SYM_STRUCT, SYM_UNION
31{
32 SYM_NORMAL, SYM_TYPEDEF, SYM_ENUM, SYM_STRUCT, SYM_UNION
33}; 30};
34 31
35struct string_list 32struct string_list {
36{ 33 struct string_list *next;
37 struct string_list *next; 34 enum symbol_type tag;
38 enum symbol_type tag; 35 char *string;
39 char *string;
40}; 36};
41 37
42struct symbol 38struct symbol {
43{ 39 struct symbol *hash_next;
44 struct symbol *hash_next; 40 const char *name;
45 const char *name; 41 enum symbol_type type;
46 enum symbol_type type; 42 struct string_list *defn;
47 struct string_list *defn; 43 struct symbol *expansion_trail;
48 struct symbol *expansion_trail; 44 int is_extern;
49 int is_extern;
50}; 45};
51 46
52typedef struct string_list **yystype; 47typedef struct string_list **yystype;
53#define YYSTYPE yystype 48#define YYSTYPE yystype
54 49
55extern FILE *outfile, *debugfile;
56
57extern int cur_line; 50extern int cur_line;
58extern char *cur_filename, *output_directory; 51extern char *cur_filename;
59
60extern int flag_debug, flag_dump_defs, flag_warnings;
61extern int checksum_version, kernel_version;
62
63extern int want_brace_phrase, want_exp_phrase, discard_phrase_contents;
64extern struct string_list *current_list, *next_list;
65
66 52
67struct symbol *find_symbol(const char *name, enum symbol_type ns); 53struct symbol *find_symbol(const char *name, enum symbol_type ns);
68struct symbol *add_symbol(const char *name, enum symbol_type type, 54struct symbol *add_symbol(const char *name, enum symbol_type type,
69 struct string_list *defn, int is_extern); 55 struct string_list *defn, int is_extern);
70void export_symbol(const char *); 56void export_symbol(const char *);
71 57
72struct string_list *reset_list(void);
73void free_list(struct string_list *s, struct string_list *e);
74void free_node(struct string_list *list); 58void free_node(struct string_list *list);
59void free_list(struct string_list *s, struct string_list *e);
75struct string_list *copy_node(struct string_list *); 60struct string_list *copy_node(struct string_list *);
76struct string_list *copy_list(struct string_list *s, struct string_list *e);
77int equal_list(struct string_list *a, struct string_list *b);
78void print_list(FILE *, struct string_list *list);
79 61
80int yylex(void); 62int yylex(void);
81int yyparse(void); 63int yyparse(void);
82 64
83void error_with_pos(const char *, ...); 65void error_with_pos(const char *, ...);
84 66
85#define version(a,b,c) ((a << 16) | (b << 8) | (c))
86
87/*----------------------------------------------------------------------*/ 67/*----------------------------------------------------------------------*/
88
89#define MODUTILS_VERSION "<in-kernel>"
90
91#define xmalloc(size) ({ void *__ptr = malloc(size); \ 68#define xmalloc(size) ({ void *__ptr = malloc(size); \
92 if(!__ptr && size != 0) { \ 69 if(!__ptr && size != 0) { \
93 fprintf(stderr, "out of memory\n"); \ 70 fprintf(stderr, "out of memory\n"); \
@@ -101,4 +78,4 @@ void error_with_pos(const char *, ...);
101 } \ 78 } \
102 __str; }) 79 __str; })
103 80
104#endif /* genksyms.h */ 81#endif /* genksyms.h */