ceptr
 All Data Structures Files Functions Variables Typedefs Macros Modules Pages
util.h
Go to the documentation of this file.
1 
6 #ifndef _CEPTR_UTIL_H
7 #define _CEPTR_UTIL_H
8 
9 #include <ctype.h>
10 #include <stdio.h>
11 #include <time.h>
12 #include <stdint.h>
13 
14 // some basic c utility functions. Functions in this file have no dependencies on any other src files
15 
16 void hexDump(char *desc, void *addr, int len);
17 int strcicmp(char const *a, char const *b);
18 void writeFile(char *fn,void *data,size_t size);
19 void *readFile(char *fn,size_t *size);
20 uint64_t diff_micro(struct timespec *start, struct timespec *end);
21 void sleepms(long milliseconds);
22 #define sleepns(ns) nanosleep((const struct timespec[]){{0, ns}}, NULL);
23 void bin_to_strhex(unsigned char *bin, unsigned int binsz, char **result);
24 
25 #endif