ELinks 0.18.0
corestrings.c File Reference

Useful interned string tables implementation. More...

#include "elinks.h"
#include <libcss/libcss.h>
#include <dom/dom.h>
#include "document/libdom/corestrings.h"
#include "document/libdom/corestringlist.h"
Include dependency graph for corestrings.c:

Macros

#define CORESTRING_LWC_VALUE(NAME, VALUE)   lwc_string *corestring_lwc_##NAME
 
#define CORESTRING_DOM_VALUE(NAME, VALUE)   dom_string *corestring_dom_##NAME
 
#define CORESTRING_LWC_VALUE(NAME, VALUE)
 
#define CORESTRING_DOM_VALUE(NAME, VALUE)
 
#define CORESTRING_LWC_VALUE(NAME, VALUE)
 
#define CORESTRING_DOM_VALUE(NAME, VALUE)
 

Functions

int corestrings_fini (void)
 
int corestrings_init (void)
 

Detailed Description

Useful interned string tables implementation.

Macro Definition Documentation

◆ CORESTRING_DOM_VALUE [1/3]

#define CORESTRING_DOM_VALUE ( NAME,
VALUE )   dom_string *corestring_dom_##NAME

◆ CORESTRING_DOM_VALUE [2/3]

#define CORESTRING_DOM_VALUE ( NAME,
VALUE )
Value:
do { \
if (corestring_dom_##NAME != NULL) { \
dom_string_unref(corestring_dom_##NAME); \
corestring_dom_##NAME = NULL; \
} \
} while (0)
#define NULL
Definition explodename.c:35

◆ CORESTRING_DOM_VALUE [3/3]

#define CORESTRING_DOM_VALUE ( NAME,
VALUE )
Value:
do { \
exc = dom_string_create_interned( \
(const uint8_t *)VALUE, \
sizeof(VALUE) - 1, \
&corestring_dom_##NAME ); \
if ((exc != DOM_NO_ERR) || \
(corestring_dom_##NAME == NULL)) { \
error = CSS_NOMEM; \
goto error; \
} \
} while(0)

◆ CORESTRING_LWC_VALUE [1/3]

#define CORESTRING_LWC_VALUE ( NAME,
VALUE )   lwc_string *corestring_lwc_##NAME

◆ CORESTRING_LWC_VALUE [2/3]

#define CORESTRING_LWC_VALUE ( NAME,
VALUE )
Value:
do { \
if (corestring_lwc_##NAME != NULL) { \
lwc_string_unref(corestring_lwc_##NAME); \
corestring_lwc_##NAME = NULL; \
} \
} while (0)

◆ CORESTRING_LWC_VALUE [3/3]

#define CORESTRING_LWC_VALUE ( NAME,
VALUE )
Value:
do { \
lerror = lwc_intern_string( \
(const char *)VALUE, \
sizeof(VALUE) - 1, \
&corestring_lwc_##NAME ); \
if ((lerror != lwc_error_ok) || \
(corestring_lwc_##NAME == NULL)) { \
error = CSS_NOMEM; \
goto error; \
} \
} while(0)

Function Documentation

◆ corestrings_fini()

int corestrings_fini ( void )

◆ corestrings_init()

int corestrings_init ( void )