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

attn_dml_prv.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 ********************************************************************/
00031 #ifndef __ALP_ATTN_DML_PRV_H__
00032 #define __ALP_ATTN_DML_PRV_H__
00033 
00034 #include <hiker/syspaths.h>
00035 
00036 /* Private strings used by attention manager DML */
00037 #define kAttnRootDirectory                  "/"
00038 
00039 #define kAttnDefDBDirectory                 ALP_SYSPATH_SYSTEM_CACHE "attnmgr"
00040 #define kAttnDefDBFileName                  "attn_mgr.db"
00041 
00042 #define kAttnResourceDirectory              ALP_SYSPATH_ETC "attnmgr"
00043 #define kAttnSchemaResourceFileName         "AttnSchema.sql"
00044 
00045 /* defaults for integer fields */
00046 #define kAttnDefPriority          3     /* lowest priority */
00047 #define kAttnDefDuration          0
00048 #define kAttnDefUserId            65534 /* nobody */
00049 #define kAttnDefGroupId           65534 /* nobody */
00050 #define kAttnDefPending           true
00051 #define kAttnDefAttributes        0     /* eventually visible,dialog,sound */
00052 #define kAttnDefAlertLuid         0
00053 #define kAttnDefTimestamp         0
00054 #define kAttnDefPropType          G_TYPE_NONE
00055 
00056 /* timestampt format */
00057 #define kAttnTimestampFormat   "%Y-%m-%d %H:%M:%S"
00058 
00059 /* attention table names */
00060 #define kAttnAlertsTableName    "ALERTS"
00061 #define kAttnPropsTableName     "PROPERTIES"
00062 
00063 /* alert column names */
00064 #define kAttnAlertNameAlertLuid  "AlertLUID"
00065 #define kAttnAlertNameSource     "Source"
00066 #define kAttnAlertNameName       "Name"
00067 #define kAttnAlertNameHandle     "Handle"
00068 #define kAttnAlertNamePriority   "Priority"
00069 #define kAttnAlertNameDuration   "Duration"
00070 #define kAttnAlertNamePending    "Pending"
00071 #define kAttnAlertNameAttributes "Attributes"
00072 #define kAttnAlertNameUserId     "UserID"
00073 #define kAttnAlertNameGroupId    "GroupID"
00074 #define kAttnAlertNameCreated    "Created"
00075 #define kAttnAlertNameUpdated    "Updated"
00076 
00077 #define kAttnAlertFields       kAttnAlertNameAlertLuid  ", " \
00078                                kAttnAlertNameSource     ", " \
00079                                kAttnAlertNameName       ", " \
00080                                kAttnAlertNameHandle     ", " \
00081                                kAttnAlertNamePriority   ", " \
00082                                kAttnAlertNameDuration   ", " \
00083                                kAttnAlertNamePending    ", " \
00084                                kAttnAlertNameAttributes ", " \
00085                                kAttnAlertNameUserId     ", " \
00086                                kAttnAlertNameGroupId    ", " \
00087                                kAttnAlertNameCreated    ", " \
00088                                kAttnAlertNameUpdated
00089 
00090 /* alert column definitions */
00091 #define kAttnAlertColAlertLuid  0
00092 #define kAttnAlertColSource     1
00093 #define kAttnAlertColName       2
00094 #define kAttnAlertColHandle     3
00095 #define kAttnAlertColPriority   4
00096 #define kAttnAlertColDuration   5
00097 #define kAttnAlertColPending    6
00098 #define kAttnAlertColAttributes 7
00099 #define kAttnAlertColUserId     8
00100 #define kAttnAlertColGroupId    9
00101 #define kAttnAlertColCreated    10
00102 #define kAttnAlertColUpdated    11
00103 
00104 /* property column names */
00105 #define kAttnPropNamePropLuid  "PropLUID"
00106 #define kAttnPropNameAlertLuid "AlertLUID"
00107 #define kAttnPropNameName      "Name"
00108 #define kAttnPropNameType      "Type"
00109 #define kAttnPropNameValue     "Value"
00110 
00111 #define kAttnPropFields        kAttnPropNamePropLuid  ", " \
00112                                kAttnPropNameAlertLuid ", " \
00113                                kAttnPropNameName      ", " \
00114                                kAttnPropNameType      ", " \
00115                                kAttnPropNameValue  
00116 
00117 /* property column definitions */
00118 #define kAttnPropColPropLuid    0
00119 #define kAttnPropColAlertLuid   1
00120 #define kAttnPropColName        2
00121 #define kAttnPropColType        3
00122 #define kAttnPropColValue       4
00123 
00124 
00125 typedef struct _AlpAttnDmlStatementType AlpAttnDmlStatementType;
00126 struct _AlpAttnDmlStatementType {
00127         AlpAttnDmlItemType itemType;
00128         AlpSALStatement    salStmtH;
00129 };
00130 
00134 typedef struct _AlpAttnBaseType AlpAttnBaseType;
00135 struct _AlpAttnBaseType {
00136     AlpAttnDmlItemType itemType; 
00137     AlpLuid            itemLuid; 
00138 };
00139 
00143 typedef struct _AlpAttnPropType AlpAttnPropType;
00144 struct _AlpAttnPropType {
00145     AlpAttnDmlItemType itemType;
00146     AlpLuid            itemLuid; 
00147 
00148     AlpLuid  alertLuid;       
00149 
00150     char     *name;            
00151     uint32_t  type;            
00152     void     *value;           
00153     uint32_t  size;            
00154 
00155     AlpAttnPropType *next;    
00156 };
00157 
00161 typedef struct _AlpAttnPropListType AlpAttnPropListType;
00162 struct _AlpAttnPropListType {
00163     AlpAttnDmlItemType itemType;
00164     AlpLuid            itemLuid;
00165 
00166     /* identifier of alert */
00167     char              *source;    
00168     char              *name;      
00169     char              *handle;    
00170 
00171     uint32_t           count;     
00172     AlpAttnPropType   *list;      
00173 };
00174 
00178 typedef struct _AlpAttnAlertType AlpAttnAlertType;
00179 struct _AlpAttnAlertType {
00180     AlpAttnDmlItemType itemType;
00181     AlpLuid            itemLuid; 
00182 
00183     /* identifier of alert */
00184     char    *source;          
00185     char    *name;            
00186     char    *handle;          
00187 
00188     /* alert data */
00189     int32_t  priority;        
00190     int32_t  duration;        
00191     int32_t  pending;         
00192     uint32_t attributes;      
00193     uid_t    userId;          
00194     gid_t    groupId;         
00195     time_t   created;         
00196     time_t   updated;         
00197 
00198     uint32_t          pcount; 
00199     AlpAttnPropType  *plist;  
00200 };
00201 
00202 #ifdef __cplusplus
00203 extern "C" {
00204 #endif
00205     static const char *alp_attn_db_path;
00206 
00207     alp_status_t alp_prv_attn_dml_create_database (const char *dbpath);
00208     alp_status_t alp_prv_attn_dml_init_database (const char *dbpath);
00209     alp_status_t alp_prv_attn_dml_convert_sal_error (alp_status_t salError);
00210     alp_status_t alp_prv_attn_dml_validate_luid (AlpDmlH dmlH, 
00211                                                  AlpAttnDmlItemType itemType,
00212                                                  AlpLuid luid);
00213     char     *alp_prv_attn_dml_get_order_string (AlpAttnDmlOrderByType orderBy);
00214 #ifdef __cplusplus
00215 }
00216 #endif
00217 
00218 #endif /* __ALP_ATTN_DML_PRV_H__ */

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