hexo/enum.h header reference
[Hardware abstraction layer module]

The source code of this header can be browsed online.

Description  

This header provides functions which can be used to convert between an enum value and an enum entry name at run time.

C enumerations are be parsed by the scripts/enum.pl script at compile time in order to produce enum descriptors usable at run time. A descriptor is more compact than an array of strings.

The script is invoked automatically by the MutekH build system. It contains syntax and usage details.

Any source file which contains enums which needs to be processed in this way must be specified in the enum_headers variable of a Makefile. All enums with a ENUM_DESCRIPTOR declaration will then produce a string descriptor macro available when this header is included.

Members  

Functions  

  • const char * enums_get_name(const char desc[], intptr_t value)
  • bool_t enums_get_value(const char desc[], const char *name, intptr_t *value)
  • bool_t enums_get_value2(const char desc[], const char *name, size_t name_len, intptr_t *value)

Macro  

Members detail  

#define ENUM_DESCRIPTOR  

This macro is declared in hexo/enum.h source file, line 68.

Documentation from alternate declaration:

This mark an enum for processing by the scripts/enum.pl script. It also produce an extern declaration of the enum descriptor.

#define ENUM_DESCRIPTOR(name, ...)  

This macro is declared in hexo/enum.h source file, line 72.

This mark an enum for processing by the scripts/enum.pl script. It also produce an extern declaration of the enum descriptor.

#define __HEXO_ENUMS_H__  

This macro is declared in hexo/enum.h source file, line 49.

const char * enums_get_name(const char desc[], intptr_t value)  

This function returns the name associated to an enum value according to the passed descriptor string.

bool_t enums_get_value(const char desc[], const char *name, intptr_t *value)  

This function is declared in hexo/enum.h source file, line 65.

This function is a wrapper of the enums_get_value2 function for NUL terminated strings.

bool_t enums_get_value2(const char desc[], const char *name, size_t name_len, intptr_t *value)  

This function gets the value of an enum entry from the name. This function returns false if no entry is found.

Valid XHTML 1.0 StrictGenerated by diaxen on Wed Oct 17 21:18:38 2018 using MkDoc