UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
uwe_datasource.h
1 /* uwe_datasource.h */
2 /* $Id: uwe_datasource.h,v 1.8 2008/04/21 08:45:56 vlad Exp $ */
3 #ifndef __uwe_datasource_h
4 #define __uwe_datasource_h
5 
6 #include <mix/portability.h>
7 #include <mix/misc.h>
8 #include <mix/ErrCodes.h>
9 
10 #ifdef __cplusplus
11 #include <mix/IniFile.hpp>
12 #endif /* C++ */
13 
14 
15 /* uds_list.ini definitions */
16 #define UDSLIST_DSName "DSName"
17 #define UDSLIST_Mounted "Mounted"
18 #define UDSLIST_Shown "Shown"
19 #define UDSLIST_DrvName "DriverName"
20 #define UDSLIST_DBLoc "DataBaseLocation"
21 #define UDSLIST_AltDBLoc "AltDBLocation"
22 #define WE_StartupMounted_ENV UDSLIST_Mounted
23 #define WE_StartupShown_ENV UDSLIST_Shown
24 
25 /* Recognized values of driver name for different versions of LDB. */
26 #define UDSLIST_DrvLDB4Sign "univers_ldb_4."
27 #define UDSLIST_DrvLDB5Sign "univers_ldb_5."
28 
29 /* Directory name for data, jobs, logs and locks location */
30 #define WE_DATA_DIR "DATA"
31 #define WE_JOBS_DIR "JOBS"
32 #define WE_LOGS_DIR "LOG"
33 #define WE_LOCKS_DIR "LOCKS"
34 #define WE_HCOPIES_DIR "HCOPIES"
35 #define WE_REPORT_DIR "REPORT"
36 #define WE_ARCHIVE_DIR "ARCHIVE"
37 
38 
39 
45 typedef struct
46 {
47  char *szDSName;
49  int dbVersion;
54  Logic bMounted;
59  Logic bShown;
62  char *szDBLoc;
64  char *szAltDBLoc;
67  char *szDrvName;
68  char *szConnOptions;
69  char *szDrvOptions;
71  int nProjList;
76  STRLIST lszProjList;
81 
82 
88 typedef void* UweDSHandle;
89 
90 
91 
92 #ifdef __cplusplus
93 extern "C" {
94 #endif /* C++ */
95 
99  UNIVERS_API ErrCode CALLSPEC UweLoadListOfDS (UweDSHandle* pHandle,
100  int* pDSNumber);
101 
106  UNIVERS_API ErrCode CALLSPEC UweScanDSFirst (UweDSHandle pHandle,
107  UweDataSourceInfo* pInfo);
108 
112  UNIVERS_API ErrCode CALLSPEC UweScanDSNext (UweDSHandle pHandle,
113  UweDataSourceInfo* pInfo);
114 
118  UNIVERS_API ErrCode CALLSPEC UweFindProjectDS (UweDSHandle pHandle,
119  const char* szProject,
120  UweDataSourceInfo* pInfo);
121 
125  UNIVERS_API ErrCode CALLSPEC
126  UweCreateProjectDS (const char* szProject,
127  const UweDataSourceInfo* pInfo);
128 
131  UNIVERS_API void CALLSPEC UweReleaseListOfDS (UweDSHandle* pHandle);
132 
136  UNIVERS_API ErrCode CALLSPEC UweGetDSInfo (UweDataSourceInfo* pDSInfo);
137 
138 
143  UNIVERS_API ErrCode CALLSPEC UweSetCurrentDS (const char* szDataSource);
144 
148  UNIVERS_API UweDataSourceInfo* CALLSPEC UweGetCurrentDSInfo ();
149 
150 
154  UNIVERS_API void CALLSPEC UweFreeDSInfo (UweDataSourceInfo* pInfo);
155 
156 
158 #define UDS_PROP_SHOWN (1<<0)
159 
164  UNIVERS_API ErrCode CALLSPEC UweChangeDSInfo (UweDSHandle pHandle,
165  const UweDataSourceInfo* pInfo,
166  int mProp);
167 
170  UNIVERS_API ErrCode CALLSPEC UweSaveDSUserConfig (UweDSHandle pHandle);
171 
172 
173 #ifdef __cplusplus
174 };
175 #endif /* C++ */
176 
177 
178 #ifdef __cplusplus
179 
185 typedef struct
186 {
187  int n_ds;
188  STRLIST list_ds;
190  int i_next_ds;
191  IniFile *dsList;
193 } Uwe_DSHandle;
194 
195 
198 UNIVERS_API ErrCode CALLSPEC UweAppendLDB5DS (IniFile* dsList);
199 
202 UNIVERS_API ErrCode CALLSPEC UweAppendLDB4DS (IniFile* dsList);
203 
204 #endif /* C++ */
205 
206 
207 
208 #endif /* uwe_datasource.h */
char * szDrvOptions
Definition: uwe_datasource.h:69
char * szAltDBLoc
Definition: uwe_datasource.h:64
char * szDSName
Definition: uwe_datasource.h:47
char * szDrvName
Definition: uwe_datasource.h:67
Logic bMounted
Definition: uwe_datasource.h:54
int dbVersion
Definition: uwe_datasource.h:49
Logic bShown
Definition: uwe_datasource.h:59
char * szDBLoc
Definition: uwe_datasource.h:62
char * szConnOptions
Definition: uwe_datasource.h:68
int nProjList
Definition: uwe_datasource.h:71
STRLIST lszProjList
Definition: uwe_datasource.h:76
Class for operating with ini-file which contains sections.
Definition: IniFile.hpp:37
Definition: uwe_datasource.h:45