Header - Database db5, long filename support. More...
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
Go to the source code of this file.
Functions | |
bool | names_init () |
initialize longname support | |
const char * | names_select_longname (const char *shortname) |
convert short name to longname | |
bool | names_generate_shortname (const char *longname, char *shortname, const size_t shortname_size) |
convert long name to shortname | |
bool | names_save () |
save names data on file | |
void | names_insert (const char *filename) |
add an entry in names list | |
bool | names_delete (const char *filename) |
delete an entry in names list | |
void | names_print () |
print names list (debug) | |
void | names_free () |
free names list | |
bool | names_select_shortname (const char *filename, char *shortname, const size_t shortname_size) |
retrieve look in names list to find shortname using longname |
Header - Database db5, long filename support.
Definition in file names.h.
bool names_delete | ( | const char * | filename | ) |
delete an entry in names list
filename | longname to remove - latin1 |
Definition at line 298 of file names.c.
References add_log(), ADDLOG_RECOVER, check, name_trans_t::longname, names_save(), and name_trans_t::next.
Referenced by db5_delete().
bool names_generate_shortname | ( | const char * | longname, | |
char * | shortname, | |||
const size_t | shortname_size | |||
) |
convert long name to shortname
longname | name to convert to shortname - latin1 | |
shortname | data to store shortname - latin1 | |
shortname_size | size of shortname |
Definition at line 245 of file names.c.
References check, file_get_extension(), and strcrc32().
Referenced by db5_longname_to_shortname().
bool names_init | ( | ) |
initialize longname support
Definition at line 151 of file names.c.
References add_log(), ADDLOG_FAIL, ADDLOG_NOTICE, CONFIG_NAMES_FILE, crc32_init, file_fcaseopen(), and name_trans_t::longname.
Referenced by db5_init().
void names_insert | ( | const char * | filename | ) |
add an entry in names list
filename | longname to remove - latin1 |
Definition at line 199 of file names.c.
References add_log(), ADDLOG_DEBUG, ADDLOG_RECOVER, check, log_dump_latin1(), names_save(), and strcrc32().
Referenced by db5_insert().
bool names_save | ( | ) |
save names data on file
Definition at line 268 of file names.c.
References add_log(), ADDLOG_FAIL, check, CONFIG_NAMES_FILE, name_trans_t::crc32, file_fcaseopen(), name_trans_t::longname, and name_trans_t::next.
Referenced by names_delete(), and names_insert().
const char* names_select_longname | ( | const char * | shortname | ) |
convert short name to longname
shortname | name to convert to longname - latin1 |
Definition at line 221 of file names.c.
References check.
Referenced by db5_print_row(), and db5_select_filename().
bool names_select_shortname | ( | const char * | filename, | |
char * | shortname, | |||
const size_t | shortname_size | |||
) |
retrieve look in names list to find shortname using longname
filename | filename to find - latin1 | |
shortname | buffer where shortname will be stored - latin1 | |
shortname_size | of shortname |
Definition at line 88 of file names.c.
References add_log(), ADDLOG_USER_ERROR, check, name_trans_t::crc32, file_get_extension(), log_dump_latin1(), name_trans_t::longname, and name_trans_t::next.
Referenced by db5_insert(), and db5_longname_to_shortname().