This implements global shell variable support. This is done by registering a new device named 'global', so global variables are just plain device parameters. Global variables are useful for storing the global state in the environment. Currently we do this by sourcing scripts instead of executing them which is quite limiting. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
13 lines
379 B
C
13 lines
379 B
C
#ifndef __GLOBALVAR_H
|
|
#define __GLOBALVAR_H
|
|
|
|
int globalvar_add_simple(const char *name);
|
|
|
|
int globalvar_add(const char *name,
|
|
int (*set)(struct device_d *dev, struct param_d *p, const char *val),
|
|
const char *(*get)(struct device_d *, struct param_d *p),
|
|
unsigned long flags);
|
|
char *globalvar_get_match(const char *match, const char *seperator);
|
|
|
|
#endif /* __GLOBALVAR_H */
|