diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2008-11-19 15:30:46 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2008-11-19 15:30:46 +0000 |
commit | 8d94751a807c93fe8f2338f941c5d360aa6402f4 (patch) | |
tree | d2b3708c82209faf88c6773952a35376faeaa192 /module | |
parent | 5999efa3acaaa27764e5899a4329ecc50d4b4c7f (diff) | |
download | iconv-8d94751a807c93fe8f2338f941c5d360aa6402f4.tar.gz iconv-8d94751a807c93fe8f2338f941c5d360aa6402f4.tar.bz2 |
Move the declarations of iconv_initialise/iconv_finalise to a different header.
This keeps the public iconv.h free of such nonsense.
Move the source for the RISC OS stubs to the distribution template tree.
We will no longer shipped compiled stubs. People are quite capable of compiling this themselves. Also take the opportunity to tidy it up a bit.
Bump the version number to 0.09
Introduce a "riscos-dist" target in Makefile-riscos.
Update various bits of documentation.
svn path=/trunk/iconv/; revision=5734
Diffstat (limited to 'module')
-rw-r--r-- | module/header.cmhg | 2 | ||||
-rw-r--r-- | module/header.h | 6 | ||||
-rw-r--r-- | module/module.c | 2 | ||||
-rw-r--r-- | module/stubs.c | 102 |
4 files changed, 5 insertions, 107 deletions
diff --git a/module/header.cmhg b/module/header.cmhg index 63dbc3e..b7386ee 100644 --- a/module/header.cmhg +++ b/module/header.cmhg @@ -1,4 +1,4 @@ -help-string: Iconv 0.08 +help-string: Iconv 0.09 title-string: Iconv diff --git a/module/header.h b/module/header.h index 0678cd7..8eda6ee 100644 --- a/module/header.h +++ b/module/header.h @@ -11,10 +11,10 @@ #define Module_Title "Iconv" #define Module_Help "Iconv" -#define Module_VersionString "0.08" -#define Module_VersionNumber 8 +#define Module_VersionString "0.09" +#define Module_VersionNumber 9 #ifndef Module_Date -#define Module_Date "11 Nov 2008" +#define Module_Date "19 Nov 2008" #endif #ifdef __cplusplus diff --git a/module/module.c b/module/module.c index 0631551..417418c 100644 --- a/module/module.c +++ b/module/module.c @@ -6,7 +6,7 @@ #include <stdlib.h> #include <string.h> -#include <iconv/iconv.h> +#include <iconv-internal/iconv.h> #include "errors.h" #include "header.h" diff --git a/module/stubs.c b/module/stubs.c deleted file mode 100644 index 96dee4b..0000000 --- a/module/stubs.c +++ /dev/null @@ -1,102 +0,0 @@ -/* Iconv stubs */ - -#include <errno.h> - -#include <sys/errno.h> - -#include "swis.h" - -#include "errors.h" /* for error numbers */ -#include "header.h" /* for SWI numbers */ -#include "iconv.h" - -iconv_t iconv_open(const char *tocode, const char *fromcode) -{ - iconv_t ret; - _kernel_oserror *error; - - error = _swix(Iconv_Open, _INR(0,1) | _OUT(0), tocode, fromcode, &ret); - if (error) { - switch (error->errnum) { - case ICONV_NOMEM: - errno = ENOMEM; - break; - case ICONV_INVAL: - errno = EINVAL; - break; - case ICONV_2BIG: - errno = E2BIG; - break; - case ICONV_ILSEQ: - errno = EILSEQ; - break; - default: - errno = EINVAL; /* munge BAD_SWI to EINVAL */ - break; - } - return (iconv_t)(-1); - } - - return ret; -} - -size_t iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, - size_t *outbytesleft) -{ - size_t ret; - _kernel_oserror *error; - - error = _swix(Iconv_Iconv, _INR(0,4) | _OUT(0), cd, inbuf, inbytesleft, outbuf, outbytesleft, &ret); - if (error) { - switch (error->errnum) { - case ICONV_NOMEM: - errno = ENOMEM; - break; - case ICONV_INVAL: - errno = EINVAL; - break; - case ICONV_2BIG: - errno = E2BIG; - break; - case ICONV_ILSEQ: - errno = EILSEQ; - break; - default: - errno = EINVAL; /* munge BAD_SWI to EINVAL */ - break; - } - return (size_t)(-1); - } - - return ret; -} - -int iconv_close(iconv_t cd) -{ - int ret; - _kernel_oserror *error; - - error = _swix(Iconv_Close, _IN(0) | _OUT(0), cd, &ret); - if (error) { - switch (error->errnum) { - case ICONV_NOMEM: - errno = ENOMEM; - break; - case ICONV_INVAL: - errno = EINVAL; - break; - case ICONV_2BIG: - errno = E2BIG; - break; - case ICONV_ILSEQ: - errno = EILSEQ; - break; - default: - errno = EINVAL; /* munge BAD_SWI to EINVAL */ - break; - } - return -1; - } - - return ret; -} |