diff options
| author | Root THC | 2026-02-24 12:42:47 +0000 |
|---|---|---|
| committer | Root THC | 2026-02-24 12:42:47 +0000 |
| commit | c9cbeced5b3f2bdd7407e29c0811e65954132540 (patch) | |
| tree | aefc355416b561111819de159ccbd86c3004cf88 /other/b-scan/tmp/include/bscan/system.h | |
| parent | 073fe4bf9fca6bf40cef2886d75df832ef4b6fca (diff) | |
initial
Diffstat (limited to 'other/b-scan/tmp/include/bscan/system.h')
| -rw-r--r-- | other/b-scan/tmp/include/bscan/system.h | 38 |
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 | |||
| 29 | void *shmalloc (int, size_t); | ||
| 30 | void do_nanosleep (time_t, long); | ||
| 31 | void xchange (void *, void *, int); | ||
| 32 | void time_diff (struct timeval *, struct timeval *); | ||
| 33 | int ctoreal(char *, char *); | ||
| 34 | void save_write(FILE *, char *, unsigned char *, int); | ||
| 35 | int isprintdata(char *, int); | ||
| 36 | int dat2hexstr(unsigned char *, unsigned int, unsigned char *, unsigned int); | ||
| 37 | int dat2strip(unsigned char *, unsigned int, unsigned char *, unsigned int); | ||
| 38 | |||
