view src/timeconv.h @ 360:26c48ea9d896

From Jeffrey Morlan: pst_build_id_ptr reads the Block BTree into a linked list, which pst_getID does a linear scan through. For large PSTs that have millions of blocks, this is extremely slow - almost all time is spent in pst_getID. Since the BTree entries must be in order, this can be dramatically improved by reading into an array and using binary search.
author Carl Byington <carl@five-ten-sg.com>
date Wed, 06 Jul 2016 10:21:08 -0700
parents e3a46f66332b
children ad7b880ad3d1
line wrap: on
line source

#ifndef __PST_TIMECONV_H
#define __PST_TIMECONV_H

#include "common.h"

#ifdef __cplusplus
extern "C" {
#endif
    /** Convert a FILETIME to ascii printable local time.
       @param[in]  filetime time structure to be converted
       @param[out] result   pointer to output buffer, must be at least 30 bytes.
       @return     result pointer to the output buffer
     */
    char* pst_fileTimeToAscii (const FILETIME* filetime, char* result);

    /** Convert a FILETIME to unix struct tm.
       @param[in]  filetime time structure to be converted
       @param[out] result   pointer to output struct tm
     */
    void pst_fileTimeToStructTM (const FILETIME* filetime, struct tm *result);

    /** Convert a FILETIME to unix time_t value.
       @param[in]  filetime time structure to be converted
       @return     result time_t value
     */
    time_t pst_fileTimeToUnixTime( const FILETIME* filetime);
#ifdef __cplusplus
}
#endif

#endif