w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

sds.h File Reference
#include <sys/types.h>
#include <stdarg.h>
#include <stdint.h>
Include dependency graph for sds.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sdshdr5
 
struct  sdshdr8
 
struct  sdshdr16
 
struct  sdshdr32
 
struct  sdshdr64
 

Macros

#define SDS_MAX_PREALLOC   (1024 * 1024)
 
#define SDS_TYPE_5   0
 
#define SDS_TYPE_8   1
 
#define SDS_TYPE_16   2
 
#define SDS_TYPE_32   3
 
#define SDS_TYPE_64   4
 
#define SDS_TYPE_MASK   7
 
#define SDS_TYPE_BITS   3
 
#define SDS_HDR_VAR(T, s)   struct sdshdr##T *sh = (void *)((s) - (sizeof(struct sdshdr##T)));
 
#define SDS_HDR(T, s)   ((struct sdshdr##T *)((s) - (sizeof(struct sdshdr##T))))
 
#define SDS_TYPE_5_LEN(f)   ((f) >> SDS_TYPE_BITS)
 

Typedefs

typedef char * sds
 

Functions

static size_t sdslen (const sds s)
 
static size_t sdsavail (const sds s)
 
static void sdssetlen (sds s, size_t newlen)
 
static void sdsinclen (sds s, size_t inc)
 
static size_t sdsalloc (const sds s)
 
static void sdssetalloc (sds s, size_t newlen)
 
sds sdsnewlen (const void *init, size_t initlen)
 
sds sdsnew (const char *init)
 
sds sdsempty (void)
 
sds sdsdup (const sds s)
 
void sdsfree (sds s)
 
sds sdsgrowzero (sds s, size_t len)
 
sds sdscatlen (sds s, const void *t, size_t len)
 
sds sdscat (sds s, const char *t)
 
sds sdscatsds (sds s, const sds t)
 
sds sdscpylen (sds s, const char *t, size_t len)
 
sds sdscpy (sds s, const char *t)
 
sds sdscatvprintf (sds s, const char *fmt, va_list ap)
 
sds sdscatprintf (sds s, const char *fmt,...)
 
sds sdscatfmt (sds s, char const *fmt,...)
 
sds sdstrim (sds s, const char *cset)
 
void sdsrange (sds s, int start, int end)
 
void sdsupdatelen (sds s)
 
void sdsclear (sds s)
 
int sdscmp (const sds s1, const sds s2)
 
sdssdssplitlen (const char *s, int len, const char *sep, int seplen, int *count)
 
void sdsfreesplitres (sds *tokens, int count)
 
void sdstolower (sds s)
 
void sdstoupper (sds s)
 
sds sdsfromlonglong (long long value)
 
sds sdscatrepr (sds s, const char *p, size_t len)
 
sdssdssplitargs (const char *line, int *argc)
 
sds sdsmapchars (sds s, const char *from, const char *to, size_t setlen)
 
sds sdsjoin (char **argv, int argc, char *sep)
 
sds sdsjoinsds (sds *argv, int argc, const char *sep, size_t seplen)
 
sds sdsMakeRoomFor (sds s, size_t addlen)
 
void sdsIncrLen (sds s, int incr)
 
sds sdsRemoveFreeSpace (sds s)
 
size_t sdsAllocSize (sds s)
 
voidsdsAllocPtr (sds s)
 

Macro Definition Documentation

◆ SDS_HDR

#define SDS_HDR (   T,
  s 
)    ((struct sdshdr##T *)((s) - (sizeof(struct sdshdr##T))))

Definition at line 88 of file sds.h.

◆ SDS_HDR_VAR

#define SDS_HDR_VAR (   T,
  s 
)    struct sdshdr##T *sh = (void *)((s) - (sizeof(struct sdshdr##T)));

Definition at line 87 of file sds.h.

◆ SDS_MAX_PREALLOC

#define SDS_MAX_PREALLOC   (1024 * 1024)

Definition at line 35 of file sds.h.

◆ SDS_TYPE_16

#define SDS_TYPE_16   2

Definition at line 82 of file sds.h.

◆ SDS_TYPE_32

#define SDS_TYPE_32   3

Definition at line 83 of file sds.h.

◆ SDS_TYPE_5

#define SDS_TYPE_5   0

Definition at line 80 of file sds.h.

◆ SDS_TYPE_5_LEN

#define SDS_TYPE_5_LEN (   f)    ((f) >> SDS_TYPE_BITS)

Definition at line 89 of file sds.h.

◆ SDS_TYPE_64

#define SDS_TYPE_64   4

Definition at line 84 of file sds.h.

◆ SDS_TYPE_8

#define SDS_TYPE_8   1

Definition at line 81 of file sds.h.

◆ SDS_TYPE_BITS

#define SDS_TYPE_BITS   3

Definition at line 86 of file sds.h.

◆ SDS_TYPE_MASK

#define SDS_TYPE_MASK   7

Definition at line 85 of file sds.h.

Typedef Documentation

◆ sds

typedef char* sds

Definition at line 41 of file sds.h.

Function Documentation

◆ sdsalloc()

static size_t sdsalloc ( const sds  s)
inlinestatic

◆ sdsAllocPtr()

void* sdsAllocPtr ( sds  s)

◆ sdsAllocSize()

size_t sdsAllocSize ( sds  s)

◆ sdsavail()

static size_t sdsavail ( const sds  s)
inlinestatic

Definition at line 108 of file sds.h.

References flags, s, SDS_HDR_VAR, SDS_TYPE_16, SDS_TYPE_32, SDS_TYPE_5, SDS_TYPE_64, SDS_TYPE_8, and SDS_TYPE_MASK.

◆ sdscat()

sds sdscat ( sds  s,
const char *  t 
)

Referenced by fdFromJson(), and loggerLogSDS().

◆ sdscatfmt()

◆ sdscatlen()

sds sdscatlen ( sds  s,
const void t,
size_t  len 
)

◆ sdscatprintf()

◆ sdscatrepr()

sds sdscatrepr ( sds  s,
const char *  p,
size_t  len 
)

◆ sdscatsds()

sds sdscatsds ( sds  s,
const sds  t 
)

Referenced by fvar_registerRegion().

◆ sdscatvprintf()

sds sdscatvprintf ( sds  s,
const char *  fmt,
va_list  ap 
)

◆ sdsclear()

void sdsclear ( sds  s)

◆ sdscmp()

int sdscmp ( const sds  s1,
const sds  s2 
)

◆ sdscpy()

sds sdscpy ( sds  s,
const char *  t 
)

◆ sdscpylen()

sds sdscpylen ( sds  s,
const char *  t,
size_t  len 
)

◆ sdsdup()

◆ sdsempty()

◆ sdsfree()

◆ sdsfreesplitres()

void sdsfreesplitres ( sds tokens,
int  count 
)

◆ sdsfromlonglong()

sds sdsfromlonglong ( long long  value)

◆ sdsgrowzero()

sds sdsgrowzero ( sds  s,
size_t  len 
)

Referenced by otfcc_buildName().

◆ sdsinclen()

static void sdsinclen ( sds  s,
size_t  inc 
)
inlinestatic

◆ sdsIncrLen()

void sdsIncrLen ( sds  s,
int  incr 
)

◆ sdsjoin()

sds sdsjoin ( char **  argv,
int  argc,
char *  sep 
)

◆ sdsjoinsds()

sds sdsjoinsds ( sds argv,
int  argc,
const char *  sep,
size_t  seplen 
)

◆ sdslen()

◆ sdsMakeRoomFor()

sds sdsMakeRoomFor ( sds  s,
size_t  addlen 
)

◆ sdsmapchars()

sds sdsmapchars ( sds  s,
const char *  from,
const char *  to,
size_t  setlen 
)

◆ sdsnew()

◆ sdsnewlen()

◆ sdsrange()

void sdsrange ( sds  s,
int  start,
int  end 
)

◆ sdsRemoveFreeSpace()

sds sdsRemoveFreeSpace ( sds  s)

◆ sdssetalloc()

static void sdssetalloc ( sds  s,
size_t  newlen 
)
inlinestatic

◆ sdssetlen()

static void sdssetlen ( sds  s,
size_t  newlen 
)
inlinestatic

◆ sdssplitargs()

sds* sdssplitargs ( const char *  line,
int argc 
)

◆ sdssplitlen()

sds* sdssplitlen ( const char *  s,
int  len,
const char *  sep,
int  seplen,
int count 
)

◆ sdstolower()

void sdstolower ( sds  s)

◆ sdstoupper()

void sdstoupper ( sds  s)

◆ sdstrim()

sds sdstrim ( sds  s,
const char *  cset 
)

◆ sdsupdatelen()

void sdsupdatelen ( sds  s)