Changeset 212


Ignore:
Timestamp:
07/25/06 16:54:28 (8 years ago)
Author:
xi
Message:

Add yaml_emitter_emit_* set of functions.

Location:
libyaml/trunk
Files:
1 added
5 edited

Legend:

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

    r211 r212  
    11401140 * 
    11411141 * @param[in]   emitter     An emitter object. 
    1142  * @param[in]   indent      The indentation increment (> 1). 
     1142 * @param[in]   indent      The indentation increment (1 < . < 10). 
    11431143 */ 
    11441144 
     
    11471147 
    11481148/** 
    1149  * Set the preferred line width. @c 0 means unlimited. 
     1149 * Set the preferred line width. @c -1 means unlimited. 
    11501150 * 
    11511151 * @param[in]   emitter     An emitter object. 
  • libyaml/trunk/src/Makefile.am

    r211 r212  
    11AM_CPPFLAGS = -I$(top_srcdir)/include 
    22lib_LTLIBRARIES = libyaml.la 
    3 libyaml_la_SOURCES = api.c reader.c scanner.c parser.c writer.c 
     3libyaml_la_SOURCES = api.c reader.c scanner.c parser.c writer.c emitter.c 
    44libyaml_la_LDFLAGS = -release $(YAML_LT_RELEASE) -version-info $(YAML_LT_CURRENT):$(YAML_LT_REVISION):$(YAML_LT_AGE) 
  • libyaml/trunk/src/api.c

    r211 r212  
    5858 */ 
    5959 
    60 YAML_DECLARE(char *) 
    61 yaml_strdup(const char *str) 
    62 { 
    63     return strdup(str); 
     60YAML_DECLARE(yaml_char_t *) 
     61yaml_strdup(const yaml_char_t *str) 
     62{ 
     63    if (!str) 
     64        return NULL; 
     65 
     66    return (yaml_char_t *)strdup((char *)str); 
    6467} 
    6568 
     
    390393    } 
    391394    STACK_DEL(emitter, emitter->indents); 
     395    yaml_event_delete(&emitter->event); 
    392396    while (!STACK_EMPTY(empty, emitter->tag_directives)) { 
    393397        yaml_tag_directive_t tag_directive = POP(emitter, emitter->tag_directives); 
     
    537541    assert(emitter);    /* Non-NULL emitter object expected. */ 
    538542 
    539     emitter->best_width = (width > 0) ? width : 0; 
     543    emitter->best_width = (width >= 0) ? width : -1; 
    540544} 
    541545 
  • libyaml/trunk/src/parser.c

    r211 r212  
    13361336    } 
    13371337 
    1338     copy.handle = (yaml_char_t *)yaml_strdup((char *)value.handle); 
    1339     copy.prefix = (yaml_char_t *)yaml_strdup((char *)value.prefix); 
     1338    copy.handle = yaml_strdup(value.handle); 
     1339    copy.prefix = yaml_strdup(value.prefix); 
    13401340    if (!copy.handle || !copy.prefix) { 
    13411341        parser->error = YAML_MEMORY_ERROR; 
  • libyaml/trunk/src/yaml_private.h

    r211 r212  
    2121yaml_free(void *ptr); 
    2222 
    23 YAML_DECLARE(char *) 
    24 yaml_strdup(const char *); 
     23YAML_DECLARE(yaml_char_t *) 
     24yaml_strdup(const yaml_char_t *); 
    2525 
    2626/* 
Note: See TracChangeset for help on using the changeset viewer.