summaryrefslogtreecommitdiffstats
path: root/src/dir.h
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-05-05 21:52:54 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2013-05-05 21:52:54 +0200
commit3f03c0e6aafef241a795e62f2edb159b1de4b038 (patch)
treec04b806dd3d93d89dc2dfbeea1e2cd070252253b /src/dir.h
parentb9458447e8cbce92cbb8bb082ae447cc5a9d9341 (diff)
Migrate from file_data to file_info structure
Diffstat (limited to 'src/dir.h')
-rw-r--r--src/dir.h56
1 files changed, 18 insertions, 38 deletions
diff --git a/src/dir.h b/src/dir.h
index ba8a0f9..a21ae1e 100644
--- a/src/dir.h
+++ b/src/dir.h
@@ -39,7 +39,20 @@ extern "C" {
#define CAPA_LIST_ADS 2
typedef struct dir_data dir_data_t;
-typedef struct file_data file_data_t;
+typedef struct
+{
+ struct td_list_head list;
+ char *name;
+ uint32_t st_ino;
+ uint32_t st_mode;
+ uint32_t st_uid;
+ uint32_t st_gid;
+ uint64_t st_size;
+ time_t td_atime; /* time of last access */
+ time_t td_mtime; /* time of last modification */
+ time_t td_ctime; /* time of last status change */
+ unsigned int status;
+} file_info_t;
struct dir_data
{
@@ -49,8 +62,8 @@ struct dir_data
int verbose;
unsigned int param;
unsigned int capabilities;
- file_data_t *(*get_dir)(disk_t *disk_car, const partition_t *partition, dir_data_t *dir_data, const unsigned long int first_inode);
- int (*copy_file)(disk_t *disk_car, const partition_t *partition, dir_data_t *dir_data, const file_data_t *file);
+ int(*get_dir)(disk_t *disk_car, const partition_t *partition, dir_data_t *dir_data, const unsigned long int first_inode, file_info_t*list);
+ int (*copy_file)(disk_t *disk_car, const partition_t *partition, dir_data_t *dir_data, const file_info_t *file);
void (*close)(dir_data_t *dir_data);
char *local_dir;
void *private_dir_data;
@@ -60,42 +73,9 @@ struct dir_data
#define FILE_STATUS_MARKED 2
#define FILE_STATUS_ADS 4
-/* TODO: migrate file_data to file_info */
-struct file_data
-{
- file_data_t *prev;
- file_data_t *next;
- char name[DIR_NAME_LEN];
- uint32_t st_ino;
- uint32_t st_mode;
- uint32_t st_uid;
- uint32_t st_gid;
- uint64_t st_size;
- time_t td_atime; /* time of last access */
- time_t td_mtime; /* time of last modification */
- time_t td_ctime; /* time of last status change */
- unsigned int status;
-};
-
-typedef struct
-{
- struct td_list_head list;
- char *name;
- uint32_t st_ino;
- uint32_t st_mode;
- uint32_t st_uid;
- uint32_t st_gid;
- uint64_t st_size;
- time_t td_atime; /* time of last access */
- time_t td_mtime; /* time of last modification */
- time_t td_ctime; /* time of last status change */
- unsigned int status;
-} file_info_t;
-
-int dir_aff_log(const dir_data_t *dir_data, const file_data_t*dir_list);
+int dir_aff_log(const dir_data_t *dir_data, const file_info_t*dir_list);
int log_list_file(const disk_t *disk_car, const partition_t *partition, const dir_data_t *dir_data, const file_info_t*list);
-unsigned int delete_list_file(file_data_t *file_list);
-void delete_list_file_info(struct td_list_head *list);
+unsigned int delete_list_file(file_info_t *list);
int dir_whole_partition_log(disk_t *disk_car, const partition_t *partition, dir_data_t *dir_data, const unsigned long int inode);
void mode_string (const unsigned int mode, char *str);
int set_mode(const char *pathname, unsigned int mode);