Changeset 264 for libyaml/trunk/include/yaml.h
- Timestamp:
- 12/27/07 12:14:01 (4 years ago)
- Files:
-
- 1 modified
-
libyaml/trunk/include/yaml.h (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libyaml/trunk/include/yaml.h
r261 r264 46 46 */ 47 47 48 /** 49 * Get the library version as a string. 50 * 51 * @returns The function returns the pointer to a static string of the form 52 * @c "X.Y.Z", where @c X is the major version number, @c Y is a minor version 53 * number, and @c Z is the patch version number. 54 */ 55 56 YAML_DECLARE(const char *) 57 yaml_get_version_string(void); 58 59 /** 60 * Get the library version numbers. 48 /** The major version number. */ 49 #define YAML_VERSION_MAJOR 0 50 51 /** The minor version number. */ 52 #define YAML_VERSION_MINOR 2 53 54 /** The patch version number. */ 55 #define YAML_VERSION_PATCH 0 56 57 /** The version string generator macro. */ 58 #define YAML_VERSION_STRING_GENERATOR(major,minor,patch) \ 59 (#major "." #minor "." #patch) 60 61 /** The version string. */ 62 #define YAML_VERSION_STRING \ 63 YAML_VERSION_STRING_GENERATOR(YAML_VERSION_MAJOR,YAML_VERSION_MINOR,YAML_VERSION_PATCH) 64 65 /** 66 * Get the library version numbers at runtime. 61 67 * 62 68 * @param[out] major Major version number. … … 67 73 YAML_DECLARE(void) 68 74 yaml_get_version(int *major, int *minor, int *patch); 75 76 /** 77 * Get the library version as a string at runtime. 78 * 79 * @returns The function returns the pointer to a static string of the form 80 * @c "X.Y.Z", where @c X is the major version number, @c Y is the minor version 81 * number, and @c Z is the patch version number. 82 */ 83 84 YAML_DECLARE(const char *) 85 yaml_get_version_string(void); 69 86 70 87 /** @} */ … … 87 104 /** Cannot decode the input stream. */ 88 105 YAML_DECODER_ERROR, 89 90 106 /** Cannot scan a YAML token. */ 91 107 YAML_SCANNER_ERROR, … … 97 113 /** Cannot write into the output stream. */ 98 114 YAML_WRITER_ERROR, 99 100 115 /** Cannot emit a YAML event. */ 101 116 YAML_EMITTER_ERROR, 102 117 /** Cannot serialize a YAML document. */ 103 YAML_SERIALIZER_ERROR 118 YAML_SERIALIZER_ERROR, 119 120 /** Cannot resolve an implicit tag. */ 121 YAML_RESOLVER_ERROR 104 122 } yaml_error_type_t; 105 123 … … 143 161 */ 144 162 struct { 145 /** The problem description. */146 const char *problem;147 /** The problem mark. */148 yaml_mark_t problem_mark;149 163 /** The context in which the problem occured 150 164 * (@c NULL if not applicable). … … 153 167 /** The context mark (if @c problem_mark is not @c NULL). **/ 154 168 yaml_mark_t context_mark; 169 /** The problem description. */ 170 const char *problem; 171 /** The problem mark. */ 172 yaml_mark_t problem_mark; 155 173 } loading; 156 174 … … 171 189 } dumping; 172 190 191 /** A problem while resolving an implicit tag (@c YAML_RESOLVER_ERROR). */ 192 struct { 193 /** The problem description. */ 194 const char *problem; 195 } resolving; 196 173 197 } data; 174 198 175 199 } yaml_error_t; 176 200 201 /** 202 * Create an error message. 203 * 204 * @param[in] error An error object. 205 * @param[out] buffer model A token to copy. 206 * 207 * @returns @c 1 if the function succeeded, @c 0 on error. The function may 208 * fail if the buffer is not large enough to contain the whole message. 209 */ 210 211 YAML_DECLARE(int) 212 yaml_error_message(yaml_error_t *error, char *buffer, size_t capacity); 177 213 178 214 /** @} */ … … 434 470 435 471 YAML_DECLARE(int) 436 yaml_token_duplicate(yaml_token_t *token, yaml_token_t *model);472 yaml_token_duplicate(yaml_token_t *token, const yaml_token_t *model); 437 473 438 474 /** … … 608 644 609 645 YAML_DECLARE(int) 610 yaml_event_duplicate(yaml_event_t *event, yaml_event_t *model);646 yaml_event_duplicate(yaml_event_t *event, const yaml_event_t *model); 611 647 612 648 /** … … 792 828 793 829 /** The tag @c !!null with the only possible value: @c null. */ 794 #define YAML_NULL_TAG "tag:yaml.org,2002:null"830 #define YAML_NULL_TAG ((const yaml_char_t *) "tag:yaml.org,2002:null") 795 831 /** The tag @c !!bool with the values: @c true and @c falce. */ 796 #define YAML_BOOL_TAG "tag:yaml.org,2002:bool"832 #define YAML_BOOL_TAG ((const yaml_char_t *) "tag:yaml.org,2002:bool") 797 833 /** The tag @c !!str for string values. */ 798 #define YAML_STR_TAG "tag:yaml.org,2002:str"834 #define YAML_STR_TAG ((const yaml_char_t *) "tag:yaml.org,2002:str") 799 835 /** The tag @c !!int for integer values. */ 800 #define YAML_INT_TAG "tag:yaml.org,2002:int"836 #define YAML_INT_TAG ((const yaml_char_t *) "tag:yaml.org,2002:int") 801 837 /** The tag @c !!float for float values. */ 802 #define YAML_FLOAT_TAG "tag:yaml.org,2002:float"838 #define YAML_FLOAT_TAG ((const yaml_char_t *) "tag:yaml.org,2002:float") 803 839 804 840 /** The tag @c !!seq is used to denote sequences. */ 805 #define YAML_SEQ_TAG "tag:yaml.org,2002:seq"841 #define YAML_SEQ_TAG ((const yaml_char_t *) "tag:yaml.org,2002:seq") 806 842 /** The tag @c !!map is used to denote mapping. */ 807 #define YAML_MAP_TAG "tag:yaml.org,2002:map"843 #define YAML_MAP_TAG ((const yaml_char_t *) "tag:yaml.org,2002:map") 808 844 809 845 /** The default scalar tag is @c !!str. */ … … 1228 1264 */ 1229 1265 1230 typedef int yaml_writer_t(void *data, unsigned char *buffer, size_t length); 1266 typedef int yaml_writer_t(void *data, const unsigned char *buffer, 1267 size_t length); 1231 1268 1232 1269 /** … … 1399 1436 1400 1437 YAML_DECLARE(int) 1401 yaml_parser_ scan(yaml_parser_t *parser, yaml_token_t *token);1438 yaml_parser_parse_token(yaml_parser_t *parser, yaml_token_t *token); 1402 1439 1403 1440 /** … … 1423 1460 1424 1461 YAML_DECLARE(int) 1425 yaml_parser_parse (yaml_parser_t *parser, yaml_event_t *event);1462 yaml_parser_parse_event(yaml_parser_t *parser, yaml_event_t *event); 1426 1463 1427 1464 #if 0 … … 1450 1487 1451 1488 YAML_DECLARE(int) 1452 yaml_parser_ load(yaml_parser_t *parser, yaml_document_t *document);1489 yaml_parser_parse_document(yaml_parser_t *parser, yaml_document_t *document); 1453 1490 1454 1491 #endif … … 1648 1685 1649 1686 YAML_DECLARE(int) 1650 yaml_emitter_emit (yaml_emitter_t *emitter, yaml_event_t *event);1687 yaml_emitter_emit_event(yaml_emitter_t *emitter, yaml_event_t *event); 1651 1688 1652 1689 #if 0 … … 1695 1732 1696 1733 YAML_DECLARE(int) 1697 yaml_emitter_ dump(yaml_emitter_t *emitter, yaml_document_t *document);1734 yaml_emitter_emit_document(yaml_emitter_t *emitter, yaml_document_t *document); 1698 1735 1699 1736 #endif
