Ignore:
Timestamp:
01/08/07 13:33:55 (8 years ago)
Author:
xi
Message:

Eliminate some warnings and add more doxygen definitions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libyaml/trunk/include/yaml.h

    r238 r243  
    9696/** The stream encoding. */ 
    9797typedef enum yaml_encoding_e { 
     98    /** Let the parser choose the encoding. */ 
    9899    YAML_ANY_ENCODING, 
     100    /** The default UTF-8 encoding. */ 
    99101    YAML_UTF8_ENCODING, 
     102    /** The UTF-16-LE encoding with BOM. */ 
    100103    YAML_UTF16LE_ENCODING, 
     104    /** The UTF-16-BE encoding with BOM. */ 
    101105    YAML_UTF16BE_ENCODING 
    102106} yaml_encoding_t; 
     
    105109 
    106110typedef enum yaml_break_e { 
     111    /** Let the parser choose the break type. */ 
    107112    YAML_ANY_BREAK, 
     113    /** Use CR for line breaks (Mac style). */ 
    108114    YAML_CR_BREAK, 
     115    /** Use LN for line breaks (Unix style). */ 
    109116    YAML_LN_BREAK, 
     117    /** Use CR LN for line breaks (DOS style). */ 
    110118    YAML_CRLN_BREAK 
    111119} yaml_break_t; 
     
    113121/** Many bad things could happen with the parser and emitter. */ 
    114122typedef enum yaml_error_type_e { 
     123    /** No error is produced. */ 
    115124    YAML_NO_ERROR, 
    116125 
     126    /** Cannot allocate or reallocate a block of memory. */ 
    117127    YAML_MEMORY_ERROR, 
    118128 
     129    /** Cannot read or decode the input stream. */ 
    119130    YAML_READER_ERROR, 
     131    /** Cannot scan the input stream. */ 
    120132    YAML_SCANNER_ERROR, 
     133    /** Cannot parse the input stream. */ 
    121134    YAML_PARSER_ERROR, 
     135    /** Cannot compose a YAML document. */ 
    122136    YAML_COMPOSER_ERROR, 
    123137 
     138    /** Cannot write to the output stream. */ 
    124139    YAML_WRITER_ERROR, 
     140    /** Cannot emit a YAML stream. */ 
    125141    YAML_EMITTER_ERROR 
    126142} yaml_error_type_t; 
     
    147163/** Scalar styles. */ 
    148164typedef enum yaml_scalar_style_e { 
     165    /** Let the emitter choose the style. */ 
    149166    YAML_ANY_SCALAR_STYLE, 
    150167 
     168    /** The plain scalar style. */ 
    151169    YAML_PLAIN_SCALAR_STYLE, 
    152170 
     171    /** The single-quoted scalar style. */ 
    153172    YAML_SINGLE_QUOTED_SCALAR_STYLE, 
     173    /** The double-quoted scalar style. */ 
    154174    YAML_DOUBLE_QUOTED_SCALAR_STYLE, 
    155175 
     176    /** The literal scalar style. */ 
    156177    YAML_LITERAL_SCALAR_STYLE, 
     178    /** The folded scalar style. */ 
    157179    YAML_FOLDED_SCALAR_STYLE 
    158180} yaml_scalar_style_t; 
     
    160182/** Sequence styles. */ 
    161183typedef enum yaml_sequence_style_e { 
     184    /** Let the emitter choose the style. */ 
    162185    YAML_ANY_SEQUENCE_STYLE, 
    163186 
     187    /** The block sequence style. */ 
    164188    YAML_BLOCK_SEQUENCE_STYLE, 
     189    /** The flow sequence style. */ 
    165190    YAML_FLOW_SEQUENCE_STYLE 
    166191} yaml_sequence_style_t; 
     
    168193/** Mapping styles. */ 
    169194typedef enum yaml_mapping_style_e { 
     195    /** Let the emitter choose the style. */ 
    170196    YAML_ANY_MAPPING_STYLE, 
    171197 
     198    /** The block mapping style. */ 
    172199    YAML_BLOCK_MAPPING_STYLE, 
     200    /** The flow mapping style. */ 
    173201    YAML_FLOW_MAPPING_STYLE 
    174202/*    YAML_FLOW_SET_MAPPING_STYLE   */ 
     
    184212/** Token types. */ 
    185213typedef enum yaml_token_type_e { 
     214    /** An empty token. */ 
    186215    YAML_NO_TOKEN, 
    187216 
     217    /** A STREAM-START token. */ 
    188218    YAML_STREAM_START_TOKEN, 
     219    /** A STREAM-END token. */ 
    189220    YAML_STREAM_END_TOKEN, 
    190221 
     222    /** A VERSION-DIRECTIVE token. */ 
    191223    YAML_VERSION_DIRECTIVE_TOKEN, 
     224    /** A TAG-DIRECTIVE token. */ 
    192225    YAML_TAG_DIRECTIVE_TOKEN, 
     226    /** A DOCUMENT-START token. */ 
    193227    YAML_DOCUMENT_START_TOKEN, 
     228    /** A DOCUMENT-END token. */ 
    194229    YAML_DOCUMENT_END_TOKEN, 
    195230 
     231    /** A BLOCK-SEQUENCE-START token. */ 
    196232    YAML_BLOCK_SEQUENCE_START_TOKEN, 
     233    /** A BLOCK-SEQUENCE-END token. */ 
    197234    YAML_BLOCK_MAPPING_START_TOKEN, 
     235    /** A BLOCK-END token. */ 
    198236    YAML_BLOCK_END_TOKEN, 
    199237 
     238    /** A FLOW-SEQUENCE-START token. */ 
    200239    YAML_FLOW_SEQUENCE_START_TOKEN, 
     240    /** A FLOW-SEQUENCE-END token. */ 
    201241    YAML_FLOW_SEQUENCE_END_TOKEN, 
     242    /** A FLOW-MAPPING-START token. */ 
    202243    YAML_FLOW_MAPPING_START_TOKEN, 
     244    /** A FLOW-MAPPING-END token. */ 
    203245    YAML_FLOW_MAPPING_END_TOKEN, 
    204246 
     247    /** A BLOCK-ENTRY token. */ 
    205248    YAML_BLOCK_ENTRY_TOKEN, 
     249    /** A FLOW-ENTRY token. */ 
    206250    YAML_FLOW_ENTRY_TOKEN, 
     251    /** A KEY token. */ 
    207252    YAML_KEY_TOKEN, 
     253    /** A VALUE token. */ 
    208254    YAML_VALUE_TOKEN, 
    209255 
     256    /** An ALIAS token. */ 
    210257    YAML_ALIAS_TOKEN, 
     258    /** An ANCHOR token. */ 
    211259    YAML_ANCHOR_TOKEN, 
     260    /** A TAG token. */ 
    212261    YAML_TAG_TOKEN, 
     262    /** A SCALAR token. */ 
    213263    YAML_SCALAR_TOKEN 
    214264} yaml_token_type_t; 
     
    302352/** Event types. */ 
    303353typedef enum yaml_event_type_e { 
     354    /** An empty event. */ 
    304355    YAML_NO_EVENT, 
    305356 
     357    /** A STREAM-START event. */ 
    306358    YAML_STREAM_START_EVENT, 
     359    /** A STREAM-END event. */ 
    307360    YAML_STREAM_END_EVENT, 
    308361 
     362    /** A DOCUMENT-START event. */ 
    309363    YAML_DOCUMENT_START_EVENT, 
     364    /** A DOCUMENT-END event. */ 
    310365    YAML_DOCUMENT_END_EVENT, 
    311366 
     367    /** An ALIAS event. */ 
    312368    YAML_ALIAS_EVENT, 
     369    /** A SCALAR event. */ 
    313370    YAML_SCALAR_EVENT, 
    314371 
     372    /** A SEQUENCE-START event. */ 
    315373    YAML_SEQUENCE_START_EVENT, 
     374    /** A SEQUENCE-END event. */ 
    316375    YAML_SEQUENCE_END_EVENT, 
    317376 
     377    /** A MAPPING-START event. */ 
    318378    YAML_MAPPING_START_EVENT, 
     379    /** A MAPPING-END event. */ 
    319380    YAML_MAPPING_END_EVENT 
    320381} yaml_event_type_t; 
     
    594655yaml_event_delete(yaml_event_t *event); 
    595656 
     657/** @} */ 
     658 
    596659/** 
    597660 * @defgroup nodes Nodes 
     
    599662 */ 
    600663 
     664/** The tag @c !!null with the only possible value: @c null. */ 
    601665#define YAML_NULL_TAG       "tag:yaml.org,2002:null" 
     666/** The tag @c !!bool with the values: @c true and @c falce. */ 
    602667#define YAML_BOOL_TAG       "tag:yaml.org,2002:bool" 
     668/** The tag @c !!str for string values. */ 
    603669#define YAML_STR_TAG        "tag:yaml.org,2002:str" 
     670/** The tag @c !!int for integer values. */ 
    604671#define YAML_INT_TAG        "tag:yaml.org,2002:int" 
     672/** The tag @c !!float for float values. */ 
    605673#define YAML_FLOAT_TAG      "tag:yaml.org,2002:float" 
     674/** The tag @c !!timestamp for date and time values. */ 
    606675#define YAML_TIMESTAMP_TAG  "tag:yaml.org,2002:timestamp" 
    607676 
     677/** The tag @c !!seq is used to denote sequences. */ 
    608678#define YAML_SEQ_TAG        "tag:yaml.org,2002:seq" 
     679/** The tag @c !!map is used to denote mapping. */ 
    609680#define YAML_MAP_TAG        "tag:yaml.org,2002:map" 
    610681 
     682/** The default scalar tag is @c !!str. */ 
    611683#define YAML_DEFAULT_SCALAR_TAG     YAML_STR_TAG 
     684/** The default sequence tag is @c !!seq. */ 
    612685#define YAML_DEFAULT_SEQUENCE_TAG   YAML_SEQ_TAG 
     686/** The default mapping tag is @c !!map. */ 
    613687#define YAML_DEFAULT_MAPPING_TAG    YAML_MAP_TAG 
    614688 
    615689/** Node types. */ 
    616690typedef enum yaml_node_type_e { 
     691    /** An empty node. */ 
    617692    YAML_NO_NODE, 
    618693 
     694    /** A scalar node. */ 
    619695    YAML_SCALAR_NODE, 
     696    /** A sequence node. */ 
    620697    YAML_SEQUENCE_NODE, 
     698    /** A mapping node. */ 
    621699    YAML_MAPPING_NODE 
    622700} yaml_node_type_t; 
     
    774852 * 
    775853 * @param[in]       document        A document object. 
    776  * @param[in]       node            The node id. 
     854 * @param[in]       index           The node id. 
    777855 * 
    778856 * @returns the node objct or @c NULL if @c node_id is out of range. 
     
    780858 
    781859YAML_DECLARE(yaml_node_t *) 
    782 yaml_document_get_node(yaml_document_t *document, int node_id); 
     860yaml_document_get_node(yaml_document_t *document, int index); 
    783861 
    784862/** 
     
    9311009 */ 
    9321010typedef enum yaml_parser_state_e { 
     1011    /** Expect STREAM-START. */ 
    9331012    YAML_PARSE_STREAM_START_STATE, 
     1013    /** Expect the beginning of an implicit document. */ 
    9341014    YAML_PARSE_IMPLICIT_DOCUMENT_START_STATE, 
     1015    /** Expect DOCUMENT-START. */ 
    9351016    YAML_PARSE_DOCUMENT_START_STATE, 
     1017    /** Expect the content of a document. */ 
    9361018    YAML_PARSE_DOCUMENT_CONTENT_STATE, 
     1019    /** Expect DOCUMENT-END. */ 
    9371020    YAML_PARSE_DOCUMENT_END_STATE, 
     1021    /** Expect a block node. */ 
    9381022    YAML_PARSE_BLOCK_NODE_STATE, 
     1023    /** Expect a block node or indentless sequence. */ 
    9391024    YAML_PARSE_BLOCK_NODE_OR_INDENTLESS_SEQUENCE_STATE, 
     1025    /** Expect a flow node. */ 
    9401026    YAML_PARSE_FLOW_NODE_STATE, 
     1027    /** Expect the first entry of a block sequence. */ 
    9411028    YAML_PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE, 
     1029    /** Expect an entry of a block sequence. */ 
    9421030    YAML_PARSE_BLOCK_SEQUENCE_ENTRY_STATE, 
     1031    /** Expect an entry of an indentless sequence. */ 
    9431032    YAML_PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE, 
     1033    /** Expect the first key of a block mapping. */ 
    9441034    YAML_PARSE_BLOCK_MAPPING_FIRST_KEY_STATE, 
     1035    /** Expect a block mapping key. */ 
    9451036    YAML_PARSE_BLOCK_MAPPING_KEY_STATE, 
     1037    /** Expect a block mapping value. */ 
    9461038    YAML_PARSE_BLOCK_MAPPING_VALUE_STATE, 
     1039    /** Expect the first entry of a flow sequence. */ 
    9471040    YAML_PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE, 
     1041    /** Expect an entry of a flow sequence. */ 
    9481042    YAML_PARSE_FLOW_SEQUENCE_ENTRY_STATE, 
     1043    /** Expect a key of an ordered mapping. */ 
    9491044    YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE, 
     1045    /** Expect a value of an ordered mapping. */ 
    9501046    YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE, 
     1047    /** Expect the and of an ordered mapping entry. */ 
    9511048    YAML_PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE, 
     1049    /** Expect the first key of a flow mapping. */ 
    9521050    YAML_PARSE_FLOW_MAPPING_FIRST_KEY_STATE, 
     1051    /** Expect a key of a flow mapping. */ 
    9531052    YAML_PARSE_FLOW_MAPPING_KEY_STATE, 
     1053    /** Expect a value of a flow mapping. */ 
    9541054    YAML_PARSE_FLOW_MAPPING_VALUE_STATE, 
     1055    /** Expect an empty value of a flow mapping. */ 
    9551056    YAML_PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE, 
     1057    /** Expect nothing. */ 
    9561058    YAML_PARSE_END_STATE 
    9571059} yaml_parser_state_t; 
     
    13761478/** The emitter states. */ 
    13771479typedef enum yaml_emitter_state_e { 
     1480    /** Expect STREAM-START. */ 
    13781481    YAML_EMIT_STREAM_START_STATE, 
     1482    /** Expect the first DOCUMENT-START or STREAM-END. */ 
    13791483    YAML_EMIT_FIRST_DOCUMENT_START_STATE, 
     1484    /** Expect DOCUMENT-START or STREAM-END. */ 
    13801485    YAML_EMIT_DOCUMENT_START_STATE, 
     1486    /** Expect the content of a document. */ 
    13811487    YAML_EMIT_DOCUMENT_CONTENT_STATE, 
     1488    /** Expect DOCUMENT-END. */ 
    13821489    YAML_EMIT_DOCUMENT_END_STATE, 
     1490    /** Expect the first item of a flow sequence. */ 
    13831491    YAML_EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE, 
     1492    /** Expect an item of a flow sequence. */ 
    13841493    YAML_EMIT_FLOW_SEQUENCE_ITEM_STATE, 
     1494    /** Expect the first key of a flow mapping. */ 
    13851495    YAML_EMIT_FLOW_MAPPING_FIRST_KEY_STATE, 
     1496    /** Expect a key of a flow mapping. */ 
    13861497    YAML_EMIT_FLOW_MAPPING_KEY_STATE, 
     1498    /** Expect a value for a simple key of a flow mapping. */ 
    13871499    YAML_EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE, 
     1500    /** Expect a value of a flow mapping. */ 
    13881501    YAML_EMIT_FLOW_MAPPING_VALUE_STATE, 
     1502    /** Expect the first item of a block sequence. */ 
    13891503    YAML_EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE, 
     1504    /** Expect an item of a block sequence. */ 
    13901505    YAML_EMIT_BLOCK_SEQUENCE_ITEM_STATE, 
     1506    /** Expect the first key of a block mapping. */ 
    13911507    YAML_EMIT_BLOCK_MAPPING_FIRST_KEY_STATE, 
     1508    /** Expect the key of a block mapping. */ 
    13921509    YAML_EMIT_BLOCK_MAPPING_KEY_STATE, 
     1510    /** Expect a value for a simple key of a block mapping. */ 
    13931511    YAML_EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE, 
     1512    /** Expect a value of a block mapping. */ 
    13941513    YAML_EMIT_BLOCK_MAPPING_VALUE_STATE, 
     1514    /** Expect nothing. */ 
    13951515    YAML_EMIT_END_STATE 
    13961516} yaml_emitter_state_t; 
     
    17861906yaml_emitter_emit(yaml_emitter_t *emitter, yaml_event_t *event); 
    17871907 
    1788 /* 
     1908/** 
    17891909 * Start a YAML stream. 
    17901910 * 
     
    17991919yaml_emitter_open(yaml_emitter_t *emitter); 
    18001920 
    1801 /* 
     1921/** 
    18021922 * Finish a YAML stream. 
    18031923 * 
     
    18121932yaml_emitter_close(yaml_emitter_t *emitter); 
    18131933 
    1814 /* 
     1934/** 
    18151935 * Emit a YAML document. 
    18161936 * 
Note: See TracChangeset for help on using the changeset viewer.