/usr/share/ada/adainclude/gnatcoll_iconv/iconv_support.c is in libgnatcoll-iconv1.7-dev 1.7gpl2015-2+b3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | /*
* Iconv binding support
* Copyright (C) 2012-2015, AdaCore
*/
#include <iconv.h>
#include <errno.h>
#include <locale.h>
const int gnatcoll_errno_einval = EINVAL;
const int gnatcoll_errno_e2big = E2BIG;
const int gnatcoll_errno_eilseq = EILSEQ;
void gnatcoll_iconv_set_locale(){
setlocale (LC_ALL, "");
}
void *gnatcoll_iconv_open(char *tocode, char *fromcode){
iconv_t res = iconv_open(tocode, fromcode);
return (res == (iconv_t) -1) ? NULL : res;
}
int gnatcoll_iconv_close(iconv_t cd) {
// iconv_close might be a macro
return iconv_close (cd);
}
#if _LIBICONV_VERSION >= 0x010D
size_t gnatcoll_iconv
(iconv_t cd, const char** inbuf, size_t *inbytesleft, char** outbuf,
size_t *outbytesleft)
#else
size_t gnatcoll_iconv
(iconv_t cd, char** inbuf, size_t *inbytesleft, char** outbuf,
size_t *outbytesleft)
#endif
{
// iconv might be a macro
return iconv(cd, inbuf, inbytesleft, outbuf, outbytesleft);
}
|