1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-30 22:43:14 +03:00

tree: Deprecate xmlSetCompressMode

This commit is contained in:
Nick Wellnhofer
2024-04-28 17:54:36 +02:00
parent 05654cfe00
commit 88169bfda6
4 changed files with 11 additions and 1 deletions

View File

@ -1288,8 +1288,10 @@ XMLPUBFUN int
XMLPUBFUN void XMLPUBFUN void
xmlSetDocCompressMode (xmlDocPtr doc, xmlSetDocCompressMode (xmlDocPtr doc,
int mode); int mode);
XML_DEPRECATED
XMLPUBFUN int XMLPUBFUN int
xmlGetCompressMode (void); xmlGetCompressMode (void);
XML_DEPRECATED
XMLPUBFUN void XMLPUBFUN void
xmlSetCompressMode (int mode); xmlSetCompressMode (int mode);

View File

@ -308,6 +308,7 @@ deprecated_funcs = {
'xmlDictCleanup': True, 'xmlDictCleanup': True,
'xmlEncodeEntities': True, 'xmlEncodeEntities': True,
'xmlFileMatch': True, 'xmlFileMatch': True,
'xmlGetCompressMode': True,
'xmlHandleEntity': True, 'xmlHandleEntity': True,
'xmlInitCharEncodingHandlers': True, 'xmlInitCharEncodingHandlers': True,
'xmlInitGlobals': True, 'xmlInitGlobals': True,
@ -378,6 +379,7 @@ deprecated_funcs = {
'xmlScanName': True, 'xmlScanName': True,
'xmlSchemaCleanupTypes': True, 'xmlSchemaCleanupTypes': True,
'xmlSchemaInitTypes': True, 'xmlSchemaInitTypes': True,
'xmlSetCompressMode': True,
'xmlSetupParserForBuffer': True, 'xmlSetupParserForBuffer': True,
'xmlSkipBlankChars': True, 'xmlSkipBlankChars': True,
'xmlStringDecodeEntities': True, 'xmlStringDecodeEntities': True,

4
tree.c
View File

@ -7673,6 +7673,8 @@ xmlSetDocCompressMode (xmlDocPtr doc, int mode) {
/** /**
* xmlGetCompressMode: * xmlGetCompressMode:
* *
* DEPRECATED: Use xmlGetDocCompressMode
*
* get the default compression mode used, ZLIB based. * get the default compression mode used, ZLIB based.
* Returns 0 (uncompressed) to 9 (max compression) * Returns 0 (uncompressed) to 9 (max compression)
*/ */
@ -7686,6 +7688,8 @@ xmlGetCompressMode(void)
* xmlSetCompressMode: * xmlSetCompressMode:
* @mode: the compression ratio * @mode: the compression ratio
* *
* DEPRECATED: Use xmlSetDocCompressMode
*
* set the default compression mode used, ZLIB based * set the default compression mode used, ZLIB based
* Correct values: 0 (uncompressed) to 9 (max compression) * Correct values: 0 (uncompressed) to 9 (max compression)
*/ */

View File

@ -2521,6 +2521,9 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
if (noout == 0) { if (noout == 0) {
int ret; int ret;
if (compress)
xmlSetDocCompressMode(doc, 9);
/* /*
* print it. * print it.
*/ */
@ -3359,7 +3362,6 @@ main(int argc, char **argv) {
else if ((!strcmp(argv[i], "-compress")) || else if ((!strcmp(argv[i], "-compress")) ||
(!strcmp(argv[i], "--compress"))) { (!strcmp(argv[i], "--compress"))) {
compress++; compress++;
xmlSetCompressMode(9);
} }
#endif #endif
#endif /* LIBXML_OUTPUT_ENABLED */ #endif /* LIBXML_OUTPUT_ENABLED */