-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathutils.h
33 lines (24 loc) · 830 Bytes
/
utils.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
#ifndef _MY_UTILS_H_
#define _MY_UTILS_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <sys/syscall.h>
#define gettid() syscall(__NR_gettid)
int bcd_code_l2int(uint32_t bcd_code);
int bcd_code_h2int(uint32_t bcd_code);
int bcd_code_2int(uint32_t bcd_code);
void DebugBacktrace(int signal_no);
void print_help(char *argv[]);
void sigterm_handler(int arg) ;
//char *print_binary_16(uint16_t bin_value,char *bin_string);
char *print_binary_16(uint16_t bin_value,char *bin_string , int len);
int hex2bin_trim(char *dst, char *src, size_t count);
void hex_dump_to_buffer(const void *buf, size_t len,
char *linebuf, size_t linebuflen);
int hex2bin_trim_len(char *dst, const char *src, size_t count);
#ifdef __cplusplus
}
#endif
#endif /*_MY_UTILS_H_*/