kfogel 2002/07/19 13:05:26
Modified: include apr_xlate.h
xlate xlate.c
Log:
* apr-util/xlate/xlate.c
(apr_xlate_open, apr_xlate_cleanup): Return APR_EINVAL where used to
return EINVAL.
* apr-util/include/apr_xlate.h
(apr_xlate_open, apr_xlate_sb_get, apr_xlate_conv_buffer,
apr_xlate_close): Document error return case.
Revision Changes Path
1.4 +14 -0 apr-util/include/apr_xlate.h
Index: apr_xlate.h
===================================================================
RCS file: /home/cvs/apr-util/include/apr_xlate.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- apr_xlate.h 19 Jul 2002 08:32:56 -0000 1.3
+++ apr_xlate.h 19 Jul 2002 20:05:26 -0000 1.4
@@ -95,6 +95,11 @@
* @remark
* Specify APR_LOCALE_CHARSET for one of the charset
* names to indicate the charset of the current locale.
+ *
+ * @remark
+ * Return APR_EINVAL if unable to procure a convset, or APR_ENOTIMPL
+ * if charset transcoding is not available in this instance of
+ * apr-util at all (i.e., APR_HAS_XLATE is undefined).
* </PRE>
*/
APU_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset,
@@ -120,6 +125,9 @@
* @param convset The handle allocated by apr_xlate_open, specifying the
* parameters of conversion
* @param onoff Output: whether or not the conversion is single-byte-only
+ * @remark
+ * Return APR_ENOTIMPL if charset transcoding is not available
+ * in this instance of apr-util (i.e., APR_HAS_XLATE is undefined).
*/
APU_DECLARE(apr_status_t) apr_xlate_sb_get(apr_xlate_t *convset, int *onoff);
@@ -136,6 +144,9 @@
* @param outbuf The address of the destination buffer
* @param outbytes_left Input: the size of the output buffer
* Output: the amount of the output buffer not yet used
+ * @remark
+ * Return APR_ENOTIMPL if charset transcoding is not available
+ * in this instance of apr-util (i.e., APR_HAS_XLATE is undefined).
*/
APU_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset,
const char *inbuf,
@@ -172,6 +183,9 @@
/**
* Close a codepage translation handle.
* @param convset The codepage translation handle to close
+ * @remark
+ * Return APR_ENOTIMPL if charset transcoding is not available
+ * in this instance of apr-util (i.e., APR_HAS_XLATE is undefined).
*/
APU_DECLARE(apr_status_t) apr_xlate_close(apr_xlate_t *convset);
1.8 +4 -4 apr-util/xlate/xlate.c
Index: xlate.c
===================================================================
RCS file: /home/cvs/apr-util/xlate/xlate.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- xlate.c 19 Jul 2002 17:08:40 -0000 1.7
+++ xlate.c 19 Jul 2002 20:05:26 -0000 1.8
@@ -187,7 +187,7 @@
if (iconv_(_close)(old->ich)) {
int rv = errno;
/* Sometimes, iconv is not good about setting errno. */
- return rv ? rv : EINVAL;
+ return rv ? rv : APR_EINVAL;
}
}
#endif
@@ -284,7 +284,7 @@
if (new->ich == (iconv_(_t))-1) {
int rv = errno;
/* Sometimes, iconv is not good about setting errno. */
- return rv ? rv : EINVAL;
+ return rv ? rv : APR_EINVAL;
}
found = 1;
check_sbcs(new);
@@ -299,8 +299,8 @@
status = APR_SUCCESS;
}
else {
- status = EINVAL; /* same as what iconv() would return if it
- couldn't handle the pair */
+ status = APR_EINVAL; /* iconv() would return EINVAL if it
+ couldn't handle the pair */
}
return status;