ekg2  GIT master
Definicje | Definicje typów | Funkcje
Dokumentacja pliku xmalloc.h
#include <sys/types.h>
#include <stddef.h>
#include <stdarg.h>
#include <limits.h>
Wykres zależności załączania dla xmalloc.h:
Ten wykres pokazuje, które pliki bezpośrednio lub pośrednio załączają ten plik:

Idź do kodu źródłowego tego pliku.

Definicje

#define __(x)   (x ? x : "(null)")
 
#define UNUSED(x)   x
 
#define PATH_MAX   4096
 

Definicje typów

typedef unsigned int socklen_t
 

Funkcje

void * xcalloc (size_t nmemb, size_t size)
 
void * xmalloc (size_t size)
 
void xfree (void *ptr)
 
void * xrealloc (void *ptr, size_t size)
 
char * xstrdup (const char *s)
 
char * xstrndup (const char *s, size_t n)
 
char * utf8ndup (const char *s, size_t n)
 
int xstrcasecmp (const char *s1, const char *s2)
 
char * xstrcat (char *dest, const char *src)
 
char * xstrchr (const char *s, int c)
 
int xstrcmp (const char *s1, const char *s2)
 
int xstrcoll (const char *s1, const char *s2)
 
char * xstrcpy (char *dest, const char *src)
 
size_t xstrcspn (const char *s, const char *reject)
 
size_t xstrlen (const char *s)
 
int xstrncasecmp_pl (const char *s1, const char *s2, size_t n)
 
char * xstrncat (char *dest, const char *src, size_t n)
 
int xstrncmp (const char *s1, const char *s2, size_t n)
 
char * xstrncpy (char *dest, const char *src, size_t n)
 
int xstrncasecmp (const char *s1, const char *s2, size_t n)
 
char * xstrpbrk (const char *s, const char *accept)
 
char * xstrrchr (const char *s, int c)
 
size_t xstrspn (const char *s, const char *accept)
 
char * xstrstr (const char *haystack, const char *needle)
 
char * xstrcasestr (const char *haystack, const char *needle)
 
char * xstrtok (char *s, const char *delim)
 
char * xindex (const char *s, int c)
 
char * xrindex (const char *s, int c)
 
char * vsaprintf (const char *format, va_list ap)
 
char * saprintf (const char *format,...)
 

Dokumentacja definicji

◆ __

#define __ (   x)    (x ? x : "(null)")

◆ PATH_MAX

#define PATH_MAX   4096

◆ UNUSED

#define UNUSED (   x)    x

Dokumentacja definicji typów

◆ socklen_t

typedef unsigned int socklen_t

Dokumentacja funkcji

◆ saprintf()

char* saprintf ( const char *  format,
  ... 
)

◆ utf8ndup()

char* utf8ndup ( const char *  s,
size_t  n 
)

◆ vsaprintf()

char* vsaprintf ( const char *  format,
va_list  ap 
)

vsaprintf()

Nota
Deprecated, please use g_strdup_vprintf() instead.

◆ xcalloc()

void* xcalloc ( size_t  nmemb,
size_t  size 
)

xcalloc()

Błąd:
same as in xmalloc()
Nota
Deprecated, please use g_new(), g_new0(), g_slice_new() or g_slice_new0() instead.

◆ xfree()

void xfree ( void *  ptr)

xfree()

Free memory pointed by ptr if ptr == NULL do nothing.
Equivalent to: if (ptr) free(ptr);

Zobacz również
xrealloc() - If you want change size of allocated memory.
Nota
Deprecated, please use g_free() (or g_slice_free()) instead.

◆ xindex()

char* xindex ( const char *  s,
int  c 
)

◆ xmalloc()

void* xmalloc ( size_t  size)

xmalloc()

Allocate memory for size bytes, clears it [set it with \0], and returns pointer to allocated memory. If malloc() fails with NULL, ekg_oom_handler() kills program.
Wrapper to malloc()+memset()

Zobacz również
xcalloc()
xfree()
Parametry
size- the same as in malloc()
Zwraca
pointer to allocated memory
Nota
Deprecated, please use g_malloc(), g_malloc0(), g_new(), g_new0(), g_slice_new() or g_slice_new0() instead.

◆ xrealloc()

void* xrealloc ( void *  ptr,
size_t  size 
)

xrealloc()

Błąd:
same as in xmalloc()
Nota
Deprecated, please use g_realloc() instead.

◆ xrindex()

char* xrindex ( const char *  s,
int  c 
)

◆ xstrcasecmp()

int xstrcasecmp ( const char *  s1,
const char *  s2 
)

◆ xstrcasestr()

char* xstrcasestr ( const char *  haystack,
const char *  needle 
)

◆ xstrcat()

char* xstrcat ( char *  dest,
const char *  src 
)

◆ xstrchr()

char* xstrchr ( const char *  s,
int  c 
)

◆ xstrcmp()

int xstrcmp ( const char *  s1,
const char *  s2 
)

◆ xstrcoll()

int xstrcoll ( const char *  s1,
const char *  s2 
)

◆ xstrcpy()

char* xstrcpy ( char *  dest,
const char *  src 
)

◆ xstrcspn()

size_t xstrcspn ( const char *  s,
const char *  reject 
)

◆ xstrdup()

char* xstrdup ( const char *  s)

xstrdup()

Nota
Deprecated, please use g_strdup() instead.

◆ xstrlen()

size_t xstrlen ( const char *  s)

◆ xstrncasecmp()

int xstrncasecmp ( const char *  s1,
const char *  s2,
size_t  n 
)

◆ xstrncasecmp_pl()

int xstrncasecmp_pl ( const char *  s1,
const char *  s2,
size_t  n 
)

◆ xstrncat()

char* xstrncat ( char *  dest,
const char *  src,
size_t  n 
)

◆ xstrncmp()

int xstrncmp ( const char *  s1,
const char *  s2,
size_t  n 
)

◆ xstrncpy()

char* xstrncpy ( char *  dest,
const char *  src,
size_t  n 
)

◆ xstrndup()

char* xstrndup ( const char *  s,
size_t  n 
)

xstrndup()

Nota
Deprecated, please use g_strndup() and g_strdup() instead.

◆ xstrpbrk()

char* xstrpbrk ( const char *  s,
const char *  accept 
)

◆ xstrrchr()

char* xstrrchr ( const char *  s,
int  c 
)

◆ xstrspn()

size_t xstrspn ( const char *  s,
const char *  accept 
)

◆ xstrstr()

char* xstrstr ( const char *  haystack,
const char *  needle 
)

◆ xstrtok()

char* xstrtok ( char *  s,
const char *  delim 
)