forked from baresip/re
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
619 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* @file re_odict.h Interface to Ordered Dictionary | ||
* | ||
* Copyright (C) 2010 - 2015 Creytiv.com | ||
*/ | ||
|
||
struct odict { | ||
struct list lst; | ||
struct hash *ht; | ||
}; | ||
|
||
struct odict_entry { | ||
struct le le, he; | ||
char *key; | ||
union { | ||
struct odict *odict; /* ODICT_OBJECT / OJECT_ARRAY */ | ||
char *str; /* ODICT_STRING */ | ||
int64_t integer; /* ODICT_INT */ | ||
double dbl; /* ODICT_DOUBLE */ | ||
bool boolean; /* ODICT_BOOL */ | ||
} u; | ||
enum odict_type { | ||
ODICT_OBJECT, | ||
ODICT_ARRAY, | ||
ODICT_STRING, | ||
ODICT_INT, | ||
ODICT_DOUBLE, | ||
ODICT_BOOL, | ||
ODICT_NULL, | ||
} type; | ||
}; | ||
|
||
int odict_alloc(struct odict **op, uint32_t hash_size); | ||
const struct odict_entry *odict_lookup(const struct odict *o, const char *key); | ||
size_t odict_count(const struct odict *o, bool nested); | ||
int odict_debug(struct re_printf *pf, const struct odict *o); | ||
|
||
int odict_entry_add(struct odict *o, const char *key, | ||
enum odict_type type, ...); | ||
int odict_entry_debug(struct re_printf *pf, const struct odict_entry *e); | ||
|
||
bool odict_type_iscontainer(enum odict_type type); | ||
bool odict_type_isreal(enum odict_type type); | ||
const char *odict_type_name(enum odict_type type); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.