| | |
| | | * $db_file: sqlite database file name |
| | | * return value: <0: failure 0:ok |
| | | * */ |
| | | extern int database_init(const char *db_file); |
| | | extern int db_open(const char *db_file); |
| | | |
| | | |
| | | /* description: close sqlite database handler |
| | | * return value: none |
| | | */ |
| | | extern void database_term(void); |
| | | extern void db_close(void); |
| | | |
| | | |
| | | /* description: push a blob packet into database |
| | |
| | | * $size: blob packet data bytes |
| | | * return value: <0: failure 0:ok |
| | | */ |
| | | extern int database_push_packet(void *pack, int size); |
| | | extern int db_write(const void *pack, int size); |
| | | |
| | | |
| | | /* description: pop the first blob packet from database |
| | |
| | | * $pack: blob packet output buffer address |
| | | * $size: blob packet output buffer size |
| | | * $byte: blob packet bytes |
| | | * $rowid: rowid of the record |
| | | * return value: <0: failure 0:ok |
| | | */ |
| | | extern int database_pop_packet(void *pack, int size, int *bytes); |
| | | extern int db_read(void *pack, int size, int *bytes, int *rowid); |
| | | |
| | | |
| | | /* description: remove the first blob packet from database |
| | | * input args: none |
| | | * input args: |
| | | * $rowid: rowid of the record |
| | | * return value: <0: failure 0:ok |
| | | */ |
| | | extern int database_del_packet(void); |
| | | extern int db_remove(int rowid); |
| | | |
| | | |
| | | #endif /* ----- #ifndef _DATABASE_H_ ----- */ |