ekg2  GIT master
Definicje | Funkcje | Zmienne
Dokumentacja pliku xmalloc.c
#include "ekg2-config.h"
#include <sys/types.h>
#include <stddef.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <unistd.h>
#include <ctype.h>
#include "compat/strndup.h"
#include "xmalloc.h"
Wykres zależności załączania dla xmalloc.c:

Definicje

#define _GNU_SOURCE
 
#define __EXTENSIONS__
 
#define fix(s)   ((s) ? (s) : "")
 

Funkcje

static void ekg_oom_handler ()
 
void * xcalloc (size_t nmemb, size_t size)
 
void * xmalloc (size_t size)
 
 __attribute__ ((visibility("hidden")))
 
void xfree (void *ptr)
 
void * xrealloc (void *ptr, size_t size)
 
char * xstrdup (const char *s)
 
char * xstrndup (const char *s, size_t n)
 
void * xmemdup (void *ptr, size_t size)
 
char * xstrstr (const char *haystack, const char *needle)
 
char * xstrcasestr (const char *haystack, const char *needle)
 
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)
 
char * xstrcpy (char *dest, const char *src)
 
size_t xstrlen (const char *s)
 
static int tolower_pl (const unsigned char c)
 
static int strncasecmp_pl (const char *cs, const char *ct, size_t count)
 
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)
 
int xstrncasecmp (const char *s1, const char *s2, size_t n)
 
char * xstrrchr (const char *s, int c)
 

Zmienne

int old_stderr
 

Dokumentacja definicji

◆ __EXTENSIONS__

#define __EXTENSIONS__

◆ _GNU_SOURCE

#define _GNU_SOURCE

◆ fix

#define fix (   s)    ((s) ? (s) : "")

Dokumentacja funkcji

◆ __attribute__()

__attribute__ ( (visibility("hidden"))  )

◆ ekg_oom_handler()

static void ekg_oom_handler ( )
static

◆ strncasecmp_pl()

static int strncasecmp_pl ( const char *  cs,
const char *  ct,
size_t  count 
)
static

◆ tolower_pl()

static int tolower_pl ( const unsigned char  c)
static

◆ 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.

◆ 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.

◆ xmemdup()

void* xmemdup ( void *  ptr,
size_t  size 
)

◆ xrealloc()

void* xrealloc ( void *  ptr,
size_t  size 
)

xrealloc()

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

◆ 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 
)

◆ xstrcpy()

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

◆ 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 
)

◆ xstrndup()

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

xstrndup()

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

◆ xstrrchr()

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

◆ xstrstr()

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

Dokumentacja zmiennych

◆ old_stderr

int old_stderr