LAR Library: tab.h Source File

LAR Library

tab.h
Go to the documentation of this file.
1 #ifndef LARLIB_TAB_H
2 #define LARLIB_TAB_H
3 
69 #include <larlib/base.h>
70 
74 typedef struct table_t table_t;
75 
81 };
82 
94 int tabOpen(const char *fname, table_t **t);
95 
110 int tabCreate(const char *fname, int recSize, table_t **t);
111 
117 void tabClose(table_t *t);
118 
134 int tabFlush(table_t *t);
135 
144 int tabRecSize(table_t *t);
145 
159 int tabGetStamp(table_t *t, uint32_t *stamp);
160 
172 int tabSetStamp(table_t *t, uint32_t stamp);
173 
206 int tabGet(table_t *t, int recn, void *recp);
207 
231 int tabPut(table_t *t, int recn, const void *recp);
232 
248 int tabAppend(table_t *t, const void *recp);
249 
261 int tabSize(table_t *t);
262 
273 int tabCount(table_t *t);
274 
296 int tabDelete(table_t *t, int recn);
297 
314 int tabUnDelete(table_t *t, int recn);
315 
334 int tabPack(const char *fname);
335 
356 int tabGoFirst(table_t *t);
357 
370 int tabGetNext(table_t *t, void *recp);
371 
384 int tabGetPrev(table_t *t, void *recp);
385 
405 int tabGoLast(table_t *t);
406 
432 int tabFindNext(table_t *t, void *recp, const void *keyp,
433  int (*cmpFn)(const void *recp, const void *keyp));
434 
458 int tabFind(table_t *t, void *recp, const void *keyp,
459  int (*cmpFn)(const void *recp, const void *keyp));
460 
461 /* @} */
462 
463 #endif
Signal that the target entry is marked as deleted.
Definition: tab.h:80
int tabGoFirst(table_t *t)
Move the current entry marker to the first (zero'th) element on the table.
struct table_t table_t
Opaque type of a table instance.
Definition: tab.h:74
int tabCount(table_t *t)
Return the number of non-deleted entries on the table.
int tabGetNext(table_t *t, void *recp)
Read the current entry and move to the next.
int tabSize(table_t *t)
Return the total number of entries on the table.
int tabFind(table_t *t, void *recp, const void *keyp, int(*cmpFn)(const void *recp, const void *keyp))
Search the table for an element.
int tabGetStamp(table_t *t, uint32_t *stamp)
Return the stamp value of the table.
int tabAppend(table_t *t, const void *recp)
Append an entry to the table.
int tabFlush(table_t *t)
Force an update of the table file.
int tabFindNext(table_t *t, void *recp, const void *keyp, int(*cmpFn)(const void *recp, const void *keyp))
Search incrementally the table for an entry.
int tabUnDelete(table_t *t, int recn)
Remove the deleted mark of an entry.
int tabCreate(const char *fname, int recSize, table_t **t)
Create a new table or reset an existing one.
int tabDelete(table_t *t, int recn)
Mark an entry as deleted.
tabErrors_t
Return codes specific to this module.
Definition: tab.h:79
unsigned int uint32_t
Unsigned 32-bit integer.
Definition: base.h:168
int tabPack(const char *fname)
Permanently remove from the table all entries marked as deleted.
Larlib basic definitions.
int tabSetStamp(table_t *t, uint32_t stamp)
Modify the stamp value of the table.
int tabGetPrev(table_t *t, void *recp)
Read the previous element.
int tabGet(table_t *t, int recn, void *recp)
Read an entry from the table.
int tabPut(table_t *t, int recn, const void *recp)
Write or update an entry on the table.
int tabGoLast(table_t *t)
Move to the last element on the table.
int tabRecSize(table_t *t)
Return the record size for a table.
int tabOpen(const char *fname, table_t **t)
Open an existing table.
void tabClose(table_t *t)
Close a table_t instance.
Generated on Mon Mar 27 2017 15:42:52 for LAR Library by   doxygen 1.8.9.1