diff options
-rw-r--r-- | c/data.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -18,7 +18,7 @@ static Unique<HINTERNET, InternetCloseHandle> s_hi = struct ParsedDoc { Unique<HINTERNET, InternetCloseHandle> hiUrl; - Unique<htmlParserCtxtPtr, xmlFreeParserCtxt> ctxt; + Unique<htmlParserCtxtPtr, xmlFreeParserCtxt> ctx; char bufI[1024]; char bufX[1024]; @@ -31,24 +31,24 @@ struct ParsedDoc if (!hiUrl.Bad(0)) throw InternetError(); - ctxt = htmlCreatePushParserCtxt(nullptr, nullptr, bufX, sizeof(bufX), szUrl, XML_CHAR_ENCODING_UTF8); - if (!ctxt.Bad(0)) + ctx = htmlCreatePushParserCtxt(nullptr, nullptr, bufX, sizeof(bufX), szUrl, XML_CHAR_ENCODING_UTF8); + if (!ctx.Bad(0)) throw XmlError(); - htmlCtxtUseOptions(ctxt.v, HTML_PARSE_RECOVER|HTML_PARSE_NOERROR|HTML_PARSE_NOWARNING); + htmlCtxtUseOptions(ctx.v, HTML_PARSE_RECOVER|HTML_PARSE_NOERROR|HTML_PARSE_NOWARNING); BOOL r; DWORD cbRead; while (r = InternetReadFile(hiUrl.v, bufI, sizeof(bufI), &cbRead), cbRead) { if (!r) throw InternetError(); - if (!htmlParseChunk(ctxt.v, bufI, cbRead, 0)) + if (!htmlParseChunk(ctx.v, bufI, cbRead, 0)) throw XmlError(); } - htmlParseChunk(ctxt.v, bufI, 0, 1); /* Stop parsing. */ + htmlParseChunk(ctx.v, bufI, 0, 1); /* Stop parsing. */ } - operator htmlDocPtr() { return ctxt.v->myDoc; } + operator htmlDocPtr() { return ctx.v->myDoc; } }; static inline void XmlFree(void* p) { xmlFree(p); } |