base/config/kconfig/expr.h File Reference

#include <stdio.h>
#include <stdbool.h>

Include dependency graph for expr.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  file
union  expr_data
struct  expr
struct  expr_value
struct  symbol_value
struct  symbol
struct  property
struct  menu

Defines

#define FILE_BUSY   0x0001
#define FILE_SCANNED   0x0002
#define FILE_PRINTED   0x0004
#define E_OR(dep1, dep2)   (((dep1)>(dep2))?(dep1):(dep2))
#define E_AND(dep1, dep2)   (((dep1)<(dep2))?(dep1):(dep2))
#define E_NOT(dep)   (2-(dep))
#define for_all_symbols(i, sym)   for (i = 0; i < 257; i++) for (sym = symbol_hash[i]; sym; sym = sym->next) if (sym->type != S_OTHER)
#define SYMBOL_YES   0x0001
#define SYMBOL_MOD   0x0002
#define SYMBOL_NO   0x0004
#define SYMBOL_CONST   0x0007
#define SYMBOL_CHECK   0x0008
#define SYMBOL_CHOICE   0x0010
#define SYMBOL_CHOICEVAL   0x0020
#define SYMBOL_PRINTED   0x0040
#define SYMBOL_VALID   0x0080
#define SYMBOL_OPTIONAL   0x0100
#define SYMBOL_WRITE   0x0200
#define SYMBOL_CHANGED   0x0400
#define SYMBOL_NEW   0x0800
#define SYMBOL_AUTO   0x1000
#define SYMBOL_CHECKED   0x2000
#define SYMBOL_CHECK_DONE   0x4000
#define SYMBOL_WARNED   0x8000
#define SYMBOL_MAXLENGTH   256
#define SYMBOL_HASHSIZE   257
#define SYMBOL_HASHMASK   0xff
#define for_all_properties(sym, st, tok)
#define for_all_defaults(sym, st)   for_all_properties(sym, st, P_DEFAULT)
#define for_all_choices(sym, st)   for_all_properties(sym, st, P_CHOICE)
#define for_all_prompts(sym, st)
#define MENU_CHANGED   0x0001
#define MENU_ROOT   0x0002

Typedefs

typedef enum tristate tristate

Enumerations

enum  tristate { no, mod, yes }
enum  expr_type {
  E_NONE, E_OR, E_AND, E_NOT,
  E_EQUAL, E_UNEQUAL, E_CHOICE, E_SYMBOL,
  E_RANGE
}
enum  symbol_type {
  S_UNKNOWN, S_BOOLEAN, S_TRISTATE, S_INT,
  S_HEX, S_STRING, S_OTHER
}
enum  prop_type {
  P_UNKNOWN, P_PROMPT, P_COMMENT, P_MENU,
  P_DEFAULT, P_CHOICE, P_SELECT, P_RANGE
}

Functions

filelookup_file (const char *name)
exprexpr_alloc_symbol (struct symbol *sym)
exprexpr_alloc_one (enum expr_type type, struct expr *ce)
exprexpr_alloc_two (enum expr_type type, struct expr *e1, struct expr *e2)
exprexpr_alloc_comp (enum expr_type type, struct symbol *s1, struct symbol *s2)
exprexpr_alloc_and (struct expr *e1, struct expr *e2)
exprexpr_alloc_or (struct expr *e1, struct expr *e2)
exprexpr_copy (struct expr *org)
void expr_free (struct expr *e)
int expr_eq (struct expr *e1, struct expr *e2)
void expr_eliminate_eq (struct expr **ep1, struct expr **ep2)
tristate expr_calc_value (struct expr *e)
exprexpr_eliminate_yn (struct expr *e)
exprexpr_trans_bool (struct expr *e)
exprexpr_eliminate_dups (struct expr *e)
exprexpr_transform (struct expr *e)
int expr_contains_symbol (struct expr *dep, struct symbol *sym)
bool expr_depends_symbol (struct expr *dep, struct symbol *sym)
exprexpr_extract_eq_and (struct expr **ep1, struct expr **ep2)
exprexpr_extract_eq_or (struct expr **ep1, struct expr **ep2)
void expr_extract_eq (enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2)
exprexpr_trans_compare (struct expr *e, enum expr_type type, struct symbol *sym)
void expr_fprint (struct expr *e, FILE *out)
void print_expr (int mask, struct expr *e, int prevtoken)
int expr_is_yes (struct expr *e)
int expr_is_no (struct expr *e)

Variables

filefile_list
filecurrent_file
symbol symbol_yes symbol_no symbol_mod
symbolmodules_sym
int cdebug


Define Documentation

#define E_AND dep1,
dep2   )     (((dep1)<(dep2))?(dep1):(dep2))
 

Definition at line 49 of file expr.h.

Referenced by __expr_eliminate_eq(), expr_alloc_and(), expr_calc_value(), expr_compare_type(), expr_contains_symbol(), expr_copy(), expr_depends_symbol(), expr_eliminate_dups(), expr_eliminate_dups1(), expr_eliminate_dups2(), expr_eliminate_eq(), expr_eliminate_yn(), expr_eq(), expr_extract_eq(), expr_extract_eq_and(), expr_free(), expr_print(), expr_trans_bool(), expr_trans_compare(), expr_transform(), menu_check_dep(), sym_calc_value(), and sym_check_expr_deps().

#define E_NOT dep   )     (2-(dep))
 

Definition at line 50 of file expr.h.

Referenced by expr_calc_value(), expr_compare_type(), expr_contains_symbol(), expr_copy(), expr_eliminate_dups2(), expr_eq(), expr_free(), expr_join_and(), expr_join_or(), expr_print(), expr_trans_bool(), expr_trans_compare(), expr_transform(), menu_check_dep(), and sym_check_expr_deps().

#define E_OR dep1,
dep2   )     (((dep1)>(dep2))?(dep1):(dep2))
 

Definition at line 48 of file expr.h.

Referenced by __expr_eliminate_eq(), conf_read(), expr_alloc_or(), expr_calc_value(), expr_compare_type(), expr_contains_symbol(), expr_copy(), expr_eliminate_dups(), expr_eliminate_dups1(), expr_eliminate_dups2(), expr_eliminate_eq(), expr_eliminate_yn(), expr_eq(), expr_extract_eq(), expr_extract_eq_or(), expr_free(), expr_print(), expr_trans_bool(), expr_trans_compare(), expr_transform(), menu_check_dep(), sym_calc_value(), sym_calc_visibility(), and sym_check_expr_deps().

#define FILE_BUSY   0x0001
 

Definition at line 26 of file expr.h.

#define FILE_PRINTED   0x0004
 

Definition at line 28 of file expr.h.

#define FILE_SCANNED   0x0002
 

Definition at line 27 of file expr.h.

#define for_all_choices sym,
st   )     for_all_properties(sym, st, P_CHOICE)
 

Definition at line 123 of file expr.h.

Referenced by sym_get_choice_prop().

#define for_all_defaults sym,
st   )     for_all_properties(sym, st, P_DEFAULT)
 

Definition at line 122 of file expr.h.

Referenced by sym_calc_choice(), and sym_get_default_prop().

#define for_all_prompts sym,
st   ) 
 

Value:

for (st = sym->prop; st; st = st->next) \ if (st->text)
Definition at line 124 of file expr.h.

Referenced by sym_calc_visibility().

#define for_all_properties sym,
st,
tok   ) 
 

Value:

for (st = sym->prop; st; st = st->next) \ if (st->type == (tok))
Definition at line 119 of file expr.h.

Referenced by sym_get_range_prop().

#define for_all_symbols i,
sym   )     for (i = 0; i < 257; i++) for (sym = symbol_hash[i]; sym; sym = sym->next) if (sym->type != S_OTHER)
 

Definition at line 79 of file expr.h.

Referenced by conf_parse(), conf_read(), sym_clear_all_valid(), and sym_set_all_changed().

#define MENU_CHANGED   0x0001
 

Definition at line 142 of file expr.h.

Referenced by sym_set_changed().

#define MENU_ROOT   0x0002
 

Definition at line 143 of file expr.h.

Referenced by display_tree(), and fixup_rootmenu().

#define SYMBOL_AUTO   0x1000
 

Definition at line 94 of file expr.h.

Referenced by dbg_print_flags(), and sym_init().

#define SYMBOL_CHANGED   0x0400
 

Definition at line 92 of file expr.h.

Referenced by conf_read(), dbg_print_flags(), display_tree(), fill_row(), sym_calc_value(), sym_set_changed(), and update_tree().

#define SYMBOL_CHECK   0x0008
 

Definition at line 85 of file expr.h.

Referenced by dbg_print_flags(), and sym_check_deps().

#define SYMBOL_CHECK_DONE   0x4000
 

Definition at line 96 of file expr.h.

Referenced by conf_parse(), and sym_check_deps().

#define SYMBOL_CHECKED   0x2000
 

Definition at line 95 of file expr.h.

Referenced by conf_parse(), and sym_check_deps().

#define SYMBOL_CHOICE   0x0010
 

Definition at line 86 of file expr.h.

Referenced by conf_write(), dbg_print_flags(), and sym_is_choice().

#define SYMBOL_CHOICEVAL   0x0020
 

Definition at line 87 of file expr.h.

Referenced by dbg_print_flags(), fill_row(), menu_finalize(), and sym_is_choice_value().

#define SYMBOL_CONST   0x0007
 

Definition at line 84 of file expr.h.

Referenced by dbg_print_flags(), expr_join_and(), sym_find(), and sym_lookup().

#define SYMBOL_HASHMASK   0xff
 

Definition at line 101 of file expr.h.

#define SYMBOL_HASHSIZE   257
 

Definition at line 100 of file expr.h.

#define SYMBOL_MAXLENGTH   256
 

Definition at line 99 of file expr.h.

Referenced by conf_expand_value().

#define SYMBOL_MOD   0x0002
 

Definition at line 82 of file expr.h.

Referenced by dbg_print_flags().

#define SYMBOL_NEW   0x0800
 

Definition at line 93 of file expr.h.

Referenced by conf_read(), dbg_print_flags(), fill_row(), sym_has_value(), sym_lookup(), sym_set_string_value(), and sym_set_tristate_value().

#define SYMBOL_NO   0x0004
 

Definition at line 83 of file expr.h.

Referenced by __expr_eliminate_eq(), and dbg_print_flags().

#define SYMBOL_OPTIONAL   0x0100
 

Definition at line 90 of file expr.h.

Referenced by dbg_print_flags(), and sym_is_optional().

#define SYMBOL_PRINTED   0x0040
 

Definition at line 88 of file expr.h.

Referenced by dbg_print_flags().

#define SYMBOL_VALID   0x0080
 

Definition at line 89 of file expr.h.

Referenced by conf_read(), dbg_print_flags(), sym_calc_value(), and sym_clear_all_valid().

#define SYMBOL_WARNED   0x8000
 

Definition at line 97 of file expr.h.

Referenced by menu_finalize().

#define SYMBOL_WRITE   0x0200
 

Definition at line 91 of file expr.h.

Referenced by conf_write(), dbg_print_flags(), and sym_calc_value().

#define SYMBOL_YES   0x0001
 

Definition at line 81 of file expr.h.

Referenced by __expr_eliminate_eq(), and dbg_print_flags().


Typedef Documentation

typedef enum tristate tristate
 

Referenced by build_conf(), change_sym_value(), conf_askvalue(), conf_sym(), expr_calc_value(), fill_row(), menu_is_visible(), sym_calc_visibility(), sym_get_string_value(), sym_get_tristate_value(), sym_set_tristate_value(), sym_toggle_tristate_value(), sym_tristate_within_range(), and toggle_sym_value().


Enumeration Type Documentation

enum expr_type
 

Enumeration values:
E_NONE 
E_OR 
E_AND 
E_NOT 
E_EQUAL 
E_UNEQUAL 
E_CHOICE 
E_SYMBOL 
E_RANGE 
Definition at line 34 of file expr.h.

enum prop_type
 

Enumeration values:
P_UNKNOWN 
P_PROMPT 
P_COMMENT 
P_MENU 
P_DEFAULT 
P_CHOICE 
P_SELECT 
P_RANGE 
Definition at line 103 of file expr.h.

Referenced by display_tree(), fill_row(), menu_get_parent_menu(), on_back_pressed(), and on_treeview2_button_press_event().

enum symbol_type
 

Enumeration values:
S_UNKNOWN 
S_BOOLEAN 
S_TRISTATE 
S_INT 
S_HEX 
S_STRING 
S_OTHER 
Definition at line 62 of file expr.h.

Referenced by conf_askvalue(), and sym_get_type().

enum tristate
 

Enumeration values:
no 
mod 
yes 
Definition at line 30 of file expr.h.


Function Documentation

struct expr* expr_alloc_and struct expr e1,
struct expr e2
 

Definition at line 51 of file expr.c.

References e1, e2, E_AND, and expr_alloc_two().

Referenced by menu_add_dep(), menu_check_dep(), and menu_finalize().

Here is the call graph for this function:

struct expr* expr_alloc_comp enum expr_type  type,
struct symbol s1,
struct symbol s2
 

Definition at line 41 of file expr.c.

Referenced by expr_join_and(), expr_join_or(), and expr_trans_compare().

struct expr* expr_alloc_one enum expr_type  type,
struct expr ce
 

Definition at line 22 of file expr.c.

Referenced by expr_eliminate_dups2(), expr_trans_compare(), expr_transform(), and menu_finalize().

struct expr* expr_alloc_or struct expr e1,
struct expr e2
 

Definition at line 58 of file expr.c.

References e1, e2, E_OR, and expr_alloc_two().

Referenced by menu_finalize().

Here is the call graph for this function:

struct expr* expr_alloc_symbol struct symbol sym  ) 
 

Definition at line 13 of file expr.c.

References E_SYMBOL.

Referenced by __expr_eliminate_eq(), expr_eliminate_dups1(), expr_eliminate_dups2(), expr_extract_eq(), expr_join_and(), expr_join_or(), expr_trans_compare(), expr_transform(), menu_add_symbol(), menu_check_dep(), menu_finalize(), and sym_add_default().

struct expr* expr_alloc_two enum expr_type  type,
struct expr e1,
struct expr e2
 

Definition at line 31 of file expr.c.

References e1, and e2.

Referenced by expr_alloc_and(), expr_alloc_or(), expr_extract_eq(), and expr_trans_compare().

tristate expr_calc_value struct expr e  ) 
 

Definition at line 928 of file expr.c.

References E_AND, E_EQUAL, E_NOT, E_OR, E_SYMBOL, E_UNEQUAL, expr_data::expr, no, expr::right, expr_data::sym, sym_calc_value(), sym_get_string_value(), tristate, expr::type, and yes.

Referenced by menu_is_visible(), sym_calc_choice(), sym_calc_value(), sym_calc_visibility(), sym_get_default_prop(), and sym_get_range_prop().

Here is the call graph for this function:

int expr_contains_symbol struct expr dep,
struct symbol sym
 

Definition at line 763 of file expr.c.

References E_AND, E_EQUAL, E_NOT, E_OR, E_SYMBOL, E_UNEQUAL, expr_data::expr, expr::right, expr_data::sym, and expr::type.

Referenced by menu_finalize().

struct expr* expr_copy struct expr org  ) 
 

Definition at line 65 of file expr.c.

References E_AND, E_CHOICE, E_EQUAL, E_NOT, E_OR, E_SYMBOL, and E_UNEQUAL.

Referenced by expr_eliminate_dups2(), expr_eq(), expr_join_and(), expr_join_or(), expr_trans_compare(), and menu_finalize().

bool expr_depends_symbol struct expr dep,
struct symbol sym
 

Definition at line 787 of file expr.c.

References E_AND, E_EQUAL, E_SYMBOL, E_UNEQUAL, expr_data::expr, expr::right, expr_data::sym, symbol_mod, symbol_yes, and expr::type.

Referenced by menu_finalize().

struct expr* expr_eliminate_dups struct expr e  ) 
 

Definition at line 602 of file expr.c.

References E_AND, E_OR, expr_eliminate_dups1(), expr_eliminate_dups2(), expr_eliminate_yn(), trans_count, and expr::type.

Referenced by menu_finalize().

Here is the call graph for this function:

void expr_eliminate_eq struct expr **  ep1,
struct expr **  ep2
 

Definition at line 166 of file expr.c.

References __expr_eliminate_eq(), e1, e2, E_AND, E_OR, and expr_eliminate_yn().

Referenced by expr_eq(), and menu_finalize().

Here is the call graph for this function:

struct expr* expr_eliminate_yn struct expr e  ) 
 

Definition at line 231 of file expr.c.

References E_AND, E_OR, E_SYMBOL, expr_data::expr, expr_free(), expr::right, symbol_yes, and expr::type.

Referenced by expr_eliminate_dups(), expr_eliminate_eq(), expr_extract_eq_and(), and expr_extract_eq_or().

Here is the call graph for this function:

int expr_eq struct expr e1,
struct expr e2
 

Definition at line 191 of file expr.c.

References e1, e2, E_AND, E_CHOICE, E_EQUAL, E_NONE, E_NOT, E_OR, E_RANGE, E_SYMBOL, E_UNEQUAL, expr_copy(), expr_eliminate_eq(), expr_free(), print_expr(), and trans_count.

Referenced by __expr_eliminate_eq(), expr_extract_eq(), expr_join_and(), and expr_join_or().

Here is the call graph for this function:

void expr_extract_eq enum expr_type  type,
struct expr **  ep,
struct expr **  ep1,
struct expr **  ep2
 

Definition at line 838 of file expr.c.

References e1, e2, E_AND, E_OR, expr_alloc_symbol(), expr_alloc_two(), expr_eq(), expr_free(), and symbol_yes.

Referenced by expr_extract_eq_and(), and expr_extract_eq_or().

Here is the call graph for this function:

struct expr* expr_extract_eq_and struct expr **  ep1,
struct expr **  ep2
 

Definition at line 816 of file expr.c.

References E_AND, expr_eliminate_yn(), and expr_extract_eq().

Referenced by expr_eliminate_dups2().

Here is the call graph for this function:

struct expr* expr_extract_eq_or struct expr **  ep1,
struct expr **  ep2
 

Definition at line 827 of file expr.c.

References E_OR, expr_eliminate_yn(), and expr_extract_eq().

Referenced by expr_eliminate_dups2().

Here is the call graph for this function:

void expr_fprint struct expr e,
FILE *  out
 

Definition at line 1072 of file expr.c.

References E_NONE, expr_print(), expr_print_file_helper(), and out.

Referenced by print_expr(), print_symbol(), and zconfdump().

Here is the call graph for this function:

void expr_free struct expr e  ) 
 

Definition at line 102 of file expr.c.

References E_AND, E_EQUAL, E_NOT, E_OR, E_SYMBOL, E_UNEQUAL, expr_data::expr, expr::right, and expr::type.

Referenced by __expr_eliminate_eq(), expr_eliminate_dups1(), expr_eliminate_dups2(), expr_eliminate_yn(), expr_eq(), expr_extract_eq(), and menu_finalize().

int expr_is_no struct expr e  )  [inline, static]
 

Definition at line 184 of file expr.h.

References E_SYMBOL, and expr::type.

Referenced by expr_eliminate_dups2().

int expr_is_yes struct expr e  )  [inline, static]
 

Definition at line 179 of file expr.h.

References E_SYMBOL, symbol_yes, and expr::type.

Referenced by expr_eliminate_dups2(), menu_finalize(), print_symbol(), and zconfdump().

struct expr* expr_trans_bool struct expr e  ) 
 

Definition at line 317 of file expr.c.

References E_AND, E_NOT, E_OR, E_SYMBOL, E_UNEQUAL, expr_data::expr, expr::right, S_TRISTATE, expr_data::sym, and expr::type.

Referenced by menu_finalize().

struct expr* expr_trans_compare struct expr e,
enum expr_type  type,
struct symbol sym
 

Definition at line 867 of file expr.c.

References e1, e2, E_AND, E_CHOICE, E_EQUAL, E_NONE, E_NOT, E_OR, E_RANGE, E_SYMBOL, E_UNEQUAL, expr_data::expr, expr_alloc_comp(), expr_alloc_one(), expr_alloc_symbol(), expr_alloc_two(), expr_copy(), expr::right, symbol_mod, symbol_yes, and expr::type.

Referenced by menu_finalize().

Here is the call graph for this function:

struct expr* expr_transform struct expr e  ) 
 

Definition at line 626 of file expr.c.

References E_AND, E_CHOICE, E_EQUAL, E_NOT, E_OR, E_SYMBOL, E_UNEQUAL, expr_data::expr, expr_alloc_one(), expr_alloc_symbol(), expr::right, S_BOOLEAN, expr_data::sym, symbol_mod, symbol_yes, and expr::type.

Referenced by expr_eliminate_dups2(), and menu_finalize().

Here is the call graph for this function:

struct file* lookup_file const char *  name  ) 
 

void print_expr int  mask,
struct expr e,
int  prevtoken
 

Definition at line 1077 of file expr.c.

References cdebug, and expr_fprint().

Referenced by expr_eq(), expr_join_and(), and expr_join_or().

Here is the call graph for this function:


Variable Documentation

int cdebug
 

Definition at line 169 of file zconf.tab.c.

Referenced by print_expr().

struct file* current_file
 

Definition at line 17 of file menu.c.

Referenced by menu_add_entry(), prop_alloc(), and zconf_endtoken().

struct file* file_list
 

Definition at line 16 of file menu.c.

Referenced by file_lookup().

struct symbol* modules_sym
 

Definition at line 33 of file symbol.c.

Referenced by conf_parse(), conf_write(), menu_check_dep(), sym_get_type(), and sym_set_tristate_value().

struct symbol symbol_yes symbol_no symbol_mod
 

Referenced by expr_depends_symbol(), expr_join_and(), expr_join_or(), expr_trans_compare(), expr_transform(), menu_check_dep(), menu_finalize(), sym_find(), and sym_lookup().


Generated on Thu Nov 20 11:50:44 2008 for RTAI API by doxygen 1.3.8