]> git.saurik.com Git - apple/hfs.git/blame - livefiles_hfs_plugin/lf_hfs_utils.h
hfs-556.100.11.tar.gz
[apple/hfs.git] / livefiles_hfs_plugin / lf_hfs_utils.h
CommitLineData
de8ee011
A
1/* Copyright © 2017-2018 Apple Inc. All rights reserved.
2 *
3 * lf_hfs_utils.h
4 * livefiles_hfs
5 *
6 * Created by Yakov Ben Zaken on 19/03/2018.
7 */
8
9#ifndef lf_hfs_utils_h
10#define lf_hfs_utils_h
11
12#include <stdio.h>
13#include <assert.h>
14#include "lf_hfs_locks.h"
15#include "lf_hfs.h"
16#include "lf_hfs_logger.h"
17
18#define hfs_assert(expr) \
19 do { \
20 if ( (expr) == (0) ) \
21 { \
22 LFHFS_LOG( LEVEL_ERROR, \
23 "HFS ASSERT [%s] [%d]\n", \
24 __FILE__, \
25 __LINE__); \
26 assert( 0 ); \
27 } \
28 } while (0)
29
30#define MAC_GMT_FACTOR 2082844800UL
31
32
33void* hashinit(int elements, u_long *hashmask);
34void hashDeinit(void* pvHashTbl);
35time_t to_bsd_time(u_int32_t hfs_time);
36u_int32_t to_hfs_time(time_t bsd_time);
37void microuptime(struct timeval *tvp);
38void microtime(struct timeval *tvp);
39void* lf_hfs_utils_allocate_and_copy_string( char *pcName, size_t uLen );
40off_t blk_to_bytes(uint32_t blk, uint32_t blk_size);
41
42#endif /* lf_hfs_utils_h */