166#if defined(USEFULBUF_CONFIG_BIG_ENDIAN) && defined(USEFULBUF_CONFIG_LITTLE_ENDIAN) 
  167#error "Cannot define both USEFULBUF_CONFIG_BIG_ENDIAN and USEFULBUF_CONFIG_LITTLE_ENDIAN" 
  176#ifdef USEFULBUF_CONFIG_HTON 
  177#include <arpa/inet.h>  
  319#define NULLUsefulBufC {NULL, 0} 
  321#define NULLUsefulBufC ((UsefulBufC) {NULL, 0}) 
  329#define NULLUsefulBuf  {NULL, 0} 
  331#define NULLUsefulBuf  ((UsefulBuf) {NULL, 0}) 
  445#define UsefulBuf_FROM_SZ_LITERAL(szString)  {(szString), sizeof(szString)-1} 
  447#define UsefulBuf_FROM_SZ_LITERAL(szString) \ 
  448    ((UsefulBufC) {(szString), sizeof(szString)-1}) 
 
  459#define UsefulBuf_FROM_BYTE_ARRAY_LITERAL(pBytes)  {(pBytes), sizeof(pBytes)} 
  461#define UsefulBuf_FROM_BYTE_ARRAY_LITERAL(pBytes) \ 
  462   ((UsefulBufC) {(pBytes), sizeof(pBytes)}) 
 
  469#define  UsefulBuf_MAKE_STACK_UB(name, size) \ 
  470    uint8_t    __pBuf##name[(size)];\ 
  471    UsefulBuf  name = {__pBuf##name , sizeof( __pBuf##name )} 
 
  480#define UsefulBuf_FROM_BYTE_ARRAY(pBytes)  {(pBytes), sizeof(pBytes)} 
  482#define UsefulBuf_FROM_BYTE_ARRAY(pBytes) \ 
  483   ((UsefulBuf) {(pBytes), sizeof(pBytes)}) 
 
  511#define UsefulBufC_NTH_BYTE(UBC, n)  (((const uint8_t *)(UBC.ptr))[n]) 
  706#ifndef USEFULBUF_DISABLE_DEPRECATED 
  708#define SZLiteralToUsefulBufC(szString)  UsefulBuf_FROM_SZ_LITERAL(szString) 
  711#define  MakeUsefulBufOnStack(name, size) \ 
  712    uint8_t    __pBuf##name[(size)];\ 
  713    UsefulBuf  name = {__pBuf##name , sizeof( __pBuf##name )} 
 
  716#define ByteArrayLiteralToUsefulBufC(pBytes) \ 
  717   UsefulBuf_FROM_BYTE_ARRAY_LITERAL(pBytes) 
 
  725   UB.ptr = (
void *)(uintptr_t)UBC.ptr;
 
 
  736#ifndef USEFULBUF_DISABLE_ALL_FLOAT 
  898#define SizeCalculateUsefulBuf {NULL, SIZE_MAX} 
  900#define SizeCalculateUsefulBuf ((UsefulBuf) {NULL, SIZE_MAX}) 
  928#define  UsefulOutBuf_MakeOnStack(name, size) \ 
  929   uint8_t       __pBuf##name[(size)];\ 
  931   UsefulOutBuf_Init(&(name), (UsefulBuf){__pBuf##name, (size)}); 
 
 1042                                             const char *szString,
 
 1074                                             uint16_t uInteger16,
 
 1091                                             uint32_t uInteger32,
 
 1108                                             uint64_t uInteger64,
 
 1112#ifndef USEFULBUF_DISABLE_ALL_FLOAT 
 1183                                             const char *szString);
 
 1211                                             uint16_t uInteger16);
 
 1226                                             uint32_t uInteger32);
 
 1241                                             uint64_t uInteger64);
 
 1244#ifndef USEFULBUF_DISABLE_ALL_FLOAT 
 1456                                  const size_t  uStart,
 
 1512                         size_t uStart1, 
size_t uLen1,
 
 1513                         size_t uStart2, 
size_t uLen2);
 
 1539                       size_t        uStartOffset,
 
 1540                       size_t        uPivotOffset,
 
 1598#define UIB_MAGIC (0xB00F) 
 1789#ifndef USEFULBUF_DISABLE_ALL_FLOAT 
 1924                       const size_t    uOffset1,
 
 1926                       const size_t    uOffset2,
 
 1927                       const size_t    uLen2);
 
 1987   UB.ptr = (
void *)(uintptr_t)UBC.ptr;
 
 
 1999   UBC.len = strlen(szString);
 
 
 2012   memset(Dest.ptr, value, Dest.len);
 
 
 2033   if(uAmount > UB.len) {
 
 
 2049   if(uAmount > UB.len) {
 
 2051   } 
else if(UB.ptr == NULL) {
 
 2052      ReturnValue.ptr = NULL;
 
 2053      ReturnValue.len = UB.len - uAmount;
 
 2055      ReturnValue.ptr = (
const uint8_t *)UB.ptr + uAmount;
 
 2056      ReturnValue.len = UB.len - uAmount;
 
 
 2065   if(UB.ptr == NULL) {
 
 2075   const size_t uOffset = (size_t)((
const uint8_t *)p - (
const uint8_t *)UB.ptr);
 
 2077    if(uOffset >= UB.len) {
 
 
 2092   return (
const uint8_t *)UB.ptr + uOffset;
 
 
 2098#ifndef USEFULBUF_DISABLE_ALL_FLOAT 
 2102   memcpy(&u32, &f, 
sizeof(uint32_t));
 
 
 2109   memcpy(&u64, &d, 
sizeof(uint64_t));
 
 
 2116   memcpy(&d, &u64, 
sizeof(uint64_t));
 
 
 2123   memcpy(&f, &u32, 
sizeof(uint32_t));
 
 
 2140   return pMe->data_len;
 
 
 2146   return 0 == pMe->data_len;
 
 
 2161                                             const char *szString,
 
 2166   UBC.len = strlen(szString);
 
 
 2181                                             uint16_t uInteger16,
 
 2188#if defined(USEFULBUF_CONFIG_BIG_ENDIAN) 
 2189   pBytes = &uInteger16;
 
 2191#elif defined(USEFULBUF_CONFIG_HTON) 
 2192   uint16_t uTmp = htons(uInteger16);
 
 2195#elif defined(USEFULBUF_CONFIG_LITTLE_ENDIAN) && defined(USEFULBUF_CONFIG_BSWAP) 
 2196   uint16_t uTmp = __builtin_bswap16(uInteger16);
 
 2202   aTmp[0] = (uint8_t)((uInteger16 & 0xff00) >> 8);
 
 2203   aTmp[1] = (uint8_t)(uInteger16 & 0xff);
 
 
 2213                                             uint32_t uInteger32,
 
 2220#if defined(USEFULBUF_CONFIG_BIG_ENDIAN) 
 2221   pBytes = &uInteger32;
 
 2223#elif defined(USEFULBUF_CONFIG_HTON) 
 2224   uint32_t uTmp = htonl(uInteger32);
 
 2227#elif defined(USEFULBUF_CONFIG_LITTLE_ENDIAN) && defined(USEFULBUF_CONFIG_BSWAP) 
 2228   uint32_t uTmp = __builtin_bswap32(uInteger32);
 
 2235   aTmp[0] = (uint8_t)((uInteger32 & 0xff000000) >> 24);
 
 2236   aTmp[1] = (uint8_t)((uInteger32 & 0xff0000) >> 16);
 
 2237   aTmp[2] = (uint8_t)((uInteger32 & 0xff00) >> 8);
 
 2238   aTmp[3] = (uint8_t)(uInteger32 & 0xff);
 
 
 2247                                             uint64_t      uInteger64,
 
 2252#if defined(USEFULBUF_CONFIG_BIG_ENDIAN) 
 2258   pBytes = &uInteger64;
 
 2260#elif defined(USEFULBUF_CONFIG_HTON) 
 2268   uint64_t uTmp = htonll(uInteger64);
 
 2272#elif defined(USEFULBUF_CONFIG_LITTLE_ENDIAN) && defined(USEFULBUF_CONFIG_BSWAP) 
 2278   uint64_t uTmp = __builtin_bswap64(uInteger64);
 
 2289   aTmp[0] = (uint8_t)((uInteger64 & 0xff00000000000000) >> 56);
 
 2290   aTmp[1] = (uint8_t)((uInteger64 & 0xff000000000000) >> 48);
 
 2291   aTmp[2] = (uint8_t)((uInteger64 & 0xff0000000000) >> 40);
 
 2292   aTmp[3] = (uint8_t)((uInteger64 & 0xff00000000) >> 32);
 
 2293   aTmp[4] = (uint8_t)((uInteger64 & 0xff000000) >> 24);
 
 2294   aTmp[5] = (uint8_t)((uInteger64 & 0xff0000) >> 16);
 
 2295   aTmp[6] = (uint8_t)((uInteger64 & 0xff00) >> 8);
 
 2296   aTmp[7] = (uint8_t)(uInteger64 & 0xff);
 
 
 2306#ifndef USEFULBUF_DISABLE_ALL_FLOAT 
 2342                                             const char *szString)
 
 2346   UBC.len = strlen(szString);
 
 
 2360                                             uint16_t uInteger16)
 
 
 2366                                             uint32_t uInteger32)
 
 
 2373                                             uint64_t uInteger64)
 
 
 2379#ifndef USEFULBUF_DISABLE_ALL_FLOAT 
 2403   return pMe->UB.len - pMe->data_len;
 
 
 2415   return pMe->UB.ptr == NULL;
 
 
 2424   if(R.len > 0 && pUOutBuf->UB.ptr != NULL) {
 
 2425      R.ptr = (uint8_t *)pUOutBuf->UB.ptr + pUOutBuf->data_len;
 
 
 2464   if(uPos > pMe->UB.len) {
 
 
 2489   if(pMe->cursor > pMe->UB.len) {
 
 2494   return pMe->UB.len - pMe->cursor;
 
 
 2539   return (uint8_t)(pResult ? *(
const uint8_t *)pResult : 0);
 
 
 2551#if defined(USEFULBUF_CONFIG_BIG_ENDIAN) || defined(USEFULBUF_CONFIG_HTON) || defined(USEFULBUF_CONFIG_BSWAP) 
 2553   memcpy(&uTmp, pResult, 
sizeof(uint16_t));
 
 2555#if defined(USEFULBUF_CONFIG_BIG_ENDIAN) 
 2558#elif defined(USEFULBUF_CONFIG_HTON) 
 2562   return __builtin_bswap16(uTmp);
 
 2574   return (uint16_t)((pResult[0] << 8) + pResult[1]);
 
 
 2589#if defined(USEFULBUF_CONFIG_BIG_ENDIAN) || defined(USEFULBUF_CONFIG_HTON) || defined(USEFULBUF_CONFIG_BSWAP) 
 2591   memcpy(&uTmp, pResult, 
sizeof(uint32_t));
 
 2593#if defined(USEFULBUF_CONFIG_BIG_ENDIAN) 
 2596#elif defined(USEFULBUF_CONFIG_HTON) 
 2600   return __builtin_bswap32(uTmp);
 
 2605   return ((uint32_t)pResult[0]<<24) +
 
 2606          ((uint32_t)pResult[1]<<16) +
 
 2607          ((uint32_t)pResult[2]<<8)  +
 
 2608           (uint32_t)pResult[3];
 
 
 2621#if defined(USEFULBUF_CONFIG_BIG_ENDIAN) || defined(USEFULBUF_CONFIG_HTON) || defined(USEFULBUF_CONFIG_BSWAP) 
 2628   memcpy(&uTmp, pResult, 
sizeof(uint64_t));
 
 2630#if defined(USEFULBUF_CONFIG_BIG_ENDIAN) 
 2637#elif defined(USEFULBUF_CONFIG_HTON) 
 2646   return ntohll(uTmp);
 
 2655   return __builtin_bswap64(uTmp);
 
 2667   return   ((uint64_t)pResult[0]<<56) +
 
 2668            ((uint64_t)pResult[1]<<48) +
 
 2669            ((uint64_t)pResult[2]<<40) +
 
 2670            ((uint64_t)pResult[3]<<32) +
 
 2671            ((uint64_t)pResult[4]<<24) +
 
 2672            ((uint64_t)pResult[5]<<16) +
 
 2673            ((uint64_t)pResult[6]<<8)  +
 
 2674            (uint64_t)pResult[7];
 
 
 2679#ifndef USEFULBUF_DISABLE_ALL_FLOAT 
 2705    pMe->UB.len = uNewLen;
 
 
static UsefulBufC UsefulInputBuf_GetUsefulBuf(UsefulInputBuf *pUInBuf, size_t uNum)
Get UsefulBuf out of the input buffer.
Definition UsefulBuf.h:2516
static void UsefulOutBuf_InsertByte(UsefulOutBuf *pUOutBuf, uint8_t byte, size_t uPos)
Insert a byte into the UsefulOutBuf.
Definition UsefulBuf.h:2172
size_t UsefulBuf_FindBytes(UsefulBufC BytesToSearch, UsefulBufC BytesToFind)
Find one UsefulBufC in another.
UsefulBufC UsefulOutBuf_OutUBuf(UsefulOutBuf *pUOutBuf)
Returns the data put into a UsefulOutBuf.
static int UsefulOutBuf_WillItFit(UsefulOutBuf *pUOutBuf, size_t uLen)
Returns 1 if some number of bytes will fit in the UsefulOutBuf.
Definition UsefulBuf.h:2407
void UsefulOutBuf_InsertUsefulBuf(UsefulOutBuf *pUOutBuf, UsefulBufC NewData, size_t uPos)
Inserts bytes into the UsefulOutBuf.
static uint8_t UsefulInputBuf_GetByte(UsefulInputBuf *pUInBuf)
Get a byte out of the input buffer.
Definition UsefulBuf.h:2530
static UsefulBuf UsefulBuf_Unconst(const UsefulBufC UBC)
Convert a const UsefulBufC to a non-const UsefulBuf.
Definition UsefulBuf.h:1980
static int UsefulInputBuf_BytesAvailable(UsefulInputBuf *pUInBuf, size_t uLen)
Check if there are unconsumed bytes.
Definition UsefulBuf.h:2498
static void UsefulOutBuf_InsertString(UsefulOutBuf *pUOutBuf, const char *szString, size_t uPos)
Insert a NULL-terminated string into the UsefulOutBuf.
Definition UsefulBuf.h:2160
static void UsefulOutBuf_InsertFloat(UsefulOutBuf *pUOutBuf, float f, size_t uPos)
Insert a float into the UsefulOutBuf.
Definition UsefulBuf.h:2307
static size_t UsefulOutBuf_GetEndPosition(UsefulOutBuf *pUOutBuf)
Returns position of end of data in the UsefulOutBuf.
Definition UsefulBuf.h:2138
static void UsefulOutBuf_AppendUsefulBuf(UsefulOutBuf *pUOutBuf, UsefulBufC NewData)
Append a UsefulBuf into the UsefulOutBuf.
Definition UsefulBuf.h:2324
static void UsefulOutBuf_InsertData(UsefulOutBuf *pUOutBuf, const void *pBytes, size_t uLen, size_t uPos)
Insert a data buffer into the UsefulOutBuf.
Definition UsefulBuf.h:2150
UsefulBufC UsefulOutBuf_CopyOut(UsefulOutBuf *pUOutBuf, UsefulBuf Dest)
Copy out the data put into a UsefulOutBuf.
struct q_useful_buf UsefulBuf
static UsefulBufC UsefulBuf_FromSZ(const char *szString)
Convert a NULL-terminated string to a UsefulBufC.
Definition UsefulBuf.h:1995
int UsefulInputBuf_Compare(UsefulInputBuf *pUInBuf, const size_t uOffset1, const size_t uLen1, const size_t uOffset2, const size_t uLen2)
Compare two ranges of bytes somewhere in the input buffer.
static void UsefulInputBuf_SetBufferLength(UsefulInputBuf *pUInBuf, size_t uNewLen)
Alters the input buffer length (use with caution).
Definition UsefulBuf.h:2703
static uint32_t UsefulInputBuf_GetUint32(UsefulInputBuf *pUInBuf)
Get a uint32_t out of the input buffer.
Definition UsefulBuf.h:2580
void UsefulOutBuf_Swap(UsefulOutBuf *pUOutBuf, size_t uStartOffset, size_t uPivotOffset, size_t uEndOffset)
Swap two regions of output bytes.
static size_t UsefulInputBuf_BytesUnconsumed(UsefulInputBuf *pUInBuf)
Returns the number of bytes from the cursor to the end of the buffer, the unconsumed bytes.
Definition UsefulBuf.h:2472
static void UsefulInputBuf_Seek(UsefulInputBuf *pUInBuf, size_t uPos)
Sets the current position in input buffer.
Definition UsefulBuf.h:2462
static uint32_t UsefulBufUtil_CopyFloatToUint32(float f)
Copy a float to a uint32_t.
Definition UsefulBuf.h:2099
struct useful_input_buf UsefulInputBuf
static size_t UsefulBuf_PointerToOffset(UsefulBufC UB, const void *p)
Convert a pointer to an offset with bounds checking.
Definition UsefulBuf.h:2063
static void UsefulOutBuf_InsertUint32(UsefulOutBuf *pUOutBuf, uint32_t uInteger32, size_t uPos)
Insert a 32-bit integer into the UsefulOutBuf.
Definition UsefulBuf.h:2212
static UsefulBuf UsefulOutBuf_RetrieveOutputStorage(UsefulOutBuf *pUOutBuf)
Retrieve the storage buffer passed in to UsefulOutBuf_Init().
Definition UsefulBuf.h:2434
const void * UsefulInputBuf_GetBytes(UsefulInputBuf *pUInBuf, size_t uNum)
Get pointer to bytes out of the input buffer.
static void UsefulInputBuf_Init(UsefulInputBuf *pUInBuf, UsefulBufC UB)
Initialize the UsefulInputBuf structure before use.
Definition UsefulBuf.h:2442
static UsefulBufC UsefulBuf_CopyPtr(UsefulBuf Dest, const void *ptr, size_t uLen)
Copy a pointer into a UsefulBuf.
Definition UsefulBuf.h:2022
static void UsefulOutBuf_AppendDouble(UsefulOutBuf *pUOutBuf, double d)
Append a double to the UsefulOutBuf.
Definition UsefulBuf.h:2387
static int UsefulBuf_IsNULLC(UsefulBufC UB)
Check if a UsefulBufC is NULLUsefulBufC or not.
Definition UsefulBuf.h:1941
static uint64_t UsefulInputBuf_GetUint64(UsefulInputBuf *pUInBuf)
Get a uint64_t out of the input buffer.
Definition UsefulBuf.h:2613
static uint16_t UsefulInputBuf_GetUint16(UsefulInputBuf *pUInBuf)
Get a uint16_t out of the input buffer.
Definition UsefulBuf.h:2542
void UsefulOutBuf_Advance(UsefulOutBuf *pUOutBuf, size_t uAmount)
Advance the amount output assuming it was written by the caller.
static float UsefulBufUtil_CopyUint32ToFloat(uint32_t u32)
Copy a uint32_t to a float.
Definition UsefulBuf.h:2120
static int UsefulBuf_IsEmptyC(UsefulBufC UB)
Check if a UsefulBufC is empty or not.
Definition UsefulBuf.h:1953
static int UsefulBuf_IsNULL(UsefulBuf UB)
Check if a UsefulBuf is NULLUsefulBuf or not.
Definition UsefulBuf.h:1935
static float UsefulInputBuf_GetFloat(UsefulInputBuf *pUInBuf)
Get a float out of the input buffer.
Definition UsefulBuf.h:2680
static void UsefulOutBuf_AppendUint32(UsefulOutBuf *pUOutBuf, uint32_t uInteger32)
Append an integer to the UsefulOutBuf.
Definition UsefulBuf.h:2365
static void UsefulOutBuf_AppendData(UsefulOutBuf *pUOutBuf, const void *pBytes, size_t uLen)
Append bytes to the UsefulOutBuf.
Definition UsefulBuf.h:2332
static UsefulBufC UsefulBuf_Set(UsefulBuf pDest, uint8_t value)
Set all bytes in a UsefulBuf to a value, for example to 0.
Definition UsefulBuf.h:2010
static UsefulBufC UsefulInputBuf_RetrieveUndecodedInput(UsefulInputBuf *pUInBuf)
Retrieve the undecoded input buffer.
Definition UsefulBuf.h:2708
static uint64_t UsefulBufUtil_CopyDoubleToUint64(double d)
Copy a double to a uint64_t.
Definition UsefulBuf.h:2106
UsefulBufC UsefulOutBuf_SubString(UsefulOutBuf *pUOutBuf, const size_t uStart, const size_t uLen)
Return a substring of the output data.
static size_t UsefulInputBuf_Tell(UsefulInputBuf *pUInBuf)
Returns current position in input buffer.
Definition UsefulBuf.h:2450
static void UsefulOutBuf_AppendString(UsefulOutBuf *pUOutBuf, const char *szString)
Append a NULL-terminated string to the UsefulOutBuf.
Definition UsefulBuf.h:2341
static int UsefulInputBuf_GetError(UsefulInputBuf *pUInBuf)
Get the error status.
Definition UsefulBuf.h:2697
static UsefulBuf UsefulBufC_Unconst(const UsefulBufC UBC)
Definition UsefulBuf.h:720
static void UsefulOutBuf_InsertUint16(UsefulOutBuf *pUOutBuf, uint16_t uInteger16, size_t uPos)
Insert a 16-bit integer into the UsefulOutBuf.
Definition UsefulBuf.h:2180
UsefulBufC UsefulBuf_CopyOffset(UsefulBuf Dest, size_t uOffset, const UsefulBufC Src)
Copy one UsefulBuf into another at an offset.
struct useful_out_buf UsefulOutBuf
static void UsefulOutBuf_AppendUint16(UsefulOutBuf *pUOutBuf, uint16_t uInteger16)
Append an integer to the UsefulOutBuf.
Definition UsefulBuf.h:2359
static void UsefulOutBuf_AppendFloat(UsefulOutBuf *pUOutBuf, float f)
Append a float to the UsefulOutBuf.
Definition UsefulBuf.h:2380
static size_t UsefulInputBuf_PointerToOffset(UsefulInputBuf *pUInBuf, const void *p)
Convert a pointer to an offset with bounds checking.
Definition UsefulBuf.h:2504
static const void * UsefulInputBuf_OffsetToPointer(UsefulInputBuf *pUInBuf, size_t uOffset)
Convert an offset to a pointer with bounds checking.
Definition UsefulBuf.h:2510
static void UsefulOutBuf_InsertDouble(UsefulOutBuf *pUOutBuf, double d, size_t uPos)
Insert a double into the UsefulOutBuf.
Definition UsefulBuf.h:2315
void UsefulOutBuf_Init(UsefulOutBuf *pUOutBuf, UsefulBuf Storage)
Initialize and supply the output buffer.
static UsefulBuf UsefulOutBuf_GetOutPlace(UsefulOutBuf *pUOutBuf)
Returns pointer and length of the output buffer not yet used.
Definition UsefulBuf.h:2419
static const void * UsefulBuf_OffsetToPointer(UsefulBufC UB, size_t uOffset)
Convert an offset to a pointer with bounds checking.
Definition UsefulBuf.h:2086
static void UsefulOutBuf_AppendUint64(UsefulOutBuf *pUOutBuf, uint64_t uInteger64)
Append an integer to the UsefulOutBuf.
Definition UsefulBuf.h:2372
UsefulBufC UsefulOutBuf_OutUBufOffset(UsefulOutBuf *pUOutBuf, size_t uOffset)
Returns data starting at an offset that was put into a UsefulOutBuf.
static double UsefulBufUtil_CopyUint64ToDouble(uint64_t u64)
Copy a uint64_t to a double.
Definition UsefulBuf.h:2113
size_t UsefulBuf_IsValue(const UsefulBufC UB, uint8_t uValue)
Find first byte that is not a particular byte value.
UsefulBufC UsefulBuf_SkipLeading(UsefulBufC String, uint8_t uByte)
Skip leading bytes of a particular value in a string.
static size_t UsefulOutBuf_RoomLeft(UsefulOutBuf *pUOutBuf)
Returns number of bytes unused used in the output buffer.
Definition UsefulBuf.h:2401
int UsefulOutBuf_Compare(UsefulOutBuf *pUOutBuf, size_t uStart1, size_t uLen1, size_t uStart2, size_t uLen2)
Compare bytes at offsets.
static void UsefulOutBuf_Reset(UsefulOutBuf *pUOutBuf)
Reset a UsefulOutBuf for re use.
Definition UsefulBuf.h:2131
static int UsefulOutBuf_IsBufferNULL(UsefulOutBuf *pUOutBuf)
Returns 1 if buffer given to UsefulOutBuf_Init() was NULL.
Definition UsefulBuf.h:2413
int UsefulBuf_Compare(const UsefulBufC UB1, const UsefulBufC UB2)
Compare one UsefulBufC to another.
static void UsefulOutBuf_AppendByte(UsefulOutBuf *pUOutBuf, uint8_t byte)
Append a byte to the UsefulOutBuf.
Definition UsefulBuf.h:2352
static int UsefulBuf_IsNULLOrEmptyC(UsefulBufC UB)
Check if a UsefulBufC is NULLUsefulBufC or empty.
Definition UsefulBuf.h:1965
static UsefulBufC UsefulBuf_Copy(UsefulBuf Dest, const UsefulBufC Src)
Copy one UsefulBuf into another.
Definition UsefulBuf.h:2004
static double UsefulInputBuf_GetDouble(UsefulInputBuf *pUInBuf)
Get a double out of the input buffer.
Definition UsefulBuf.h:2688
static UsefulBufC UsefulBuf_Const(const UsefulBuf UB)
Convert a non-const UsefulBuf to a const UsefulBufC.
Definition UsefulBuf.h:1971
struct q_useful_buf_c UsefulBufC
static UsefulBufC UsefulBuf_Head(UsefulBufC UB, size_t uAmount)
Returns a truncation of a UsefulBufC.
Definition UsefulBuf.h:2031
static UsefulBufC UsefulBuf_Tail(UsefulBufC UB, size_t uAmount)
Returns bytes from the end of a UsefulBufC.
Definition UsefulBuf.h:2045
static void UsefulOutBuf_InsertUint64(UsefulOutBuf *pUOutBuf, uint64_t uInteger64, size_t uPos)
Insert a 64-bit integer into the UsefulOutBuf.
Definition UsefulBuf.h:2246
static int UsefulBuf_IsNULLOrEmpty(UsefulBuf UB)
Check if a UsefulBuf is NULLUsefulBuf or empty.
Definition UsefulBuf.h:1959
static int UsefulOutBuf_GetError(UsefulOutBuf *pUOutBuf)
Returns the current error status.
Definition UsefulBuf.h:2395
static int UsefulOutBuf_AtStart(UsefulOutBuf *pUOutBuf)
Returns whether any data has been added to the UsefulOutBuf.
Definition UsefulBuf.h:2144
#define NULLUsefulBufC
Definition UsefulBuf.h:321
#define UIB_MAGIC
Definition UsefulBuf.h:1598
static size_t UsefulInputBuf_GetBufferLength(UsefulInputBuf *pUInBuf)
Gets the input buffer length.
Definition UsefulBuf.h:2456
static int UsefulBuf_IsEmpty(UsefulBuf UB)
Check if a UsefulBuf is empty or not.
Definition UsefulBuf.h:1947
Definition UsefulBuf.h:280
Definition UsefulBuf.h:291
Definition UsefulBuf.h:875