diff options
author | Gabor X Toth <*@tg-x.net> | 2014-05-29 16:35:53 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2014-05-29 16:35:53 +0000 |
commit | a5877668ba805c5e0efe622e6ce4c58ff5609bf9 (patch) | |
tree | 5560a9107d5add87388ac8900184f621050fa514 /src/env | |
parent | 0a3564262a17b8e0dddb553c31bb783c99ee1ec1 (diff) | |
download | gnunet-a5877668ba805c5e0efe622e6ce4c58ff5609bf9.tar.gz gnunet-a5877668ba805c5e0efe622e6ce4c58ff5609bf9.zip |
PSYC util lib: receiving/transmitting/logging PSYC messages
Diffstat (limited to 'src/env')
-rw-r--r-- | src/env/env.c | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/src/env/env.c b/src/env/env.c index 107be8827..45c9fa7e0 100644 --- a/src/env/env.c +++ b/src/env/env.c | |||
@@ -78,44 +78,47 @@ GNUNET_ENV_environment_add (struct GNUNET_ENV_Environment *env, | |||
78 | } | 78 | } |
79 | 79 | ||
80 | 80 | ||
81 | /** | 81 | /** |
82 | * Get the modifier at the beginning of an environment. | 82 | * Get the first modifier of the environment. |
83 | * | ||
84 | * @param env | ||
85 | * @param oper | ||
86 | * @param name | ||
87 | * @param value | ||
88 | * @param value_size | ||
89 | * | ||
90 | * @return | ||
91 | */ | 83 | */ |
92 | int | 84 | struct GNUNET_ENV_Modifier * |
93 | GNUNET_ENV_environment_head (struct GNUNET_ENV_Environment *env, | 85 | GNUNET_ENV_environment_head (const struct GNUNET_ENV_Environment *env) |
94 | enum GNUNET_ENV_Operator *oper, const char **name, | ||
95 | const void **value, size_t *value_size) | ||
96 | { | 86 | { |
97 | if (NULL == env->mod_head) | 87 | return env->mod_head; |
98 | return GNUNET_NO; | 88 | } |
99 | 89 | ||
100 | struct GNUNET_ENV_Modifier *mod = env->mod_head; | 90 | |
101 | *oper = mod->oper; | 91 | /** |
102 | *name = mod->name; | 92 | * Get the last modifier of the environment. |
103 | *value = mod->value; | 93 | */ |
104 | *value_size = mod->value_size; | 94 | struct GNUNET_ENV_Modifier * |
105 | return GNUNET_YES; | 95 | GNUNET_ENV_environment_tail (const struct GNUNET_ENV_Environment *env) |
96 | { | ||
97 | return env->mod_tail; | ||
98 | } | ||
99 | |||
100 | |||
101 | /** | ||
102 | * Remove a modifier from the environment. | ||
103 | */ | ||
104 | void | ||
105 | GNUNET_ENV_environment_remove (struct GNUNET_ENV_Environment *env, | ||
106 | struct GNUNET_ENV_Modifier *mod) | ||
107 | { | ||
108 | GNUNET_CONTAINER_DLL_remove (env->mod_head, env->mod_tail, mod); | ||
106 | } | 109 | } |
107 | 110 | ||
108 | 111 | ||
109 | /** | 112 | /** |
110 | * Get the modifier at the beginning of an environment and remove it. | 113 | * Get the modifier at the beginning of an environment and remove it. |
111 | * | 114 | * |
112 | * @param env | 115 | * @param env |
113 | * @param oper | 116 | * @param oper |
114 | * @param name | 117 | * @param name |
115 | * @param value | 118 | * @param value |
116 | * @param value_size | 119 | * @param value_size |
117 | * | 120 | * |
118 | * @return | 121 | * @return |
119 | */ | 122 | */ |
120 | int | 123 | int |
121 | GNUNET_ENV_environment_shift (struct GNUNET_ENV_Environment *env, | 124 | GNUNET_ENV_environment_shift (struct GNUNET_ENV_Environment *env, |