Skip to content

Commit b349225

Browse files
committed
include: Change some return types from int to enum
This also affects some new functions from 2.13.
1 parent fd1b939 commit b349225

File tree

21 files changed

+172
-165
lines changed

21 files changed

+172
-165
lines changed

HTMLtree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ htmlIsBooleanAttr(const xmlChar *name)
337337
* *
338338
************************************************************************/
339339

340-
static int
340+
static xmlParserErrors
341341
htmlFindOutputEncoder(const char *encoding, xmlCharEncodingHandler **out) {
342342
/*
343343
* Fallback to HTML if the encoding is unspecified

buf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ xmlBufferResize(xmlBufferPtr buf, unsigned int size)
10921092
* Add a string range to an XML buffer. if len == -1, the length of
10931093
* str is recomputed.
10941094
*
1095-
* Returns a xmlParserError code.
1095+
* Returns a xmlParserErrors code.
10961096
*/
10971097
int
10981098
xmlBufferAdd(xmlBufferPtr buf, const xmlChar *str, int len) {
@@ -1124,7 +1124,7 @@ xmlBufferAdd(xmlBufferPtr buf, const xmlChar *str, int len) {
11241124
* Add a string range to the beginning of an XML buffer.
11251125
* if len == -1, the length of @str is recomputed.
11261126
*
1127-
* Returns a xmlParserError code.
1127+
* Returns a xmlParserErrors code.
11281128
*/
11291129
int
11301130
xmlBufferAddHead(xmlBufferPtr buf, const xmlChar *str, int len) {

doc/libxml2-api.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7764,14 +7764,14 @@ crash if you try to modify the tree)'/>
77647764
</function>
77657765
<function name='xmlBufferAdd' file='tree' module='buf'>
77667766
<info>Add a string range to an XML buffer. if len == -1, the length of str is recomputed.</info>
7767-
<return type='int' info='a xmlParserError code.'/>
7767+
<return type='int' info='a xmlParserErrors code.'/>
77687768
<arg name='buf' type='xmlBufferPtr' info='the buffer to dump'/>
77697769
<arg name='str' type='const xmlChar *' info='the #xmlChar string'/>
77707770
<arg name='len' type='int' info='the number of #xmlChar to add'/>
77717771
</function>
77727772
<function name='xmlBufferAddHead' file='tree' module='buf'>
77737773
<info>Add a string range to the beginning of an XML buffer. if len == -1, the length of @str is recomputed.</info>
7774-
<return type='int' info='a xmlParserError code.'/>
7774+
<return type='int' info='a xmlParserErrors code.'/>
77757775
<arg name='buf' type='xmlBufferPtr' info='the buffer'/>
77767776
<arg name='str' type='const xmlChar *' info='the #xmlChar string'/>
77777777
<arg name='len' type='int' info='the number of #xmlChar to add'/>
@@ -8110,7 +8110,7 @@ crash if you try to modify the tree)'/>
81108110
</functype>
81118111
<functype name='xmlCharEncConvFunc' file='encoding' module='encoding'>
81128112
<info>Convert between character encodings. The value of @inlen after return is the number of bytes consumed and @outlen is the number of bytes produced. If the converter can consume partial multi-byte sequences, the @flush flag can be used to detect truncated sequences at EOF. Otherwise, the flag can be ignored.</info>
8113-
<return type='int' info='a non-negative number on success or an XML_ENC_ERR code.'/>
8113+
<return type='xmlCharEncError' info='an XML_ENC_ERR code.'/>
81148114
<arg name='vctxt' type='void *' info='conversion context'/>
81158115
<arg name='out' type='unsigned char *' info='a pointer to an array of bytes to store the result'/>
81168116
<arg name='outlen' type='int *' info='the length of @out'/>
@@ -8120,7 +8120,7 @@ crash if you try to modify the tree)'/>
81208120
</functype>
81218121
<functype name='xmlCharEncConvImpl' file='encoding' module='encoding'>
81228122
<info>If this function returns XML_ERR_OK, it must fill the @out pointer with an encoding handler. The handler can be obtained from xmlCharEncNewCustomHandler. @flags can contain XML_ENC_INPUT, XML_ENC_OUTPUT or both.</info>
8123-
<return type='int' info='an xmlParserErrors code.'/>
8123+
<return type='xmlParserErrors' info='an xmlParserErrors code.'/>
81248124
<arg name='vctxt' type='void *' info='user data'/>
81258125
<arg name='name' type='const char *' info='encoding name'/>
81268126
<arg name='flags' type='xmlCharEncFlags' info='bit mask of flags'/>
@@ -8142,7 +8142,7 @@ crash if you try to modify the tree)'/>
81428142
</function>
81438143
<function name='xmlCharEncNewCustomHandler' file='encoding' module='encoding'>
81448144
<info>Create a custom xmlCharEncodingHandler.</info>
8145-
<return type='int' info='an xmlParserError code.'/>
8145+
<return type='xmlParserErrors' info='an xmlParserErrors code.'/>
81468146
<arg name='name' type='const char *' info='the encoding name'/>
81478147
<arg name='input' type='xmlCharEncConvFunc' info='input callback which converts to UTF-8'/>
81488148
<arg name='output' type='xmlCharEncConvFunc' info='output callback which converts from UTF-8'/>
@@ -8371,7 +8371,7 @@ crash if you try to modify the tree)'/>
83718371
</function>
83728372
<function name='xmlCreateCharEncodingHandler' file='encoding' module='encoding'>
83738373
<info>Find or create a handler matching the encoding. The following converters are looked up in order: - Built-in handler (UTF-8, UTF-16, ISO-8859-1, ASCII) - Custom implementation if provided - User-registered global handler (deprecated) - iconv if enabled - ICU if enabled The handler must be closed with xmlCharEncCloseFunc. If the encoding is UTF-8, a NULL handler and no error code will be returned. @flags can contain XML_ENC_INPUT, XML_ENC_OUTPUT or both. Available since 2.14.0.</info>
8374-
<return type='int' info='XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another xmlParserErrors error code.'/>
8374+
<return type='xmlParserErrors' info='XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another xmlParserErrors error code.'/>
83758375
<arg name='name' type='const char *' info='a string describing the char encoding.'/>
83768376
<arg name='flags' type='xmlCharEncFlags' info='bit mask of flags'/>
83778377
<arg name='impl' type='xmlCharEncConvImpl' info='a conversion implementation (optional)'/>
@@ -9865,7 +9865,7 @@ crash if you try to modify the tree)'/>
98659865
</functype>
98669866
<function name='xmlInputSetEncodingHandler' file='parser' module='parserInternals'>
98679867
<info>Use encoding handler to decode input data. Closes the handler on error.</info>
9868-
<return type='int' info='an xmlParserErrors code.'/>
9868+
<return type='xmlParserErrors' info='an xmlParserErrors code.'/>
98699869
<arg name='input' type='xmlParserInputPtr' info='the input stream'/>
98709870
<arg name='handler' type='xmlCharEncodingHandlerPtr' info='the encoding handler'/>
98719871
</function>
@@ -10168,7 +10168,7 @@ crash if you try to modify the tree)'/>
1016810168
</function>
1016910169
<function name='xmlLookupCharEncodingHandler' file='encoding' module='encoding'>
1017010170
<info>Find or create a handler matching the encoding. The following converters are looked up in order: - Built-in handler (UTF-8, UTF-16, ISO-8859-1, ASCII) - User-registered global handler (deprecated) - iconv if enabled - ICU if enabled The handler must be closed with xmlCharEncCloseFunc. If the encoding is UTF-8, a NULL handler and no error code will be returned. Available since 2.13.0.</info>
10171-
<return type='int' info='XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another xmlParserErrors error code.'/>
10171+
<return type='xmlParserErrors' info='XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another xmlParserErrors error code.'/>
1017210172
<arg name='enc' type='xmlCharEncoding' info='an xmlCharEncoding value.'/>
1017310173
<arg name='out' type='xmlCharEncodingHandler **' info='pointer to result'/>
1017410174
</function>
@@ -10619,7 +10619,7 @@ crash if you try to modify the tree)'/>
1061910619
</function>
1062010620
<function name='xmlNewInputFromUrl' file='parser' module='parserInternals'>
1062110621
<info>Create a new input stream based on a file or a URL. The flag XML_INPUT_UNZIP allows decompression. The flag XML_INPUT_NETWORK allows network access. The following resource loaders will be called if they were registered (in order of precedence): - the per-thread xmlParserInputBufferCreateFilenameFunc set with xmlParserInputBufferCreateFilenameDefault (deprecated) - the default loader which will return - the result from a matching global input callback set with xmlRegisterInputCallbacks (deprecated) - a HTTP resource if support is compiled in. - a file opened from the filesystem, with automatic detection of compressed files if support is compiled in. Available since 2.14.0.</info>
10622-
<return type='int' info='an xmlParserErrors code.'/>
10622+
<return type='xmlParserErrors' info='an xmlParserErrors code.'/>
1062310623
<arg name='filename' type='const char *' info='the filename to use as entity'/>
1062410624
<arg name='flags' type='xmlParserInputFlags' info='XML_INPUT flags'/>
1062510625
<arg name='out' type='xmlParserInputPtr *' info='pointer to new parser input'/>
@@ -10947,7 +10947,7 @@ crash if you try to modify the tree)'/>
1094710947
</function>
1094810948
<function name='xmlOpenCharEncodingHandler' file='encoding' module='encoding'>
1094910949
<info>Find or create a handler matching the encoding. The following converters are looked up in order: - Built-in handler (UTF-8, UTF-16, ISO-8859-1, ASCII) - User-registered global handler (deprecated) - iconv if enabled - ICU if enabled The handler must be closed with xmlCharEncCloseFunc. If the encoding is UTF-8, a NULL handler and no error code will be returned. Available since 2.13.0.</info>
10950-
<return type='int' info='XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another xmlParserErrors error code.'/>
10950+
<return type='xmlParserErrors' info='XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another xmlParserErrors error code.'/>
1095110951
<arg name='name' type='const char *' info='a string describing the char encoding.'/>
1095210952
<arg name='output' type='int' info='boolean, use handler for output'/>
1095310953
<arg name='out' type='xmlCharEncodingHandler **' info='pointer to result'/>
@@ -12275,7 +12275,7 @@ crash if you try to modify the tree)'/>
1227512275
</function>
1227612276
<functype name='xmlResourceLoader' file='parser' module='parser'>
1227712277
<info>Callback for custom resource loaders. @flags can contain XML_INPUT_UNZIP and XML_INPUT_NETWORK. On success, @out should be set to a new parser input object and XML_ERR_OK should be returned.</info>
12278-
<return type='int' info='an xmlParserError code.'/>
12278+
<return type='xmlParserErrors' info='an xmlParserErrors code.'/>
1227912279
<arg name='ctxt' type='void *' info='parser context'/>
1228012280
<arg name='url' type='const char *' info='URL to load'/>
1228112281
<arg name='publicId' type='const char *' info='publid ID from DTD (optional)'/>
@@ -12628,7 +12628,7 @@ crash if you try to modify the tree)'/>
1262812628
<function name='xmlSaveFinish' file='xmlsave' module='xmlsave'>
1262912629
<cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
1263012630
<info>Close a document saving context, i.e. make sure that all bytes have been output and free the associated data. Available since 2.13.0.</info>
12631-
<return type='int' info='an xmlParserErrors code.'/>
12631+
<return type='xmlParserErrors' info='an xmlParserErrors code.'/>
1263212632
<arg name='ctxt' type='xmlSaveCtxtPtr' info='a document saving context'/>
1263312633
</function>
1263412634
<function name='xmlSaveFlush' file='xmlsave' module='xmlsave'>

0 commit comments

Comments
 (0)