80 ret = gw_malloc(
sizeof(*ret));
102 }
while(meta != NULL);
109 struct meta_data *ret = NULL, *curr = NULL;
117 type = next_type = -1;
124 }
else if (
type == 0) {
127 }
else if (
type == 2 && key != NULL) {
130 }
else if (key == NULL) {
135 error(0,
"MDATA: Found '?' but not expected it end=%ld start=%ld type=%d.", end,
start,
type);
142 if (
type == 1 && curr != NULL && key == NULL) {
147 error(0,
"MDATA: Found '=' but not expected it end=%ld start=%ld type=%d.", end,
start,
type);
154 if (
type == 2 && curr != NULL && key != NULL) {
157 }
else if (
type == 1 && key == NULL) {
161 error(0,
"MDATA: Found '&' but not expected it end=%ld start=%ld type=%d.", end,
start,
type);
172 if (
start >= 0 && end >= 0) {
175 if (end -
start - 1 == 0)
185 curr = gw_malloc(
sizeof(*curr));
187 curr->next = gw_malloc(
sizeof(*curr));
229 if (mdata == NULL || data == NULL)
242 }
while(mdata != NULL);
253 if (data == NULL ||
group == NULL)
259 for (curr = mdata; curr != NULL; curr = curr->
next) {
280 if (data == NULL ||
group == NULL)
284 for (curr = mdata; curr != NULL; curr = curr->
next) {
329 if (data == NULL ||
group == NULL || value == NULL)
333 for (curr = mdata; curr != NULL; curr = curr->
next) {
373 if (data == NULL ||
group == NULL || key == NULL)
379 for (curr = mdata; curr != NULL; curr = curr->
next) {
397 if (data == NULL ||
group == NULL || key == NULL)
401 for (curr = mdata; curr != NULL; curr = curr->
next) {
425 struct meta_data *mdata, *new_mdata, *new_curr, *curr;
438 if (new_mdata == NULL) {
443 for (new_curr = new_mdata; new_curr != NULL; new_curr = new_curr->
next) {
444 for (curr = mdata; curr != NULL; curr = curr->
next) {
464 }
else if (curr->
next == NULL) {
Dict * dict_create(long size_hint, void(*destroy_value)(void *))
void error(int err, const char *fmt,...)
int octstr_str_case_compare(const Octstr *ostr, const char *str)
void dict_put(Dict *dict, Octstr *key, void *value)
int octstr_url_decode(Octstr *ostr)
#define octstr_get_cstr(ostr)
void * dict_remove(Dict *dict, Octstr *key)
void * gwlist_extract_first(List *list)
void * dict_get(Dict *dict, Octstr *key)
void octstr_delete(Octstr *ostr1, long pos, long len)
#define octstr_duplicate(ostr)
void octstr_destroy(Octstr *ostr)
#define octstr_create(cstr)
void octstr_destroy_item(void *os)
long octstr_len(const Octstr *ostr)
void dict_destroy(Dict *dict)
void * gwlist_consume(List *list)
void debug(const char *place, int err, const char *fmt,...)
void octstr_format_append(Octstr *os, const char *fmt,...)
List * dict_keys(Dict *dict)
int dict_put_once(Dict *dict, Octstr *key, void *value)
#define octstr_create_from_data(data, len)
int octstr_compare(const Octstr *ostr1, const Octstr *ostr2)
void gwlist_destroy(List *list, gwlist_item_destructor_t *destructor)