-
Notifications
You must be signed in to change notification settings - Fork 1
/
util.h
54 lines (40 loc) · 972 Bytes
/
util.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
typedef char s8_t;
typedef char* ps8_t;
typedef unsigned char u8_t;
typedef unsigned char* pu8_t;
typedef char s16_t;
typedef char * ps16_t;
typedef unsigned short u16_t;
typedef unsigned short* pu16_t;
typedef unsigned int u32_t;
typedef unsigned int* pu32_t;
typedef unsigned long long u64_t;
typedef unsigned long long* pu64_t;
#if __x86_64__
typedef __uint128_t u128;
#else
typedef int64_t u128;
#endif
typedef unsigned char BOOL;
#ifndef __KERNEL__
#define LINUX_VERSION_CODE 0
#define KERNEL_VERSION(major, minor, micro) 0
#define printk printf
#endif
#ifdef __KERNEL__
#include <linux/fs.h>
char* strtok(char *, const char *);
void get_file_path_from_dentry(struct dentry *dentry, char* buf, int len);
void get_dir_path_from_dentry(struct dentry *dentry,char* buf,int len);
#else
#define ERANGE 34
#define GETOPT_VAL_HELP 270
int fls64(u64_t);
u64_t parse_size(char *);
#endif