james woodyatt avatar james woodyatt committed bff7fa0

Some progress toward implementing the new callbacks in expat-2.0.x for
handling the DOCTYPE and related parser productions.

Comments (0)

Files changed (4)

 + (unspecified): It might be helpful to define a core abstraction for switching
     gadgets, e.g. for multiplexing streams, etc.  More research is in order.
 
-Sideline branch problems:
-
-+ ALL FILES NEED OCAMLDOC!
++ [xml, mime, sasl and beep] Write the OCamlDoc content
 
 + (T_beep.T2) Sessions preliminarily sending <greeting/> elements (immediately
     on creation, rather than at programmatic opportunity), but receiving them
 type parser
 
 type error =
-  | ERROR_NO_MEMORY | ERROR_SYNTAX | ERROR_NO_ELEMENTS | ERROR_INVALID_TOKEN
-  | ERROR_UNCLOSED_TOKEN | ERROR_PARTIAL_CHAR | ERROR_TAG_MISMATCH
-  | ERROR_DUPLICATE_ATTRIBUTE | ERROR_JUNK_AFTER_DOC_ELEMENT
-  | ERROR_PARAM_ENTITY_REF | ERROR_UNDEFINED_ENTITY
-  | ERROR_RECURSIVE_ENTITY_REF | ERROR_ASYNC_ENTITY | ERROR_BAD_CHAR_REF
-  | ERROR_BINARY_ENTITY_REF | ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF
-  | ERROR_MISPLACED_XML_PI | ERROR_UNKNOWN_ENCODING | ERROR_INCORRECT_ENCODING
-  | ERROR_UNCLOSED_CDATA_SECTION | ERROR_EXTERNAL_ENTITY_HANDLING
-  | ERROR_NOT_STANDALONE | ERROR_UNEXPECTED_STATE | ERROR_ENTITY_DECLARED_IN_PE
-  | ERROR_FEATURE_REQUIRES_XML_DTD | ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING
+  | ERROR_NO_MEMORY
+  | ERROR_SYNTAX
+  | ERROR_NO_ELEMENTS
+  | ERROR_INVALID_TOKEN
+  | ERROR_UNCLOSED_TOKEN
+  | ERROR_PARTIAL_CHAR
+  | ERROR_TAG_MISMATCH
+  | ERROR_DUPLICATE_ATTRIBUTE
+  | ERROR_JUNK_AFTER_DOC_ELEMENT
+  | ERROR_PARAM_ENTITY_REF
+  | ERROR_UNDEFINED_ENTITY
+  | ERROR_RECURSIVE_ENTITY_REF
+  | ERROR_ASYNC_ENTITY
+  | ERROR_BAD_CHAR_REF
+  | ERROR_BINARY_ENTITY_REF
+  | ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF
+  | ERROR_MISPLACED_XML_PI
+  | ERROR_UNKNOWN_ENCODING
+  | ERROR_INCORRECT_ENCODING
+  | ERROR_UNCLOSED_CDATA_SECTION
+  | ERROR_EXTERNAL_ENTITY_HANDLING
+  | ERROR_NOT_STANDALONE
+  | ERROR_UNEXPECTED_STATE
+  | ERROR_ENTITY_DECLARED_IN_PE
+  | ERROR_FEATURE_REQUIRES_XML_DTD
+  | ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING
+  | ERROR_UNBOUND_PREFIX
+  | ERROR_UNDECLARING_PREFIX
+  | ERROR_INCOMPLETE_PE
+  | ERROR_XML_DECL
+  | ERROR_TEXT_DECL
+  | ERROR_PUBLICID
+  | ERROR_SUSPENDED
+  | ERROR_NOT_SUSPENDED
+  | ERROR_ABORTED
+  | ERROR_FINISHED
+  | ERROR_SUSPEND_PE
+  | ERROR_RESERVED_PREFIX_XML
+  | ERROR_RESERVED_PREFIX_XMLNS
+  | ERROR_RESERVED_NAMESPACE_URI
   | ERROR_UNKNOWN of int
 
 exception Error of error
 
 type standalone = SA_no | SA_yes | SA_implied
 
+type ctype =
+    | CTYPE_EMPTY
+    | CTYPE_ANY
+    | CTYPE_MIXED
+    | CTYPE_NAME
+    | CTYPE_CHOICE
+    | CTYPE_SEQ
+    | CTYPE_UNKNOWN of int
+
+type cquant =
+    | CQUANT_NONE
+    | CQUANT_OPT
+    | CQUANT_REP
+    | CQUANT_PLUS
+    | CQUANT_UNKNOWN of int
+
+type content = {
+    ctype: ctype;
+    cquant: cquant;
+    name: string;
+    children: content array;
+}
+
+external set_handler_element_decl:
+    parser -> (string -> content -> unit) option -> unit =
+    "xml_expat_set_handler_element_decl"
+
+type attdflt =
+    | AD_required
+    | AD_implied
+    | AD_explicit of string
+
+external set_handler_attlist_decl:
+    parser -> (elname:string -> attname:string -> atttype:string ->
+    dflt:attdflt -> unit) option -> unit =
+    "xml_expat_set_handler_attlist_decl"
+
 external set_handler_xml_decl:
     parser ->
     (?version:string -> ?encoding:string -> standalone -> unit) option ->

xml/xml_expat.mli

   OF THE POSSIBILITY OF SUCH DAMAGE. 
  *---------------------------------------------------------------------------*)
 
+(** Expat XML parser. *)
+
+(** {6 Overview}
+    
+    This module is a straightforward wrapper to the C-language bindings of the
+    Expat XML parser.  Requires 2.0.1 or later.
+*)
+
 val version: string
 
 type numeric_version = { major: int; minor: int; micro: int }
 type parser and parser_factory
 
 type error =
-  | ERROR_NO_MEMORY | ERROR_SYNTAX | ERROR_NO_ELEMENTS | ERROR_INVALID_TOKEN
-  | ERROR_UNCLOSED_TOKEN | ERROR_PARTIAL_CHAR | ERROR_TAG_MISMATCH
-  | ERROR_DUPLICATE_ATTRIBUTE | ERROR_JUNK_AFTER_DOC_ELEMENT
-  | ERROR_PARAM_ENTITY_REF | ERROR_UNDEFINED_ENTITY
-  | ERROR_RECURSIVE_ENTITY_REF | ERROR_ASYNC_ENTITY | ERROR_BAD_CHAR_REF
-  | ERROR_BINARY_ENTITY_REF | ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF
-  | ERROR_MISPLACED_XML_PI | ERROR_UNKNOWN_ENCODING | ERROR_INCORRECT_ENCODING
-  | ERROR_UNCLOSED_CDATA_SECTION | ERROR_EXTERNAL_ENTITY_HANDLING
-  | ERROR_NOT_STANDALONE | ERROR_UNEXPECTED_STATE | ERROR_ENTITY_DECLARED_IN_PE
-  | ERROR_FEATURE_REQUIRES_XML_DTD | ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING
+  | ERROR_NO_MEMORY
+  | ERROR_SYNTAX
+  | ERROR_NO_ELEMENTS
+  | ERROR_INVALID_TOKEN
+  | ERROR_UNCLOSED_TOKEN
+  | ERROR_PARTIAL_CHAR
+  | ERROR_TAG_MISMATCH
+  | ERROR_DUPLICATE_ATTRIBUTE
+  | ERROR_JUNK_AFTER_DOC_ELEMENT
+  | ERROR_PARAM_ENTITY_REF
+  | ERROR_UNDEFINED_ENTITY
+  | ERROR_RECURSIVE_ENTITY_REF
+  | ERROR_ASYNC_ENTITY
+  | ERROR_BAD_CHAR_REF
+  | ERROR_BINARY_ENTITY_REF
+  | ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF
+  | ERROR_MISPLACED_XML_PI
+  | ERROR_UNKNOWN_ENCODING
+  | ERROR_INCORRECT_ENCODING
+  | ERROR_UNCLOSED_CDATA_SECTION
+  | ERROR_EXTERNAL_ENTITY_HANDLING
+  | ERROR_NOT_STANDALONE
+  | ERROR_UNEXPECTED_STATE
+  | ERROR_ENTITY_DECLARED_IN_PE
+  | ERROR_FEATURE_REQUIRES_XML_DTD
+  | ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING
+  | ERROR_UNBOUND_PREFIX
+  | ERROR_UNDECLARING_PREFIX
+  | ERROR_INCOMPLETE_PE
+  | ERROR_XML_DECL
+  | ERROR_TEXT_DECL
+  | ERROR_PUBLICID
+  | ERROR_SUSPENDED
+  | ERROR_NOT_SUSPENDED
+  | ERROR_ABORTED
+  | ERROR_FINISHED
+  | ERROR_SUSPEND_PE
+  | ERROR_RESERVED_PREFIX_XML
+  | ERROR_RESERVED_PREFIX_XMLNS
+  | ERROR_RESERVED_NAMESPACE_URI
   | ERROR_UNKNOWN of int
 
 exception Error of error
 
 type standalone = SA_no | SA_yes | SA_implied
 
+type ctype =
+    | CTYPE_EMPTY
+    | CTYPE_ANY
+    | CTYPE_MIXED
+    | CTYPE_NAME
+    | CTYPE_CHOICE
+    | CTYPE_SEQ
+    | CTYPE_UNKNOWN of int
+
+type cquant =
+    | CQUANT_NONE
+    | CQUANT_OPT
+    | CQUANT_REP
+    | CQUANT_PLUS
+    | CQUANT_UNKNOWN of int
+
+type content = {
+    ctype: ctype;
+    cquant: cquant;
+    name: string;
+    children: content array;
+}
+
+val set_handler_element_decl:
+    parser -> (string -> content -> unit) option -> unit
+
+type attdflt =
+    | AD_required
+    | AD_implied
+    | AD_explicit of string
+
+val set_handler_attlist_decl:
+    parser -> (elname:string -> attname:string -> atttype:string ->
+    dflt:attdflt -> unit) option -> unit
+
 val set_handler_xml_decl:
     parser ->
     (?version:string -> ?encoding:string -> standalone -> unit) option ->

xml/xml_expat_p.c

 #include <stdlib.h>
 #include <string.h>
 
-#define FAILWITH(S)	(failwith("Xml_expat." S))
-#define INVALID_ARG(S)	(invalid_argument("Xml_expat." S))
+#define FAILWITH(S) (failwith("Xml_expat." S))
+#define INVALID_ARG(S)  (invalid_argument("Xml_expat." S))
 
 static value xml_expat_val_string_option(const char* ptr)
 {
     XML_ERROR_UNEXPECTED_STATE,
     XML_ERROR_ENTITY_DECLARED_IN_PE,
     XML_ERROR_FEATURE_REQUIRES_XML_DTD,
-    XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING
+    XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING,
+    /* Added in 1.95.7. */
+    XML_ERROR_UNBOUND_PREFIX,
+    /* Added in 1.95.8. */
+    XML_ERROR_UNDECLARING_PREFIX,
+    XML_ERROR_INCOMPLETE_PE,
+    XML_ERROR_XML_DECL,
+    XML_ERROR_TEXT_DECL,
+    XML_ERROR_PUBLICID,
+    XML_ERROR_SUSPENDED,
+    XML_ERROR_NOT_SUSPENDED,
+    XML_ERROR_ABORTED,
+    XML_ERROR_FINISHED,
+    XML_ERROR_SUSPEND_PE,
+    /* Added in 2.0. */
+    XML_ERROR_RESERVED_PREFIX_XML,
+    XML_ERROR_RESERVED_PREFIX_XMLNS,
+    XML_ERROR_RESERVED_NAMESPACE_URI
 };
 
 #define Xml_expat_error_array_size \
     xml_expat_get_constant_unknown0
 };
 
-static const int xml_expat_content_type_array[] = {
+static const int xml_expat_ctype_array[] = {
     XML_CTYPE_EMPTY,
     XML_CTYPE_ANY,
     XML_CTYPE_MIXED,
     XML_CTYPE_SEQ
 };
 
-#define Xml_expat_content_type_array_size \
-    sizeof xml_expat_content_type_array / \
-    sizeof xml_expat_content_type_array[0]
+#define Xml_expat_ctype_array_size \
+    sizeof xml_expat_ctype_array / \
+    sizeof xml_expat_ctype_array[0]
 
-static const Xml_expat_constant_table_t xml_expat_content_type_table = {
-    xml_expat_content_type_array,
-    Xml_expat_content_type_array_size,
+static const Xml_expat_constant_table_t xml_expat_ctype_table = {
+    xml_expat_ctype_array,
+    Xml_expat_ctype_array_size,
     xml_expat_get_constant_unknown0
 };
 
-static const int xml_expat_content_quant_array[] = {
+static const int xml_expat_cquant_array[] = {
     XML_CQUANT_NONE,
     XML_CQUANT_OPT,
     XML_CQUANT_REP,
     XML_CQUANT_PLUS
 };
 
-#define Xml_expat_content_quant_array_size \
-    sizeof xml_expat_content_quant_array / \
-    sizeof xml_expat_content_quant_array[0]
+#define Xml_expat_cquant_array_size \
+    sizeof xml_expat_cquant_array / \
+    sizeof xml_expat_cquant_array[0]
 
-static const Xml_expat_constant_table_t xml_expat_content_quant_table = {
-    xml_expat_content_quant_array,
-    Xml_expat_content_quant_array_size,
+static const Xml_expat_constant_table_t xml_expat_cquant_table = {
+    xml_expat_cquant_array,
+    Xml_expat_cquant_array_size,
     xml_expat_get_constant_unknown0
 };
 
 static const int xml_expat_standalone_array[] = { 0, 1, -1 };
-static const Xml_expat_constant_table_t xml_expat_standaloneable = {
+static const Xml_expat_constant_table_t xml_expat_standalone_table = {
     xml_expat_standalone_array, 3, 0
 };
 
 enum xml_expat_handler_field_e {
     Xml_expat_handler_xml_decl,
+    Xml_expat_handler_doctype_start,            /* unimplemented */
+    Xml_expat_handler_doctype_end,              /* unimplemented */
+    Xml_expat_handler_entity_decl,              /* unimplemented */
+    Xml_expat_handler_notation_decl,            /* unimplemented */
+    Xml_expat_handler_namespace_start,          /* unimplemented */
+    Xml_expat_handler_namespace_end,            /* unimplemented */
+    Xml_expat_handler_element_decl,
+    Xml_expat_handler_attlist_decl,
+    Xml_expat_handler_not_standalone,           /* unimplemented */
     Xml_expat_handler_character_data,
     Xml_expat_handler_element_start,
     Xml_expat_handler_element_end,
     Xml_expat_handler_cdata_start,
     Xml_expat_handler_cdata_end,
     Xml_expat_handler_external_entity_ref,
+    Xml_expat_handler_skipped_entity,           /* unimplemented */
     Xml_expat_handler_comment,
+    Xml_expat_handler_unknown_encoding,         /* unimplemented */
     Xml_expat_handler_default
 };
 
-#define XML_expat_user_data_field_count		(Xml_expat_handler_default + 1)
+#define XML_expat_user_data_field_count     (Xml_expat_handler_default + 1)
 
 static void xml_expat_parser_finalize(value v)
 {
     CAMLreturn0;
 }
 
+/*---
+external set_handler_element_decl:
+    parser -> (string -> content -> unit) option -> unit =
+    "xml_expat_set_handler_element_decl"
+  ---*/
+static value xml_expat_aux_content_copy(XML_Content* model)
+{
+    CAMLparam0();
+    CAMLlocal5(typeVal, quantVal, nameVal, childrenVal, modelVal);
+    int i;
+    
+    typeVal = xml_expat_get_constant(&xml_expat_ctype_table, model->type);
+    quantVal = xml_expat_get_constant(&xml_expat_cquant_table, model->quant);
+    nameVal = copy_string(model->name);
+    
+    childrenVal = alloc(model->numchildren, 0);
+    for (i = 0; i < model->numchildren; ++i) {
+        CAMLlocal1(childVal);
+        childVal = xml_expat_aux_content_copy(&model->children[i]);
+        Store_field(childrenVal, i, childVal);
+    }
+    
+    modelVal = alloc_small(4, 0);
+    Store_field(modelVal, 0, typeVal);
+    Store_field(modelVal, 1, quantVal);
+    Store_field(modelVal, 2, nameVal);
+    Store_field(modelVal, 3, childrenVal);
+    
+    CAMLreturn(modelVal);
+}
+
+static void xml_expat_handler_aux_element_decl
+   (void* userData, const XML_Char* name, XML_Content* model)
+{
+    CAMLparam0();
+    CAMLlocal3(nameVal, modelVal, handlerVal);
+    value* userDataValPtr = (value*) userData;
+    
+    nameVal = copy_string(name);
+    modelVal = xml_expat_aux_content_copy(model);
+    
+    handlerVal = Field(*userDataValPtr, Xml_expat_handler_element_decl);
+    assert(Is_block(handlerVal));
+    callback2(Field(handlerVal, 0), nameVal, modelVal);
+    
+    CAMLreturn0;
+}
+
+CAMLprim void xml_expat_set_handler_element_decl
+   (value parserVal, value handlerVal)
+{
+    CAMLparam2(parserVal, handlerVal);
+    
+    XML_Parser parser;
+    XML_ElementDeclHandler handlerF;
+    value* userDataValPtr;
+    
+    parser = Xml_expat_parser_val(parserVal);
+    userDataValPtr = (value*) XML_GetUserData(parser);
+    assert(!!userDataValPtr);
+    handlerF = Is_block(handlerVal) ? xml_expat_handler_aux_element_decl : 0;
+    
+    Store_field(*userDataValPtr, Xml_expat_handler_xml_decl, handlerVal);
+    XML_SetElementDeclHandler(parser, handlerF);
+    
+    CAMLreturn0;
+}
+
+/*---
+  external set_handler_attlist_decl:
+    parser -> (elname:string -> attname:string -> atttype:string ->
+    dflt:attdflt -> unit) option -> unit =
+    "xml_expat_set_handler_attlist_decl"
+  ---*/
+static void xml_expat_handler_aux_attlist_decl
+   (void* userData, const XML_Char* elname, const XML_Char* attname,
+    const XML_Char* att_type, const XML_Char* dflt, int isrequired)
+{
+    CAMLparam0();
+    CAMLlocal5(elnameVal, attnameVal, atttypeVal, attdfltVal, handlerVal);
+    CAMLlocalN(argValArray, 4);
+    value* userDataValPtr = (value*) userData;
+    
+    argValArray[0] = copy_string(elname);
+    argValArray[1] = copy_string(attname);
+    argValArray[2] = copy_string(att_type);
+    
+    if (!dflt) {
+        argValArray[3] = isrequired
+            ? Val_int(0)    /* PA_required  */
+            : Val_int(1);   /* PA_implied   */
+    }
+    else {
+        CAMLlocal1(explicitVal);
+        
+        explicitVal = copy_string(dflt);
+        
+        argValArray[3] = alloc_small(1, 0); /* PA_explicit */
+        Store_field(attdfltVal, 0, explicitVal);
+    }
+    
+    handlerVal = Field(*userDataValPtr, Xml_expat_handler_element_decl);
+    assert(Is_block(handlerVal));
+    callbackN(Field(handlerVal, 0), 4, argValArray);
+    
+    CAMLreturn0;
+}
+
+CAMLprim void xml_expat_set_handler_attlist_decl
+   (value parserVal, value handlerVal)
+{
+    CAMLparam2(parserVal, handlerVal);
+    
+    XML_Parser parser;
+    XML_AttlistDeclHandler handlerF;
+    value* userDataValPtr;
+    
+    parser = Xml_expat_parser_val(parserVal);
+    userDataValPtr = (value*) XML_GetUserData(parser);
+    assert(!!userDataValPtr);
+    handlerF = Is_block(handlerVal) ? xml_expat_handler_aux_attlist_decl : 0;
+    
+    Store_field(*userDataValPtr, Xml_expat_handler_attlist_decl, handlerVal);
+    XML_SetAttlistDeclHandler(parser, handlerF);
+    
+    CAMLreturn0;
+}
+
+/*---
+  external set_handler_xml_decl:
+    parser ->
+    (?version:string -> ?encoding:string -> standalone -> unit) option ->
+    unit = "xml_expat_set_handler_xml_decl"
+  ---*/
 static void xml_expat_handler_aux_xml_decl
    (void* userData, const XML_Char* version, const XML_Char* encoding,
     int standalone)
     versionVal = xml_expat_val_string_option(version);
     encodingVal = xml_expat_val_string_option(encoding);
     standaloneVal =
-        xml_expat_get_constant(&xml_expat_standaloneable, standalone);
+        xml_expat_get_constant(&xml_expat_standalone_table, standalone);
     
     handlerVal = Field(*userDataValPtr, Xml_expat_handler_xml_decl);
     assert(Is_block(handlerVal));    
     CAMLreturn0;
 }
 
-/*---
-  external set_handler_xml_decl:
-    parser ->
-    (?version:string -> ?encoding:string -> standalone -> unit) option ->
-    unit = "xml_expat_set_handler_xml_decl"
-  ---*/
 CAMLprim void xml_expat_set_handler_xml_decl
    (value parserVal, value handlerVal)
 {
     CAMLreturn0;
 }
 
+/*---
+  external set_handler_character_data:
+    parser -> (string -> unit) option -> unit =
+    "xml_expat_set_handler_character_data"
+  ---*/
 static void xml_expat_handler_aux_character_data
    (void* userData, const char* buffer, int len)
 {
     CAMLreturn0;
 }
 
-/*---
-  external set_handler_character_data:
-    parser -> (string -> unit) option -> unit =
-    "xml_expat_set_handler_character_data"
-  ---*/
 CAMLprim void xml_expat_set_handler_character_data
    (value parserVal, value handlerVal)
 {
     CAMLreturn0;
 }
 
+/*---
+  external set_handler_element_start:
+    parser -> (string -> unit) option -> unit =
+    "xml_expat_set_handler_element_start"
+  ---*/
 static void xml_expat_handler_aux_element_start
    (void* userData, const char* name, const char** attr)
 {
     CAMLreturn0;
 }
 
-/*---
-  external set_handler_element_start:
-    parser -> (string -> unit) option -> unit =
-    "xml_expat_set_handler_element_start"
-  ---*/
 CAMLprim void xml_expat_set_handler_element_start
    (value parserVal, value handlerVal)
 {
     CAMLreturn0;
 }
 
+/*---
+  external set_handler_element_end:
+    parser -> (string -> unit) option -> unit =
+    "xml_expat_set_handler_element_end"
+  ---*/
 static void xml_expat_handler_aux_element_end
    (void* userData, const char* buffer)
 {
     CAMLreturn0;
 }
 
-/*---
-  external set_handler_element_end:
-    parser -> (string -> unit) option -> unit =
-    "xml_expat_set_handler_element_end"
-  ---*/
 CAMLprim void xml_expat_set_handler_element_end
    (value parserVal, value handlerVal)
 {
     CAMLreturn0;
 }
 
+/*---
+  external set_handler_processing_instruction:
+    parser -> (string -> unit) option -> unit =
+    "xml_expat_set_handler_processing_instruction"
+  ---*/
 static void xml_expat_handler_aux_processing_instruction
    (void* userData, const char* target, const char* buffer)
 {
     CAMLreturn0;
 }
 
-/*---
-  external set_handler_processing_instruction:
-    parser -> (string -> unit) option -> unit =
-    "xml_expat_set_handler_processing_instruction"
-  ---*/
 CAMLprim void xml_expat_set_handler_processing_instruction
    (value parserVal, value handlerVal)
 {
     CAMLreturn0;
 }
 
+/*---
+  external set_handler_cdata_start:
+    parser -> (unit -> unit) option -> unit =
+    "xml_expat_set_handler_cdata_start"
+  ---*/
 static void xml_expat_handler_aux_cdata_start(void* userData)
 {
     CAMLparam0();
     CAMLreturn0;
 }
 
-/*---
-  external set_handler_cdata_start:
-    parser -> (unit -> unit) option -> unit =
-    "xml_expat_set_handler_cdata_start"
-  ---*/
 CAMLprim void xml_expat_set_handler_cdata_start
    (value parserVal, value handlerVal)
 {
     CAMLreturn0;
 }
 
+/*---
+  external set_handler_cdata_end:
+    parser -> (unit -> unit) option -> unit =
+    "xml_expat_set_handler_cdata_end"
+  ---*/
 static void xml_expat_handler_aux_cdata_end(void* userData)
 {
     CAMLparam0();
     CAMLreturn0;
 }
 
-/*---
-  external set_handler_cdata_end:
-    parser -> (unit -> unit) option -> unit =
-    "xml_expat_set_handler_cdata_end"
-  ---*/
 CAMLprim void xml_expat_set_handler_cdata_end
    (value parserVal, value handlerVal)
 {
     CAMLreturn0;
 }
 
+/*---
+  external set_handler_external_entity_ref:
+    parser -> (string option -> string option -> string -> string option ->
+    unit) option -> unit = "xml_expat_set_handler_external_entity_ref"
+  ---*/
 static int xml_expat_handler_aux_external_entity_ref
    (XML_Parser parser, const char* context, const char* base,
     const char* systemId, const char* publicId)
     CAMLreturn(XML_STATUS_OK);
 }
 
-/*---
-  external set_handler_external_entity_ref:
-    parser -> (string option -> string option -> string -> string option ->
-    unit) option -> unit = "xml_expat_set_handler_external_entity_ref"
-  ---*/
 CAMLprim void xml_expat_set_handler_external_entity_ref
    (value parserVal, value handlerVal)
 {
     CAMLreturn0;
 }
 
+/*---
+  external set_handler_comment:
+    parser -> (string -> unit) option -> unit =
+    "xml_expat_set_handler_comment"
+  ---*/
 static void xml_expat_handler_aux_comment
    (void* userData, const char* buffer)
 {
     CAMLreturn0;
 }
 
-/*---
-  external set_handler_comment:
-    parser -> (string -> unit) option -> unit =
-    "xml_expat_set_handler_comment"
-  ---*/
 CAMLprim void xml_expat_set_handler_comment
    (value parserVal, value handlerVal)
 {
     CAMLreturn0;
 }
 
+/*---
+  external set_handler_default:
+    parser -> (string -> unit) option -> unit =
+    "xml_expat_set_default_handler"
+  ---*/
 static void xml_expat_handler_aux_default
    (void* userData, const char* buffer, int len)
 {
     CAMLreturn0;
 }
 
-/*---
-  external set_handler_default:
-    parser -> (string -> unit) option -> unit =
-    "xml_expat_set_default_handler"
-  ---*/
 CAMLprim void xml_expat_set_handler_default(value parserVal, value handlerVal)
 {
     CAMLparam2(parserVal, handlerVal);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.