18
* Check if provided string is a decimal integer
19
* @param[in] str - string to check
20
* @return - 1 if string is a number and 0 - otherwise
17
22
int pcilib_isnumber(const char *str);
25
* Check if provided string is a hexdecimal integer, optionally prefexed with 0x
26
* @param[in] str - string to check
27
* @return - 1 if string is a number and 0 - otherwise
18
29
int pcilib_isxnumber(const char *str);
32
* Check if first \p len bytes of the provided string is a decimal integer
33
* @param[in] str - string to check
34
* @param[in] len - size of the string
35
* @return - 1 if string is a number and 0 - otherwise
19
37
int pcilib_isnumber_n(const char *str, size_t len);
40
* Check if first \p len bytes of the provided string is a hexdecimal integer, optionally prefexed with 0x
41
* @param[in] str - string to check
42
* @param[in] len - size of the string
43
* @return - 1 if string is a number and 0 - otherwise
20
45
int pcilib_isxnumber_n(const char *str, size_t len);
48
* Change the endianess of the provided number (between big- and little-endian format)
49
* @param[in] x - number in little/big endian format
50
* @return - number in big/little endian format
22
52
uint16_t pcilib_swap16(uint16_t x);
55
* Change the endianess of the provided number (between big- and little-endian format)
56
* @param[in] x - number in little/big endian format
57
* @return - number in big/little endian format
23
59
uint32_t pcilib_swap32(uint32_t x);
62
* Change the endianess of the provided number (between big- and little-endian format)
63
* @param[in] x - number in little/big endian format
64
* @return - number in big/little endian format
24
66
uint64_t pcilib_swap64(uint64_t x);
25
void pcilib_swap(void *dst, void *src, size_t size, size_t n);
69
* Change the endianess of the provided array
70
* @param[out] dst - the destination memory region, can be equal to \p src
71
* @param[in] src - the source memory region
72
* @param[in] access - the size of word in bytes (1, 2, 4, or 8)
73
* @param[in] n - the number of words to copy (\p n * \p access bytes are copied).
75
void pcilib_swap(void *dst, void *src, size_t access, size_t n);