summaryrefslogtreecommitdiffstats
path: root/src/fat_dir.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2012-09-16 16:33:40 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2012-09-16 16:33:40 +0200
commitd5ec1a37dba590399170b2484efd7ece388ab160 (patch)
treec1cda1dc75a7affce5879f4227a75122d7f591c5 /src/fat_dir.c
parent4cbe56e5380b2a17109169fb56c7ccebc72add88 (diff)
move date_dos2unix() and set_secwest() to src/common.c
Diffstat (limited to 'src/fat_dir.c')
-rw-r--r--src/fat_dir.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/fat_dir.c b/src/fat_dir.c
index 43aa376..ba55df0 100644
--- a/src/fat_dir.c
+++ b/src/fat_dir.c
@@ -55,15 +55,12 @@ struct fat_dir_struct
};
-static int date_dos2unix(const unsigned short f_time,const unsigned short f_date);
static file_data_t *fat1x_rootdir(disk_t *disk_car, const partition_t *partition, const dir_data_t *dir_data, const struct fat_boot_sector*fat_header);
static file_data_t *fat_dir(disk_t *disk_car, const partition_t *partition, dir_data_t *dir_data, const unsigned long int first_cluster);
static inline void fat16_towchar(wchar_t *dst, const uint8_t *src, size_t len);
static int fat_copy(disk_t *disk_car, const partition_t *partition, dir_data_t *dir_data, const file_data_t *file);
static void dir_partition_fat_close(dir_data_t *dir_data);
-static int32_t secwest;
-
static inline void fat16_towchar(wchar_t *dst, const uint8_t *src, size_t len)
{
while (len--) {
@@ -325,26 +322,6 @@ EODir:
return dir_list;
}
-static int day_n[] = { 0,31,59,90,120,151,181,212,243,273,304,334,0,0,0,0 };
- /* JanFebMarApr May Jun Jul Aug Sep Oct Nov Dec */
-
-/* Convert a MS-DOS time/date pair to a UNIX date (seconds since 1 1 70). */
-
-static int date_dos2unix(const unsigned short f_time, const unsigned short f_date)
-{
- int month,year,secs;
-
- /* first subtract and mask after that... Otherwise, if
- f_date == 0, bad things happen */
- month = ((f_date >> 5) - 1) & 15;
- year = f_date >> 9;
- secs = (f_time & 31)*2+60*((f_time >> 5) & 63)+(f_time >> 11)*3600+86400*
- ((f_date & 31)-1+day_n[month]+(year/4)+year*365-((year & 3) == 0 &&
- month < 2 ? 1 : 0)+3653);
- /* days since 1.1.70 plus 80's leap day */
- return secs+secwest;
-}
-
enum {FAT_FOLLOW_CLUSTER, FAT_NEXT_FREE_CLUSTER, FAT_NEXT_CLUSTER};
static int is_EOC(const unsigned int cluster, const upart_type_t upart_type)
@@ -484,28 +461,6 @@ static file_data_t *fat1x_rootdir(disk_t *disk_car, const partition_t *partition
}
}
-static void set_secwest(void)
-{
- struct tm *tmptr;
- time_t t;
-
- t = time(NULL);
- tmptr = localtime(&t);
-#ifdef HAVE_STRUCT_TM_TM_GMTOFF
- secwest = -1 * tmptr->tm_gmtoff;
-#elif defined (DJGPP)
- secwest = 0;
-#else
-#if defined (__CYGWIN__)
- secwest = _timezone;
-#else
- secwest = timezone;
-#endif
- /* account for daylight savings */
- if (tmptr->tm_isdst)
- secwest -= 3600;
-#endif
-}
int dir_partition_fat_init(disk_t *disk_car, const partition_t *partition, dir_data_t *dir_data, const int verbose)
{