38#ifndef SCPI_UTILS_PRIVATE_H 
   39#define SCPI_UTILS_PRIVATE_H 
   43#include "../../../libraries/scpi-parser/inc/scpi/types.h" 
   49#if defined(__GNUC__) && (__GNUC__ >= 4) 
   50#define LOCAL __attribute__((visibility ("hidden"))) 
   55    char * strnpbrk(
const char *str, 
size_t size, 
const char *set) LOCAL;
 
   56    scpi_bool_t compareStr(
const char * str1, 
size_t len1, 
const char * str2, 
size_t len2) LOCAL;
 
   57    scpi_bool_t compareStrAndNum(
const char * str1, 
size_t len1, 
const char * str2, 
size_t len2, int32_t * num) LOCAL;
 
   58    size_t UInt32ToStrBaseSign(uint32_t val, 
char * str, 
size_t len, int8_t base, scpi_bool_t sign) LOCAL;
 
   59    size_t UInt64ToStrBaseSign(uint64_t val, 
char * str, 
size_t len, int8_t base, scpi_bool_t sign) LOCAL;
 
   60    size_t strBaseToInt32(
const char * str, int32_t * val, int8_t base) LOCAL;
 
   61    size_t strBaseToUInt32(
const char * str, uint32_t * val, int8_t base) LOCAL;
 
   62    size_t strBaseToInt64(
const char * str, int64_t * val, int8_t base) LOCAL;
 
   63    size_t strBaseToUInt64(
const char * str, uint64_t * val, int8_t base) LOCAL;
 
   64    size_t strToFloat(
const char * str, 
float * val) LOCAL;
 
   65    size_t strToDouble(
const char * str, 
double * val) LOCAL;
 
   66    scpi_bool_t locateText(
const char * str1, 
size_t len1, 
const char ** str2, 
size_t * len2) LOCAL;
 
   67    scpi_bool_t locateStr(
const char * str1, 
size_t len1, 
const char ** str2, 
size_t * len2) LOCAL;
 
   68    size_t skipWhitespace(
const char * cmd, 
size_t len) LOCAL;
 
   69    scpi_bool_t matchPattern(
const char * pattern, 
size_t pattern_len, 
const char * str, 
size_t str_len, int32_t * num) LOCAL;
 
   70    scpi_bool_t matchCommand(
const char * pattern, 
const char * cmd, 
size_t len, int32_t *numbers, 
size_t numbers_len, int32_t default_value) LOCAL;
 
   71    scpi_bool_t composeCompoundCommand(
const scpi_token_t * prev, scpi_token_t * current) LOCAL;
 
   73#define SCPI_DTOSTRE_UPPERCASE   1 
   74#define SCPI_DTOSTRE_ALWAYS_SIGN 2 
   75#define SCPI_DTOSTRE_PLUS_SIGN   4 
   76    char * SCPI_dtostre(
double __val, 
char * __s, 
size_t __ssize, 
unsigned char __prec, 
unsigned char __flags);
 
   78    scpi_array_format_t SCPI_GetNativeFormat(
void);
 
   79    uint16_t SCPI_Swap16(uint16_t val);
 
   80    uint32_t SCPI_Swap32(uint32_t val);
 
   81    uint64_t SCPI_Swap64(uint64_t val);
 
   84    size_t BSD_strnlen(
const char *s, 
size_t maxlen) LOCAL;
 
   87#if !HAVE_STRNCASECMP && !HAVE_STRNICMP 
   88    int OUR_strncasecmp(
const char *s1, 
const char *s2, 
size_t n) LOCAL;
 
   91#if USE_DEVICE_DEPENDENT_ERROR_INFORMATION && !USE_MEMORY_ALLOCATION_FREE 
   92    void scpiheap_init(scpi_error_info_heap_t * heap, 
char * error_info_heap, 
size_t error_info_heap_length);
 
   93    char * scpiheap_strndup(scpi_error_info_heap_t * heap, 
const char *s, 
size_t n) LOCAL;
 
   94    void scpiheap_free(scpi_error_info_heap_t * heap, 
char *s, scpi_bool_t rollback) LOCAL;
 
   95    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;
 
   99    char *OUR_strndup(
const char *s, 
size_t n);
 
  103#define min(a, b)  (((a) < (b)) ? (a) : (b)) 
  107#define max(a, b)  (((a) > (b)) ? (a) : (b)) 
  112   ({ __typeof__ (a) _a = (a); \ 
  113       __typeof__ (b) _b = (b); \ 
  114     _a > _b ? _a : _b; }) 
  117   ({ __typeof__ (a) _a = (a); \ 
  118       __typeof__ (b) _b = (b); \ 
  119     _a < _b ? _a : _b; })