inc/db5_dat.h File Reference

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

Detailed Description

Header - Database db5, data.

Author:
Julien Blitte
Version:
0.1

Definition in file db5_dat.h.


Function Documentation

bool db5_dat_delete_row ( const uint32_t  index  ) 

delete an entry of database

Parameters:
index entry position
Returns:
true if is successfull

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

Returns:
true if is successfull

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

Parameters:
entry new entry
Returns:
true if is successfull

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

Parameters:
filename the local filename - latin1
Returns:
row position, (unsigned)-1 if no found

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

Parameters:
index entry position
entry read entry
Returns:
true if is successfull

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

Parameters:
index entry position
entry new entry
Returns:
true if is successfull

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().

 All Classes Files Functions Variables Typedefs Defines

Generated on Mon Jan 11 00:15:07 2010 for db5fuse by  doxygen 1.6.1