|
The Assimilation Monitoring Project
|
Implements the ConfigContext class class. More...
#include <configcontext.h>#include <memory.h>#include <stdlib.h>#include <string.h>#include <stdio.h>
Go to the source code of this file.
Macros | |
| #define | BROKEN_G_SLIST_FREE_FULL 1 |
| #define | g_slist_free_full assim_slist_free_full |
| #define | JSONQUOTES "\\\"" |
| #define | TOKEN_COLON ':' |
| #define | GULP (void)g_scanner_get_next_token(scan) |
| #define | SYNERROR(scan, token, symbol, msg) {g_warning("In Function %s line %d", __FUNCTION__, __LINE__);g_scanner_unexp_token(scan, token, "keyword", "keyword", symbol, msg, TRUE);} |
Functions | |
| FSTATIC void | _configcontext_finalize (AssimObj *aself) |
| Finalize (free) a ConfigContext object. More... | |
| FSTATIC enum ConfigValType | _configcontext_gettype (const ConfigContext *self, const char *name) |
| Return a the type of value associated with a given name. More... | |
| FSTATIC ConfigValue * | _configcontext_getvalue (const ConfigContext *self, const char *name) |
| Return a the value structure associated with a given name. More... | |
| FSTATIC GSList * | _configcontext_keys (const ConfigContext *cfg) |
| Return a GSList of all the keys in a ConfigContext object. More... | |
| FSTATIC guint | _configcontext_keycount (const ConfigContext *cfg) |
| Return the number of keys in a ConfigContext object. More... | |
| FSTATIC gint64 | _configcontext_getint (const ConfigContext *self, const char *name) |
| Get an integer value. More... | |
| FSTATIC void | _configcontext_setint (ConfigContext *self, const char *name, gint value) |
| Set a name to an integer value. More... | |
| FSTATIC gboolean | _configcontext_getbool (const ConfigContext *self, const char *name) |
| Get an boolean value. More... | |
| FSTATIC void | _configcontext_setbool (ConfigContext *, const char *name, gboolean value) |
| FSTATIC const char * | _configcontext_getstring (const ConfigContext *self, const char *name) |
| Return the value of a string name. More... | |
| FSTATIC void | _configcontext_setstring (ConfigContext *self,const char *name,const char *value) |
| Set a name to a string value. More... | |
| FSTATIC GSList * | _configcontext_getarray (const ConfigContext *, const char *name) |
| FSTATIC void | _configcontext_setarray (ConfigContext *, const char *name, GSList *value) |
| FSTATIC NetAddr * | _configcontext_getaddr (const ConfigContext *self, const char *name) |
| Return the NetAddr value of a name. More... | |
| FSTATIC void | _configcontext_setaddr (ConfigContext *self, const char *name, NetAddr *addr) |
| Set the NetAddr value of a name. More... | |
| FSTATIC Frame * | _configcontext_getframe (const ConfigContext *self, const char *name) |
| Return the Frame class value of a name. More... | |
| FSTATIC void | _configcontext_setframe (ConfigContext *self, const char *name, Frame *frame) |
| Set the signature frame to the given SignFrame. More... | |
| FSTATIC ConfigContext * | _configcontext_getconfig (const ConfigContext *self, const char *name) |
| Return a the a ConfigContext value associated with a given name. More... | |
| FSTATIC char * | _configcontext_getstr (const ConfigContext *self, const char *name) |
| Return a string value (toString) associated with a given name. More... | |
| FSTATIC void | _configcontext_setconfig (ConfigContext *self, const char *name, ConfigContext *value) |
| Save/Set a ConfigContext value associated with a given name. More... | |
| FSTATIC gint | _configcontext_key_compare (gconstpointer a, gconstpointer b) |
| Compare two string keys (for GSList sorting) More... | |
| FSTATIC char * | _configcontext_toString (gconstpointer aself) |
| Convert a ConfigContext to a printable string (in JSON notation) More... | |
| FSTATIC char * | _configcontext_elem_toString (ConfigValue *val) |
| Convert a ConfigContext element (ConfigValue) to a String. More... | |
| FSTATIC char * | JSONquotestring (char *s) |
| Escape characters in a string according to JSON conventions... More... | |
| FSTATIC ConfigContext * | _configcontext_JSON_parse_string (const char *json) |
| FSTATIC GScanner * | _configcontext_JSON_GScanner_new (void) |
| Create a GScanner object that is set up to scan JSON text. More... | |
| FSTATIC ConfigContext * | _configcontext_JSON_parse_objandEOF (GScanner *scan) |
| Parse complete JSON object followed by EOF. More... | |
| FSTATIC ConfigContext * | _configcontext_JSON_parse_object (GScanner *scan) |
| Parse a JSON object. More... | |
| FSTATIC ConfigContext * | _configcontext_JSON_parse_members (GScanner *scan, ConfigContext *cfg) |
| Parse a JSON (object) members (a list of "name" : "value" pairs) More... | |
| FSTATIC ConfigContext * | _configcontext_JSON_parse_pair (GScanner *scan, ConfigContext *cfg) |
| FSTATIC ConfigValue * | _configcontext_JSON_parse_value (GScanner *scan) |
| FSTATIC gboolean | _configcontext_JSON_parse_array (GScanner *scan, GSList **retval) |
| FSTATIC ConfigValue * | _configcontext_value_new (enum ConfigValType t) |
| Create a ConfigValue object (containing an object and its type) More... | |
| FSTATIC void | _configcontext_value_vfinalize (gpointer vself) |
| FSTATIC void | _configcontext_value_finalize (AssimObj *aself) |
| FSTATIC void | _key_free (gpointer vself) |
| void | assim_slist_free_full (GSList *list, void(*)(gpointer)) |
| ConfigContext * | configcontext_new (gsize objsize) |
| Construct a new ConfigContext object - with no values defaulted. More... | |
| FSTATIC void | _configcontext_setbool (ConfigContext *self, const char *name, gint value) |
| Set a name to an integer value. More... | |
| FSTATIC void | _configcontext_value_vfinalize (void *vself) |
| Finalize (free) a ConfigValue object. More... | |
| ConfigContext * | configcontext_new_JSON_string (const char *jsontext) |
| Construct a ConfigContext object from the given JSON string. More... | |
Implements the ConfigContext class class.
This file provides a place to remember and pass configuration values around.
This file is part of the Assimilation Project.
The Assimilation software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the Assimilation Project software. If not, see http://www.gnu.org/licenses/
Definition in file configcontext.c.
| #define BROKEN_G_SLIST_FREE_FULL 1 |
Definition at line 29 of file configcontext.c.
| #define g_slist_free_full assim_slist_free_full |
Definition at line 34 of file configcontext.c.
Referenced by _configcontext_JSON_parse_array(), and _configcontext_value_finalize().
| FSTATIC ConfigContext* _configcontext_JSON_parse_string | ( | const char * | json | ) |
| FSTATIC void _configcontext_setbool | ( | ConfigContext * | , |
| const char * | name, | ||
| gboolean | value | ||
| ) |
| FSTATIC void _configcontext_value_vfinalize | ( | gpointer | vself | ) |
Referenced by _configcontext_JSON_parse_array(), _configcontext_value_finalize(), and configcontext_new().
