Main Page | Modules | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

gs_imp.h

Go to the documentation of this file.
00001 /********************************************************************
00002 
00003 Copyright © 2006, ACCESS Systems Americas, Inc. All rights reserved.
00004 
00005 The contents of this file are subject to the Mozilla Public License Version
00006 1.1 (the "License"); you may not use this file except in compliance with
00007 the License. You may obtain a copy of the License at
00008 http://www.mozilla.org/MPL/
00009 
00010 Software distributed under the License is distributed on an "AS IS" basis,
00011 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012 for the specific language governing rights and limitations under the
00013 License.
00014 
00015 The Original Code is the entire contents of this file.
00016 
00017 The Initial Developer of the Original Code is ACCESS Systems Americas, Inc.
00018 
00019 Portions created by ACCESS Systems Americas, Inc. are Copyright © 2006. All
00020 Rights Reserved.
00021 
00022 Contributor(s): none.
00023 
00024 ********************************************************************/
00033 #ifndef __GS_IMP_H__
00034 #define __GS_IMP_H__
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039 
00040 #include <pthread.h>
00041 #include <assert.h>
00042 #include <stdlib.h>
00043 #include <string.h>
00044 #include <unistd.h>
00045 #include <sys/types.h>
00046 #include <glib.h>
00047 
00048 #include "hiker/global_settings.h"
00049          
00050 #include "hiker/ipc.h"
00051 #include "proc_id.h"
00052 
00053 #define ALP_STATUS_GLOBAL_SETTINGS_BUSY ((alp_status_t) ALP_CLASS_GLOBAL_SETTINGS | 0x40000000)
00054 
00055 struct _AlpGlobalSettingsEntryIterator
00056 {
00057     GList *entries;
00058     GList *current;
00059     char *base_path;
00060 } ;
00061 
00062 #if 0
00063 struct _Callback
00064 {
00065     AlpGlobalSettingsContext *context;
00066     /*AlpGlobalSettingsCallback func;*/
00067     int exact_key;
00068     GString *key;
00069     int id; /*Gconf callback ID */
00070 };
00071 #endif
00072 
00073 
00074 
00075 #define CHECK_ARG(arg)\
00076     if ((arg) == NULL)\
00077     {\
00078         ALP_TM(T(ALP_CLASS_GLOBAL_SETTINGS, "zero " #arg " pointer supplied"));\
00079         return ALP_STATUS_GLOBAL_SETTINGS_ARGUMENT_INVALID ;\
00080     }
00081 
00082 
00083 #define CHECK_ARG_VOID_RETURN(arg)\
00084     if ((arg) == NULL)\
00085     {\
00086         ALP_TM(T(ALP_CLASS_GLOBAL_SETTINGS, "zero " #arg " pointer supplied"));\
00087         return ;\
00088     }
00089 
00090 #define CHECK_CONTEXT\
00091     CHECK_ARG(context)
00092 
00093 #define CHECK_ITERATOR\
00094     CHECK_ARG(iterator)
00095 
00096 #define CHECK_TYPE(v, t)\
00097     if ((v)->type != (t))\
00098     {\
00099         ALP_TM(T(ALP_CLASS_GLOBAL_SETTINGS, "incorrect value type"));\
00100         return ALP_STATUS_GLOBAL_SETTINGS_INCORRECT_TYPE ;\
00101     }
00102     
00103 
00104     
00105 void free_glist(GList *list);
00106 void free_gslist(GSList *list);
00107 void gstring_copy(GString **gs, const gchar *src);    
00108 void global_settings_value_clean(AlpGlobalSettingsValue *value);
00109 void global_settings_entry_clean(AlpGlobalSettingsEntry *entry);
00110 void global_settings_value_copy(const AlpGlobalSettingsValue *src, AlpGlobalSettingsValue *des);
00111 void global_settings_value_list_to_GSList(const AlpGlobalSettingsValue *value, GSList **list);
00112 void global_settings_list_copy(const GList *src, GList **dst);
00113 AlpGlobalSettingsValue * global_settings_value_duplicate(const AlpGlobalSettingsValue *src);        
00114 AlpGlobalSettingsEntry *alp_global_settings_entry_alloc(void);
00115 void alp_global_settings_entry_free(AlpGlobalSettingsEntry *e);    
00116 AlpGlobalSettingsValue *alp_global_settings_value_alloc(void);
00117 void alp_global_settings_value_free(AlpGlobalSettingsValue *v);
00118 void alp_global_settings_entry_iterator_free(AlpGlobalSettingsEntryIterator *);
00119 
00120 const char * gs_type_to_string(AlpGlobalSettingsValueType t);
00121 const char *gs_bool_to_string(gboolean b);
00122 
00123 int gs_pack_value(AlpMessage* msg, const AlpGlobalSettingsValue *v);
00124 int gs_unpack_value(AlpMessage* msg, AlpGlobalSettingsValue *v);
00125 void gs_start_pack(AlpMessage** msg, ALP_GLOBAL_SETTINGS_RPC_PROCS);
00126 int gs_end_pack(AlpMessage* msg);
00127 int gs_svr_pack_entry_iterator(AlpMessage* msg, const AlpGlobalSettingsEntryIterator * iterator);
00128 int gs_svr_unpack_entry_iterator(AlpMessage* msg, AlpGlobalSettingsEntryIterator * iterator);
00129 
00130 int is_dir(const char *path);
00131 void normalize_path(char *path);
00132 int form_absolute_path(const char *cwd, const char *key, char result[PATH_MAX]);
00133 
00134 const char *status_to_string(int status);
00135 
00136 #ifdef __cplusplus
00137 }       // extern "C"
00138 #endif
00139 
00140 #endif

Generated on Sat Dec 16 20:29:47 2006 for hiker-0.9 by  doxygen 1.4.4