Changeset 178


Ignore:
Timestamp:
05/26/06 17:46:47 (8 years ago)
Author:
xi
Message:

Doxygenify the header file.

Add basic reader fields to the parser structure.

Start implementing basic parser functions.

Location:
libyaml/trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • libyaml/trunk/doc/doxygen.cfg

    r172 r178  
    1111USE_WINDOWS_ENCODING   = NO 
    1212BRIEF_MEMBER_DESC      = YES 
    13 REPEAT_BRIEF           = NO 
     13REPEAT_BRIEF           = YES 
    1414ABBREVIATE_BRIEF       =  
    1515ALWAYS_DETAILED_SEC    = NO 
     
    1919STRIP_FROM_INC_PATH    =  
    2020SHORT_NAMES            = NO 
    21 JAVADOC_AUTOBRIEF      = NO 
     21JAVADOC_AUTOBRIEF      = YES 
    2222MULTILINE_CPP_IS_BRIEF = NO 
    2323DETAILS_AT_TOP         = NO 
     
    4747SHOW_INCLUDE_FILES     = YES 
    4848INLINE_INFO            = YES 
    49 SORT_MEMBER_DOCS       = YES 
     49SORT_MEMBER_DOCS       = NO 
    5050SORT_BRIEF_DOCS        = NO 
    5151SORT_BY_SCOPE_NAME     = NO 
     
    118118TOC_EXPAND             = NO 
    119119DISABLE_INDEX          = NO 
    120 ENUM_VALUES_PER_LINE   = 4 
     120ENUM_VALUES_PER_LINE   = 1 
    121121GENERATE_TREEVIEW      = NO 
    122122TREEVIEW_WIDTH         = 250 
  • libyaml/trunk/include/Makefile.am

    r172 r178  
    1 INCLUDES = yaml/yaml.h yaml/yaml_version.h yaml/yaml_error.h 
     1INCLUDES = yaml/yaml.h #yaml/yaml_version.h yaml/yaml_error.h 
    22DOXYGEN_CFG = $(top_srcdir)/doc/doxygen.cfg 
    33 
  • libyaml/trunk/include/yaml/yaml.h

    r172 r178  
    33 * @brief Public interface for libyaml. 
    44 *  
    5  * Include the header file with 
     5 * Include the header file with the code: 
    66 * @code 
    77 * #include <yaml/yaml.h> 
     
    1818#include <stdlib.h> 
    1919 
    20 #include "yaml_version.h" 
    21 #include "yaml_error.h" 
    22  
    23 typedef enum { 
    24     YAML_DETECT_ENCODING, 
     20/** 
     21 * @defgroup version Version Information 
     22 * @{ 
     23 */ 
     24 
     25/** 
     26 * Get the library version as a string. 
     27 * 
     28 * @returns The function returns the pointer to a static string of the form 
     29 * @c "X.Y.Z", where @c X is the major version number, @c Y is a minor version 
     30 * number, and @c Z is the patch version number. 
     31 */ 
     32 
     33const char * 
     34yaml_get_version_string(void); 
     35 
     36/** 
     37 * Get the library version numbers. 
     38 * 
     39 * @param[out]  major   Major version number. 
     40 * @param[out]  minor   Minor version number. 
     41 * @param[out]  patch   Patch version number. 
     42 */ 
     43 
     44void 
     45yaml_get_version(int *major, int *minor, int *patch); 
     46 
     47/** @} */ 
     48 
     49/** 
     50 * @defgroup basic Basic Types 
     51 * @{ 
     52 */ 
     53 
     54/** The character type. */ 
     55typedef unsigned char yaml_char_t; 
     56 
     57/** The stream encoding. */ 
     58typedef enum { 
     59    YAML_ANY_ENCODING, 
    2560    YAML_UTF8_ENCODING, 
    2661    YAML_UTF16LE_ENCODING, 
    2762    YAML_UTF16BE_ENCODING 
    2863} yaml_encoding_t; 
     64 
     65/** @} */ 
     66 
     67/* 
     68 
     69typedef enum { 
     70    YAML_NO_ERROR, 
     71 
     72    YAML_MEMORY_ERROR, 
     73 
     74    YAML_READER_ERROR, 
     75    YAML_SCANNER_ERROR, 
     76    YAML_PARSER_ERROR, 
     77 
     78    YAML_WRITER_ERROR, 
     79    YAML_EMITTER_ERROR 
     80} yaml_error_type_t; 
    2981 
    3082typedef enum { 
     
    183235} yaml_event_t; 
    184236 
     237*/ 
     238 
     239 
     240/** 
     241 * @defgroup parser Parser Definitions 
     242 * @{ 
     243 */ 
     244 
     245/** 
     246 * The prototype of a read handler. 
     247 * 
     248 * The read handler is called when the parser needs to read more bytes from the 
     249 * source.  The handler should write not more than @a size bytes to the @a 
     250 * buffer.  The number of written bytes should be set to the @a length variable. 
     251 * 
     252 * @param[in]   ext     A pointer to an application data specified by 
     253 *                      @c yaml_parser_set_read_handler. 
     254 * @param[out]  buffer  The buffer to write the data from the source. 
     255 * @param[in]   size    The size of the buffer. 
     256 * @param[out]  length  The actual number of bytes read from the source. 
     257 * 
     258 * @returns On success, the handler should return @c 1.  If the handler failed, 
     259 * the returned value should be @c 0.  On EOF, the handler should set the 
     260 * @a length to @c 0 and return @c 1. 
     261 */ 
     262typedef int yaml_read_handler_t(void *ext, yaml_char_t *buffer, size_t size, 
     263        size_t *length); 
     264 
     265 
     266/** 
     267 * The parser structure. 
     268 * 
     269 * All members are internal.  Manage the structure using the @c yaml_parser_ 
     270 * family of functions. 
     271 */ 
     272 
     273typedef struct { 
     274 
     275    /** 
     276     * @name Reader stuff 
     277     * @{ 
     278     */ 
     279 
     280    /** Read handler */ 
     281    yaml_read_handler_t *reader; 
     282 
     283    /** A pointer for passing to the read handler. */ 
     284    void *reader_ext; 
     285 
     286    /** EOF flag */ 
     287    int eof; 
     288 
     289    /** The pointer to the beginning of the working buffer. */ 
     290    yaml_char_t *buffer; 
     291 
     292    /** The pointer to the current character in the working buffer. */ 
     293    yaml_char_t *pointer; 
     294 
     295    /** The remaining undecoded characters. */ 
     296    unsigned char *raw_buffer; 
     297 
     298    /** The size of the raw buffer. */ 
     299    size_t raw_buffer_size; 
     300 
     301    /** The input encoding. */ 
     302    yaml_encoding_t encoding; 
     303 
     304    /** 
     305     * @} 
     306     */ 
     307 
     308} yaml_parser_t; 
     309 
     310/** 
     311 * Create a new parser. 
     312 * 
     313 * This function creates a new parser object.  An application is responsible 
     314 * for destroying the object using the @c yaml_parser_delete function. 
     315 * 
     316 * @returns A new parser object; @c NULL on error. 
     317 */ 
     318 
     319yaml_parser_t * 
     320yaml_parser_new(void); 
     321 
     322/** 
     323 * Destroy a parser. 
     324 * 
     325 * @param[in]   parser  A parser object. 
     326 */ 
     327 
     328void 
     329yaml_parser_delete(yaml_parser_t *parser); 
     330 
     331/** @} */ 
     332 
    185333/* 
    186 typedef struct { 
    187 } yaml_parser_t; 
    188  
    189334typedef struct { 
    190335} yaml_emitter_t; 
  • libyaml/trunk/include/yaml/yaml_version.h

    r172 r178  
    1 /** 
     1/* 
    22 * @file yaml_version.h 
    33 * @brief Version information. 
     
    1313#endif 
    1414 
    15 /** 
     15/* 
    1616 * @brief Get the library version. 
    1717 */ 
     
    2020yaml_get_version_string(void); 
    2121 
    22 /** 
     22/* 
    2323 * @brief Get the library version numbers. 
    2424 */ 
  • libyaml/trunk/src/Makefile.am

    r169 r178  
    11AM_CPPFLAGS = -I$(top_srcdir)/include 
    22lib_LTLIBRARIES = libyaml.la 
    3 libyaml_la_SOURCES = version.c 
     3libyaml_la_SOURCES = version.c api.c 
    44libyaml_la_LDFLAGS = -release $(YAML_LT_RELEASE) -version-info $(YAML_LT_CURRENT):$(YAML_LT_REVISION):$(YAML_LT_AGE) 
Note: See TracChangeset for help on using the changeset viewer.