diff --git a/include/libxml/tree.h b/include/libxml/tree.h index bc99548b..433120a1 100644 --- a/include/libxml/tree.h +++ b/include/libxml/tree.h @@ -1288,8 +1288,10 @@ XMLPUBFUN int XMLPUBFUN void xmlSetDocCompressMode (xmlDocPtr doc, int mode); +XML_DEPRECATED XMLPUBFUN int xmlGetCompressMode (void); +XML_DEPRECATED XMLPUBFUN void xmlSetCompressMode (int mode); diff --git a/python/generator.py b/python/generator.py index 081a67f2..11f58c73 100755 --- a/python/generator.py +++ b/python/generator.py @@ -308,6 +308,7 @@ deprecated_funcs = { 'xmlDictCleanup': True, 'xmlEncodeEntities': True, 'xmlFileMatch': True, + 'xmlGetCompressMode': True, 'xmlHandleEntity': True, 'xmlInitCharEncodingHandlers': True, 'xmlInitGlobals': True, @@ -378,6 +379,7 @@ deprecated_funcs = { 'xmlScanName': True, 'xmlSchemaCleanupTypes': True, 'xmlSchemaInitTypes': True, + 'xmlSetCompressMode': True, 'xmlSetupParserForBuffer': True, 'xmlSkipBlankChars': True, 'xmlStringDecodeEntities': True, diff --git a/tree.c b/tree.c index 8e91d3af..6eb677f8 100644 --- a/tree.c +++ b/tree.c @@ -7673,6 +7673,8 @@ xmlSetDocCompressMode (xmlDocPtr doc, int mode) { /** * xmlGetCompressMode: * + * DEPRECATED: Use xmlGetDocCompressMode + * * get the default compression mode used, ZLIB based. * Returns 0 (uncompressed) to 9 (max compression) */ @@ -7686,6 +7688,8 @@ xmlGetCompressMode(void) * xmlSetCompressMode: * @mode: the compression ratio * + * DEPRECATED: Use xmlSetDocCompressMode + * * set the default compression mode used, ZLIB based * Correct values: 0 (uncompressed) to 9 (max compression) */ diff --git a/xmllint.c b/xmllint.c index 9bf23f1f..9122ec2f 100644 --- a/xmllint.c +++ b/xmllint.c @@ -2521,6 +2521,9 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { if (noout == 0) { int ret; + if (compress) + xmlSetDocCompressMode(doc, 9); + /* * print it. */ @@ -3359,7 +3362,6 @@ main(int argc, char **argv) { else if ((!strcmp(argv[i], "-compress")) || (!strcmp(argv[i], "--compress"))) { compress++; - xmlSetCompressMode(9); } #endif #endif /* LIBXML_OUTPUT_ENABLED */