WIZlib Library API  ver 1.0
WIZlib Library API User Menual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
util.h
Go to the documentation of this file.
1 
12 #ifndef _UTIL_H
13 #define _UTIL_H
14 
15 //#include "common/common.h"
16 
39 #define MEM_FREE(mem_p) do{ if(mem_p) { free(mem_p); mem_p = NULL; } }while(0)
40 #define BITSET(var_v, bit_v) (var_v |= bit_v)
41 #define BITCLR(var_v, bit_v) (var_v &= ~(bit_v))
42 
43 typedef void (*void_func)(void);
44 typedef void (*alarm_cbfunc)(int8 arg);
45 typedef union long2char_t {
46  uint32 byte4;
47  uint8 byte1[4];
48 } long2char;
49 
50 typedef union short2char_t {
51  uint16 s;
52  uint8 c[2];
53 } short2char;
54 
55 
56 int8 alarm_set(uint32 time, alarm_cbfunc cb, int8 arg);
57 int8 alarm_del(alarm_cbfunc cb, int8 arg);
58 int8 alarm_chk(alarm_cbfunc cb, int8 arg);
59 void alarm_run(void);
60 int8 digit_length(int32 dgt, int8 base);
61 int32 str_check(int (*method)(int), int8 *str);
62 int8* strsep(register int8 **stringp, register const int8 *delim);
63 void print_dump(void *buf, uint16 len);
64 uint16 checksum(uint8 * src, uint32 len);
65 int32 base64_decode(int8 *text, uint8 *dst, int32 numBytes );
66 int32 base64_encode(int8 *text, int32 numBytes, int8 *encodedText);
67 
68 #endif //_UTIL_H
69 
70 
71