enunciate

articulate your web api.

C Module

The C module generates C data structures and (de)serialization functions that can be used in conjunction with libxml2 to (de)serialize the REST resources as they are represented as XML data.

The order of the C deployment module is 0, as it doesn't depend on any artifacts exported by any other module.

Configuration

The C module is configured with the "c" element under the "modules" element of the enunciate configuration file. It supports the following attributes:

  • The "label" attribute is the label for the C API. This is the name by which the file will be identified (producing [label].c). By default the label is the same as the Enunciate project label.
  • The "forceEnable" attribute is used to force-enable the C module. By default, the C module is enabled only if REST endpoints are found in the project.
  • The "enumConstantNamePattern" attribute defines the format string for converting an enum constant name to a unique c-style constant name. The arguments passed to the format string are: (1) the project label (2) the namespace id of the type definition (3) the name of the type definition (4) the NOT decapitalized annotation-specified client name of the type declaration (5) the decapitalized annotation-specified client name of the type declaration (6) the NOT-decapitalized simple name of the type declaration (7) the decapitalized simple name of the type declaration (8) the package name (9) the annotation-specified client name of the enum contant (10) the simple name of the enum constant. All tokens will be "scrubbed" by replacing any non-word character with the "_" character. The default value for this pattern is "%1$S_%2$S_%3$S_%9$S".
  • The "typeDefinitionNamePattern" attribute defines the format string for converting an type definition name to a unique c-style name. The arguments passed to the format string are: (1) the project label (2) the namespace id of the type definition (3) the name of the type definition (4) the NOT decapitalized annotation-specified client name of the type declaration (5) the decapitalized annotation-specified client name of the type declaration (6) the NOT-decapitalized simple name of the type declaration (7) the decapitalized simple name of the type declaration (8) the package name. All tokens will be "scrubbed" by replacing any non-word character with the "_" character. The default value for this pattern is "%1$s_%2$s_%3$s".
  • The 'separateCommonCode' attribute tells Enunciate to keep the code that is common to all Enunciate-generated projects separate from the code that is generated specifically for this project. Default: true.
Flattr this