summaryrefslogtreecommitdiffstats
path: root/nuttx/include/stdlib.h
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2007-06-30 17:05:44 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2007-06-30 17:05:44 +0000
commit1cbe5e978e5c7a58616f322d2c66caf786b0ae84 (patch)
tree9fdb70976d886c68d4fbdc2d93cf71f20c69f551 /nuttx/include/stdlib.h
parent3e6dbe195f7c2c50a6df948e35aa1d281425d12e (diff)
Add basic tasking support for environment variables
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@291 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/include/stdlib.h')
-rw-r--r--nuttx/include/stdlib.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/nuttx/include/stdlib.h b/nuttx/include/stdlib.h
index 4a9f2ef0d6..6e7f441122 100644
--- a/nuttx/include/stdlib.h
+++ b/nuttx/include/stdlib.h
@@ -40,6 +40,7 @@
* Included Files
************************************************************/
+#include <nuttx/config.h>
#include <sys/types.h>
/************************************************************
@@ -54,6 +55,15 @@
#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1
+/* The environ variable, normally 'extern char **environ;' is
+ * not implemented as a function call. However, get_environ_ptr()
+ * can be used in its place.
+ */
+
+#ifndef CONFIG_DISABLE_ENIVRON
+# define environ get_environ_ptr()
+#endif
+
/************************************************************
* Global Type Definitions
************************************************************/
@@ -74,6 +84,10 @@ struct mallinfo
* Global Function Prototypes
************************************************************/
+/************************************************************
+ * Global Function Prototypes
+ ************************************************************/
+
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
@@ -89,7 +103,14 @@ EXTERN int rand(void);
/* Environment variable support */
-EXTERN char *getenv(const char *name);
+#ifndef CONFIG_DISABLE_ENIVRON
+EXTERN FAR char **get_environ_ptr( void );
+EXTERN FAR char *getenv(const char *name);
+EXTERN int putenv(char *string);
+EXTERN int clearenv(void);
+EXTERN int setenv(const char *name, const char *value, int overwrite);
+EXTERN int unsetenv(const char *name);
+#endif
/* Process exit functions */