26 #include <mix/General.h>
27 #include <mix/Exceptions.h>
28 #include <mix/Types.h>
29 #include <mix/units.h>
30 #include <mix/mutex.h>
32 #include <ldb/dbnamedefs.h>
47 typedef void* dbHandle;
50 #define DB_PRECISION (0.00001)
57 #define DB_DSC1 (1<<0)
59 #define DB_DSC2 (1<<1)
61 #define DB_DSC3 (1<<2)
62 #define DB_ASC (DB_ASC1|DB_ASC2|DB_ASC3)
63 #define DB_DSC (DB_DSC1|DB_DSC2|DB_DSC3)
66 #define DB_CREATE DbCreateFile
67 #define DB_WRITE DbReadWriteFile
68 #define DB_READ DbReadOnlyFile
69 #define DB_MEMORY DbMemory
78 dbHandle dbOpen (
const char* szProject,
84 dbHandle dbOpenName (
const char* szProject,
90 dbHandle dbOpenItem (
const char* szProject,
99 dbHandle dbOpenItemEx (
const char* szProject,
105 dbHandle dbOpenList (
const char* szProject,
106 const char* szTableType,
110 dbHandle dbOpenIndex (
const char* szProject,
111 const char* szTableType,
122 void dbReopen (dbHandle dbh,
126 void dbClose (dbHandle dbh);
129 void dbRemove (
const char* szProject,
133 void dbRename (
const char* szProject,
138 void dbRestoreLock (dbHandle dbh);
141 MutexId* dbMutex (dbHandle dbh);
149 char** dbTableTypeList (
int* pNumber);
154 Logic dbCheckTable (
const char* szTableName);
157 ErrCode dbRegisterTableType (
const char* ttname,
163 ErrCode dbFetchTableType (
const char* ttname,
172 Logic dbIsModified (dbHandle dbh);
175 Logic dbIsModifiable (dbHandle dbh);
179 void dbSetModified (dbHandle dbh, Logic bFlag);
182 void dbSetModifiable (dbHandle dbh, Logic bFlag);
190 const char* dbTableType (dbHandle dbh);
193 const char* dbFileName (dbHandle dbh);
199 const char* dbProject (dbHandle dbh);
202 DbIndex dbLinesCount (dbHandle dbh);
206 int dbColumnsCount (dbHandle dbh);
217 ErrCode dbThisTableType (dbHandle dbh,
226 void dbSetUnit (dbHandle dbh,
227 const char* szColumnName,
231 UnitId dbGetUnit (dbHandle dbh,
232 const char* szColumnName);
236 CategoryId dbColumnUnitCateg (dbHandle dbh,
237 const char* szColumnName);
244 void dbCleanTable (dbHandle dbh);
247 void dbFlush (dbHandle dbh);
251 void dbSort1 (dbHandle dbh,
252 const char* szColumnName1,
257 void dbSort2 (dbHandle dbh,
258 const char* szColumnName1,
259 const char* szColumnName2,
265 void dbSort3 (dbHandle dbh,
266 const char* szColumnName1,
267 const char* szColumnName2,
268 const char* szColumnName3,
276 void dbColumnName (dbHandle dbh,
282 AtomType dbColumnType (dbHandle dbh,
283 const char* szColumnName);
287 int dbColumnDim (dbHandle dbh,
288 const char* szColumnName);
293 Logic dbCheckColumn (dbHandle dbh,
294 const char* szColumnName);
298 int dbColumnDefaultInt (dbHandle dbh,
299 const char* szColumnName);
303 float dbColumnDefaultFloat (dbHandle dbh,
304 const char* szColumnName);
307 Logic dbCheckNumericColumn (dbHandle dbh,
308 const char* szColumnName);
315 void dbAddLine (dbHandle dbh);
318 void dbAddLines (dbHandle dbh, DbIndex lines);
322 void dbInsertLine (dbHandle dbh, DbIndex index);
326 void dbInsertLines (dbHandle dbh, DbIndex index, DbIndex lines);
329 void dbRemoveLine (dbHandle dbh, DbIndex index);
332 void dbRemoveLines (dbHandle dbh, DbIndex startIndex,
336 void dbMergeTables (dbHandle dbhDst, dbHandle dbhSrc);
339 void dbCopyTables (dbHandle dbhDst, DbIndex iWhere,
340 dbHandle dbhSrc, DbIndex iFrom, DbIndex nLines);
348 double dbGetFloat (dbHandle dbh, DbIndex lineIndex,
349 const char* szColumnName);
353 int dbGetInt (dbHandle dbh, DbIndex lineIndex,
354 const char* szColumnName);
358 long long dbGetInt8 (dbHandle dbh, DbIndex lineIndex,
359 const char* szColumnName);
362 char dbGetChar (dbHandle dbh, DbIndex lineIndex,
363 const char* szColumnName);
366 void dbGetPtr (dbHandle dbh, DbIndex lineIndex,
367 const char* szColumnName,
371 void dbGetPointer (dbHandle dbh, DbIndex lineIndex,
380 char* dbGetString (dbHandle dbh, DbIndex lineIndex,
381 const char* szColumnName,
387 void dbGetFloatAr (dbHandle dbh, DbIndex lineIndex,
388 const char* szColumnName,
394 void dbGetDoubleAr (dbHandle dbh, DbIndex lineIndex,
395 const char* szColumnName,
401 void dbGetIntAr (dbHandle dbh, DbIndex lineIndex,
402 const char* szColumnName,
408 void dbGetInt8Ar (dbHandle dbh, DbIndex lineIndex,
409 const char* szColumnName,
418 void dbGetIntColumn (dbHandle dbh,
421 const char* szColumnName,
426 void dbGetIntArColumn (dbHandle dbh,
429 const char* szColumnName,
434 void dbGetInt8Column (dbHandle dbh,
437 const char* szColumnName,
442 void dbGetInt8ArColumn (dbHandle dbh,
445 const char* szColumnName,
450 void dbGetFloatColumn (dbHandle dbh,
453 const char* szColumnName,
458 void dbGetFloatArColumn (dbHandle dbh,
461 const char* szColumnName,
466 void dbGetDoubleColumn (dbHandle dbh,
469 const char* szColumnName,
474 void dbGetDoubleArColumn (dbHandle dbh,
477 const char* szColumnName,
481 Logic dbCheckEmptyValue (dbHandle dbh, DbIndex lineIndex,
482 const char* szColumnName);
490 void dbSetFloat (dbHandle dbh, DbIndex lineIndex,
491 const char* szColumnName,
double value);
495 void dbSetInt (dbHandle dbh, DbIndex lineIndex,
496 const char* szColumnName,
int value);
500 void dbSetInt8 (dbHandle dbh, DbIndex lineIndex,
501 const char* szColumnName,
long long value);
504 void dbSetChar (dbHandle dbh, DbIndex lineIndex,
505 const char* szColumnName,
char value);
508 void dbSetPtr (dbHandle dbh, DbIndex lineIndex,
509 const char* szColumnName,
513 void dbSetPointer (dbHandle dbh, DbIndex lineIndex,
522 void dbSetString (dbHandle dbh, DbIndex lineIndex,
523 const char* szColumnName,
529 void dbSetFloatAr (dbHandle dbh, DbIndex lineIndex,
530 const char* szColumnName,
536 void dbSetDoubleAr (dbHandle dbh, DbIndex lineIndex,
537 const char* szColumnName,
542 void dbSetIntAr (dbHandle dbh, DbIndex lineIndex,
543 const char* szColumnName,
549 void dbSetInt8Ar (dbHandle dbh, DbIndex lineIndex,
550 const char* szColumnName,
551 const long long* ar);
559 void dbSetIntColumn (dbHandle dbh,
562 const char* szColumnName,
567 void dbSetIntArColumn (dbHandle dbh,
570 const char* szColumnName,
575 void dbSetInt8Column (dbHandle dbh,
578 const char* szColumnName,
579 const long long* ar);
583 void dbSetInt8ArColumn (dbHandle dbh,
586 const char* szColumnName,
587 const long long** arOfAr);
591 void dbSetFloatColumn (dbHandle dbh,
594 const char* szColumnName,
599 void dbSetFloatArColumn (dbHandle dbh,
602 const char* szColumnName,
603 const float** arOfAr);
607 void dbSetDoubleColumn (dbHandle dbh,
610 const char* szColumnName,
615 void dbSetDoubleArColumn (dbHandle dbh,
618 const char* szColumnName,
619 const double** arOfAr);
622 void dbSetEmptyValue (dbHandle dbh, DbIndex lineIndex,
623 const char* szColumnName);
630 extern TLStorage
int dbStatus;
633 extern volatile double dbEpsilon;
Definition: dbnamedefs.h:67
Definition: dbnamedefs.h:103
Definition: dbnamedefs.h:85