* xmlSchemaSAXUnplug: * @plug: a data structure returned by xmlSchemaSAXPlug * * Unplug a SAX based validation layer in a SAX parsing event flow. * The original pointers used in the call are restored. * * Returns 0 in case of success and -1 in case of failure. */
| 28601 | * Returns 0 in case of success and -1 in case of failure. |
| 28602 | */ |
| 28603 | int |
| 28604 | xmlSchemaSAXUnplug(xmlSchemaSAXPlugPtr plug) |
| 28605 | { |
| 28606 | xmlSAXHandlerPtr *sax; |
| 28607 | void **user_data; |
| 28608 | |
| 28609 | if ((plug == NULL) || (plug->magic != XML_SAX_PLUG_MAGIC)) |
| 28610 | return(-1); |
| 28611 | plug->magic = 0; |
| 28612 | |
| 28613 | xmlSchemaPostRun(plug->ctxt); |
| 28614 | /* restore the data */ |
| 28615 | sax = plug->user_sax_ptr; |
| 28616 | *sax = plug->user_sax; |
| 28617 | if (plug->user_sax != NULL) { |
| 28618 | user_data = plug->user_data_ptr; |
| 28619 | *user_data = plug->user_data; |
| 28620 | } |
| 28621 | |
| 28622 | /* free and return */ |
| 28623 | xmlFree(plug); |
| 28624 | return(0); |
| 28625 | } |
| 28626 | |
| 28627 | /** |
| 28628 | * xmlSchemaValidateSetLocator: |
no test coverage detected