cf_query.h

Go to the documentation of this file.
00001 #ifndef __cf_query_h__
00002 #define __cf_query_h__
00003 
00004 #include "application_config.h"
00005 
00006 #include <glib.h>
00007 
00008 #ifdef __cplusplus
00009 extern "C" {
00010 #endif
00011 
00012   // Returns FALSE iff there is an error. In the "not found" case TRUE
00013   // is returned, and "value" is not set; "found" is set to indicate
00014   // if something was found, if it is non-NULL. "found" is also set to
00015   // FALSE if the config setting is "nil" rather than an integer.
00016   gboolean try_get_ConfigDb_int(const gchar* name, int* value, 
00017         gboolean* found, GError** error);
00018 
00019   gboolean get_ConfigDb_int(const gchar* name, int* value, 
00020           int default_value, GError** error);
00021 
00022   int force_get_ConfigDb_int(const gchar* name, int default_value);
00023 
00024   int force_lua_eval_int(const gchar* luaStr, int default_value);
00025 
00026   gboolean try_get_ConfigDb_bool(const gchar* name, gboolean* value, 
00027          gboolean* found, GError** error);
00028 
00029   gboolean get_ConfigDb_bool(const gchar* name, gboolean* value, 
00030            gboolean default_value, GError** error);
00031 
00032   gboolean force_get_ConfigDb_bool(const gchar* name, gboolean default_value);
00033 
00034   gboolean force_lua_eval_bool(const gchar* luaStr, gboolean default_value);
00035 
00036   // Caller takes ownership of the string set to "s". "s" is set to
00037   // NULL if no config entry by "name" is found, or if the entry has a
00038   // nil value.
00039   gboolean try_get_ConfigDb_str(const gchar* name, gchar** s, 
00040         GError** error);
00041 
00042   // Like try_get_ConfigDb_str, but if *s would get set to NULL, then
00043   // instead sets it to strdup'ed copy of "default_s" (except if
00044   // "default_s" itself is NULL).
00045   gboolean get_ConfigDb_str(const gchar* name, gchar** s, 
00046           const gchar* default_s, GError** error);
00047 
00048   int get_config_iap_id();
00049 
00050   // The returned buffer is "static", and not to be freed.
00051   const gchar* get_config_username();
00052 
00053 #ifdef __cplusplus
00054 } /* extern "C" */
00055 #endif
00056 
00057 #endif /* __cf_query_h__ */
00058 
00059 /**
00060 
00061 cf_query.h
00062 
00063 Copyright 2009 Helsinki Institute for Information Technology (HIIT)
00064 and the authors. All rights reserved.
00065 
00066 Authors: Tero Hasu <tero.hasu@hut.fi>
00067 
00068 Permission is hereby granted, free of charge, to any person
00069 obtaining a copy of this software and associated documentation files
00070 (the "Software"), to deal in the Software without restriction,
00071 including without limitation the rights to use, copy, modify, merge,
00072 publish, distribute, sublicense, and/or sell copies of the Software,
00073 and to permit persons to whom the Software is furnished to do so,
00074 subject to the following conditions:
00075 
00076 The above copyright notice and this permission notice shall be
00077 included in all copies or substantial portions of the Software.
00078 
00079 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00080 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00081 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00082 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
00083 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
00084 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00085 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00086 SOFTWARE.
00087 
00088  **/

ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:52 2011 by Doxygen 1.6.1