| 5946 | */ |
| 5947 | |
| 5948 | htmlDocPtr |
| 5949 | htmlSAXParseFile(const char *filename, const char *encoding, htmlSAXHandlerPtr sax, |
| 5950 | void *userData) { |
| 5951 | htmlDocPtr ret; |
| 5952 | htmlParserCtxtPtr ctxt; |
| 5953 | htmlSAXHandlerPtr oldsax = NULL; |
| 5954 | |
| 5955 | ctxt = htmlCreateFileParserCtxt(filename, encoding); |
| 5956 | if (ctxt == NULL) return(NULL); |
| 5957 | if (sax != NULL) { |
| 5958 | oldsax = ctxt->sax; |
| 5959 | ctxt->sax = sax; |
| 5960 | ctxt->userData = userData; |
| 5961 | } |
| 5962 | |
| 5963 | htmlParseDocument(ctxt); |
| 5964 | |
| 5965 | ret = ctxt->myDoc; |
| 5966 | if (sax != NULL) { |
| 5967 | ctxt->sax = oldsax; |
| 5968 | ctxt->userData = NULL; |
| 5969 | } |
| 5970 | htmlFreeParserCtxt(ctxt); |
| 5971 | |
| 5972 | return(ret); |
| 5973 | } |
| 5974 | |
| 5975 | /** |
| 5976 | * htmlParseFile: |
no test coverage detected