librfn
An ad-hoc utility library
Data Fields
rf_enumtable_t Struct Reference

Lookup table used for the conversions. More...

#include <enum.h>

Data Fields

const char * s
 
int e
 

Detailed Description

Lookup table used for the conversions.

This is normally initialized using a user supplied macro that takes advantage of both the token concatenation operator (##) and the stringize opeator (#). For example the following will produce a table to link the enumerated value NAMESPACE_PREFIX_ALPHA to the string "ALPHA" (and so on).

#define E(x) { NAMESPACE_PREFIX_ ## x, #x }
rf_enumtable_t namespace_prefix_lookup[] = RF_ENUMTABLE_INITIALIZER(
E(ALPHA),
E(BRAVO),
E(CHARLIE)
);
#undef E

Definition at line 43 of file enum.h.

Field Documentation

int e

Definition at line 45 of file enum.h.

const char* s

Definition at line 44 of file enum.h.


The documentation for this struct was generated from the following file: