/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 2003-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* character codeset coder
*/
#include <codex.h>
#include <iconv.h>
typedef struct State_s
{
char* bp;
} State_t;
static int
{
register const char* p;
register int c;
{
if (*p == '(')
p++;
while (c = *p++)
{
if (c == ')' && !*p)
break;
if (c == '?' || c == ']')
}
while (c = *p++)
{
if (c == ']')
}
}
return 0;
}
static int
{
const char* src;
const char* dst;
if (flags & CODEX_DECODE)
{
if (!src)
{
return -1;
}
}
else
{
if (!src)
{
(*p->disc->errorf)(NiL, p->disc, 2, "%s: destination codeset option must be specified", p->meth->name);
return -1;
}
if (!dst)
{
src = 0;
}
}
{
{
{
return -1;
}
{
return -1;
}
}
return -1;
}
{
return 0;
}
return 0;
}
static int
{
int r;
if (!state)
r = -1;
else
{
}
return r;
}
static ssize_t
{
char* fb;
char* tb;
ssize_t r;
if (n < fn)
fn = n;
tn = n;
n = 0;
{
{
if (!n)
n = -1;
break;
}
n += r;
}
{
while (fn--)
}
return n;
}
static ssize_t
{
char* fb;
char* tb;
size_t r;
fn = n;
n = 0;
while (fn > 0)
{
return n ? n : -1;
n += r;
return n ? n : -1;
}
return n;
}
static int
{
mbinit();
return 0;
}
{
"iconv",
"iconv character codeset conversion. One or two character codeset"
" options must be specified. Two options specify the source and"
" destination codesets. One option specifies the decode source or"
" encode destination codeset; the implied second codeset defaults"
" to \bnative\b.",
"[+(version)?codex-iconv (AT&T Research) 2000-05-09]"
"[+(author)?Glenn Fowler <gsf@research.att.com>]",
0,
0,
0,
0,
0,
};