2008-12-31 15:23:00 +00:00
|
|
|
#ifndef _LIGHTTPD_ENVIRONMENT_H_
|
|
|
|
#define _LIGHTTPD_ENVIRONMENT_H_
|
|
|
|
|
2009-07-08 19:06:07 +00:00
|
|
|
#include <lighttpd/settings.h>
|
|
|
|
|
|
|
|
typedef struct liEnvironment liEnvironment;
|
|
|
|
|
|
|
|
typedef struct liEnvironmentDup liEnvironmentDup;
|
2008-12-31 15:23:00 +00:00
|
|
|
|
2009-07-08 19:06:07 +00:00
|
|
|
struct liEnvironment {
|
2008-12-31 15:23:00 +00:00
|
|
|
GHashTable *table;
|
|
|
|
};
|
|
|
|
|
2009-02-15 17:55:27 +00:00
|
|
|
/* read only duplicate of a real environment: use it to remember which
|
|
|
|
env vars you already sent (mod_fastcgi) */
|
2009-07-08 19:06:07 +00:00
|
|
|
struct liEnvironmentDup {
|
2009-02-15 17:55:27 +00:00
|
|
|
GHashTable *table;
|
|
|
|
};
|
|
|
|
|
2009-09-13 15:46:02 +00:00
|
|
|
LI_API void li_environment_init(liEnvironment *env); /* create table */
|
|
|
|
LI_API void li_environment_reset(liEnvironment *env); /* remove all entries */
|
|
|
|
LI_API void li_environment_clear(liEnvironment *env); /* destroy table */
|
2008-12-31 15:23:00 +00:00
|
|
|
|
2009-01-01 15:44:42 +00:00
|
|
|
/* overwrite previous value */
|
2009-07-09 20:17:24 +00:00
|
|
|
LI_API void li_environment_set(liEnvironment *env, const gchar *key, size_t keylen, const gchar *val, size_t valuelen);
|
2009-01-01 15:44:42 +00:00
|
|
|
/* do not overwrite */
|
2009-07-09 20:17:24 +00:00
|
|
|
LI_API void li_environment_insert(liEnvironment *env, const gchar *key, size_t keylen, const gchar *val, size_t valuelen);
|
|
|
|
LI_API void li_environment_remove(liEnvironment *env, const gchar *key, size_t keylen);
|
|
|
|
LI_API GString* li_environment_get(liEnvironment *env, const gchar *key, size_t keylen);
|
2008-12-31 15:23:00 +00:00
|
|
|
|
2009-02-15 17:55:27 +00:00
|
|
|
|
|
|
|
/* create (data) read only copy of a environment; don't modify the real environment
|
|
|
|
while using the duplicate */
|
2009-07-09 20:17:24 +00:00
|
|
|
LI_API liEnvironmentDup* li_environment_make_dup(liEnvironment *env);
|
|
|
|
LI_API void li_environment_dup_free(liEnvironmentDup *envdup);
|
2009-02-15 17:55:27 +00:00
|
|
|
/* remove an entry (this is allowed - it doesn't modify anything in the original environment);
|
|
|
|
you must not modify the returned GString */
|
2009-07-09 20:17:24 +00:00
|
|
|
LI_API GString* li_environment_dup_pop(liEnvironmentDup *envdup, const gchar *key, size_t keylen);
|
2009-02-15 17:55:27 +00:00
|
|
|
|
|
|
|
|
2008-12-31 15:23:00 +00:00
|
|
|
#endif
|