Ignore:
Timestamp:
05/29/06 16:08:09 (8 years ago)
Author:
xi
Message:

Working on the decoding code.

File:
1 edited

Legend:

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

    r179 r180  
    253253 * buffer.  The number of written bytes should be set to the @a length variable. 
    254254 * 
    255  * @param[in]   ext         A pointer to an application data specified by 
     255 * @param[in]   data        A pointer to an application data specified by 
    256256 *                          @c yaml_parser_set_read_handler. 
    257257 * @param[out]  buffer      The buffer to write the data from the source. 
     
    263263 * @a length to @c 0 and return @c 1. 
    264264 */ 
    265 typedef int yaml_read_handler_t(void *ext, unsigned char *buffer, size_t size, 
     265 
     266typedef int yaml_read_handler_t(void *data, unsigned char *buffer, size_t size, 
    266267        size_t *size_read); 
     268 
     269/** 
     270 * This structure holds a string input specified by 
     271 * @c yaml_parser_set_input_string. 
     272 */ 
     273 
     274typedef struct { 
     275    unsigned char *start; 
     276    unsigned char *end; 
     277    unsigned char *current; 
     278} yaml_string_input_t; 
    267279 
    268280/** 
     
    280292     */ 
    281293 
    282     error_type_t error; 
     294    yaml_error_type_t error; 
    283295 
    284296    /** 
     
    303315    yaml_char_t *buffer; 
    304316 
    305     /** The size of the buffer (in bytes). */ 
    306     size_t buffer_size; 
     317    /** The pointer to the end of the working buffer. */ 
     318    yaml_char_t *buffer_end; 
    307319 
    308320    /** The pointer to the current character in the working buffer. */ 
    309     yaml_char_t *buffer_pointer; 
    310  
    311     /** The number of unread characters in the buffer (in characters). */ 
    312     size_t buffer_length; 
    313  
    314     /** The remaining undecoded characters. */ 
     321    yaml_char_t *pointer; 
     322 
     323    /** The number of unread characters in the working buffer. */ 
     324    size_t unread; 
     325 
     326    /** The pointer to the beginning of the raw buffer. */ 
    315327    unsigned char *raw_buffer; 
    316328 
    317     /** The size of the raw buffer (in bytes). */ 
    318     size_t raw_buffer_size; 
    319  
    320     /** Is the application responsible for freeing the raw buffer? */ 
    321     int raw_buffer_foreign; 
     329    /** The pointer to the current character in the raw buffer. */ 
     330    unsigned char *raw_pointer; 
     331 
     332    /** The number of unread bytes in the raw buffer. */ 
     333    size_t raw_unread; 
    322334 
    323335    /** The input encoding. */ 
     
    335347    /** The column of the current position (starting from @c 0). */ 
    336348    size_t column; 
     349 
     350    /* String input structure. */ 
     351    yaml_string_input_t string_input; 
    337352 
    338353    /** 
     
    462477yaml_free(void *ptr); 
    463478 
     479/** The size of the raw buffer. */ 
     480 
     481#define YAML_RAW_BUFFER_SIZE 16384 
     482 
     483/** 
     484 * The size of the buffer. 
     485 * 
     486 * We allocate enough space for decoding the whole raw buffer. 
     487 */ 
     488 
     489#define YAML_BUFFER_SIZE    (YAML_RAW_BUFFER_SIZE*3) 
     490 
    464491/** @} */ 
    465492 
Note: See TracChangeset for help on using the changeset viewer.