aboutsummaryrefslogtreecommitdiffstats
path: root/pseudo.h
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2010-08-10 11:30:18 -0500
committerPeter Seebach <seebs@laptop-seebs-net.local>2010-08-11 14:38:11 -0500
commit5d027f78a6e677e9272a17555a83124026e6fb08 (patch)
treed82c988b997f8889734d09ce72dd7433a353ef50 /pseudo.h
parenta6a473ab1bac9c4b11049653f3b344d827c380c5 (diff)
downloadpseudo-5d027f78a6e677e9272a17555a83124026e6fb08.tar.gz
pseudo-5d027f78a6e677e9272a17555a83124026e6fb08.tar.bz2
pseudo-5d027f78a6e677e9272a17555a83124026e6fb08.zip
Enable local variable cache
Add local variable cache via get_value and set_value. The local cache is setup at constructor time (or soon after). Rewrite the pseudo_setupenv and pseudo_dropenv routines, add a new pseudo_setupenvp and pseudo_dropenvp as well to handle the execve cases. We can now successfully use /usr/bin/env -i env and get pseudo values back!
Diffstat (limited to 'pseudo.h')
-rw-r--r--pseudo.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/pseudo.h b/pseudo.h
index 0564c7b..a6284e5 100644
--- a/pseudo.h
+++ b/pseudo.h
@@ -20,6 +20,12 @@
#include <stdlib.h>
#include <fcntl.h>
+struct pseudo_variables { char * key; size_t key_len; char * value; };
+
+void pseudo_dump_env(char **envp);
+int pseudo_set_value(const char * key, const char * value);
+char * pseudo_get_value(const char * key);
+
typedef enum {
OP_UNKNOWN = -1,
OP_NONE = 0,
@@ -121,8 +127,10 @@ void pseudo_new_pid(void);
/* pseudo_fix_path resolves symlinks up to this depth */
#define PSEUDO_MAX_LINK_RECURSION 16
extern char *pseudo_fix_path(const char *, const char *, size_t, size_t, size_t *, int);
-extern char **pseudo_dropenv(char * const *);
-extern char **pseudo_setupenv(char * const *, char *);
+extern void pseudo_dropenv(void);
+extern char **pseudo_dropenvp(char * const *);
+extern void pseudo_setupenv(void);
+extern char **pseudo_setupenvp(char * const *);
extern char *pseudo_prefix_path(char *);
extern char *pseudo_bindir_path(char *);
extern char *pseudo_libdir_path(char *);