Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
expr.h File Reference
#include <assert.h>
#include <stdio.h>
#include "list.h"
#include <stdbool.h>

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
 
struct  jump_key
 

Macros

#define EXPR_OR(dep1, dep2)   (((dep1)>(dep2))?(dep1):(dep2))
 
#define EXPR_AND(dep1, dep2)   (((dep1)<(dep2))?(dep1):(dep2))
 
#define EXPR_NOT(dep)   (2-(dep))
 
#define expr_list_for_each_sym(l, e, s)   for (e = (l); e && (s = e->right.sym); e = e->left.expr)
 
#define for_all_symbols(i, sym)   for (i = 0; i < SYMBOL_HASHSIZE; i++) for (sym = symbol_hash[i]; sym; sym = sym->next) if (sym->type != S_OTHER)
 
#define SYMBOL_CONST   0x0001 /* symbol is const */
 
#define SYMBOL_CHECK   0x0008 /* used during dependency checking */
 
#define SYMBOL_CHOICE   0x0010 /* start of a choice block (null name) */
 
#define SYMBOL_CHOICEVAL   0x0020 /* used as a value in a choice block */
 
#define SYMBOL_VALID   0x0080 /* set when symbol.curr is calculated */
 
#define SYMBOL_OPTIONAL   0x0100 /* choice is optional - values can be 'n' */
 
#define SYMBOL_WRITE   0x0200 /* ? */
 
#define SYMBOL_CHANGED   0x0400 /* ? */
 
#define SYMBOL_AUTO   0x1000 /* value from environment variable */
 
#define SYMBOL_CHECKED   0x2000 /* used during dependency checking */
 
#define SYMBOL_WARNED   0x8000 /* warning has been issued */
 
#define SYMBOL_DEF   0x10000 /* First bit of SYMBOL_DEF */
 
#define SYMBOL_DEF_USER   0x10000 /* symbol.def[S_DEF_USER] is valid */
 
#define SYMBOL_DEF_AUTO   0x20000 /* symbol.def[S_DEF_AUTO] is valid */
 
#define SYMBOL_DEF3   0x40000 /* symbol.def[S_DEF_3] is valid */
 
#define SYMBOL_DEF4   0x80000 /* symbol.def[S_DEF_4] is valid */
 
#define SYMBOL_MAXLENGTH   256
 
#define SYMBOL_HASHSIZE   9973
 
#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
 
#define JUMP_NB   9
 

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_LIST, E_SYMBOL,
  E_RANGE
}
 
enum  symbol_type {
  SYM_NORMAL, SYM_TYPEDEF, SYM_ENUM, SYM_STRUCT,
  SYM_UNION, SYM_ENUM_CONST, S_UNKNOWN, S_BOOLEAN,
  S_TRISTATE, S_INT, S_HEX, S_STRING,
  S_OTHER
}
 
enum  {
  S_DEF_USER, S_DEF_AUTO, S_DEF_DEF3, S_DEF_DEF4,
  S_DEF_COUNT
}
 
enum  prop_type {
  P_UNKNOWN, P_PROMPT, P_COMMENT, P_MENU,
  P_DEFAULT, P_CHOICE, P_SELECT, P_RANGE,
  P_ENV, P_SYMBOL
}
 

Functions

struct filelookup_file (const char *name)
 
struct exprexpr_alloc_symbol (struct symbol *sym)
 
struct exprexpr_alloc_one (enum expr_type type, struct expr *ce)
 
struct exprexpr_alloc_two (enum expr_type type, struct expr *e1, struct expr *e2)
 
struct exprexpr_alloc_comp (enum expr_type type, struct symbol *s1, struct symbol *s2)
 
struct exprexpr_alloc_and (struct expr *e1, struct expr *e2)
 
struct exprexpr_alloc_or (struct expr *e1, struct expr *e2)
 
struct exprexpr_copy (const 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)
 
struct exprexpr_eliminate_yn (struct expr *e)
 
struct exprexpr_trans_bool (struct expr *e)
 
struct exprexpr_eliminate_dups (struct expr *e)
 
struct 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)
 
struct exprexpr_extract_eq_and (struct expr **ep1, struct expr **ep2)
 
struct 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)
 
struct exprexpr_trans_compare (struct expr *e, enum expr_type type, struct symbol *sym)
 
struct exprexpr_simplify_unmet_dep (struct expr *e1, struct expr *e2)
 
void expr_fprint (struct expr *e, FILE *out)
 
void expr_gstr_print (struct expr *e, struct gstr *gs)
 

Variables

struct filefile_list
 
struct filecurrent_file
 
struct symbol symbol_yes symbol_no symbol_mod
 
struct symbolmodules_sym
 
struct symbolsym_defconfig_list
 
int cdebug
 

Macro Definition Documentation

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

Definition at line 46 of file expr.h.

#define expr_list_for_each_sym (   l,
  e,
  s 
)    for (e = (l); e && (s = e->right.sym); e = e->left.expr)

Definition at line 49 of file expr.h.

#define EXPR_NOT (   dep)    (2-(dep))

Definition at line 47 of file expr.h.

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

Definition at line 45 of file expr.h.

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

Definition at line 154 of file expr.h.

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

Definition at line 153 of file expr.h.

#define for_all_prompts (   sym,
  st 
)
Value:
for (st = sym->prop; st; st = st->next) \
if (st->text)

Definition at line 155 of file expr.h.

#define for_all_properties (   sym,
  st,
  tok 
)
Value:
for (st = sym->prop; st; st = st->next) \
if (st->type == (tok))

Definition at line 150 of file expr.h.

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

Definition at line 88 of file expr.h.

#define JUMP_NB   9

Definition at line 184 of file expr.h.

#define MENU_CHANGED   0x0001

Definition at line 174 of file expr.h.

#define MENU_ROOT   0x0002

Definition at line 175 of file expr.h.

#define SYMBOL_AUTO   0x1000 /* value from environment variable */

Definition at line 98 of file expr.h.

#define SYMBOL_CHANGED   0x0400 /* ? */

Definition at line 97 of file expr.h.

#define SYMBOL_CHECK   0x0008 /* used during dependency checking */

Definition at line 91 of file expr.h.

#define SYMBOL_CHECKED   0x2000 /* used during dependency checking */

Definition at line 99 of file expr.h.

#define SYMBOL_CHOICE   0x0010 /* start of a choice block (null name) */

Definition at line 92 of file expr.h.

#define SYMBOL_CHOICEVAL   0x0020 /* used as a value in a choice block */

Definition at line 93 of file expr.h.

#define SYMBOL_CONST   0x0001 /* symbol is const */

Definition at line 90 of file expr.h.

#define SYMBOL_DEF   0x10000 /* First bit of SYMBOL_DEF */

Definition at line 103 of file expr.h.

#define SYMBOL_DEF3   0x40000 /* symbol.def[S_DEF_3] is valid */

Definition at line 106 of file expr.h.

#define SYMBOL_DEF4   0x80000 /* symbol.def[S_DEF_4] is valid */

Definition at line 107 of file expr.h.

#define SYMBOL_DEF_AUTO   0x20000 /* symbol.def[S_DEF_AUTO] is valid */

Definition at line 105 of file expr.h.

#define SYMBOL_DEF_USER   0x10000 /* symbol.def[S_DEF_USER] is valid */

Definition at line 104 of file expr.h.

#define SYMBOL_HASHSIZE   9973

Definition at line 110 of file expr.h.

#define SYMBOL_MAXLENGTH   256

Definition at line 109 of file expr.h.

#define SYMBOL_OPTIONAL   0x0100 /* choice is optional - values can be 'n' */

Definition at line 95 of file expr.h.

#define SYMBOL_VALID   0x0080 /* set when symbol.curr is calculated */

Definition at line 94 of file expr.h.

#define SYMBOL_WARNED   0x8000 /* warning has been issued */

Definition at line 100 of file expr.h.

#define SYMBOL_WRITE   0x0200 /* ? */

Definition at line 96 of file expr.h.

Typedef Documentation

typedef enum tristate tristate

Enumeration Type Documentation

anonymous enum
Enumerator:
S_DEF_USER 
S_DEF_AUTO 
S_DEF_DEF3 
S_DEF_DEF4 
S_DEF_COUNT 

Definition at line 67 of file expr.h.

enum expr_type
Enumerator:
E_NONE 
E_OR 
E_AND 
E_NOT 
E_EQUAL 
E_UNEQUAL 
E_LIST 
E_SYMBOL 
E_RANGE 

Definition at line 31 of file expr.h.

enum prop_type
Enumerator:
P_UNKNOWN 
P_PROMPT 
P_COMMENT 
P_MENU 
P_DEFAULT 
P_CHOICE 
P_SELECT 
P_RANGE 
P_ENV 
P_SYMBOL 

Definition at line 123 of file expr.h.

Enumerator:
SYM_NORMAL 
SYM_TYPEDEF 
SYM_ENUM 
SYM_STRUCT 
SYM_UNION 
SYM_ENUM_CONST 
S_UNKNOWN 
S_BOOLEAN 
S_TRISTATE 
S_INT 
S_HEX 
S_STRING 
S_OTHER 

Definition at line 62 of file expr.h.

enum tristate
Enumerator:
no 
mod 
yes 

Definition at line 27 of file expr.h.

Function Documentation

struct expr* expr_alloc_and ( struct expr e1,
struct expr e2 
)
read

Definition at line 48 of file expr.c.

struct expr* expr_alloc_comp ( enum expr_type  type,
struct symbol s1,
struct symbol s2 
)
read

Definition at line 39 of file expr.c.

struct expr* expr_alloc_one ( enum expr_type  type,
struct expr ce 
)
read

Definition at line 22 of file expr.c.

struct expr* expr_alloc_or ( struct expr e1,
struct expr e2 
)
read

Definition at line 55 of file expr.c.

struct expr* expr_alloc_symbol ( struct symbol sym)
read

Definition at line 14 of file expr.c.

struct expr* expr_alloc_two ( enum expr_type  type,
struct expr e1,
struct expr e2 
)
read

Definition at line 30 of file expr.c.

tristate expr_calc_value ( struct expr e)

Definition at line 938 of file expr.c.

int expr_contains_symbol ( struct expr dep,
struct symbol sym 
)

Definition at line 773 of file expr.c.

struct expr* expr_copy ( const struct expr org)
read

Definition at line 62 of file expr.c.

bool expr_depends_symbol ( struct expr dep,
struct symbol sym 
)

Definition at line 797 of file expr.c.

struct expr* expr_eliminate_dups ( struct expr e)
read

Definition at line 612 of file expr.c.

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

Definition at line 164 of file expr.c.

struct expr* expr_eliminate_yn ( struct expr e)
read

Definition at line 231 of file expr.c.

int expr_eq ( struct expr e1,
struct expr e2 
)

Definition at line 189 of file expr.c.

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

Definition at line 848 of file expr.c.

struct expr* expr_extract_eq_and ( struct expr **  ep1,
struct expr **  ep2 
)
read

Definition at line 826 of file expr.c.

struct expr* expr_extract_eq_or ( struct expr **  ep1,
struct expr **  ep2 
)
read

Definition at line 837 of file expr.c.

void expr_fprint ( struct expr e,
FILE *  out 
)

Definition at line 1130 of file expr.c.

void expr_free ( struct expr e)

Definition at line 99 of file expr.c.

void expr_gstr_print ( struct expr e,
struct gstr gs 
)

Definition at line 1165 of file expr.c.

struct expr* expr_simplify_unmet_dep ( struct expr e1,
struct expr e2 
)
read

Definition at line 1028 of file expr.c.

struct expr* expr_trans_bool ( struct expr e)
read

Definition at line 317 of file expr.c.

struct expr* expr_trans_compare ( struct expr e,
enum expr_type  type,
struct symbol sym 
)
read

Definition at line 877 of file expr.c.

struct expr* expr_transform ( struct expr e)
read

Definition at line 636 of file expr.c.

struct file* lookup_file ( const char name)
read

Variable Documentation

int cdebug
struct file* current_file

Definition at line 19 of file menu.c.

struct file* file_list

Definition at line 18 of file menu.c.

struct symbol* modules_sym

Definition at line 33 of file symbol.c.

struct symbol* sym_defconfig_list

Definition at line 32 of file symbol.c.

Definition at line 18 of file symbol.c.