Kannel: Open Source WAP and SMS gateway  svn-r5335
wsp_strings.h File Reference
#include "gwlib/gwlib.h"
#include "wap/wsp.h"
#include "wsp_strings.def"

Go to the source code of this file.

Macros

#define LINEAR(name, strings)
 
#define STRING(string)
 
#define LINEAR(name, strings)
 
#define STRING(string)
 
#define NAMED(name, strings)   enum name##_enum { strings name##_dummy };
 
#define NSTRING(string, name)   name,
 
#define VNSTRING(version, string, name)   name,
 

Functions

void wsp_strings_init (void)
 
void wsp_strings_shutdown (void)
 

Macro Definition Documentation

◆ LINEAR [1/2]

#define LINEAR (   name,
  strings 
)
Value:
Octstr *wsp_##name##_to_string(long number); \
unsigned char *wsp_##name##_to_cstr(long number); \
long wsp_string_to_##name(Octstr *ostr); \
long wsp_string_to_versioned_##name(Octstr *ostr, int version);
int number
Definition: smsc_cimd2.c:213
char * name
Definition: smsc_cimd2.c:212
Definition: octstr.c:118

Definition at line 107 of file wsp_strings.h.

◆ LINEAR [2/2]

#define LINEAR (   name,
  strings 
)

Definition at line 107 of file wsp_strings.h.

◆ NAMED

#define NAMED (   name,
  strings 
)    enum name##_enum { strings name##_dummy };

Definition at line 109 of file wsp_strings.h.

◆ NSTRING

#define NSTRING (   string,
  name 
)    name,

Definition at line 110 of file wsp_strings.h.

◆ STRING [1/2]

#define STRING (   string)

Definition at line 108 of file wsp_strings.h.

◆ STRING [2/2]

#define STRING (   string)

Definition at line 108 of file wsp_strings.h.

◆ VNSTRING

#define VNSTRING (   version,
  string,
  name 
)    name,

Definition at line 111 of file wsp_strings.h.

Function Documentation

◆ wsp_strings_init()

void wsp_strings_init ( void  )

Definition at line 269 of file wsp_strings.c.

References initialized.

Referenced by main(), wsp_session_init(), and wsp_unit_init().

270 {
271  if (initialized > 0) {
272  initialized++;
273  return;
274  }
275 
276 #define LINEAR(name, strings) \
277  construct_linear_table(&name##_table, \
278  name##_strings, TABLE_SIZE(name##_strings));
279 #define NUMBERED(name, strings) \
280  construct_numbered_table(&name##_table, \
281  name##_strings, TABLE_SIZE(name##_strings));
282 #include "wsp_strings.def"
283  initialized++;
284 }
static int initialized
Definition: wsp_strings.c:75

◆ wsp_strings_shutdown()

void wsp_strings_shutdown ( void  )

Definition at line 286 of file wsp_strings.c.

References initialized.

Referenced by main(), wsp_session_shutdown(), and wsp_unit_shutdown().

287 {
288  /* If we were initialized more than once, then wait for more than
289  * one shutdown. */
290  if (initialized > 1) {
291  initialized--;
292  return;
293  }
294 
295 #define LINEAR(name, strings) \
296  destroy_table(&name##_table);
297 #include "wsp_strings.def"
298 
299  initialized = 0;
300 }
static int initialized
Definition: wsp_strings.c:75
See file LICENSE for details about the license agreement for using, modifying, copying or deriving work from this software.