00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef DBALLE_DB_REPINFO_H
00023 #define DBALLE_DB_REPINFO_H
00024
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028
00035 #include <dballe/db/internals.h>
00036
00037 struct _dba_db;
00038
00040 struct _dba_db_repinfo_cache {
00042 DBALLE_SQL_C_UINT_TYPE id;
00043
00045 char* memo;
00047 char* desc;
00049 DBALLE_SQL_C_UINT_TYPE prio;
00051 char* descriptor;
00053 DBALLE_SQL_C_UINT_TYPE tablea;
00054
00056 char* new_memo;
00058 char* new_desc;
00060 DBALLE_SQL_C_UINT_TYPE new_prio;
00062 char* new_descriptor;
00064 DBALLE_SQL_C_UINT_TYPE new_tablea;
00065 };
00067 typedef struct _dba_db_repinfo_cache* dba_db_repinfo_cache;
00068
00070 struct _dba_db_repinfo_memoidx {
00072 char memo[30];
00074 int id;
00075 };
00077 typedef struct _dba_db_repinfo_memoidx* dba_db_repinfo_memoidx;
00078
00082 struct _dba_db_repinfo
00083 {
00085 struct _dba_db* db;
00086
00088 dba_db_repinfo_cache cache;
00090 int cache_size;
00092 int cache_alloc_size;
00093
00095 dba_db_repinfo_memoidx memo_idx;
00096 };
00098 typedef struct _dba_db_repinfo* dba_db_repinfo;
00099
00110 dba_err dba_db_repinfo_create(dba_db db, dba_db_repinfo* ins);
00111
00118 void dba_db_repinfo_delete(dba_db_repinfo ins);
00119
00127 void dba_db_repinfo_invalidate_cache(dba_db_repinfo ins);
00128
00142 dba_err dba_db_repinfo_get_id(dba_db_repinfo ri, const char* memo, int* id);
00143
00156 dba_err dba_db_repinfo_has_id(dba_db_repinfo ri, int id, int* exists);
00157
00168 dba_db_repinfo_cache dba_db_repinfo_get_by_id(dba_db_repinfo ri, int id);
00169
00180 dba_db_repinfo_cache dba_db_repinfo_get_by_memo(dba_db_repinfo ri, const char* memo);
00181
00198 dba_err dba_db_repinfo_update(dba_db_repinfo ri, const char* deffile, int* added, int* deleted, int* updated);
00199
00200 #if 0
00201 void dba_db_repinfo_set_ident(dba_db_repinfo ins, const char* ident);
00202 dba_err dba_db_repinfo_get_id(dba_db_repinfo ins, int *id);
00203 dba_err dba_db_repinfo_insert(dba_db_repinfo ins, int *id);
00204 dba_err dba_db_repinfo_update(dba_db_repinfo ins);
00205 #endif
00206
00207
00208 #ifdef __cplusplus
00209 }
00210 #endif
00211
00212
00213 #endif