summaryrefslogtreecommitdiff
path: root/other/b-scan/tmp/include/bscan/system.h
diff options
context:
space:
mode:
authorRoot THC2026-02-24 12:42:47 +0000
committerRoot THC2026-02-24 12:42:47 +0000
commitc9cbeced5b3f2bdd7407e29c0811e65954132540 (patch)
treeaefc355416b561111819de159ccbd86c3004cf88 /other/b-scan/tmp/include/bscan/system.h
parent073fe4bf9fca6bf40cef2886d75df832ef4b6fca (diff)
initial
Diffstat (limited to 'other/b-scan/tmp/include/bscan/system.h')
-rw-r--r--other/b-scan/tmp/include/bscan/system.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/other/b-scan/tmp/include/bscan/system.h b/other/b-scan/tmp/include/bscan/system.h
new file mode 100644
index 0000000..6eed6d8
--- /dev/null
+++ b/other/b-scan/tmp/include/bscan/system.h
@@ -0,0 +1,38 @@
1/*
2 * generic system functions
3 */
4
5#include <sys/time.h>
6#include <unistd.h>
7#include <errno.h>
8#include <stdio.h>
9#include <string.h>
10
11#define DEV_ZERO "/dev/zero"
12
13/*
14 * we use the 'do while' trick to use err_abort as if they were functions
15 */
16#define err_abort(code,text) do { \
17 fprintf (stderr, "%s at \"%s\":%d: %s\n", \
18 text, __FILE__, __LINE__, strerror (code)); \
19 abort(); \
20 } while (0)
21
22#define errno_abort(text) do { \
23 fprintf(stderr, "%s at \"%s\":%d: %s\n", \
24 text, __FILE__, __LINE__, strerror (errno)); \
25 abort(); \
26 } while (0)
27
28
29void *shmalloc (int, size_t);
30void do_nanosleep (time_t, long);
31void xchange (void *, void *, int);
32void time_diff (struct timeval *, struct timeval *);
33int ctoreal(char *, char *);
34void save_write(FILE *, char *, unsigned char *, int);
35int isprintdata(char *, int);
36int dat2hexstr(unsigned char *, unsigned int, unsigned char *, unsigned int);
37int dat2strip(unsigned char *, unsigned int, unsigned char *, unsigned int);
38