37#ifndef SCPI_UTILS_PRIVATE_H
38#define SCPI_UTILS_PRIVATE_H
48#if defined(__GNUC__) && (__GNUC__ >= 4)
49#define LOCAL __attribute__((visibility ("hidden")))
54 char *
strnpbrk(
const char *str,
size_t size,
const char *set)
LOCAL;
69 scpi_bool_t matchCommand(
const char * pattern,
const char * cmd,
size_t len, int32_t *numbers,
size_t numbers_len, int32_t default_value,
bool *query)
LOCAL;
72#define SCPI_DTOSTRE_UPPERCASE 1
73#define SCPI_DTOSTRE_ALWAYS_SIGN 2
74#define SCPI_DTOSTRE_PLUS_SIGN 4
75 char *
SCPI_dtostre(
double __val,
char * __s,
size_t __ssize,
unsigned char __prec,
unsigned char __flags);
86#if !HAVE_STRNCASECMP && !HAVE_STRNICMP
90#if USE_DEVICE_DEPENDENT_ERROR_INFORMATION && !USE_MEMORY_ALLOCATION_FREE
91 void scpiheap_init(scpi_error_info_heap_t * heap,
char * error_info_heap,
size_t error_info_heap_length);
92 char * scpiheap_strndup(scpi_error_info_heap_t * heap,
const char *s,
size_t n)
LOCAL;
93 void scpiheap_free(scpi_error_info_heap_t * heap,
char *s,
scpi_bool_t rollback)
LOCAL;
94 scpi_bool_t scpiheap_get_parts(scpi_error_info_heap_t * heap,
const char *s1,
size_t * len1,
const char ** s2,
size_t * len2)
LOCAL;
102#define min(a, b) (((a) < (b)) ? (a) : (b))
106#define max(a, b) (((a) > (b)) ? (a) : (b))
111 ({ __typeof__ (a) _a = (a); \
112 __typeof__ (b) _b = (b); \
113 _a > _b ? _a : _b; })
116 ({ __typeof__ (a) _a = (a); \
117 __typeof__ (b) _b = (b); \
118 _a < _b ? _a : _b; })
enum _scpi_array_format_t scpi_array_format_t
uint64_t SCPI_Swap64(uint64_t val)
char * SCPI_dtostre(double __val, char *__s, size_t __ssize, unsigned char __prec, unsigned char __flags)
char * strnpbrk(const char *str, size_t size, const char *set)
size_t skipWhitespace(const char *cmd, size_t len)
scpi_bool_t compareStrAndNum(const char *str1, size_t len1, const char *str2, size_t len2, int32_t *num)
scpi_bool_t matchPattern(const char *pattern, size_t pattern_len, const char *str, size_t str_len, int32_t *num)
size_t UInt64ToStrBaseSign(uint64_t val, char *str, size_t len, int8_t base, scpi_bool_t sign)
uint32_t SCPI_Swap32(uint32_t val)
scpi_bool_t locateText(const char *str1, size_t len1, const char **str2, size_t *len2)
size_t strToDouble(const char *str, double *val)
size_t strBaseToUInt64(const char *str, uint64_t *val, int8_t base)
scpi_bool_t matchCommand(const char *pattern, const char *cmd, size_t len, int32_t *numbers, size_t numbers_len, int32_t default_value, bool *query)
size_t strBaseToUInt32(const char *str, uint32_t *val, int8_t base)
scpi_bool_t composeCompoundCommand(const scpi_token_t *prev, scpi_token_t *current)
scpi_array_format_t SCPI_GetNativeFormat(void)
size_t strBaseToInt64(const char *str, int64_t *val, int8_t base)
scpi_bool_t locateStr(const char *str1, size_t len1, const char **str2, size_t *len2)
scpi_bool_t compareStr(const char *str1, size_t len1, const char *str2, size_t len2)
size_t strBaseToInt32(const char *str, int32_t *val, int8_t base)
size_t BSD_strnlen(const char *s, size_t maxlen)
int OUR_strncasecmp(const char *s1, const char *s2, size_t n)
char * OUR_strndup(const char *s, size_t n)
size_t strToFloat(const char *str, float *val)
uint16_t SCPI_Swap16(uint16_t val)
size_t UInt32ToStrBaseSign(uint32_t val, char *str, size_t len, int8_t base, scpi_bool_t sign)