2022-05-17 14:44:08 +00:00
|
|
|
#ifndef SHADE_UTIL_H
|
|
|
|
#define SHADE_UTIL_H
|
2022-05-09 13:45:06 +00:00
|
|
|
|
2022-05-15 19:16:01 +00:00
|
|
|
#define IS_DIGIT(x) (x == '0' || x == '1' || x == '2' || x == '3' || x == '4' || x == '5' || x == '6' || x == '7' || x == '8' || x == '9')
|
|
|
|
#define IS_HEX(x) (IS_DIGIT(x) || x == 'a' || x == 'b' || x == 'c' || x == 'd' || x == 'e' || x == 'f')
|
|
|
|
|
2022-05-17 14:44:08 +00:00
|
|
|
/**
|
|
|
|
* @brief Copy nbytes bytes from source to dest
|
|
|
|
*
|
|
|
|
* @param source
|
|
|
|
* @param dest
|
|
|
|
* @param nbytes
|
|
|
|
*/
|
2022-05-09 13:45:06 +00:00
|
|
|
void memcpy(char *source, char *dest, int nbytes);
|
2022-05-17 14:44:08 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Set len bytes from dest to val
|
|
|
|
*
|
|
|
|
* @param dest
|
|
|
|
* @param val
|
|
|
|
* @param len
|
|
|
|
*/
|
2022-05-09 13:45:06 +00:00
|
|
|
void memset(char *dest, char val, int len);
|
|
|
|
|
|
|
|
#endif
|