Index: libyaml/trunk/include/yaml/yaml.h
===================================================================
--- libyaml/trunk/include/yaml/yaml.h	(revision 179)
+++ libyaml/trunk/include/yaml/yaml.h	(revision 180)
@@ -253,5 +253,5 @@
  * buffer.  The number of written bytes should be set to the @a length variable.
  *
- * @param[in]   ext         A pointer to an application data specified by
+ * @param[in]   data        A pointer to an application data specified by
  *                          @c yaml_parser_set_read_handler.
  * @param[out]  buffer      The buffer to write the data from the source.
@@ -263,6 +263,18 @@
  * @a length to @c 0 and return @c 1.
  */
-typedef int yaml_read_handler_t(void *ext, unsigned char *buffer, size_t size,
+
+typedef int yaml_read_handler_t(void *data, unsigned char *buffer, size_t size,
         size_t *size_read);
+
+/**
+ * This structure holds a string input specified by
+ * @c yaml_parser_set_input_string.
+ */
+
+typedef struct {
+    unsigned char *start;
+    unsigned char *end;
+    unsigned char *current;
+} yaml_string_input_t;
 
 /**
@@ -280,5 +292,5 @@
      */
 
-    error_type_t error;
+    yaml_error_type_t error;
 
     /**
@@ -303,21 +315,21 @@
     yaml_char_t *buffer;
 
-    /** The size of the buffer (in bytes). */
-    size_t buffer_size;
+    /** The pointer to the end of the working buffer. */
+    yaml_char_t *buffer_end;
 
     /** The pointer to the current character in the working buffer. */
-    yaml_char_t *buffer_pointer;
-
-    /** The number of unread characters in the buffer (in characters). */
-    size_t buffer_length;
-
-    /** The remaining undecoded characters. */
+    yaml_char_t *pointer;
+
+    /** The number of unread characters in the working buffer. */
+    size_t unread;
+
+    /** The pointer to the beginning of the raw buffer. */
     unsigned char *raw_buffer;
 
-    /** The size of the raw buffer (in bytes). */
-    size_t raw_buffer_size;
-
-    /** Is the application responsible for freeing the raw buffer? */
-    int raw_buffer_foreign;
+    /** The pointer to the current character in the raw buffer. */
+    unsigned char *raw_pointer;
+
+    /** The number of unread bytes in the raw buffer. */
+    size_t raw_unread;
 
     /** The input encoding. */
@@ -335,4 +347,7 @@
     /** The column of the current position (starting from @c 0). */
     size_t column;
+
+    /* String input structure. */
+    yaml_string_input_t string_input;
 
     /**
@@ -462,4 +477,16 @@
 yaml_free(void *ptr);
 
+/** The size of the raw buffer. */
+
+#define YAML_RAW_BUFFER_SIZE 16384
+
+/**
+ * The size of the buffer.
+ *
+ * We allocate enough space for decoding the whole raw buffer.
+ */
+
+#define YAML_BUFFER_SIZE    (YAML_RAW_BUFFER_SIZE*3)
+
 /** @} */
 
