Cross Reference: ccode.h
xref
: /
osnet-11
/
usr
/
src
/
lib
/
libast
/
common
/
include
/
ccode.h
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
ccode.h revision 1
1
N/A
/***********************************************************************
1
N/A
* *
1
N/A
* This software is part of the ast package *
1
N/A
* Copyright (c) 1985-2011 AT&T Intellectual Property *
1
N/A
* and is licensed under the *
1
N/A
* Common Public License, Version 1.0 *
1
N/A
* by AT&T Intellectual Property *
1
N/A
* *
1
N/A
* A copy of the License is available at *
1
N/A
*
http://www.opensource.org/licenses/cpl1.0.txt
*
1
N/A
* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
1
N/A
* *
1
N/A
* Information and Software Systems Research *
1
N/A
* AT&T Research *
1
N/A
* Florham Park NJ *
1
N/A
* *
1
N/A
* Glenn Fowler <gsf@research.att.com> *
1
N/A
* David Korn <dgk@research.att.com> *
1
N/A
* Phong Vo <kpv@research.att.com> *
1
N/A
* *
1
N/A
***********************************************************************/
1
N/A
#
pragma
prototyped
1
N/A
1
N/A
/*
1
N/A
* Glenn Fowler
1
N/A
* AT&T Research
1
N/A
*
1
N/A
* character code map interface
1
N/A
*
1
N/A
* NOTE: used for mapping between 8-bit character encodings
1
N/A
* ISO character sets are handled by sfio
1
N/A
*/
1
N/A
1
N/A
#
ifndef
_CHARCODE_H
1
N/A
#
define
_CHARCODE_H
1
1
N/A
1
N/A
#
include
<
ast_common.h
>
1
N/A
#
include
<
ast_ccode.h
>
1
N/A
1
N/A
typedef
struct
Ccmap_s
1
N/A
{
1
N/A
const
char
*
name
;
/* code set name */
1
N/A
const
char
*
match
;
/* strmatch() pattern */
1
N/A
const
char
*
desc
;
/* code set description */
1
N/A
const
char
*
canon
;
/* canonical name format */
1
N/A
const
char
*
index
;
/* default index */
1
N/A
int
ccode
;
/* <
ccode.h
> code index */
1
N/A
void
*
data
;
/* map specific data */
1
N/A
}
Ccmap_t
;
1
N/A
1
N/A
#
if
_BLD_ast
&&
defined
(
__EXPORT__
)
1
N/A
#
define
extern
__EXPORT__
1
N/A
#
endif
1
N/A
1
N/A
extern
unsigned
char
*
_ccmap
(
int
,
int
);
1
N/A
extern
void
*
_ccmapcpy
(
unsigned
char
*,
void
*,
const
void
*,
size_t
);
1
N/A
extern
void
*
_ccmapstr
(
unsigned
char
*,
void
*,
size_t
);
1
N/A
1
N/A
extern
int
ccmapid
(
const
char
*);
1
N/A
extern
char
*
ccmapname
(
int
);
1
N/A
extern
void
*
ccnative
(
void
*,
const
void
*,
size_t
);
1
N/A
extern
Ccmap_t
*
ccmaplist
(
Ccmap_t
*);
1
N/A
1
N/A
#
undef
extern
1
N/A
1
N/A
#
define
CCOP
(i,o) ((i)==(o)?0:(((o)<<
8
)|(i)))
1
N/A
#
define
CCIN
(x) ((x)&
0xFF
)
1
N/A
#
define
CCOUT
(x) (((x)>>
8
)&
0xFF
)
1
N/A
#
define
CCCONVERT
(x) ((x)&
0xFF00
)
1
N/A
1
N/A
#
define
CCCVT
(x)
CCMAP
(x,0)
1
N/A
#
define
CCMAP
(i,o) ((i)==(o)?(
unsigned
char
*)0:
_ccmap
(i,o))
1
N/A
#
define
CCMAPCHR
(m,c) ((m)?(m)[c]:(c))
1
N/A
#
define
CCMAPCPY
(m,t,f,n) ((m)?
_ccmapcpy
(m,t,f,n):
memcpy
(t,f,n))
1
N/A
#
define
CCMAPSTR
(m,s,n) ((m)?
_ccmapstr
(m,s,n):(
void
*)(s))
1
N/A
1
N/A
#
define
ccmap
(i,o)
CCMAP
(i,o)
1
N/A
#
define
ccmapchr
(m,c)
CCMAPCHR
(m,c)
1
N/A
#
define
ccmapcpy
(m,t,f,n)
CCMAPCPY
(m,t,f,n)
1
N/A
#
define
ccmapstr
(m,s,n)
CCMAPSTR
(m,s,n)
1
N/A
1
N/A
#
define
CCMAPC
(c,i,o) ((i)==(o)?(c):
CCMAP
(i,o)[c])
1
N/A
#
define
CCMAPM
(t,f,n,i,o) ((i)==(o)?
memcpy
(t,f,n):
_ccmapcpy
(
CCMAP
(i,o),t,f,n))
1
N/A
#
define
CCMAPS
(s,n,i,o) ((i)==(o)?(
void
*)(s):
_ccmapstr
(
CCMAP
(i,o),s,n))
1
N/A
1
N/A
#
define
ccmapc
(c,i,o)
CCMAPC
(c,i,o)
1
N/A
#
define
ccmapm
(t,f,n,i,o)
CCMAPM
(t,f,n,i,o)
1
N/A
#
define
ccmaps
(s,n,i,o)
CCMAPS
(s,n,i,o)
1
N/A
1
N/A
#
endif