Go to the source code of this file.
Data Structures | |
struct | filedb_top |
struct | filedb_header |
struct | filedb_entry |
Defines | |
#define | my_free(ptr) |
#define | malloc_strcpy(target, entry) |
#define | malloc_strcpy_nocheck(target, entry) |
#define | filedb_tot_dynspace(fdh) |
#define | filedb_zero_dynspace(fdh) |
#define | malloc_fdbe() _malloc_fdbe(__FILE__, __LINE__) |
#define | filedb_getfile(fdb, pos, get) _filedb_getfile(fdb, pos, get, __FILE__, __LINE__) |
#define | filedb_matchfile(fdb, pos, match) _filedb_matchfile(fdb, pos, match, __FILE__, __LINE__) |
#define | filedb_updatefile(fdb, pos, fdbe, update) _filedb_updatefile(fdb, pos, fdbe, update, __FILE__, __LINE__) |
#define | filedb_addfile(fdb, fdbe) _filedb_addfile(fdb, fdbe, __FILE__, __LINE__) |
#define | filedb_movefile(fdb, pos, fdbe) _filedb_movefile(fdb, pos, fdbe, __FILE__, __LINE__) |
#define | FILEDB_VERSION1 0x0001 |
#define | FILEDB_VERSION2 0x0002 |
#define | FILEDB_VERSION3 0x0003 |
#define | FILEDB_NEWEST_VER FILEDB_VERSION3 |
#define | POS_NEW 0 |
#define | FILE_UNUSED 0x0001 |
#define | FILE_DIR 0x0002 |
#define | FILE_SHARE 0x0004 |
#define | FILE_HIDDEN 0x0008 |
#define | FILE_ISLINK 0x0010 |
#define | FILEDB_ESTDYN 50 |
Enumerations | |
enum | { GET_HEADER, GET_FILENAME, GET_FULL, UPDATE_HEADER, UPDATE_SIZE, UPDATE_ALL, TYPE_NEW, TYPE_EXIST } |
Functions | |
static void | free_fdbe (filedb_entry **) |
static filedb_entry * | _malloc_fdbe (char *, int) |
static int | filedb_readtop (FILE *, filedb_top *) |
static int | filedb_writetop (FILE *, filedb_top *) |
static int | filedb_delfile (FILE *, long) |
static filedb_entry * | filedb_findempty (FILE *, int) |
static int | _filedb_updatefile (FILE *, long, filedb_entry *, int, char *, int) |
static int | _filedb_movefile (FILE *, long, filedb_entry *, char *, int) |
static int | _filedb_addfile (FILE *, filedb_entry *, char *, int) |
static filedb_entry * | _filedb_getfile (FILE *, long, int, char *, int) |
static filedb_entry * | _filedb_matchfile (FILE *, long, char *, char *, int) |
static filedb_entry * | filedb_getentry (char *, char *) |
#define FILE_DIR 0x0002 |
Definition at line 144 of file filedb3.h.
Referenced by cmd_mkdir(), cmd_mv_cp(), cmd_reget_get(), cmd_rm(), cmd_rmdir(), cmd_share(), cmd_unshare(), convert_old_files(), filedb_change(), filedb_getdirs(), filedb_getfiles(), filedb_getlink(), filedb_ls(), filedb_setlink(), filedb_update(), files_reget(), remote_filereq(), and resolve_dir().
#define FILE_HIDDEN 0x0008 |
Definition at line 146 of file filedb3.h.
Referenced by cmd_desc(), cmd_hide(), cmd_mv_cp(), cmd_reget_get(), cmd_rm(), cmd_share(), cmd_unhide(), cmd_unshare(), filedb_change(), filedb_ls(), files_reget(), and remote_filereq().
#define FILE_ISLINK 0x0010 |
Definition at line 147 of file filedb3.h.
Referenced by _filedb_getfile(), and filedb_update().
#define FILE_SHARE 0x0004 |
Definition at line 145 of file filedb3.h.
Referenced by cmd_share(), cmd_unshare(), filedb_change(), filedb_ls(), and remote_filereq().
#define FILE_UNUSED 0x0001 |
Definition at line 143 of file filedb3.h.
Referenced by _filedb_getfile(), _filedb_matchfile(), convert_version1(), convert_version2(), filedb_cleanup(), filedb_delfile(), filedb_findempty(), filedb_getdirs(), filedb_getfiles(), filedb_ls(), filedb_mergeempty(), and filedb_update().
#define filedb_addfile | ( | fdb, | |||
fdbe | ) | _filedb_addfile(fdb, fdbe, __FILE__, __LINE__) |
Definition at line 127 of file filedb3.h.
Referenced by cmd_ln(), cmd_mv_cp(), convert_old_files(), convert_version1(), convert_version2(), filedb_setlink(), and filedb_update().
#define FILEDB_ESTDYN 50 |
Definition at line 149 of file filedb3.h.
Referenced by filedb_findempty().
#define filedb_getfile | ( | fdb, | |||
pos, | |||||
get | ) | _filedb_getfile(fdb, pos, get, __FILE__, __LINE__) |
Definition at line 124 of file filedb3.h.
Referenced by _filedb_matchfile(), filedb_cleanup(), filedb_findempty(), filedb_getdirs(), filedb_getfiles(), filedb_ls(), filedb_mergeempty(), and filedb_update().
#define filedb_matchfile | ( | fdb, | |||
pos, | |||||
match | ) | _filedb_matchfile(fdb, pos, match, __FILE__, __LINE__) |
Definition at line 125 of file filedb3.h.
Referenced by cmd_desc(), cmd_hide(), cmd_ln(), cmd_mkdir(), cmd_mv_cp(), cmd_reget_get(), cmd_rm(), cmd_rmdir(), cmd_share(), cmd_unhide(), cmd_unshare(), filedb_add(), filedb_change(), filedb_getentry(), filedb_setdesc(), filedb_setlink(), filedb_setowner(), filedb_update(), files_reget(), incr_file_gots(), remote_filereq(), and resolve_dir().
#define filedb_movefile | ( | fdb, | |||
pos, | |||||
fdbe | ) | _filedb_movefile(fdb, pos, fdbe, __FILE__, __LINE__) |
Definition at line 128 of file filedb3.h.
Referenced by filedb_cleanup(), and filedb_findempty().
#define FILEDB_NEWEST_VER FILEDB_VERSION3 |
Definition at line 138 of file filedb3.h.
Referenced by filedb_initdb(), and filedb_open().
#define filedb_tot_dynspace | ( | fdh | ) |
((fdh).filename_len + (fdh).desc_len + \ (fdh).chan_len + (fdh).uploader_len + (fdh).flags_req_len + \ (fdh).sharelink_len)
Definition at line 109 of file filedb3.h.
Referenced by _filedb_getfile(), _filedb_updatefile(), and filedb_delfile().
#define filedb_updatefile | ( | fdb, | |||
pos, | |||||
fdbe, | |||||
update | ) | _filedb_updatefile(fdb, pos, fdbe, update, __FILE__, __LINE__) |
Definition at line 126 of file filedb3.h.
Referenced by cmd_desc(), cmd_hide(), cmd_ln(), cmd_mkdir(), cmd_reget_get(), cmd_share(), cmd_unhide(), cmd_unshare(), filedb_add(), filedb_change(), filedb_mergeempty(), filedb_setdesc(), filedb_setlink(), filedb_setowner(), filedb_update(), files_reget(), and incr_file_gots().
#define FILEDB_VERSION1 0x0001 |
Definition at line 135 of file filedb3.h.
Referenced by convert_old_db().
#define FILEDB_VERSION3 0x0003 |
Definition at line 137 of file filedb3.h.
Referenced by convert_old_db().
#define filedb_zero_dynspace | ( | fdh | ) |
{ \ (fdh).filename_len = 0; \ (fdh).desc_len = 0; \ (fdh).chan_len = 0; \ (fdh).uploader_len = 0; \ (fdh).flags_req_len = 0; \ (fdh).sharelink_len = 0; \ }
Definition at line 113 of file filedb3.h.
Referenced by filedb_delfile().
#define malloc_fdbe | ( | ) | _malloc_fdbe(__FILE__, __LINE__) |
Definition at line 123 of file filedb3.h.
Referenced by cmd_ln(), cmd_mkdir(), cmd_mv_cp(), convert_old_files(), convert_version1(), convert_version2(), filedb_findempty(), filedb_setlink(), and filedb_update().
#define malloc_strcpy | ( | target, | |||
entry | ) |
do { \ if (entry) { \ (target) = nrealloc((target), strlen(entry) + 1); \ strcpy((target), (entry)); \ } else \ my_free(target); \ } while (0)
Definition at line 93 of file filedb3.h.
Referenced by _dcc_send(), cmd_desc(), cmd_ln(), cmd_mkdir(), cmd_mv_cp(), cmd_reget_get(), cmd_rmdir(), convert_old_files(), convert_version1(), convert_version2(), filedb_add(), filedb_getlink(), filedb_ls(), filedb_setdesc(), filedb_setlink(), filedb_setowner(), filedb_update(), files_ls(), files_reget(), incr_file_gots(), make_point_path(), remote_filereq(), and resolve_dir().
#define malloc_strcpy_nocheck | ( | target, | |||
entry | ) |
do { \ (target) = nrealloc((target), strlen(entry) + 1); \ strcpy((target), (entry)); \ } while (0)
Definition at line 102 of file filedb3.h.
Referenced by cmd_mkdir(), and convert_old_files().
#define my_free | ( | ptr | ) |
Definition at line 83 of file filedb3.h.
Referenced by _dcc_send(), cmd_chdir(), cmd_desc(), cmd_file_help(), cmd_files(), cmd_ln(), cmd_mkdir(), cmd_mv_cp(), cmd_reget_get(), cmd_rm(), cmd_rmdir(), convert_old_db(), convert_old_files(), dcc_files(), do_dcc_send(), filedb_add(), filedb_ls(), filedb_open(), filedb_setdesc(), filedb_setlink(), filedb_setowner(), filedb_update(), filelist_free(), files_ls(), files_reget(), files_setpwd(), filesys_dcc_send(), filesys_dcc_send_hostresolved(), free_fdbe(), incr_file_gots(), mktempfile(), remote_filereq(), and resolve_dir().
#define POS_NEW 0 |
Definition at line 140 of file filedb3.h.
Referenced by _filedb_addfile(), _filedb_updatefile(), and cmd_mkdir().
anonymous enum |
GET_HEADER | |
GET_FILENAME | |
GET_FULL | |
UPDATE_HEADER | |
UPDATE_SIZE | |
UPDATE_ALL | |
TYPE_NEW | |
TYPE_EXIST |
Definition at line 151 of file filedb3.h.
00151 { 00152 GET_HEADER, /* Only save minimal data */ 00153 GET_FILENAME, /* Additionally save filename */ 00154 GET_FULL, /* Save all data */ 00155 00156 UPDATE_HEADER, /* Only update header */ 00157 UPDATE_SIZE, /* Update header, enforce new buf sizes */ 00158 UPDATE_ALL, /* Update additional data too */ 00159 00160 TYPE_NEW, /* New entry */ 00161 TYPE_EXIST /* Existing entry */ 00162 };
static int _filedb_addfile | ( | FILE * | , | |
filedb_entry * | , | |||
char * | , | |||
int | ||||
) | [static] |
static filedb_entry* _filedb_getfile | ( | FILE * | , | |
long | , | |||
int | , | |||
char * | , | |||
int | ||||
) | [static] |
static filedb_entry* _filedb_matchfile | ( | FILE * | , | |
long | , | |||
char * | , | |||
char * | , | |||
int | ||||
) | [static] |
static int _filedb_movefile | ( | FILE * | , | |
long | , | |||
filedb_entry * | , | |||
char * | , | |||
int | ||||
) | [static] |
static int _filedb_updatefile | ( | FILE * | , | |
long | , | |||
filedb_entry * | , | |||
int | , | |||
char * | , | |||
int | ||||
) | [static] |
static filedb_entry* _malloc_fdbe | ( | char * | , | |
int | ||||
) | [static] |
static int filedb_delfile | ( | FILE * | , | |
long | ||||
) | [static] |
static filedb_entry* filedb_findempty | ( | FILE * | , | |
int | ||||
) | [static] |
static filedb_entry* filedb_getentry | ( | char * | , | |
char * | ||||
) | [static] |
static int filedb_readtop | ( | FILE * | , | |
filedb_top * | ||||
) | [static] |
static int filedb_writetop | ( | FILE * | , | |
filedb_top * | ||||
) | [static] |
static void free_fdbe | ( | filedb_entry ** | ) | [static] |