kconfig/lkc.h
changeset 1 eeea35fbf182
child 39 af42eec9d383
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/kconfig/lkc.h	Sat Feb 24 11:00:05 2007 +0000
     1.3 @@ -0,0 +1,157 @@
     1.4 +/*
     1.5 + * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
     1.6 + * Released under the terms of the GNU GPL v2.0.
     1.7 + */
     1.8 +
     1.9 +#ifndef LKC_H
    1.10 +#define LKC_H
    1.11 +
    1.12 +#define PROJECT_NAME "crosstool-NG"
    1.13 +
    1.14 +// Make some warnings go away
    1.15 +#define YYENABLE_NLS 0
    1.16 +#define YYLTYPE_IS_TRIVIAL 0
    1.17 +
    1.18 +#include "expr.h"
    1.19 +
    1.20 +#ifndef KBUILD_NO_NLS
    1.21 +# include <libintl.h>
    1.22 +#else
    1.23 +# define gettext(Msgid) ((const char *) (Msgid))
    1.24 +# define textdomain(Domainname) ((const char *) (Domainname))
    1.25 +# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
    1.26 +#endif
    1.27 +
    1.28 +#ifdef __cplusplus
    1.29 +extern "C" {
    1.30 +#endif
    1.31 +
    1.32 +#ifdef LKC_DIRECT_LINK
    1.33 +#define P(name,type,arg)	extern type name arg
    1.34 +#else
    1.35 +#include "lkc_defs.h"
    1.36 +#define P(name,type,arg)	extern type (*name ## _p) arg
    1.37 +#endif
    1.38 +#include "lkc_proto.h"
    1.39 +#undef P
    1.40 +
    1.41 +#define SRCTREE "srctree"
    1.42 +
    1.43 +#define PACKAGE "crosstool-NG"
    1.44 +#define LOCALEDIR "/usr/share/locale"
    1.45 +
    1.46 +#define _(text) gettext(text)
    1.47 +#define N_(text) (text)
    1.48 +
    1.49 +
    1.50 +#define TF_COMMAND	0x0001
    1.51 +#define TF_PARAM	0x0002
    1.52 +#define TF_OPTION	0x0004
    1.53 +
    1.54 +#define T_OPT_MODULES		1
    1.55 +#define T_OPT_DEFCONFIG_LIST	2
    1.56 +
    1.57 +struct kconf_id {
    1.58 +	int name;
    1.59 +	int token;
    1.60 +	unsigned int flags;
    1.61 +	enum symbol_type stype;
    1.62 +};
    1.63 +
    1.64 +int zconfparse(void);
    1.65 +void zconfdump(FILE *out);
    1.66 +
    1.67 +extern int zconfdebug;
    1.68 +void zconf_starthelp(void);
    1.69 +FILE *zconf_fopen(const char *name);
    1.70 +void zconf_initscan(const char *name);
    1.71 +void zconf_nextfile(const char *name);
    1.72 +int zconf_lineno(void);
    1.73 +char *zconf_curname(void);
    1.74 +
    1.75 +/* confdata.c */
    1.76 +char *conf_get_default_confname(void);
    1.77 +
    1.78 +/* kconfig_load.c */
    1.79 +void kconfig_load(void);
    1.80 +
    1.81 +/* menu.c */
    1.82 +void menu_init(void);
    1.83 +struct menu *menu_add_menu(void);
    1.84 +void menu_end_menu(void);
    1.85 +void menu_add_entry(struct symbol *sym);
    1.86 +void menu_end_entry(void);
    1.87 +void menu_add_dep(struct expr *dep);
    1.88 +struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep);
    1.89 +struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep);
    1.90 +void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep);
    1.91 +void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep);
    1.92 +void menu_add_option(int token, char *arg);
    1.93 +void menu_finalize(struct menu *parent);
    1.94 +void menu_set_type(int type);
    1.95 +
    1.96 +/* util.c */
    1.97 +struct file *file_lookup(const char *name);
    1.98 +int file_write_dep(const char *name);
    1.99 +
   1.100 +struct gstr {
   1.101 +	size_t len;
   1.102 +	char  *s;
   1.103 +};
   1.104 +struct gstr str_new(void);
   1.105 +struct gstr str_assign(const char *s);
   1.106 +void str_free(struct gstr *gs);
   1.107 +void str_append(struct gstr *gs, const char *s);
   1.108 +void str_printf(struct gstr *gs, const char *fmt, ...);
   1.109 +const char *str_get(struct gstr *gs);
   1.110 +
   1.111 +/* symbol.c */
   1.112 +void sym_init(void);
   1.113 +void sym_clear_all_valid(void);
   1.114 +void sym_set_all_changed(void);
   1.115 +void sym_set_changed(struct symbol *sym);
   1.116 +struct symbol *sym_check_deps(struct symbol *sym);
   1.117 +struct property *prop_alloc(enum prop_type type, struct symbol *sym);
   1.118 +struct symbol *prop_get_symbol(struct property *prop);
   1.119 +
   1.120 +static inline tristate sym_get_tristate_value(struct symbol *sym)
   1.121 +{
   1.122 +	return sym->curr.tri;
   1.123 +}
   1.124 +
   1.125 +
   1.126 +static inline struct symbol *sym_get_choice_value(struct symbol *sym)
   1.127 +{
   1.128 +	return (struct symbol *)sym->curr.val;
   1.129 +}
   1.130 +
   1.131 +static inline bool sym_set_choice_value(struct symbol *ch, struct symbol *chval)
   1.132 +{
   1.133 +	return sym_set_tristate_value(chval, yes);
   1.134 +}
   1.135 +
   1.136 +static inline bool sym_is_choice(struct symbol *sym)
   1.137 +{
   1.138 +	return sym->flags & SYMBOL_CHOICE ? true : false;
   1.139 +}
   1.140 +
   1.141 +static inline bool sym_is_choice_value(struct symbol *sym)
   1.142 +{
   1.143 +	return sym->flags & SYMBOL_CHOICEVAL ? true : false;
   1.144 +}
   1.145 +
   1.146 +static inline bool sym_is_optional(struct symbol *sym)
   1.147 +{
   1.148 +	return sym->flags & SYMBOL_OPTIONAL ? true : false;
   1.149 +}
   1.150 +
   1.151 +static inline bool sym_has_value(struct symbol *sym)
   1.152 +{
   1.153 +	return sym->flags & SYMBOL_DEF_USER ? true : false;
   1.154 +}
   1.155 +
   1.156 +#ifdef __cplusplus
   1.157 +}
   1.158 +#endif
   1.159 +
   1.160 +#endif /* LKC_H */