You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2001/06/28 07:54:26 UTC
cvs commit: apr-iconv/util iconv.c iconv_stream.c iconv_stream.h
wrowe 01/06/27 22:54:25
Modified: ces _tbl_simple.c iso-10646-ucs-2.c iso-10646-ucs-4.c
ucs2-internal.c ucs4-internal.c unicode-1-1-utf-7.c
utf-16.c utf-8.c
util iconv.c iconv_stream.c iconv_stream.h
Log:
More aprization
Revision Changes Path
1.5 +5 -5 apr-iconv/ces/_tbl_simple.c
Index: _tbl_simple.c
===================================================================
RCS file: /home/cvs/apr-iconv/ces/_tbl_simple.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- _tbl_simple.c 2001/06/21 12:24:07 1.4
+++ _tbl_simple.c 2001/06/28 05:54:14 1.5
@@ -72,13 +72,13 @@
return res == 16 ? 0 : (res > 8 ? 2 : 1);
}
-static ssize_t
+static apr_ssize_t
convert_from_ucs(struct iconv_ces *ces, ucs_t in,
- unsigned char **outbuf, size_t *outbytesleft)
+ unsigned char **outbuf, apr_size_t *outbytesleft)
{
struct iconv_ccs_desc *ccsd = ces->data;
ucs_t res;
- size_t bytes;
+ apr_size_t bytes;
if (in == UCS_CHAR_NONE)
return 1; /* No state reinitialization for table charsets */
@@ -99,12 +99,12 @@
static ucs_t
convert_to_ucs(struct iconv_ces *ces, const unsigned char **inbuf,
- size_t *inbytesleft)
+ apr_size_t *inbytesleft)
{
struct iconv_ccs_desc *ccsd = ces->data;
unsigned char byte = *(*inbuf);
ucs_t res = ICONV_CCS_CONVERT_TO_UCS(ccsd, byte);
- size_t bytes = (res == UCS_CHAR_INVALID && table_nbits(ces) > 8) ? 2 : 1;
+ apr_size_t bytes = (res == UCS_CHAR_INVALID && table_nbits(ces) > 8) ? 2 : 1;
if (*inbytesleft < bytes)
return UCS_CHAR_NONE; /* Not enough bytes in the input buffer */
1.3 +4 -4 apr-iconv/ces/iso-10646-ucs-2.c
Index: iso-10646-ucs-2.c
===================================================================
RCS file: /home/cvs/apr-iconv/ces/iso-10646-ucs-2.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- iso-10646-ucs-2.c 2001/03/24 04:06:22 1.2
+++ iso-10646-ucs-2.c 2001/06/28 05:54:14 1.3
@@ -45,11 +45,11 @@
return names;
}
-static ssize_t
+static apr_ssize_t
convert_from_ucs(struct iconv_ces *ces, ucs_t in,
- unsigned char **outbuf, size_t *outbytesleft)
+ unsigned char **outbuf, apr_size_t *outbytesleft)
{
- size_t bytes;
+ apr_size_t bytes;
int *state = ces->data;
if (in == UCS_CHAR_NONE)
@@ -78,7 +78,7 @@
static ucs_t
convert_to_ucs(struct iconv_ces *ces, const unsigned char **inbuf,
- size_t *inbytesleft)
+ apr_size_t *inbytesleft)
{
ucs_t res;
int *state = ces->data;
1.3 +3 -3 apr-iconv/ces/iso-10646-ucs-4.c
Index: iso-10646-ucs-4.c
===================================================================
RCS file: /home/cvs/apr-iconv/ces/iso-10646-ucs-4.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- iso-10646-ucs-4.c 2001/03/24 04:06:22 1.2
+++ iso-10646-ucs-4.c 2001/06/28 05:54:15 1.3
@@ -45,9 +45,9 @@
return names;
}
-static ssize_t
+static apr_ssize_t
convert_from_ucs(struct iconv_ces *ces, ucs_t in,
- unsigned char **outbuf, size_t *outbytesleft)
+ unsigned char **outbuf, apr_size_t *outbytesleft)
{
int *state = (int*)ces->data;
int bytes;
@@ -80,7 +80,7 @@
static ucs_t
convert_to_ucs(struct iconv_ces *ces,
- const unsigned char **inbuf, size_t *inbytesleft)
+ const unsigned char **inbuf, apr_size_t *inbytesleft)
{
ucs_t res;
int *state = (int*)ces->data;
1.3 +3 -3 apr-iconv/ces/ucs2-internal.c
Index: ucs2-internal.c
===================================================================
RCS file: /home/cvs/apr-iconv/ces/ucs2-internal.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ucs2-internal.c 2001/03/24 04:06:22 1.2
+++ ucs2-internal.c 2001/06/28 05:54:15 1.3
@@ -49,9 +49,9 @@
return sizeof(ucs2_t);
}
-static ssize_t
+static apr_ssize_t
convert_from_ucs(struct iconv_ces *ces, ucs_t in,
- unsigned char **outbuf, size_t *outbytesleft)
+ unsigned char **outbuf, apr_size_t *outbytesleft)
{
if (in == UCS_CHAR_NONE)
return 1; /* No state reinitialization for table charsets */
@@ -66,7 +66,7 @@
static ucs_t
convert_to_ucs(struct iconv_ces *ces,
- const unsigned char **inbuf, size_t *inbytesleft)
+ const unsigned char **inbuf, apr_size_t *inbytesleft)
{
if (*inbytesleft < sizeof(ucs2_t))
return UCS_CHAR_NONE; /* Not enough bytes in the input buffer */
1.3 +3 -3 apr-iconv/ces/ucs4-internal.c
Index: ucs4-internal.c
===================================================================
RCS file: /home/cvs/apr-iconv/ces/ucs4-internal.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ucs4-internal.c 2001/03/24 04:06:22 1.2
+++ ucs4-internal.c 2001/06/28 05:54:16 1.3
@@ -49,9 +49,9 @@
return sizeof(ucs4_t);
}
-static ssize_t
+static apr_ssize_t
convert_from_ucs(struct iconv_ces *ces, ucs_t in,
- unsigned char **outbuf, size_t *outbytesleft)
+ unsigned char **outbuf, apr_size_t *outbytesleft)
{
if (in == UCS_CHAR_NONE)
return 1; /* No state reinitialization for table charsets */
@@ -64,7 +64,7 @@
static ucs_t
convert_to_ucs(struct iconv_ces *ces,
- const unsigned char **inbuf, size_t *inbytesleft)
+ const unsigned char **inbuf, apr_size_t *inbytesleft)
{
if (*inbytesleft < sizeof(ucs4_t))
return UCS_CHAR_NONE; /* Not enough bytes in the input buffer */
1.3 +4 -4 apr-iconv/ces/unicode-1-1-utf-7.c
Index: unicode-1-1-utf-7.c
===================================================================
RCS file: /home/cvs/apr-iconv/ces/unicode-1-1-utf-7.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- unicode-1-1-utf-7.c 2001/03/24 04:06:22 1.2
+++ unicode-1-1-utf-7.c 2001/06/28 05:54:16 1.3
@@ -48,7 +48,7 @@
}
static APR_INLINE int
-lackofbytes(int bytes, size_t *bytesleft)
+lackofbytes(int bytes, apr_size_t *bytesleft)
{
if (bytes > *bytesleft)
return 1;
@@ -120,9 +120,9 @@
utf7_encoded;
}
-static ssize_t
+static apr_ssize_t
convert_from_ucs(struct iconv_ces *module, ucs_t in,
- unsigned char **outbuf, size_t *outbytesleft)
+ unsigned char **outbuf, apr_size_t *outbytesleft)
{
#define utf7_state ((char *)(module->data))
int ch = char_type(in), needbytes = 3;
@@ -229,7 +229,7 @@
}
static ucs_t convert_to_ucs(struct iconv_ces *module,
- const unsigned char **inbuf, size_t *inbytesleft)
+ const unsigned char **inbuf, apr_size_t *inbytesleft)
{
#define utf7_state ((char *)(module->data))
int ch = char_type(*(unsigned char *)*inbuf), needbytes = 0;
1.4 +3 -3 apr-iconv/ces/utf-16.c
Index: utf-16.c
===================================================================
RCS file: /home/cvs/apr-iconv/ces/utf-16.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- utf-16.c 2001/06/21 12:24:08 1.3
+++ utf-16.c 2001/06/28 05:54:17 1.4
@@ -43,9 +43,9 @@
return names;
}
-static ssize_t
+static apr_ssize_t
convert_from_ucs(struct iconv_ces *ces, ucs_t in,
- unsigned char **outbuf, size_t *outbytesleft)
+ unsigned char **outbuf, apr_size_t *outbytesleft)
{
unsigned char *cp;
int *state = (int *)ces->data;
@@ -86,7 +86,7 @@
static ucs_t
convert_to_ucs(struct iconv_ces *ces,
- const unsigned char **inbuf, size_t *inbytesleft)
+ const unsigned char **inbuf, apr_size_t *inbytesleft)
{
ucs_t res, res2;
int *state = (int *)ces->data;
1.3 +3 -3 apr-iconv/ces/utf-8.c
Index: utf-8.c
===================================================================
RCS file: /home/cvs/apr-iconv/ces/utf-8.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- utf-8.c 2001/03/30 17:20:50 1.2
+++ utf-8.c 2001/06/28 05:54:17 1.3
@@ -46,9 +46,9 @@
#define cont_byte(b) (((b) & 0x3F) | 0x80)
-static ssize_t
+static apr_ssize_t
convert_from_ucs(struct iconv_ces *ces, ucs_t in,
- unsigned char **outbuf, size_t *outbytesleft)
+ unsigned char **outbuf, apr_size_t *outbytesleft)
{
unsigned char *cp;
int n;
@@ -94,7 +94,7 @@
static ucs_t
convert_to_ucs(struct iconv_ces *ces,
- const unsigned char **inbuf, size_t *inbytesleft)
+ const unsigned char **inbuf, apr_size_t *inbytesleft)
{
const unsigned char *in = *inbuf;
unsigned char byte = *in++;
1.5 +1 -1 apr-iconv/util/iconv.c
Index: iconv.c
===================================================================
RCS file: /home/cvs/apr-iconv/util/iconv.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- iconv.c 2001/06/21 12:24:19 1.4
+++ iconv.c 2001/06/28 05:54:23 1.5
@@ -44,7 +44,7 @@
convert_stream(FILE *in, iconv_stream *out)
{
static char buffer[4096];
- size_t size;
+ apr_size_t size;
while ((size = fread(buffer, 1, sizeof(buffer), in))) {
if (iconv_bwrite(out, buffer, size) <= 0) {
1.4 +9 -9 apr-iconv/util/iconv_stream.c
Index: iconv_stream.c
===================================================================
RCS file: /home/cvs/apr-iconv/util/iconv_stream.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- iconv_stream.c 2001/06/21 12:24:19 1.3
+++ iconv_stream.c 2001/06/28 05:54:23 1.4
@@ -62,14 +62,14 @@
free(stream);
}
-ssize_t iconv_write(void *handle, const void *buf, size_t insize)
+apr_ssize_t iconv_write(void *handle, const void *buf, apr_size_t insize)
{
#define stream ((iconv_stream *)handle)
char buffer[4096];
- size_t outsize = sizeof(buffer), size;
+ apr_size_t outsize = sizeof(buffer), size;
char *outbuf = buffer;
const char *inbuf = buf;
- size_t chars;
+ apr_size_t chars;
apr_status_t status;
if (!buf)
@@ -80,7 +80,7 @@
stream->chars += chars;
size = outbuf - buffer;
if (size) {
- ssize_t r;
+ apr_ssize_t r;
outbuf = buffer;
while ((r = stream->method(stream->handle, outbuf, size)) < size) {
if (r < 0)
@@ -97,11 +97,11 @@
#undef stream
}
-ssize_t iconv_bwrite(void *handle, const void *buf, size_t insize)
+apr_ssize_t iconv_bwrite(void *handle, const void *buf, apr_size_t insize)
{
#define stream ((iconv_stream *)handle)
- ssize_t res = 0;
- size_t left, size = insize;
+ apr_ssize_t res = 0;
+ apr_size_t left, size = insize;
if (!buf)
return iconv_write(handle, NULL, 0);
if (stream->buffer && stream->buf_ptr > stream->buffer) {
@@ -158,9 +158,9 @@
#undef stream
}
-static ssize_t fwrite_wrapper(void *handle, void *buf, size_t size)
+static apr_ssize_t fwrite_wrapper(void *handle, void *buf, apr_size_t size)
{
- size_t res = fwrite(buf, 1, size, (FILE *)handle);
+ apr_size_t res = fwrite(buf, 1, size, (FILE *)handle);
return (res && !ferror((FILE *)handle)) ? res : -1;
}
1.3 +6 -7 apr-iconv/util/iconv_stream.h
Index: iconv_stream.h
===================================================================
RCS file: /home/cvs/apr-iconv/util/iconv_stream.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- iconv_stream.h 2001/04/04 17:29:02 1.2
+++ iconv_stream.h 2001/06/28 05:54:24 1.3
@@ -1,17 +1,16 @@
#ifndef _ICONV_STREAM_H_
#define _ICONV_STREAM_H_
-#include <sys/types.h> /* size_t, ssize_t */
#include <stdio.h> /* FILE */
#include "iconv.h" /* iconv_t */
-typedef ssize_t (*iconv_stream_func)(void *d, void *buf, size_t nbytes);
+typedef apr_ssize_t (*iconv_stream_func)(void *d, void *buf, apr_size_t nbytes);
typedef struct {
iconv_t cd;
- size_t chars;
- size_t in_bytes;
- size_t out_bytes;
+ apr_size_t chars;
+ apr_size_t in_bytes;
+ apr_size_t out_bytes;
char * buffer;
char * buf_ptr;
void * handle;
@@ -24,7 +23,7 @@
iconv_stream *iconv_ostream_fopen(iconv_t cd, FILE *handle);
-ssize_t iconv_write(void *stream, const void *buf, size_t nbytes);
-ssize_t iconv_bwrite(void *stream, const void *buf, size_t nbytes);
+apr_ssize_t iconv_write(void *stream, const void *buf, apr_size_t nbytes);
+apr_ssize_t iconv_bwrite(void *stream, const void *buf, apr_size_t nbytes);
#endif /*_ICONV_STREAM_H_*/