Header - Database db5, data. More...
#include <stdbool.h>
#include <stdint.h>
#include "db5_types.h"
Go to the source code of this file.
Defines | |
#define | DB5_ROW_NOT_FOUND ((uint32_t)-1) |
magic value returned when a row is not found in database | |
Functions | |
bool | db5_dat_init () |
initialize databse | |
void | db5_dat_free () |
clean database on exiting | |
bool | db5_dat_select_row (const uint32_t index, db5_row *entry) |
read an entry into database | |
bool | db5_dat_update (const uint32_t index, db5_row *entry) |
modify an entry into database | |
bool | db5_dat_insert (db5_row *entry) |
add an entry into database | |
bool | db5_dat_delete_row (const uint32_t index) |
delete an entry of database | |
uint32_t | db5_dat_select_by_filename (const char *filename) |
find a row corresponding to a file |
Header - Database db5, data.
Definition in file db5_dat.h.
bool db5_dat_delete_row | ( | const uint32_t | index | ) |
delete an entry of database
index | entry position |
Definition at line 117 of file db5_dat.c.
References add_log(), ADDLOG_FAIL, db5_dat_select_row(), db5_dat_update(), db5_hdr_count(), db5_hdr_grow(), and file_truncate().
Referenced by db5_delete().
bool db5_dat_init | ( | ) |
initialize databse
Definition at line 30 of file db5_dat.c.
References add_log(), ADDLOG_CRITICAL, CONFIG_DB5_DAT_FILE, CONFIG_DB5_DATA_DIR, crc32_init, and file_fcaseopen().
Referenced by db5_init().
bool db5_dat_insert | ( | db5_row * | entry | ) |
add an entry into database
entry | new entry |
Definition at line 86 of file db5_dat.c.
References add_log(), ADDLOG_FAIL, check, CONFIG_MAX_DB5_ENTRY, db5_hdr_count(), and db5_hdr_grow().
Referenced by db5_insert().
uint32_t db5_dat_select_by_filename | ( | const char * | filename | ) |
find a row corresponding to a file
filename | the local filename - latin1 |
Definition at line 163 of file db5_dat.c.
References add_log(), ADDLOG_FAIL, check, db5_dat_select_row(), db5_hdr_count(), DB5_ROW_NOT_FOUND, db5_row::filename, filename_size, and ws_atows().
Referenced by db5_delete(), db5_insert(), db5_longname_to_shortname(), and db5_update().
bool db5_dat_select_row | ( | const uint32_t | index, | |
db5_row * | entry | |||
) |
read an entry into database
index | entry position | |
entry | read entry |
Definition at line 50 of file db5_dat.c.
References add_log(), ADDLOG_FAIL, and check.
Referenced by db5_dat_delete_row(), db5_dat_select_by_filename(), db5_index_index_column(), and db5_select_filename().
bool db5_dat_update | ( | const uint32_t | index, | |
db5_row * | entry | |||
) |
modify an entry into database
index | entry position | |
entry | new entry |
Definition at line 68 of file db5_dat.c.
References add_log(), ADDLOG_FAIL, and check.
Referenced by db5_dat_delete_row(), and db5_update().