Ignore:
Timestamp:
16/02/2010 22:12:18 (2 years ago)
Author:
chris
Message:

Move modification time functions out-of-line to help with debugging
them.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/lib/common/FileModificationTime.h

    r2460 r2612  
    1515#include "BoxTime.h" 
    1616 
    17 inline box_time_t FileModificationTime(EMU_STRUCT_STAT &st) 
    18 { 
    19 #ifndef HAVE_STRUCT_STAT_ST_MTIMESPEC 
    20         box_time_t datamodified = ((int64_t)st.st_mtime) * (MICRO_SEC_IN_SEC_LL); 
    21 #else 
    22         box_time_t datamodified = (((int64_t)st.st_mtimespec.tv_nsec) / NANO_SEC_IN_USEC_LL) 
    23                         + (((int64_t)st.st_mtimespec.tv_sec) * (MICRO_SEC_IN_SEC_LL)); 
    24 #endif 
    25          
    26         return datamodified; 
    27 } 
    28  
    29 inline box_time_t FileAttrModificationTime(EMU_STRUCT_STAT &st) 
    30 { 
    31         box_time_t statusmodified = 
    32 #ifdef HAVE_STRUCT_STAT_ST_MTIMESPEC 
    33                 (((int64_t)st.st_ctimespec.tv_nsec) / (NANO_SEC_IN_USEC_LL)) + 
    34                 (((int64_t)st.st_ctimespec.tv_sec)  * (MICRO_SEC_IN_SEC_LL)); 
    35 #elif defined HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 
    36                 (((int64_t)st.st_ctim.tv_nsec) / (NANO_SEC_IN_USEC_LL)) + 
    37                 (((int64_t)st.st_ctim.tv_sec)  * (MICRO_SEC_IN_SEC_LL)); 
    38 #elif defined HAVE_STRUCT_STAT_ST_ATIMENSEC 
    39                 (((int64_t)st.st_ctimensec) / (NANO_SEC_IN_USEC_LL)) + 
    40                 (((int64_t)st.st_ctime)     * (MICRO_SEC_IN_SEC_LL)); 
    41 #else // no nanoseconds anywhere 
    42                 (((int64_t)st.st_ctime) * (MICRO_SEC_IN_SEC_LL)); 
    43 #endif 
    44          
    45         return statusmodified; 
    46 } 
    47  
    48 inline box_time_t FileModificationTimeMaxModAndAttr(EMU_STRUCT_STAT &st) 
    49 { 
    50 #ifndef HAVE_STRUCT_STAT_ST_MTIMESPEC 
    51         box_time_t datamodified = ((int64_t)st.st_mtime) * (MICRO_SEC_IN_SEC_LL); 
    52         box_time_t statusmodified = ((int64_t)st.st_ctime) * (MICRO_SEC_IN_SEC_LL); 
    53 #else 
    54         box_time_t datamodified = (((int64_t)st.st_mtimespec.tv_nsec) / NANO_SEC_IN_USEC_LL) 
    55                         + (((int64_t)st.st_mtimespec.tv_sec) * (MICRO_SEC_IN_SEC_LL)); 
    56         box_time_t statusmodified = (((int64_t)st.st_ctimespec.tv_nsec) / NANO_SEC_IN_USEC_LL) 
    57                         + (((int64_t)st.st_ctimespec.tv_sec) * (MICRO_SEC_IN_SEC_LL)); 
    58 #endif 
    59          
    60         return (datamodified > statusmodified)?datamodified:statusmodified; 
    61 } 
     17box_time_t FileModificationTime(EMU_STRUCT_STAT &st); 
     18box_time_t FileAttrModificationTime(EMU_STRUCT_STAT &st); 
     19box_time_t FileModificationTimeMaxModAndAttr(EMU_STRUCT_STAT &st); 
    6220 
    6321#endif // FILEMODIFICATIONTIME__H 
Note: See TracChangeset for help on using the changeset viewer.