3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 #ifndef _ENVIRONMENT_H_
25 #define _ENVIRONMENT_H_
30 * Managment of a environment variable
33 struct variable_d
*next
; /**< List management */
34 char data
[0]; /**< variable length data */
38 struct env_context
*parent
; /**< FIXME */
39 struct variable_d
*local
; /**< FIXME */
40 struct variable_d
*global
; /**< FIXME */
43 struct env_context
*get_current_context(void);
44 char *var_val(struct variable_d
*);
45 char *var_name(struct variable_d
*);
47 const char *getenv(const char *);
48 int setenv(const char *, const char *);
50 int env_pop_context(void);
51 int env_push_context(void);
53 int envfs_load(char *filename
, char *dirname
);
54 int envfs_save(char *filename
, char *dirname
);
56 int export(const char *);
59 int file_size_action(const char *, struct stat
*, void *, int);
60 int file_save_action(const char *, struct stat
*, void *, int);
62 #endif /* __BAREBOX__ */
64 /* This part is used for the host and the target */
70 #define PAD4(x) ((x + 3) & ~3)
72 #endif /* _ENVIRONMENT_H_ */
76 * @brief Environment handling
78 * Important: This file will also be used on the host to create
79 * the default environment when building the barebox binary.