wrowe 2002/06/08 11:53:13
Modified: include apr_xlate.h
i18n/unix xlate.c
passwd apr_md5.c
Log:
renames for apr_xlate_sb_get, which was far more complicated.
It seems we are relying more and more on link entry points. We really
can't be going about macroizing out NOTIMPL cases, since there is no way
to later pick up the features when you replace with the same library
built for support of a given feature, or swap it out later.
So all platforms need to include unix/xlate.c with #define APR_HAS_XLATE 0
to at least gain the ENOTIMPL entry points.
Revision Changes Path
1.18 +6 -34 apr/include/apr_xlate.h
Index: apr_xlate.h
===================================================================
RCS file: /home/cvs/apr/include/apr_xlate.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- apr_xlate.h 13 Mar 2002 20:39:15 -0000 1.17
+++ apr_xlate.h 8 Jun 2002 18:53:13 -0000 1.18
@@ -82,7 +82,6 @@
* APR_ENOTIMPL at run-time.
*/
-#if APR_HAS_XLATE
typedef struct apr_xlate_t apr_xlate_t;
/**
@@ -130,7 +129,12 @@
* parameters of conversion
* @param onoff Output: whether or not the conversion is single-byte-only
*/
-APR_DECLARE(apr_status_t) apr_xlate_get_sb(apr_xlate_t *convset, int *onoff);
+APR_DECLARE(apr_status_t) apr_xlate_sb_get(apr_xlate_t *convset, int *onoff);
+
+/**
+ * Deprecated: Use apr_xlate_sb_get()
+ */
+APR_DECLARE(void) apr_xlate_get_sb(apr_xlate_t *convset, int *onoff);
/**
* Convert a buffer of text from one codepage to another.
@@ -180,38 +184,6 @@
* @param convset The codepage translation handle to close
*/
APR_DECLARE(apr_status_t) apr_xlate_close(apr_xlate_t *convset);
-
-#else
-/**
- * handle for the Translation routines
- * (currently not implemented)
- */
-typedef void apr_xlate_t;
-
-/**
- * For platforms where we don't bother with translating between charsets,
- * these are macros which always return failure.
- */
-
-#define apr_xlate_open(convset, topage, frompage, pool) APR_ENOTIMPL
-
-#define apr_xlate_get_sb(convset, onoff) APR_ENOTIMPL
-
-#define apr_xlate_conv_buffer(convset, inbuf, inbytes_left, outbuf, \
- outbytes_left) APR_ENOTIMPL
-
-#define apr_xlate_conv_byte(convset, inchar) (-1)
-
-/**
- * The purpose of apr_xlate_conv_char is to translate one character
- * at a time. This needs to be written carefully so that it works
- * with double-byte character sets.
- */
-#define apr_xlate_conv_char(convset, inchar, outchar) APR_ENOTIMPL
-
-#define apr_xlate_close(convset) APR_ENOTIMPL
-
-#endif /* ! APR_HAS_XLATE */
/** @} */
#ifdef __cplusplus
1.26 +43 -1 apr/i18n/unix/xlate.c
Index: xlate.c
===================================================================
RCS file: /home/cvs/apr/i18n/unix/xlate.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- xlate.c 16 Apr 2002 20:25:57 -0000 1.25
+++ xlate.c 8 Jun 2002 18:53:13 -0000 1.26
@@ -276,7 +276,7 @@
return status;
}
-apr_status_t apr_xlate_get_sb(apr_xlate_t *convset, int *onoff)
+apr_status_t apr_xlate_sb_get(apr_xlate_t *convset, int *onoff)
{
*onoff = convset->sbcs_table != NULL;
return APR_SUCCESS;
@@ -360,4 +360,46 @@
return apr_pool_cleanup_run(convset->pool, convset, apr_xlate_cleanup);
}
+#else /* !APR_HAS_XLATE */
+
+APR_DECLARE(apr_status_t) apr_xlate_open(apr_xlate_t **convset,
+ const char *topage,
+ const char *frompage,
+ apr_pool_t *pool)
+{
+ return APR_ENOTIMPL;
+}
+
+APR_DECLARE(apr_status_t) apr_xlate_sb_get(apr_xlate_t *convset, int *onoff)
+{
+ return APR_ENOTIMPL;
+}
+
+APR_DECLARE(apr_int32_t) apr_xlate_conv_byte(apr_xlate_t *convset,
+ unsigned char inchar)
+{
+ return (-1);
+}
+
+APR_DECLARE(apr_status_t) apr_xlate_conv_buffer(apr_xlate_t *convset,
+ const char *inbuf,
+ apr_size_t *inbytes_left,
+ char *outbuf,
+ apr_size_t *outbytes_left)
+{
+ return APR_ENOTIMPL;
+}
+
+APR_DECLARE(apr_status_t) apr_xlate_close(apr_xlate_t *convset)
+{
+ return APR_ENOTIMPL;
+}
+
#endif /* APR_HAS_XLATE */
+
+/* Deprecated
+ */
+APR_DECLARE(apr_status_t) apr_xlate_get_sb(apr_xlate_t *convset, int *onoff)
+{
+ return apr_xlate_sb_get(convset, onoff);
+}
1.20 +1 -1 apr/passwd/apr_md5.c
Index: apr_md5.c
===================================================================
RCS file: /home/cvs/apr/passwd/apr_md5.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- apr_md5.c 10 May 2002 20:28:32 -0000 1.19
+++ apr_md5.c 8 Jun 2002 18:53:13 -0000 1.20
@@ -216,7 +216,7 @@
/* TODO: remove the single-byte-only restriction from this code
*/
- rv = apr_xlate_get_sb(xlate, &is_sb);
+ rv = apr_xlate_sb_get(xlate, &is_sb);
if (rv != APR_SUCCESS) {
return rv;
}