forked from KolibriOS/kolibrios
delete libraries/newlib
git-svn-id: svn://kolibrios.org@4356 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
b920e42ea8
commit
1733516bb5
@ -1,435 +0,0 @@
|
||||
|
||||
CC = gcc
|
||||
AR = ar rc
|
||||
LD = ld
|
||||
|
||||
CFLAGS = -c -O2 -fomit-frame-pointer -DBUILD_DLL
|
||||
LDFLAGS = -nostdlib -shared -s -T libcdll.lds --output-def libc.orig.def --out-implib libc.dll.a --image-base 0
|
||||
|
||||
LIBC_TOPDIR = .
|
||||
LIBC_INCLUDES = $(LIBC_TOPDIR)/include
|
||||
|
||||
NAME:= libc
|
||||
|
||||
DEFINES:= -D_IEEE_LIBM
|
||||
|
||||
INCLUDES:= -I $(LIBC_INCLUDES)
|
||||
|
||||
STATIC_SRCS:= \
|
||||
crt/start.S \
|
||||
crt/crt1.c \
|
||||
crt/crt2.c \
|
||||
crt/chkstk.S \
|
||||
crt/exit.S \
|
||||
pe/crtloader.c
|
||||
|
||||
LIBDLL_SRCS:= \
|
||||
crt/dllstart.c \
|
||||
crt/chkstk.S \
|
||||
crt/exit.S \
|
||||
crt/pseudo-reloc.c \
|
||||
crt/setjmp.S
|
||||
|
||||
|
||||
LIBCDLL_SRCS:= \
|
||||
crt/crtdll.c \
|
||||
crt/pseudo-reloc.c \
|
||||
crt/chkstk.S \
|
||||
crt/exit.S \
|
||||
pe/loader.c
|
||||
|
||||
LIBCRT_SRCS:= \
|
||||
crt/start.S \
|
||||
crt/chkstk.S \
|
||||
crt/crt3.c \
|
||||
crt/pseudo-reloc.c \
|
||||
pe/crtloader.c
|
||||
|
||||
CORE_SRCS:= \
|
||||
argz/buf_findstr.c \
|
||||
argz/envz_get.c \
|
||||
crt/emutls.c \
|
||||
crt/thread.S \
|
||||
crt/tls.S \
|
||||
crt/setjmp.S \
|
||||
crt/assert.c \
|
||||
crt/cpu_features.c \
|
||||
ctype/ctype_.c \
|
||||
ctype/isascii.c \
|
||||
ctype/isblank.c \
|
||||
ctype/isalnum.c \
|
||||
ctype/isalpha.c \
|
||||
ctype/iscntrl.c \
|
||||
ctype/isdigit.c \
|
||||
ctype/islower.c \
|
||||
ctype/isupper.c \
|
||||
ctype/isprint.c \
|
||||
ctype/ispunct.c \
|
||||
ctype/isspace.c \
|
||||
ctype/iswctype.c \
|
||||
ctype/iswalnum.c \
|
||||
ctype/iswalpha.c \
|
||||
ctype/iswblank.c \
|
||||
ctype/iswcntrl.c \
|
||||
ctype/iswdigit.c \
|
||||
ctype/iswgraph.c \
|
||||
ctype/iswlower.c \
|
||||
ctype/iswprint.c \
|
||||
ctype/iswpunct.c \
|
||||
ctype/iswspace.c \
|
||||
ctype/iswupper.c \
|
||||
ctype/iswxdigit.c \
|
||||
ctype/isxdigit.c \
|
||||
ctype/toascii.c \
|
||||
ctype/tolower.c \
|
||||
ctype/toupper.c \
|
||||
ctype/towctrans.c \
|
||||
ctype/towlower.c \
|
||||
ctype/towupper.c \
|
||||
ctype/wctrans.c \
|
||||
ctype/wctype.c \
|
||||
errno/errno.c \
|
||||
locale/locale.c \
|
||||
locale/lctype.c \
|
||||
reent/impure.c \
|
||||
reent/init_reent.c \
|
||||
reent/getreent.c \
|
||||
reent/mutex.c \
|
||||
reent/gettimeofdayr.c \
|
||||
reent/hdlman.c \
|
||||
reent/isattyr.c \
|
||||
reent/openr.c \
|
||||
reent/closer.c \
|
||||
reent/readr.c \
|
||||
reent/lseekr.c \
|
||||
reent/fstatr.c \
|
||||
reent/writer.c \
|
||||
search/qsort.c \
|
||||
search/bsearch.c \
|
||||
signal/signal.c \
|
||||
sys/create.c \
|
||||
sys/delete.c \
|
||||
sys/finfo.c \
|
||||
sys/read.c \
|
||||
sys/write.c \
|
||||
sys/fsize.c \
|
||||
time/asctime.c \
|
||||
time/asctime_r.c \
|
||||
time/clock.c \
|
||||
time/ctime.c \
|
||||
time/ctime_r.c \
|
||||
time/difftime.c \
|
||||
time/gettzinfo.c \
|
||||
time/gmtime.c \
|
||||
time/gmtime_r.c \
|
||||
time/mktime.c \
|
||||
time/mktm_r.c \
|
||||
time/lcltime.c \
|
||||
time/lcltime_r.c \
|
||||
time/strftime.c \
|
||||
time/time.c \
|
||||
time/tzlock.c \
|
||||
time/tzvars.c
|
||||
|
||||
|
||||
STDLIB_SRCS= \
|
||||
__atexit.c \
|
||||
__call_atexit.c \
|
||||
abort.c \
|
||||
abs.c \
|
||||
atof.c \
|
||||
atoi.c \
|
||||
atol.c \
|
||||
div.c \
|
||||
dtoa.c \
|
||||
dtoastub.c \
|
||||
exit.c \
|
||||
gdtoa-gethex.c \
|
||||
gdtoa-hexnan.c \
|
||||
getenv.c \
|
||||
mprec.c \
|
||||
mbtowc.c \
|
||||
mbtowc_r.c \
|
||||
mbrtowc.c \
|
||||
mlock.c \
|
||||
calloc.c \
|
||||
malloc.c \
|
||||
mallocr.c \
|
||||
rand.c \
|
||||
rand_r.c \
|
||||
rand48.c \
|
||||
realloc.c \
|
||||
seed48.c \
|
||||
srand48.c \
|
||||
strtod.c \
|
||||
strtol.c \
|
||||
strtold.c \
|
||||
strtoll.c \
|
||||
strtoll_r.c \
|
||||
strtoul.c \
|
||||
strtoull.c \
|
||||
strtoull_r.c \
|
||||
system.c \
|
||||
wcrtomb.c \
|
||||
wctomb_r.c
|
||||
|
||||
|
||||
STRING_SRCS= memcpy.c \
|
||||
memcmp.c \
|
||||
memmove.c \
|
||||
memset.c \
|
||||
memchr.c \
|
||||
stpcpy.c \
|
||||
stpncpy.c \
|
||||
strcat.c \
|
||||
strchr.c \
|
||||
strcmp.c \
|
||||
strcoll.c \
|
||||
strcasecmp.c \
|
||||
strncasecmp.c \
|
||||
strncat.c \
|
||||
strncmp.c \
|
||||
strncpy.c \
|
||||
strndup.c \
|
||||
strndup_r.c \
|
||||
strnlen.c \
|
||||
strcasestr.c \
|
||||
strdup.c \
|
||||
strdup_r.c \
|
||||
strerror.c \
|
||||
strlen.c \
|
||||
strrchr.c \
|
||||
strpbrk.c \
|
||||
strsep.c \
|
||||
strstr.c \
|
||||
strtok.c \
|
||||
strtok_r.c \
|
||||
strupr.c \
|
||||
strcspn.c \
|
||||
strspn.c \
|
||||
strcpy.c \
|
||||
u_strerr.c
|
||||
|
||||
STDIO_SRCS= \
|
||||
clearerr.c \
|
||||
diprintf.c \
|
||||
dprintf.c \
|
||||
printf.c \
|
||||
putchar.c \
|
||||
fgetc.c \
|
||||
fgets.c \
|
||||
fopen.c \
|
||||
fclose.c \
|
||||
fdopen.c \
|
||||
fflush.c \
|
||||
flags.c \
|
||||
fileno.c \
|
||||
findfp.c \
|
||||
fiprintf.c \
|
||||
fiscanf.c \
|
||||
fprintf.c \
|
||||
fputc.c \
|
||||
fputs.c \
|
||||
fputwc.c \
|
||||
fread.c \
|
||||
freopen.c \
|
||||
fscanf.c \
|
||||
fseek.c \
|
||||
fseeko.c \
|
||||
ftell.c \
|
||||
ftello.c \
|
||||
fwrite.c \
|
||||
fvwrite.c \
|
||||
fwalk.c \
|
||||
putc.c \
|
||||
puts.c \
|
||||
refill.c \
|
||||
rget.c \
|
||||
remove.c \
|
||||
rename.c \
|
||||
setvbuf.c \
|
||||
stdio.c \
|
||||
tmpfile.c \
|
||||
tmpnam.c \
|
||||
ungetc.c \
|
||||
vasniprintf.c \
|
||||
vasnprintf.c \
|
||||
vdprintf.c \
|
||||
vdiprintf.c \
|
||||
vscanf.c \
|
||||
vsprintf.c \
|
||||
vsnprintf.c \
|
||||
vsscanf.c \
|
||||
makebuf.c \
|
||||
wsetup.c \
|
||||
wbuf.c \
|
||||
sccl.c \
|
||||
siprintf.c \
|
||||
sniprintf.c \
|
||||
snprintf.c \
|
||||
sprintf.c \
|
||||
sscanf.c
|
||||
|
||||
|
||||
MATH_SRCS = e_acos.c e_acosh.c e_asin.c e_atan2.c e_atanh.c e_cosh.c e_exp.c e_fmod.c \
|
||||
e_hypot.c e_j0.c e_j1.c e_jn.c e_log.c e_log10.c e_pow.c e_rem_pio2.c \
|
||||
e_remainder.c e_scalb.c e_sinh.c e_sqrt.c ef_acos.c ef_acosh.c ef_asin.c \
|
||||
ef_atan2.c ef_atanh.c ef_cosh.c ef_exp.c ef_fmod.c ef_hypot.c ef_j0.c ef_j1.c \
|
||||
ef_jn.c ef_log.c ef_log10.c ef_pow.c ef_rem_pio2.c ef_remainder.c ef_scalb.c \
|
||||
ef_sinh.c ef_sqrt.c er_gamma.c er_lgamma.c erf_gamma.c erf_lgamma.c f_exp.c \
|
||||
f_expf.c f_llrint.c f_llrintf.c f_llrintl.c f_lrint.c f_lrintf.c f_lrintl.c \
|
||||
f_pow.c f_powf.c f_rint.c f_rintf.c f_rintl.c k_cos.c k_rem_pio2.c k_sin.c \
|
||||
k_standard.c k_tan.c kf_cos.c kf_rem_pio2.c kf_sin.c kf_tan.c s_asinh.c \
|
||||
s_atan.c s_cbrt.c s_ceil.c s_copysign.c s_cos.c s_erf.c s_exp10.c s_expm1.c \
|
||||
s_fabs.c s_fdim.c s_finite.c s_floor.c s_fma.c s_fmax.c s_fmin.c s_fpclassify.c \
|
||||
s_frexp.c s_ilogb.c s_infconst.c s_infinity.c s_isinf.c s_isinfd.c s_isnan.c \
|
||||
s_isnand.c s_ldexp.c s_lib_ver.c s_llrint.c s_llround.c s_log1p.c s_log2.c \
|
||||
s_logb.c s_lrint.c s_lround.c s_matherr.c s_modf.c s_nan.c s_nearbyint.c \
|
||||
s_nextafter.c s_pow10.c s_remquo.c s_rint.c s_round.c s_scalbln.c s_scalbn.c \
|
||||
s_signbit.c s_signif.c s_sin.c s_tan.c s_tanh.c s_trunc.c scalblnl.c scalbnl.c \
|
||||
sf_asinh.c sf_atan.c sf_cbrt.c sf_ceil.c sf_copysign.c sf_cos.c sf_erf.c \
|
||||
sf_exp10.c sf_expm1.c sf_fabs.c sf_fdim.c sf_finite.c sf_floor.c sf_fma.c \
|
||||
sf_fmax.c sf_fmin.c sf_fpclassify.c sf_frexp.c sf_ilogb.c sf_infinity.c \
|
||||
sf_isinf.c sf_isinff.c sf_isnan.c sf_isnanf.c sf_ldexp.c sf_llrint.c \
|
||||
sf_llround.c sf_log1p.c sf_log2.c sf_logb.c sf_lrint.c sf_lround.c sf_modf.c \
|
||||
sf_nan.c sf_nearbyint.c sf_nextafter.c sf_pow10.c sf_remquo.c sf_rint.c \
|
||||
sf_round.c sf_scalbln.c sf_scalbn.c sf_signif.c sf_sin.c sf_tan.c sf_tanh.c \
|
||||
sf_trunc.c w_acos.c w_acosh.c w_asin.c w_atan2.c w_atanh.c w_cosh.c w_drem.c \
|
||||
w_exp.c w_exp2.c w_fmod.c w_gamma.c w_hypot.c w_j0.c w_j1.c w_jn.c w_lgamma.c \
|
||||
w_log.c w_log10.c w_pow.c w_remainder.c w_scalb.c w_sincos.c w_sinh.c w_sqrt.c \
|
||||
w_tgamma.c wf_acos.c wf_acosh.c wf_asin.c wf_atan2.c wf_atanh.c wf_cosh.c \
|
||||
wf_drem.c wf_exp.c wf_exp2.c wf_fmod.c wf_gamma.c wf_hypot.c wf_j0.c wf_j1.c \
|
||||
wf_jn.c wf_lgamma.c wf_log.c wf_log10.c wf_pow.c wf_remainder.c wf_scalb.c \
|
||||
wf_sincos.c wf_sinh.c wf_sqrt.c wf_tgamma.c wr_gamma.c wr_lgamma.c wrf_gamma.c \
|
||||
wrf_lgamma.c \
|
||||
f_atan2.S f_atan2f.S f_frexp.S f_frexpf.S f_ldexp.S f_ldexpf.S f_log.S \
|
||||
f_log10.S f_log10f.S f_logf.S f_tan.S f_tanf.S
|
||||
|
||||
|
||||
STATIC_OBJS = $(patsubst %.S, %.o, $(patsubst %.c, %.o, $(STATIC_SRCS)))
|
||||
|
||||
LIBCRT_OBJS = $(patsubst %.S, %.o, $(patsubst %.c, %.o, $(LIBCRT_SRCS)))
|
||||
|
||||
LIBDLL_OBJS = $(patsubst %.S, %.o, $(patsubst %.c, %.o, $(LIBDLL_SRCS)))
|
||||
|
||||
LIBCDLL_OBJS = $(patsubst %.S, %.o, $(patsubst %.c, %.o, $(LIBCDLL_SRCS)))
|
||||
|
||||
CORE_OBJS = $(patsubst %.S, %.o, $(patsubst %.asm, %.obj,\
|
||||
$(patsubst %.c, %.o, $(CORE_SRCS))))
|
||||
|
||||
STDIO_OBJS = $(patsubst %.c, stdio/%.o,$(STDIO_SRCS))
|
||||
|
||||
|
||||
STRING_OBJS = $(patsubst %.S, string/%.o, $(patsubst %.asm, string/%.o,\
|
||||
$(patsubst %.c, string/%.o, $(STRING_SRCS))))
|
||||
|
||||
STDLIB_OBJS = $(patsubst %.S, stdlib/%.o, $(patsubst %.asm, stdlib/%.o,\
|
||||
$(patsubst %.c, stdlib/%.o, $(STDLIB_SRCS))))
|
||||
|
||||
|
||||
MATH_OBJS = $(patsubst %.S, math/%.o, $(patsubst %.asm, math/%.o,\
|
||||
$(patsubst %.c, math/%.o, $(MATH_SRCS))))
|
||||
|
||||
|
||||
PRINTF_OBJS= stdio/vfprintf.o \
|
||||
stdio/vfiprintf.o \
|
||||
stdio/svfprintf.o \
|
||||
stdio/svfiprintf.o \
|
||||
stdio/vfscanf.o \
|
||||
stdio/vfiscanf.o \
|
||||
stdio/svscanf.o \
|
||||
stdio/svfiscanf.o
|
||||
|
||||
ifeq ($(findstring static,$(MAKECMDGOALS)),static)
|
||||
|
||||
LIB_SRCS:= $(STATIC_SRCS)
|
||||
LIB_OBJS:= $(STATIC_OBJS)
|
||||
|
||||
else
|
||||
|
||||
LIB_SRCS:= $(LIBCDLL_SRCS)
|
||||
LIB_OBJS:= $(LIBCDLL_OBJS)
|
||||
|
||||
endif
|
||||
|
||||
LIB_SRCS+= \
|
||||
$(CORE_SRCS) \
|
||||
$(STDIO_SRCS) \
|
||||
$(STRING_SRCS) \
|
||||
$(STDLIB_SRCS)
|
||||
|
||||
LIB_OBJS+= \
|
||||
$(CORE_OBJS) \
|
||||
$(STRING_OBJS) \
|
||||
$(STDLIB_OBJS) \
|
||||
$(STDIO_OBJS) \
|
||||
$(PRINTF_OBJS) \
|
||||
$(MATH_OBJS)
|
||||
|
||||
|
||||
|
||||
shared: $(NAME).dll libcrt.a libdll.a
|
||||
|
||||
|
||||
$(NAME).dll: $(LIB_OBJS) $(SRC_DEP) Makefile
|
||||
$(LD) $(LDFLAGS) --exclude-symbols __chkstk,__chkstk_ms,_alloca -Map libcmap -L. -o $@ $(LIB_OBJS) -lgcc --version-script libc.ver
|
||||
sed -e "s/ @[^ ]*//" libc.orig.def > libc.def
|
||||
sed -f cmd1.sed libc.def > mem
|
||||
sed -f newlib.sed mem >libc.inc
|
||||
|
||||
|
||||
libcrt.a: $(LIBCRT_OBJS) Makefile
|
||||
$(AR) libcrt.a $(LIBCRT_OBJS)
|
||||
|
||||
libdll.a: $(LIBDLL_OBJS) Makefile
|
||||
$(AR) libdll.a $(LIBDLL_OBJS)
|
||||
|
||||
|
||||
static: $(NAME).a
|
||||
|
||||
$(NAME).a: $(LIB_OBJS) $(SRC_DEP) Makefile
|
||||
$(AR) $(NAME).a $(LIB_OBJS)
|
||||
|
||||
|
||||
|
||||
stdio/vfprintf.o: stdio/vfprintf.c
|
||||
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums -DFLOATING_POINT -c stdio/vfprintf.c -o $@
|
||||
|
||||
stdio/vfiprintf.o: stdio/vfprintf.c
|
||||
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums -DINTEGER_ONLY -c stdio/vfprintf.c -o $@
|
||||
|
||||
stdio/svfprintf.o: stdio/vfprintf.c
|
||||
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums -DSTRING_ONLY -c stdio/vfprintf.c -o $@
|
||||
|
||||
stdio/svfiprintf.o: stdio/vfprintf.c
|
||||
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -fshort-enums -DINTEGER_ONLY -DSTRING_ONLY -c stdio/vfprintf.c -o $@
|
||||
|
||||
|
||||
stdio/vfscanf.o: stdio/vfscanf.c
|
||||
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) stdio/vfscanf.c -o $@
|
||||
|
||||
stdio/vfiscanf.o: stdio/vfscanf.c
|
||||
$(CC) $(CFLAGS) $(DEFINES) -DINTEGER_ONLY $(INCLUDES) stdio/vfscanf.c -o $@
|
||||
|
||||
stdio/svscanf.o: stdio/vfscanf.c
|
||||
$(CC) $(CFLAGS) $(DEFINES) -DSTRING_ONLY $(INCLUDES) stdio/vfscanf.c -o $@
|
||||
|
||||
|
||||
stdio/svfiscanf.o: stdio/vfscanf.c
|
||||
$(CC) $(CFLAGS) $(DEFINES) -DINTEGER_ONLY -DSTRING_ONLY $(INCLUDES) stdio/vfscanf.c -o $@
|
||||
|
||||
|
||||
|
||||
%.obj : %.asm Makefile
|
||||
fasm $< $
|
||||
|
||||
%.o : %.c Makefile
|
||||
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $<
|
||||
|
||||
|
||||
clean:
|
||||
-rm -f */*.o
|
||||
|
||||
|
||||
|
||||
|
@ -1,128 +0,0 @@
|
||||
/*OUTPUT_FORMAT("binary")*/
|
||||
|
||||
ENTRY(__start)
|
||||
SECTIONS
|
||||
{
|
||||
.text 0x000000:
|
||||
{
|
||||
LONG(0x554e454D);
|
||||
LONG(0x32305445);
|
||||
LONG(1);
|
||||
LONG(__start);
|
||||
LONG(___iend);
|
||||
LONG(___memsize);
|
||||
LONG(___stacktop);
|
||||
LONG(___cmdline);
|
||||
LONG(___pgmname); /* full path */
|
||||
LONG(0); /*FIXME tls data */
|
||||
LONG(__idata_start)
|
||||
LONG(__idata_end)
|
||||
LONG(_main)
|
||||
|
||||
*(.init)
|
||||
*(.text)
|
||||
*(SORT(.text$*))
|
||||
*(.text.*)
|
||||
*(.glue_7t)
|
||||
*(.glue_7)
|
||||
___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
|
||||
LONG (-1);*(.ctors); *(.ctor); *(SORT(.ctors.*)); LONG (0);
|
||||
___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
|
||||
LONG (-1); *(.dtors); *(.dtor); *(SORT(.dtors.*)); LONG (0);
|
||||
*(.fini)
|
||||
/* ??? Why is .gcc_exc here? */
|
||||
*(.gcc_exc)
|
||||
PROVIDE (etext = .);
|
||||
*(.gcc_except_table)
|
||||
}
|
||||
|
||||
.rdata ALIGN(16) :
|
||||
{
|
||||
*(.rdata)
|
||||
*(SORT(.rdata$*))
|
||||
___RUNTIME_PSEUDO_RELOC_LIST__ = .;
|
||||
__RUNTIME_PSEUDO_RELOC_LIST__ = .;
|
||||
*(.rdata_runtime_pseudo_reloc)
|
||||
___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
|
||||
__RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
|
||||
}
|
||||
.CRT ALIGN(16) :
|
||||
{
|
||||
___crt_xc_start__ = . ;
|
||||
*(SORT(.CRT$XC*)) /* C initialization */
|
||||
___crt_xc_end__ = . ;
|
||||
___crt_xi_start__ = . ;
|
||||
*(SORT(.CRT$XI*)) /* C++ initialization */
|
||||
___crt_xi_end__ = . ;
|
||||
___crt_xl_start__ = . ;
|
||||
*(SORT(.CRT$XL*)) /* TLS callbacks */
|
||||
/* ___crt_xl_end__ is defined in the TLS Directory support code */
|
||||
___crt_xp_start__ = . ;
|
||||
*(SORT(.CRT$XP*)) /* Pre-termination */
|
||||
___crt_xp_end__ = . ;
|
||||
___crt_xt_start__ = . ;
|
||||
*(SORT(.CRT$XT*)) /* Termination */
|
||||
___crt_xt_end__ = . ;
|
||||
}
|
||||
|
||||
.data ALIGN(64) :
|
||||
{
|
||||
PROVIDE ( __data_start__ = .) ;
|
||||
*(.data)
|
||||
*(.data2)
|
||||
*(SORT(.data$*))
|
||||
*(.jcr)
|
||||
__CRT_MT = .;
|
||||
LONG(0);
|
||||
PROVIDE ( __data_end__ = .) ;
|
||||
*(.data_cygwin_nocopy)
|
||||
___iend = . ;
|
||||
}
|
||||
|
||||
.idata ALIGN(16):
|
||||
{
|
||||
__idata_start = .;
|
||||
SORT(*)(.idata$2)
|
||||
SORT(*)(.idata$3)
|
||||
/* These zeroes mark the end of the import list. */
|
||||
LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
|
||||
SORT(*)(.idata$4)
|
||||
SORT(*)(.idata$5)
|
||||
SORT(*)(.idata$6)
|
||||
SORT(*)(.idata$7)
|
||||
__idata_end = . ;
|
||||
}
|
||||
|
||||
bss ALIGN(16):
|
||||
{
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
. = ALIGN(16);
|
||||
___cmdline = .;
|
||||
. = . + 256;
|
||||
___pgmname = .;
|
||||
. = . + 1024 + 16;
|
||||
___stacktop = .;
|
||||
___memsize = . ;
|
||||
}
|
||||
|
||||
/DISCARD/ :
|
||||
{
|
||||
*(.debug$S)
|
||||
*(.debug$T)
|
||||
*(.debug$F)
|
||||
*(.drectve)
|
||||
*(.note.GNU-stack)
|
||||
*(.eh_frame)
|
||||
*(.comment)
|
||||
*(.debug_abbrev)
|
||||
*(.debug_info)
|
||||
*(.debug_line)
|
||||
*(.debug_frame)
|
||||
*(.debug_loc)
|
||||
*(.debug_pubnames)
|
||||
*(.debug_aranges)
|
||||
*(.debug_ranges)
|
||||
}
|
||||
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software
|
||||
* is freely granted, provided that this notice is preserved.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "buf_findstr.h"
|
||||
|
||||
/* Find string str in buffer buf of length buf_len. Point buf to character after string,
|
||||
or set it to NULL if end of buffer is reached. Return 1 if found, 0 if not. */
|
||||
int
|
||||
_buf_findstr(const char *str, char **buf, size_t *buf_len)
|
||||
{
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
|
||||
for (i = 0; i < *buf_len; i++)
|
||||
{
|
||||
if (str[0] == (*buf)[i])
|
||||
{
|
||||
j = i;
|
||||
while (str[j - i] && (str[j - i] == (*buf)[j])) j++;
|
||||
if(str[j - i] == '\0')
|
||||
{
|
||||
*buf += j;
|
||||
*buf_len -= j;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (i == *buf_len)
|
||||
{
|
||||
*buf += *buf_len;
|
||||
*buf_len = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software
|
||||
* is freely granted, provided that this notice is preserved.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/* Find string str in buffer buf of length buf_len. Point buf to
|
||||
character after string, or set it to NULL if end of buffer is
|
||||
reached. Return 1 if found, 0 if not. */
|
||||
int _buf_findstr(const char *str, char **buf, size_t *buf_len);
|
@ -1,43 +0,0 @@
|
||||
/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software
|
||||
* is freely granted, provided that this notice is preserved.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <envz.h>
|
||||
|
||||
#include "buf_findstr.h"
|
||||
|
||||
char *
|
||||
_DEFUN (envz_get, (envz, envz_len, name),
|
||||
const char *envz _AND
|
||||
size_t envz_len _AND
|
||||
const char *name)
|
||||
{
|
||||
char *buf_ptr = (char *)envz;
|
||||
size_t buf_len = envz_len;
|
||||
|
||||
while(buf_len)
|
||||
{
|
||||
if (_buf_findstr(name, &buf_ptr, &buf_len))
|
||||
{
|
||||
if (*buf_ptr == '=')
|
||||
{
|
||||
buf_ptr++;
|
||||
return (char *)buf_ptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*buf_ptr == '\0')
|
||||
/* NULL entry. */
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* No matching entries found. */
|
||||
return NULL;
|
||||
}
|
@ -1 +0,0 @@
|
||||
s|[^ ][A-Za-z0-9_]*|&,'&',\\|
|
@ -1 +0,0 @@
|
||||
s|\<DATA\>||
|
@ -1,74 +0,0 @@
|
||||
/*
|
||||
FUNCTION
|
||||
<<assert>>---macro for debugging diagnostics
|
||||
|
||||
INDEX
|
||||
assert
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <assert.h>
|
||||
void assert(int <[expression]>);
|
||||
|
||||
DESCRIPTION
|
||||
Use this macro to embed debuggging diagnostic statements in
|
||||
your programs. The argument <[expression]> should be an
|
||||
expression which evaluates to true (nonzero) when your program
|
||||
is working as you intended.
|
||||
|
||||
When <[expression]> evaluates to false (zero), <<assert>>
|
||||
calls <<abort>>, after first printing a message showing what
|
||||
failed and where:
|
||||
|
||||
. Assertion failed: <[expression]>, file <[filename]>, line <[lineno]>, function: <[func]>
|
||||
|
||||
If the name of the current function is not known (for example,
|
||||
when using a C89 compiler that does not understand __func__),
|
||||
the function location is omitted.
|
||||
|
||||
The macro is defined to permit you to turn off all uses of
|
||||
<<assert>> at compile time by defining <<NDEBUG>> as a
|
||||
preprocessor variable. If you do this, the <<assert>> macro
|
||||
expands to
|
||||
|
||||
. (void(0))
|
||||
|
||||
RETURNS
|
||||
<<assert>> does not return a value.
|
||||
|
||||
PORTABILITY
|
||||
The <<assert>> macro is required by ANSI, as is the behavior
|
||||
when <<NDEBUG>> is defined.
|
||||
|
||||
Supporting OS subroutines required (only if enabled): <<close>>, <<fstat>>,
|
||||
<<getpid>>, <<isatty>>, <<kill>>, <<lseek>>, <<read>>, <<sbrk>>, <<write>>.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* func can be NULL, in which case no function information is given. */
|
||||
void
|
||||
_DEFUN (__assert_func, (file, line, func, failedexpr),
|
||||
const char *file _AND
|
||||
int line _AND
|
||||
const char *func _AND
|
||||
const char *failedexpr)
|
||||
{
|
||||
fiprintf(stderr,
|
||||
"assertion \"%s\" failed: file \"%s\", line %d%s%s\n",
|
||||
failedexpr, file, line,
|
||||
func ? ", function: " : "", func ? func : "");
|
||||
abort();
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
void
|
||||
_DEFUN (_assert, (file, line, failedexpr),
|
||||
const char *file _AND
|
||||
int line _AND
|
||||
const char *failedexpr)
|
||||
{
|
||||
__assert_func (file, line, NULL, failedexpr);
|
||||
/* NOTREACHED */
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
|
||||
.global ___chkstk
|
||||
.global ___chkstk_ms
|
||||
.global __alloca
|
||||
|
||||
.section .text
|
||||
|
||||
#.def ___chkstk; .scl 2; .type 32; .endef
|
||||
#.def ___chkstk_ms; .scl 2; .type 32; .endef
|
||||
#.def __alloca; .scl 2; .type 32; .endef
|
||||
|
||||
___chkstk:
|
||||
__alloca:
|
||||
pushl %ecx /* save temp */
|
||||
leal 8(%esp), %ecx /* point past return addr */
|
||||
subl %eax, %ecx
|
||||
cmpl %fs:8, %ecx # check low stack limit
|
||||
jb 1f
|
||||
|
||||
movl %esp, %eax /* save old stack pointer */
|
||||
movl %ecx, %esp /* decrement stack */
|
||||
movl (%eax), %ecx /* recover saved temp */
|
||||
movl 4(%eax), %eax /* recover return address */
|
||||
|
||||
/* Push the return value back. Doing this instead of just
|
||||
jumping to %eax preserves the cached call-return stack
|
||||
used by most modern processors. */
|
||||
pushl %eax
|
||||
ret
|
||||
1:
|
||||
int3 #trap to debugger
|
||||
.ascii "Stack overflow"
|
||||
|
||||
|
||||
___chkstk_ms:
|
||||
pushl %ecx /* save temp */
|
||||
pushl %eax
|
||||
cmpl $0x1000, %eax /* > 4k ?*/
|
||||
leal 12(%esp), %ecx /* point past return addr */
|
||||
jb 2f
|
||||
|
||||
1:
|
||||
subl $0x1000, %ecx /* yes, move pointer down 4k*/
|
||||
cmpl %fs:8, %ecx /* check low stack limit */
|
||||
jb 3f
|
||||
|
||||
orl $0x0, (%ecx) /* probe there */
|
||||
subl $0x1000, %eax /* decrement count */
|
||||
cmpl $0x1000, %eax
|
||||
ja 1b /* and do it again */
|
||||
|
||||
2:
|
||||
subl %eax, %ecx
|
||||
orl $0x0, (%ecx) /* less than 4k, just peek here */
|
||||
|
||||
popl %eax
|
||||
popl %ecx
|
||||
ret
|
||||
3:
|
||||
int3 #trap to debugger
|
||||
.ascii "Stack overflow"
|
@ -1,72 +0,0 @@
|
||||
|
||||
#include "cpu_features.h"
|
||||
|
||||
/* level 1 edx bits */
|
||||
#define EDX_CX8 (1 << 8) /* CMPXCHG8B */
|
||||
#define EDX_CMOV (1 << 15)
|
||||
#define EDX_MMX (1 << 23)
|
||||
#define EDX_FXSR (1 << 24) /* FXSAVE and FXRSTOR */
|
||||
#define EDX_SSE (1 << 25)
|
||||
#define EDX_SSE2 (1 << 26)
|
||||
|
||||
/* level 1 ecx bits */
|
||||
#define ECX_SSE3 (1 << 0)
|
||||
#define ECX_CX16 (1 << 13) /* CMPXCHG16B */
|
||||
|
||||
/* extended level 0x80000001 edx bits */
|
||||
#define EDX_3DNOW (1 << 31)
|
||||
#define EDX_3DNOWP (1 << 30)
|
||||
#define EDX_LM (1 << 29) /*LONG MODE */
|
||||
|
||||
#define __cpuid(level,a,b,c,d) \
|
||||
__asm__ __volatile__ ("cpuid;" \
|
||||
: "=a" (a), "=b" (b), "=c" (c), "=d" (d)\
|
||||
: "0" (level))
|
||||
|
||||
/* Combine the different cpuid flags into a single bitmap. */
|
||||
|
||||
unsigned int __cpu_features = 0;
|
||||
|
||||
void __cpu_features_init (void)
|
||||
{
|
||||
unsigned int eax, ebx, ecx, edx;
|
||||
|
||||
__cpuid (0, eax, ebx, ecx, edx);
|
||||
if (eax == 0)
|
||||
return;
|
||||
|
||||
__cpuid (1, eax, ebx, ecx, edx);
|
||||
|
||||
if (edx & EDX_CX8)
|
||||
__cpu_features |= _CRT_CMPXCHG8B;
|
||||
if (edx & EDX_CMOV)
|
||||
__cpu_features |= _CRT_CMOV;
|
||||
|
||||
if (edx & EDX_MMX)
|
||||
__cpu_features |= _CRT_MMX;
|
||||
if (edx & EDX_FXSR)
|
||||
__cpu_features |= _CRT_FXSR;
|
||||
if (edx & EDX_SSE)
|
||||
__cpu_features |= _CRT_SSE;
|
||||
if (edx & EDX_SSE2)
|
||||
__cpu_features |= _CRT_SSE2;
|
||||
|
||||
|
||||
if (ecx & ECX_SSE3)
|
||||
__cpu_features |= _CRT_SSE3;
|
||||
if (ecx & ECX_CX16)
|
||||
__cpu_features |= _CRT_CMPXCHG16B;
|
||||
|
||||
__cpuid (0x80000000, eax, ebx, ecx, edx);
|
||||
if (eax < 0x80000001)
|
||||
return;
|
||||
__cpuid (0x80000001, eax, ebx, ecx, edx);
|
||||
if (edx & EDX_3DNOW)
|
||||
__cpu_features |= _CRT_3DNOW;
|
||||
if (edx & EDX_3DNOWP)
|
||||
__cpu_features |= _CRT_3DNOWP;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1,21 +0,0 @@
|
||||
#ifndef _CPU_FEATURES_H
|
||||
#define _CPU_FEATURES_H
|
||||
|
||||
#define _CRT_CMPXCHG8B 0x0001
|
||||
#define _CRT_CMOV 0x0002
|
||||
#define _CRT_MMX 0x0004
|
||||
#define _CRT_FXSR 0x0008
|
||||
#define _CRT_SSE 0x0010
|
||||
#define _CRT_SSE2 0x0020
|
||||
#define _CRT_SSE3 0x0040
|
||||
#define _CRT_CMPXCHG16B 0x0080
|
||||
#define _CRT_3DNOW 0x0100
|
||||
#define _CRT_3DNOWP 0x0200
|
||||
|
||||
extern unsigned int __cpu_features;
|
||||
|
||||
/* Currently we use this in fpenv functions */
|
||||
#define __HAS_SSE __cpu_features & _CRT_SSE
|
||||
|
||||
|
||||
#endif
|
@ -1,137 +0,0 @@
|
||||
/*
|
||||
* crt1.c
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is a part of the mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER within the package.
|
||||
*
|
||||
* Source code for the startup proceedures used by all programs. This code
|
||||
* is compiled to make crt1.o, which should be located in the library path.
|
||||
*
|
||||
*/
|
||||
|
||||
/* Hide the declaration of _fmode with dllimport attribute in stdlib.h to
|
||||
avoid problems with older GCC. */
|
||||
|
||||
#include <newlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/kos_io.h>
|
||||
|
||||
#include "cpu_features.h"
|
||||
|
||||
|
||||
/* NOTE: The code for initializing the _argv, _argc, and environ variables
|
||||
* has been moved to a separate .c file which is included in both
|
||||
* crt1.c and dllcrt1.c. This means changes in the code don't have to
|
||||
* be manually synchronized, but it does lead to this not-generally-
|
||||
* a-good-idea use of include. */
|
||||
|
||||
|
||||
extern char __cmdline[];
|
||||
extern char __pgmname[];
|
||||
|
||||
extern int main (int, char **, char **);
|
||||
|
||||
int _errno;
|
||||
int _fmode;
|
||||
|
||||
char __appcwd[1024];
|
||||
int __appcwdlen;
|
||||
|
||||
int _argc;
|
||||
char **_argv;
|
||||
|
||||
static char *arg[2];
|
||||
|
||||
void _exit(int __status) __attribute__((noreturn));
|
||||
|
||||
|
||||
char * __libc_getenv(const char *name)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void __main (){};
|
||||
|
||||
struct app_hdr
|
||||
{
|
||||
char banner[8];
|
||||
int version;
|
||||
int start;
|
||||
int iend;
|
||||
int memsize;
|
||||
int stacktop;
|
||||
char *cmdline;
|
||||
char *path;
|
||||
};
|
||||
|
||||
typedef void (*ctp)();
|
||||
static void __do_global_ctors ()
|
||||
{
|
||||
extern int __CTOR_LIST__;
|
||||
int *c = &__CTOR_LIST__;
|
||||
c++;
|
||||
while (*c)
|
||||
{
|
||||
ctp d = (ctp)*c;
|
||||
(d)();
|
||||
c++;
|
||||
}
|
||||
}
|
||||
|
||||
void __attribute__((noreturn))
|
||||
__crt_startup (void)
|
||||
{
|
||||
int nRet;
|
||||
struct app_hdr *header;
|
||||
|
||||
|
||||
init_global_reent();
|
||||
|
||||
/*
|
||||
* Initialize floating point unit.
|
||||
*/
|
||||
__cpu_features_init (); /* Do we have SSE, etc.*/
|
||||
// _fpreset (); /* Supplied by the runtime library. */
|
||||
|
||||
__do_global_ctors();
|
||||
|
||||
__appcwdlen = strrchr(&__pgmname[0], '/') - &__pgmname[0] + 1;
|
||||
__appcwdlen = __appcwdlen > 1023 ? 1023 : __appcwdlen;
|
||||
memcpy(__appcwd, &__pgmname, __appcwdlen);
|
||||
__appcwd[__appcwdlen] = 0;
|
||||
|
||||
set_cwd(__appcwd);
|
||||
|
||||
arg[0] = &__pgmname[0];
|
||||
|
||||
if( __cmdline[0] != 0)
|
||||
{
|
||||
_argc = 2;
|
||||
arg[1] = &__cmdline[0];
|
||||
} else _argc = 1;
|
||||
|
||||
_argv = arg;
|
||||
|
||||
/*
|
||||
* Sets the default file mode.
|
||||
* If _CRT_fmode is set, also set mode for stdin, stdout
|
||||
* and stderr, as well
|
||||
* NOTE: DLLs don't do this because that would be rude!
|
||||
*/
|
||||
// _mingw32_init_fmode ();
|
||||
|
||||
|
||||
nRet = main (_argc, _argv, NULL);
|
||||
|
||||
/*
|
||||
* Perform exit processing for the C library. This means
|
||||
* flushing output and calling 'atexit' registered functions.
|
||||
*/
|
||||
exit (nRet);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,22 +0,0 @@
|
||||
#include <newlib.h>
|
||||
|
||||
void init_reent();
|
||||
|
||||
void __attribute__((noreturn))
|
||||
__thread_startup (int (*entry)(void*), void *param,
|
||||
void *stacklow, void *stackhigh)
|
||||
{
|
||||
int retval;
|
||||
|
||||
__asm__ __volatile__( // save stack limits
|
||||
"movl %0, %%fs:8 \n\t" // use TLS
|
||||
"movl %1, %%fs:12 \n\t"
|
||||
::"r"(stacklow), "r"(stackhigh));
|
||||
|
||||
init_reent(); // initialize thread reentry structure
|
||||
|
||||
retval = entry(param); // call user thread function
|
||||
|
||||
_exit(retval);
|
||||
};
|
||||
|
@ -1,64 +0,0 @@
|
||||
/*
|
||||
* crt1.c
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is a part of the mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER within the package.
|
||||
*
|
||||
* Source code for the startup proceedures used by all programs. This code
|
||||
* is compiled to make crt1.o, which should be located in the library path.
|
||||
*
|
||||
*/
|
||||
|
||||
/* Hide the declaration of _fmode with dllimport attribute in stdlib.h to
|
||||
avoid problems with older GCC. */
|
||||
|
||||
#include <newlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
typedef void (*ctp)();
|
||||
static void __do_global_ctors ()
|
||||
{
|
||||
extern int __CTOR_LIST__;
|
||||
int *c = &__CTOR_LIST__;
|
||||
c++;
|
||||
while (*c)
|
||||
{
|
||||
ctp d = (ctp)*c;
|
||||
(d)();
|
||||
c++;
|
||||
}
|
||||
}
|
||||
|
||||
void *load_libc();
|
||||
void __main (){};
|
||||
|
||||
void* get_entry_point(void *raw);
|
||||
|
||||
void _pei386_runtime_relocator (void){};
|
||||
|
||||
void __attribute__((noreturn))
|
||||
__crt_startup (void)
|
||||
{
|
||||
struct app_hdr *header;
|
||||
void *img;
|
||||
void __attribute__((noreturn)) (*entry)(void *img);
|
||||
|
||||
// _pei386_runtime_relocator();
|
||||
|
||||
img = load_libc();
|
||||
|
||||
if(img == NULL)
|
||||
{
|
||||
asm ("int $0x40" ::"a"(-1));
|
||||
};
|
||||
|
||||
entry = get_entry_point(img);
|
||||
entry(img);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,24 +0,0 @@
|
||||
|
||||
|
||||
.global __start
|
||||
.global ___main
|
||||
.global _DllMainCRTStartup
|
||||
|
||||
|
||||
.section .init
|
||||
|
||||
.def __start; .scl 2; .type 32; .endef
|
||||
.def _DllMainCRTStartup; .scl 2; .type 32; .endef
|
||||
|
||||
.align 4
|
||||
__start:
|
||||
_DllMainCRTStartup:
|
||||
|
||||
call __pei386_runtime_relocator
|
||||
jmp _main
|
||||
|
||||
.align 4
|
||||
___main:
|
||||
ret
|
||||
|
||||
|
@ -1,15 +0,0 @@
|
||||
|
||||
extern void _pei386_runtime_relocator (void);
|
||||
|
||||
int DllStartup(void *module, int reason)
|
||||
{
|
||||
_pei386_runtime_relocator();
|
||||
return 1;
|
||||
};
|
||||
|
||||
void ___dll_start ()
|
||||
|
||||
{
|
||||
_pei386_runtime_relocator();
|
||||
|
||||
}
|
@ -1,125 +0,0 @@
|
||||
|
||||
#include <_ansi.h>
|
||||
#include <reent.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <setjmp.h>
|
||||
#include <sys/kos_io.h>
|
||||
|
||||
struct app_hdr
|
||||
{
|
||||
char banner[8];
|
||||
int version;
|
||||
int start;
|
||||
int iend;
|
||||
int memsize;
|
||||
int stacktop;
|
||||
char *cmdline;
|
||||
char *path;
|
||||
int reserved;
|
||||
void *__idata_start;
|
||||
void *__idata_end;
|
||||
int (*main)(int argc, char **argv, char **envp);
|
||||
};
|
||||
|
||||
int _argc;
|
||||
char **_argv;
|
||||
|
||||
|
||||
void* get_entry_point(void *raw);
|
||||
int (*entry)(int, char **, char **);
|
||||
|
||||
void init_loader(void *libc_image);
|
||||
|
||||
|
||||
void init_reent();
|
||||
|
||||
jmp_buf loader_env;
|
||||
|
||||
void __attribute__((noreturn))
|
||||
__thread_startup (int (*entry)(void*), void *param,
|
||||
void *stacklow, void *stackhigh)
|
||||
{
|
||||
int retval;
|
||||
|
||||
asm volatile ( "xchgw %bx, %bx");
|
||||
|
||||
__asm__ __volatile__( // save stack limits
|
||||
"movl %0, %%fs:8 \n\t" // use TLS
|
||||
"movl %1, %%fs:12 \n\t"
|
||||
::"r"(stacklow), "r"(stackhigh));
|
||||
|
||||
init_reent(); // initialize thread reentry structure
|
||||
|
||||
retval = entry(param); // call user thread function
|
||||
|
||||
_exit(retval);
|
||||
};
|
||||
|
||||
char * __libc_getenv(const char *name)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void _pei386_runtime_relocator (void);
|
||||
int link_app();
|
||||
|
||||
char __appcwd[1024];
|
||||
int __appcwdlen;
|
||||
char* __appenv;
|
||||
int __appenv_size;
|
||||
|
||||
static char *arg[2];
|
||||
|
||||
extern char _tls_map[128];
|
||||
|
||||
void __attribute__((noreturn))
|
||||
libc_crt_startup (void *libc_base)
|
||||
{
|
||||
struct app_hdr *header = NULL;
|
||||
|
||||
int len;
|
||||
char *p;
|
||||
|
||||
void *my_app;
|
||||
int retval = 0;
|
||||
|
||||
_pei386_runtime_relocator();
|
||||
|
||||
memset(_tls_map, 0xFF, 32*4);
|
||||
_tls_map[0] = 0xE0;
|
||||
init_reent();
|
||||
__initPOSIXHandles();
|
||||
|
||||
// __appenv = load_file("/sys/system.env", &__appenv_size);
|
||||
|
||||
init_loader(libc_base);
|
||||
|
||||
if( link_app() == 0)
|
||||
goto done;
|
||||
|
||||
__appcwdlen = strrchr(header->path, '/') - header->path;
|
||||
__appcwdlen = __appcwdlen > 1022 ? 1022 : __appcwdlen;
|
||||
memcpy(__appcwd, header->path, __appcwdlen);
|
||||
set_cwd(__appcwd);
|
||||
|
||||
arg[0] = header->path;
|
||||
|
||||
if( header->cmdline[0] != 0)
|
||||
{
|
||||
_argc = 2;
|
||||
arg[1] = header->cmdline;
|
||||
}
|
||||
else _argc = 1;
|
||||
|
||||
_argv = arg;
|
||||
|
||||
retval = header->main(_argc, _argv, NULL);
|
||||
done:
|
||||
exit (retval);
|
||||
}
|
||||
|
||||
|
@ -1,8 +0,0 @@
|
||||
|
||||
extern void _pei386_runtime_relocator (void);
|
||||
|
||||
int DllStartup(void *module, int reason)
|
||||
{
|
||||
_pei386_runtime_relocator();
|
||||
return 1;
|
||||
};
|
@ -1,218 +0,0 @@
|
||||
/* TLS emulation.
|
||||
Copyright (C) 2006, 2008, 2009 Free Software Foundation, Inc.
|
||||
Contributed by Jakub Jelinek <jakub@redhat.com>.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <memory.h>
|
||||
#include <errno.h>
|
||||
#include <gthr.h>
|
||||
|
||||
void *tls_alloc(void);
|
||||
void __mutex_lock(volatile int *val);
|
||||
|
||||
|
||||
static inline void yield(void)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(68), "b"(1));
|
||||
};
|
||||
|
||||
int __gthread_once (__gthread_once_t *once, void (*func) (void))
|
||||
{
|
||||
if (once == NULL || func == NULL)
|
||||
return EINVAL;
|
||||
|
||||
if (! once->done)
|
||||
{
|
||||
if(++once->started == 0)
|
||||
{
|
||||
(*func) ();
|
||||
once->done = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Another thread is currently executing the code, so wait for it
|
||||
to finish; yield the CPU in the meantime. If performance
|
||||
does become an issue, the solution is to use an Event that
|
||||
we wait on here (and set above), but that implies a place to
|
||||
create the event before this routine is called. */
|
||||
while (! once->done)
|
||||
yield();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#define __GTHREAD_ONCE_INIT {0, -1}
|
||||
|
||||
typedef unsigned int word __attribute__((mode(word)));
|
||||
typedef unsigned int pointer __attribute__((mode(pointer)));
|
||||
|
||||
struct __emutls_object
|
||||
{
|
||||
word size;
|
||||
word align;
|
||||
union {
|
||||
pointer offset;
|
||||
void *ptr;
|
||||
} loc;
|
||||
void *templ;
|
||||
};
|
||||
|
||||
struct __emutls_array
|
||||
{
|
||||
pointer size;
|
||||
void **data[];
|
||||
};
|
||||
|
||||
void *__emutls_get_address (struct __emutls_object *);
|
||||
void __emutls_register_common (struct __emutls_object *, word, word, void *);
|
||||
|
||||
static __gthread_mutex_t emutls_mutex;
|
||||
static __gthread_key_t emutls_key;
|
||||
static pointer emutls_size;
|
||||
|
||||
static void emutls_destroy (void *ptr)
|
||||
{
|
||||
struct __emutls_array *arr = ptr;
|
||||
pointer size = arr->size;
|
||||
pointer i;
|
||||
|
||||
for (i = 0; i < size; ++i)
|
||||
{
|
||||
if (arr->data[i])
|
||||
free (arr->data[i][-1]);
|
||||
}
|
||||
free (ptr);
|
||||
};
|
||||
|
||||
static void emutls_init (void)
|
||||
{
|
||||
if (__gthread_key_create (&emutls_key, emutls_destroy) != 0)
|
||||
abort ();
|
||||
}
|
||||
|
||||
static void *emutls_alloc (struct __emutls_object *obj)
|
||||
{
|
||||
void *ptr;
|
||||
void *ret;
|
||||
|
||||
/* We could use here posix_memalign if available and adjust
|
||||
emutls_destroy accordingly. */
|
||||
if (obj->align <= sizeof (void *))
|
||||
{
|
||||
ptr = malloc (obj->size + sizeof (void *));
|
||||
if (ptr == NULL)
|
||||
abort ();
|
||||
((void **) ptr)[0] = ptr;
|
||||
ret = ptr + sizeof (void *);
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr = malloc (obj->size + sizeof (void *) + obj->align - 1);
|
||||
if (ptr == NULL)
|
||||
abort ();
|
||||
ret = (void *) (((pointer) (ptr + sizeof (void *) + obj->align - 1))
|
||||
& ~(pointer)(obj->align - 1));
|
||||
((void **) ret)[-1] = ptr;
|
||||
}
|
||||
|
||||
if (obj->templ)
|
||||
memcpy (ret, obj->templ, obj->size);
|
||||
else
|
||||
memset (ret, 0, obj->size);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void * __emutls_get_address (struct __emutls_object *obj)
|
||||
{
|
||||
pointer offset = obj->loc.offset;
|
||||
|
||||
if (__builtin_expect (offset == 0, 0))
|
||||
{
|
||||
static __gthread_once_t once = __GTHREAD_ONCE_INIT;
|
||||
__gthread_once (&once, emutls_init);
|
||||
__gthread_mutex_lock (&emutls_mutex);
|
||||
offset = obj->loc.offset;
|
||||
if (offset == 0)
|
||||
{
|
||||
offset = ++emutls_size;
|
||||
obj->loc.offset = offset;
|
||||
}
|
||||
__gthread_mutex_unlock (&emutls_mutex);
|
||||
}
|
||||
|
||||
struct __emutls_array *arr = __gthread_getspecific (emutls_key);
|
||||
if (__builtin_expect (arr == NULL, 0))
|
||||
{
|
||||
pointer size = offset + 32;
|
||||
arr = calloc (size + 1, sizeof (void *));
|
||||
if (arr == NULL)
|
||||
abort ();
|
||||
arr->size = size;
|
||||
__gthread_setspecific (emutls_key, (void *) arr);
|
||||
}
|
||||
else if (__builtin_expect (offset > arr->size, 0))
|
||||
{
|
||||
pointer orig_size = arr->size;
|
||||
pointer size = orig_size * 2;
|
||||
if (offset > size)
|
||||
size = offset + 32;
|
||||
arr = realloc (arr, (size + 1) * sizeof (void *));
|
||||
if (arr == NULL)
|
||||
abort ();
|
||||
arr->size = size;
|
||||
memset (arr->data + orig_size, 0,
|
||||
(size - orig_size) * sizeof (void *));
|
||||
__gthread_setspecific (emutls_key, (void *) arr);
|
||||
}
|
||||
|
||||
void *ret = arr->data[offset - 1];
|
||||
if (__builtin_expect (ret == NULL, 0))
|
||||
{
|
||||
ret = emutls_alloc (obj);
|
||||
arr->data[offset - 1] = ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void __emutls_register_common (struct __emutls_object *obj,
|
||||
word size, word align, void *templ)
|
||||
{
|
||||
if (obj->size < size)
|
||||
{
|
||||
obj->size = size;
|
||||
obj->templ = NULL;
|
||||
}
|
||||
if (obj->align < align)
|
||||
obj->align = align;
|
||||
if (templ && size == obj->size)
|
||||
obj->templ = templ;
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
|
||||
|
||||
.section .text
|
||||
|
||||
.global __exit
|
||||
.global __Exit
|
||||
|
||||
|
||||
.align 4
|
||||
__exit:
|
||||
__Exit:
|
||||
movl 4(%esp), %edx #store exit code
|
||||
movl $68, %eax
|
||||
movl $13, %ebx
|
||||
movl %fs:8, %ecx
|
||||
int $0x40 #destroy stack
|
||||
|
||||
movl $-1, %eax
|
||||
int $0x40 #terminate thread
|
||||
|
@ -1,76 +0,0 @@
|
||||
/* This file was based on the modified setjmp.S performed by
|
||||
* Joel Sherill (joel@OARcorp.com) which specified the use
|
||||
* of the __USER_LABEL_PREFIX__ and __REGISTER_PREFIX__ macros.
|
||||
**
|
||||
** This file is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
/* These are predefined by new versions of GNU cpp. */
|
||||
|
||||
#ifndef __USER_LABEL_PREFIX__
|
||||
#define __USER_LABEL_PREFIX__ _
|
||||
#endif
|
||||
|
||||
#define __REG_PREFIX__ %
|
||||
|
||||
/* ANSI concatenation macros. */
|
||||
|
||||
#define CONCAT1(a, b) CONCAT2(a, b)
|
||||
#define CONCAT2(a, b) a##b
|
||||
|
||||
/* Use the right prefix for global labels. */
|
||||
|
||||
#define SYM(x) CONCAT1(__USER_LABEL_PREFIX__, x)
|
||||
|
||||
/* Use the right prefix for registers. */
|
||||
|
||||
#define REG(x) CONCAT1(__REG_PREFIX__, x)
|
||||
|
||||
#define eax REG(eax)
|
||||
#define ebx REG(ebx)
|
||||
#define ecx REG(ecx)
|
||||
#define edx REG(edx)
|
||||
#define esi REG(esi)
|
||||
#define edi REG(edi)
|
||||
#define ebp REG(ebp)
|
||||
#define esp REG(esp)
|
||||
|
||||
#define st0 REG(st)
|
||||
#define st1 REG(st(1))
|
||||
#define st2 REG(st(2))
|
||||
#define st3 REG(st(3))
|
||||
#define st4 REG(st(4))
|
||||
#define st5 REG(st(5))
|
||||
#define st6 REG(st(6))
|
||||
#define st7 REG(st(7))
|
||||
|
||||
#define ax REG(ax)
|
||||
#define bx REG(bx)
|
||||
#define cx REG(cx)
|
||||
#define dx REG(dx)
|
||||
|
||||
#define ah REG(ah)
|
||||
#define bh REG(bh)
|
||||
#define ch REG(ch)
|
||||
#define dh REG(dh)
|
||||
|
||||
#define al REG(al)
|
||||
#define bl REG(bl)
|
||||
#define cl REG(cl)
|
||||
#define dl REG(dl)
|
||||
|
||||
#define mm1 REG(mm1)
|
||||
#define mm2 REG(mm2)
|
||||
#define mm3 REG(mm3)
|
||||
#define mm4 REG(mm4)
|
||||
#define mm5 REG(mm5)
|
||||
#define mm6 REG(mm6)
|
||||
#define mm7 REG(mm7)
|
||||
|
||||
#ifdef _I386MACH_NEED_SOTYPE_FUNCTION
|
||||
#define SOTYPE_FUNCTION(sym) .type SYM(sym),@function
|
||||
#else
|
||||
#define SOTYPE_FUNCTION(sym)
|
||||
#endif
|
||||
|
@ -1,214 +0,0 @@
|
||||
/* pseudo-reloc.c
|
||||
|
||||
Contributed by Egor Duda <deo@logos-m.ru>
|
||||
Modified by addition of runtime_pseudo_reloc version 2
|
||||
by Kai Tietz <kai.tietz@onevision.com>
|
||||
|
||||
THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
|
||||
This source code is offered for use in the public domain. You may
|
||||
use, modify or distribute it freely.
|
||||
|
||||
This code is distributed in the hope that it will be useful but
|
||||
WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
DISCLAMED. This includes but is not limited to warrenties of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <memory.h>
|
||||
|
||||
extern char __RUNTIME_PSEUDO_RELOC_LIST__;
|
||||
extern char __RUNTIME_PSEUDO_RELOC_LIST_END__;
|
||||
extern char _image_base__;
|
||||
|
||||
void _pei386_runtime_relocator (void);
|
||||
|
||||
/* v1 relocation is basically:
|
||||
* *(base + .target) += .addend
|
||||
* where (base + .target) is always assumed to point
|
||||
* to a DWORD (4 bytes).
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t addend;
|
||||
uint32_t target;
|
||||
} runtime_pseudo_reloc_item_v1;
|
||||
|
||||
/* v2 relocation is more complex. In effect, it is
|
||||
* *(base + .target) += *(base + .sym) - (base + .sym)
|
||||
* with care taken in both reading, sign extension, and writing
|
||||
* because .flags may indicate that (base + .target) may point
|
||||
* to a BYTE, WORD, DWORD, or QWORD (w64).
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t sym;
|
||||
uint32_t target;
|
||||
uint32_t flags;
|
||||
} runtime_pseudo_reloc_item_v2;
|
||||
|
||||
typedef struct {
|
||||
uint32_t magic1;
|
||||
uint32_t magic2;
|
||||
uint32_t version;
|
||||
} runtime_pseudo_reloc_v2;
|
||||
|
||||
#define RP_VERSION_V1 0
|
||||
#define RP_VERSION_V2 1
|
||||
|
||||
static void
|
||||
do_pseudo_reloc (void * start, void * end, void * base)
|
||||
{
|
||||
ptrdiff_t addr_imp, reldata;
|
||||
ptrdiff_t reloc_target = (ptrdiff_t) ((char *)end - (char*)start);
|
||||
runtime_pseudo_reloc_v2 *v2_hdr = (runtime_pseudo_reloc_v2 *) start;
|
||||
runtime_pseudo_reloc_item_v2 *r;
|
||||
|
||||
/* A valid relocation list will contain at least one entry, and
|
||||
* one v1 data structure (the smallest one) requires two DWORDs.
|
||||
* So, if the relocation list is smaller than 8 bytes, bail.
|
||||
*/
|
||||
if (reloc_target < 8)
|
||||
return;
|
||||
|
||||
/* Check if this is the old pseudo relocation version. */
|
||||
/* There are two kinds of v1 relocation lists:
|
||||
* 1) With a (v2-style) version header. In this case, the
|
||||
* first entry in the list is a 3-DWORD structure, with
|
||||
* value:
|
||||
* { 0, 0, RP_VERSION_V1 }
|
||||
* In this case, we skip to the next entry in the list,
|
||||
* knowing that all elements after the head item can
|
||||
* be cast to runtime_pseudo_reloc_item_v1.
|
||||
* 2) Without a (v2-style) version header. In this case, the
|
||||
* first element in the list IS an actual v1 relocation
|
||||
* record, which is two DWORDs. Because there will never
|
||||
* be a case where a v1 relocation record has both
|
||||
* addend == 0 and target == 0, this case will not be
|
||||
* confused with the prior one.
|
||||
* All current binutils, when generating a v1 relocation list,
|
||||
* use the second (e.g. original) form -- that is, without the
|
||||
* v2-style version header.
|
||||
*/
|
||||
if (reloc_target >= 12
|
||||
&& v2_hdr->magic1 == 0 && v2_hdr->magic2 == 0
|
||||
&& v2_hdr->version == RP_VERSION_V1)
|
||||
{
|
||||
/* We have a list header item indicating that the rest
|
||||
* of the list contains v1 entries. Move the pointer to
|
||||
* the first true v1 relocation record. By definition,
|
||||
* that v1 element will not have both addend == 0 and
|
||||
* target == 0 (and thus, when interpreted as a
|
||||
* runtime_pseudo_reloc_v2, it will not have both
|
||||
* magic1 == 0 and magic2 == 0).
|
||||
*/
|
||||
v2_hdr++;
|
||||
}
|
||||
|
||||
if (v2_hdr->magic1 != 0 || v2_hdr->magic2 != 0)
|
||||
{
|
||||
/*************************
|
||||
* Handle v1 relocations *
|
||||
*************************/
|
||||
runtime_pseudo_reloc_item_v1 * o;
|
||||
for (o = (runtime_pseudo_reloc_item_v1 *) v2_hdr;
|
||||
o < (runtime_pseudo_reloc_item_v1 *)end;
|
||||
o++)
|
||||
{
|
||||
uint32_t newval;
|
||||
reloc_target = (ptrdiff_t) base + o->target;
|
||||
newval = (*((uint32_t*) reloc_target)) + o->addend;
|
||||
*(uint32_t*)reloc_target = newval;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* If we got this far, then we have relocations of version 2 or newer */
|
||||
|
||||
/* Check if this is a known version. */
|
||||
if (v2_hdr->version != RP_VERSION_V2)
|
||||
{
|
||||
// printf(" Unknown pseudo relocation protocol version %d.\n",
|
||||
// (int) v2_hdr->version);
|
||||
return;
|
||||
}
|
||||
|
||||
/*************************
|
||||
* Handle v2 relocations *
|
||||
*************************/
|
||||
|
||||
/* Walk over header. */
|
||||
r = (runtime_pseudo_reloc_item_v2 *) &v2_hdr[1];
|
||||
|
||||
for (; r < (runtime_pseudo_reloc_item_v2 *) end; r++)
|
||||
{
|
||||
/* location where new address will be written */
|
||||
reloc_target = (ptrdiff_t) base + r->target;
|
||||
|
||||
/* get sym pointer. It points either to the iat entry
|
||||
* of the referenced element, or to the stub function.
|
||||
*/
|
||||
addr_imp = (ptrdiff_t) base + r->sym;
|
||||
addr_imp = *((ptrdiff_t *) addr_imp);
|
||||
|
||||
/* read existing relocation value from image, casting to the
|
||||
* bitsize indicated by the 8 LSBs of flags. If the value is
|
||||
* negative, manually sign-extend to ptrdiff_t width. Raise an
|
||||
* error if the bitsize indicated by the 8 LSBs of flags is not
|
||||
* supported.
|
||||
*/
|
||||
switch ((r->flags & 0xff))
|
||||
{
|
||||
case 8:
|
||||
reldata = (ptrdiff_t) (*((unsigned char *)reloc_target));
|
||||
if ((reldata & 0x80) != 0)
|
||||
reldata |= ~((ptrdiff_t) 0xff);
|
||||
break;
|
||||
case 16:
|
||||
reldata = (ptrdiff_t) (*((unsigned short *)reloc_target));
|
||||
if ((reldata & 0x8000) != 0)
|
||||
reldata |= ~((ptrdiff_t) 0xffff);
|
||||
break;
|
||||
case 32:
|
||||
reldata = (ptrdiff_t) (*((unsigned int *)reloc_target));
|
||||
break;
|
||||
default:
|
||||
reldata=0;
|
||||
// printf(" Unknown pseudo relocation bit size %d.\n",
|
||||
// (int) (r->flags & 0xff));
|
||||
break;
|
||||
}
|
||||
|
||||
/* Adjust the relocation value */
|
||||
reldata -= ((ptrdiff_t) base + r->sym);
|
||||
reldata += addr_imp;
|
||||
|
||||
/* Write the new relocation value back to *reloc_target */
|
||||
switch ((r->flags & 0xff))
|
||||
{
|
||||
case 8:
|
||||
*(uint8_t*)reloc_target = (uint8_t)reldata;
|
||||
break;
|
||||
case 16:
|
||||
*(uint16_t*)reloc_target = (uint16_t)reldata;
|
||||
break;
|
||||
case 32:
|
||||
*(uint32_t*)reloc_target = (uint32_t)reldata;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_pei386_runtime_relocator (void)
|
||||
{
|
||||
static int was_init = 0;
|
||||
if (was_init)
|
||||
return;
|
||||
++was_init;
|
||||
do_pseudo_reloc (&__RUNTIME_PSEUDO_RELOC_LIST__,
|
||||
&__RUNTIME_PSEUDO_RELOC_LIST_END__,
|
||||
&_image_base__);
|
||||
}
|
@ -1,89 +0,0 @@
|
||||
/* This is file is a merger of SETJMP.S and LONGJMP.S */
|
||||
/*
|
||||
* This file was modified to use the __USER_LABEL_PREFIX__ and
|
||||
* __REGISTER_PREFIX__ macros defined by later versions of GNU cpp by
|
||||
* Joel Sherrill (joel@OARcorp.com)
|
||||
* Slight change: now includes i386mach.h for this (Werner Almesberger)
|
||||
*
|
||||
* Copyright (C) 1991 DJ Delorie
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms is permitted
|
||||
* provided that the above copyright notice and following paragraph are
|
||||
* duplicated in all such forms.
|
||||
*
|
||||
* This file is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*/
|
||||
|
||||
/*
|
||||
** jmp_buf:
|
||||
** eax ebx ecx edx esi edi ebp esp eip
|
||||
** 0 4 8 12 16 20 24 28 32
|
||||
*/
|
||||
|
||||
#include "i386mach.h"
|
||||
|
||||
.global SYM (setjmp)
|
||||
.global SYM (longjmp)
|
||||
SOTYPE_FUNCTION(setjmp)
|
||||
SOTYPE_FUNCTION(longjmp)
|
||||
|
||||
.def _setjmp; .scl 2; .type 32; .endef
|
||||
|
||||
SYM (setjmp):
|
||||
|
||||
pushl ebp
|
||||
movl esp,ebp
|
||||
|
||||
pushl edi
|
||||
movl 8 (ebp),edi
|
||||
|
||||
movl eax,0 (edi)
|
||||
movl ebx,4 (edi)
|
||||
movl ecx,8 (edi)
|
||||
movl edx,12 (edi)
|
||||
movl esi,16 (edi)
|
||||
|
||||
movl -4 (ebp),eax
|
||||
movl eax,20 (edi)
|
||||
|
||||
movl 0 (ebp),eax
|
||||
movl eax,24 (edi)
|
||||
|
||||
movl esp,eax
|
||||
addl $12,eax
|
||||
movl eax,28 (edi)
|
||||
|
||||
movl 4 (ebp),eax
|
||||
movl eax,32 (edi)
|
||||
|
||||
popl edi
|
||||
movl $0,eax
|
||||
leave
|
||||
ret
|
||||
|
||||
.def _longjmp; .scl 2; .type 32; .endef
|
||||
|
||||
SYM (longjmp):
|
||||
pushl ebp
|
||||
movl esp,ebp
|
||||
|
||||
movl 8(ebp),edi /* get jmp_buf */
|
||||
movl 12(ebp),eax /* store retval in j->eax */
|
||||
movl eax,0(edi)
|
||||
|
||||
movl 24(edi),ebp
|
||||
|
||||
movl 28(edi),esp
|
||||
|
||||
pushl 32(edi)
|
||||
|
||||
movl 0(edi),eax
|
||||
movl 4(edi),ebx
|
||||
movl 8(edi),ecx
|
||||
movl 12(edi),edx
|
||||
movl 16(edi),esi
|
||||
movl 20(edi),edi
|
||||
|
||||
ret
|
@ -1,46 +0,0 @@
|
||||
|
||||
.section .init
|
||||
|
||||
.global __start
|
||||
|
||||
#tls:0 pid process id
|
||||
#tls:4 tid reserved for thread slot
|
||||
#tls:8 thread's stack low limit
|
||||
#tls:12 thread's stack high limit
|
||||
#tls:16 reseved for libc
|
||||
|
||||
.align 4
|
||||
__start:
|
||||
movl $68, %eax
|
||||
movl $12, %ebx
|
||||
lea __size_of_stack_reserve__, %ecx
|
||||
addl $4095, %ecx #load stack size
|
||||
andl $-4096, %ecx #align to page granularity
|
||||
int $0x40 #and allocate
|
||||
testl %eax, %eax
|
||||
jz 1f
|
||||
|
||||
addl %eax, %ecx
|
||||
movl %eax, %fs:8
|
||||
movl %ecx, %fs:12 #save stack base - low limit
|
||||
#save stack top - high limit
|
||||
movl %ecx, %esp #reload stack
|
||||
|
||||
subl $1024, %esp
|
||||
|
||||
movl $9, %eax
|
||||
movl %esp, %ebx
|
||||
movl $-1, %ecx
|
||||
int $0x40
|
||||
|
||||
movl 30(%ebx), %eax
|
||||
movl %eax, %fs:0 #save pid
|
||||
|
||||
addl $1024, %esp
|
||||
|
||||
jmp ___crt_startup
|
||||
1:
|
||||
int3 #trap to debugger
|
||||
|
||||
.ascii "No enough memory for stack allocation"
|
||||
|
@ -1,48 +0,0 @@
|
||||
|
||||
.global _create_thread
|
||||
.global ___thread_startup
|
||||
|
||||
.section .text
|
||||
|
||||
.def _create_thread; .scl 2; .type 32; .endef
|
||||
|
||||
.align 4
|
||||
_create_thread:
|
||||
#.thr_proc equ esp+8
|
||||
#.param equ esp+12
|
||||
#.stack_size equ esp+16
|
||||
|
||||
pushl %ebx
|
||||
|
||||
movl $68, %eax
|
||||
movl $12, %ebx
|
||||
movl 16(%esp), %ecx #[.stack_size]
|
||||
addl $4095, %ecx
|
||||
andl $-4096, %ecx
|
||||
movl %ecx, 16(%esp) #save stack size
|
||||
int $0x40
|
||||
testl %eax, %eax
|
||||
jz 1f
|
||||
|
||||
leal -20(%eax,%ecx), %edx
|
||||
|
||||
movl 8(%esp), %ebx #[.thr_proc]
|
||||
mov %ebx, 4(%edx)
|
||||
|
||||
movl 12(%esp), %ebx #[.param]
|
||||
movl %ebx, 8(%edx)
|
||||
|
||||
addl %eax, %ecx
|
||||
movl %eax, 12(%edx) #stack low limit
|
||||
movl %ecx, 16(%edx) #stack high limit
|
||||
|
||||
movl $51, %eax
|
||||
movl $1, %ebx
|
||||
lea ___thread_startup , %ecx
|
||||
int $0x40
|
||||
popl %ebx
|
||||
ret
|
||||
1:
|
||||
notl %eax
|
||||
popl %ebx
|
||||
ret
|
@ -1,48 +0,0 @@
|
||||
|
||||
|
||||
.section .text
|
||||
|
||||
.global _tls_alloc
|
||||
.global __tls_map
|
||||
|
||||
.align 4
|
||||
_tls_alloc:
|
||||
|
||||
pushl $tls_mutex
|
||||
call ___mutex_lock
|
||||
popl %eax
|
||||
|
||||
movl tls_map_start, %edx
|
||||
.align 4
|
||||
.test:
|
||||
bsfl (%edx), %eax
|
||||
jnz .done
|
||||
|
||||
add $4, %edx
|
||||
cmpl $128+__tls_map, %edx
|
||||
jb .test
|
||||
|
||||
xorl %eax, %eax
|
||||
mov %eax, tls_mutex
|
||||
ret
|
||||
|
||||
.done:
|
||||
btrl %eax, (%edx)
|
||||
movl %edx, tls_map_start
|
||||
movl $0, tls_mutex
|
||||
|
||||
subl $__tls_map, %edx
|
||||
leal (%eax, %edx, 8), %eax
|
||||
shll $2, %eax
|
||||
ret
|
||||
|
||||
.section .data
|
||||
|
||||
tls_mutex: .long(0)
|
||||
tls_map_start: .long(__tls_map)
|
||||
|
||||
.section .bss
|
||||
|
||||
.align 16
|
||||
|
||||
__tls_map: .space 128
|
@ -1,223 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1989 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char sccsid[] = "@(#)ctype_.c 5.6 (Berkeley) 6/1/90";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#define _CTYPE_DATA_0_127 \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C|_S, _C|_S, _C|_S, _C|_S, _C|_S, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_N, _N, _N, _N, _N, _N, _N, _N, \
|
||||
_N, _N, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _P, _P, _P, _P, _P, \
|
||||
_P, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _P, _P, _P, _P, _C
|
||||
|
||||
#define _CTYPE_DATA_128_255 \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0
|
||||
|
||||
#if (defined(__GNUC__) && !defined(__CHAR_UNSIGNED__) && !defined(COMPACT_CTYPE)) || defined (__CYGWIN__)
|
||||
#define ALLOW_NEGATIVE_CTYPE_INDEX
|
||||
#endif
|
||||
|
||||
#if defined(_MB_CAPABLE)
|
||||
#if defined(_MB_EXTENDED_CHARSETS_ISO)
|
||||
#include "ctype_iso.h"
|
||||
#endif
|
||||
#if defined(_MB_EXTENDED_CHARSETS_WINDOWS)
|
||||
#include "ctype_cp.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(ALLOW_NEGATIVE_CTYPE_INDEX)
|
||||
/* No static const on Cygwin since it's referenced and potentially overwritten
|
||||
for compatibility with older applications. */
|
||||
#ifndef __CYGWIN__
|
||||
static _CONST
|
||||
#endif
|
||||
char _ctype_b[128 + 256] = {
|
||||
_CTYPE_DATA_128_255,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_DATA_128_255
|
||||
};
|
||||
|
||||
#ifdef _NEED_OLD_CTYPE_PTR_DEFINITION
|
||||
#ifndef _MB_CAPABLE
|
||||
_CONST
|
||||
#endif
|
||||
char __EXPORT *__ctype_ptr = (char *) _ctype_b + 128;
|
||||
#endif
|
||||
|
||||
#ifndef _MB_CAPABLE
|
||||
_CONST
|
||||
#endif
|
||||
char __EXPORT *__ctype_ptr__ = (char *) _ctype_b + 127;
|
||||
|
||||
# ifdef __CYGWIN__
|
||||
|
||||
__asm__ (" \n\
|
||||
.data \n\
|
||||
.globl __ctype_ \n\
|
||||
.set __ctype_,__ctype_b+127 \n\
|
||||
.text \n\
|
||||
");
|
||||
|
||||
# else /* !__CYGWIN__ */
|
||||
|
||||
_CONST char _ctype_[1 + 256] = {
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_DATA_128_255
|
||||
};
|
||||
# endif /* !__CYGWIN__ */
|
||||
|
||||
#else /* !defined(ALLOW_NEGATIVE_CTYPE_INDEX) */
|
||||
|
||||
_CONST char _ctype_[1 + 256] = {
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_DATA_128_255
|
||||
};
|
||||
|
||||
#ifdef _NEED_OLD_CTYPE_PTR_DEFINITION
|
||||
#ifndef _MB_CAPABLE
|
||||
_CONST
|
||||
#endif
|
||||
char *__ctype_ptr = (char *) _ctype_ + 1;
|
||||
#endif
|
||||
|
||||
#ifndef _MB_CAPABLE
|
||||
_CONST
|
||||
#endif
|
||||
char *__ctype_ptr__ = (char *) _ctype_;
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(_MB_CAPABLE)
|
||||
/* Cygwin has its own implementation which additionally maintains backward
|
||||
compatibility with applications built under older Cygwin releases. */
|
||||
#ifndef __CYGWIN__
|
||||
void
|
||||
__set_ctype (const char *charset)
|
||||
{
|
||||
#if defined(_MB_EXTENDED_CHARSETS_ISO) || defined(_MB_EXTENDED_CHARSETS_WINDOWS)
|
||||
int idx;
|
||||
#endif
|
||||
|
||||
switch (*charset)
|
||||
{
|
||||
#if defined(_MB_EXTENDED_CHARSETS_ISO)
|
||||
case 'I':
|
||||
idx = __iso_8859_index (charset + 9);
|
||||
/* The ctype table has a leading ISO-8859-1 element so we have to add
|
||||
1 to the index returned by __iso_8859_index. If __iso_8859_index
|
||||
returns < 0, it's ISO-8859-1. */
|
||||
if (idx < 0)
|
||||
idx = 0;
|
||||
else
|
||||
++idx;
|
||||
# if defined(ALLOW_NEGATIVE_CTYPE_INDEX)
|
||||
#ifdef _NEED_OLD_CTYPE_PTR_DEFINITION
|
||||
__ctype_ptr = (char *) (__ctype_iso[idx] + 128);
|
||||
#endif
|
||||
__ctype_ptr__ = (char *) (__ctype_iso[idx] + 127);
|
||||
# else
|
||||
#ifdef _NEED_OLD_CTYPE_PTR_DEFINITION
|
||||
__ctype_ptr = (char *) __ctype_iso[idx] + 1;
|
||||
#endif
|
||||
__ctype_ptr__ = (char *) __ctype_iso[idx];
|
||||
# endif
|
||||
return;
|
||||
#endif
|
||||
#if defined(_MB_EXTENDED_CHARSETS_WINDOWS)
|
||||
case 'C':
|
||||
idx = __cp_index (charset + 2);
|
||||
if (idx < 0)
|
||||
break;
|
||||
# if defined(ALLOW_NEGATIVE_CTYPE_INDEX)
|
||||
#ifdef _NEED_OLD_CTYPE_PTR_DEFINITION
|
||||
__ctype_ptr = (char *) (__ctype_cp[idx] + 128);
|
||||
#endif
|
||||
__ctype_ptr__ = (char *) (__ctype_cp[idx] + 127);
|
||||
# else
|
||||
#ifdef _NEED_OLD_CTYPE_PTR_DEFINITION
|
||||
__ctype_ptr = (char *) __ctype_cp[idx] + 1;
|
||||
#endif
|
||||
__ctype_ptr__ = (char *) __ctype_cp[idx];
|
||||
# endif
|
||||
return;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
# if defined(ALLOW_NEGATIVE_CTYPE_INDEX)
|
||||
#ifdef _NEED_OLD_CTYPE_PTR_DEFINITION
|
||||
__ctype_ptr = (char *) _ctype_b + 128;
|
||||
#endif
|
||||
__ctype_ptr__ = (char *) _ctype_b + 127;
|
||||
# else
|
||||
#ifdef _NEED_OLD_CTYPE_PTR_DEFINITION
|
||||
__ctype_ptr = (char *) _ctype_ + 1;
|
||||
#endif
|
||||
__ctype_ptr__ = (char *) _ctype_;
|
||||
# endif
|
||||
}
|
||||
#endif /* !__CYGWIN__ */
|
||||
#endif /* _MB_CAPABLE */
|
@ -1,775 +0,0 @@
|
||||
/* ctype table definitions for Windows codepage charsets.
|
||||
Included by ctype_.c. */
|
||||
|
||||
#define _CTYPE_CP437_128_254 \
|
||||
_U, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _U, _U, \
|
||||
_U, _L, _U, _L, _L, _L, _L, _L, \
|
||||
_L, _U, _U, _P, _P, _P, _P, _P, \
|
||||
_L, _L, _L, _L, _L, _L, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_L, _L, _U, _L, _U, _L, _P, _L, \
|
||||
_U, _U, _U, _L, _P, _L, _L, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P
|
||||
#define _CTYPE_CP437_255 _S|_B
|
||||
#define _CTYPE_CP720_128_254 \
|
||||
0, 0, _L, _L, 0, _L, 0, _L, \
|
||||
_L, _L, _L, _L, _L, 0, 0, 0, \
|
||||
0, _P, _P, _L, _P, _P, _L, _L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _P, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _P, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P
|
||||
#define _CTYPE_CP720_255 _S|_B
|
||||
#define _CTYPE_CP737_128_254 \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _P, _P, _P, _U, _U, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P
|
||||
#define _CTYPE_CP737_255 _S|_B
|
||||
#define _CTYPE_CP775_128_254 \
|
||||
_U, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _U, _L, _L, _U, _U, _U, \
|
||||
_U, _L, _U, _L, _L, _U, _P, _U, \
|
||||
_L, _U, _U, _L, _P, _U, _P, _P, \
|
||||
_U, _U, _L, _U, _L, _L, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _U, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _U, _U, _U, \
|
||||
_U, _P, _P, _P, _P, _U, _U, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _U, _U, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _U, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_U, _L, _U, _U, _L, _U, _P, _L, \
|
||||
_U, _L, _U, _L, _L, _U, _U, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P
|
||||
#define _CTYPE_CP775_255 _S|_B
|
||||
#define _CTYPE_CP850_128_254 \
|
||||
_U, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _U, _U, \
|
||||
_U, _L, _U, _L, _L, _L, _L, _L, \
|
||||
_L, _U, _U, _L, _P, _U, _P, _L, \
|
||||
_L, _L, _L, _L, _L, _U, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _U, _U, _U, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _L, _U, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_L, _U, _U, _U, _U, _L, _U, _U, \
|
||||
_U, _P, _P, _P, _P, _P, _U, _P, \
|
||||
_U, _L, _U, _U, _L, _U, _P, _L, \
|
||||
_U, _U, _U, _U, _L, _U, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P
|
||||
#define _CTYPE_CP850_255 _S|_B
|
||||
#define _CTYPE_CP852_128_254 \
|
||||
_U, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _U, _L, _L, _U, _U, _U, \
|
||||
_U, _U, _L, _L, _L, _U, _L, _U, \
|
||||
_L, _U, _U, _U, _L, _U, _P, _L, \
|
||||
_L, _L, _L, _L, _U, _L, _U, _L, \
|
||||
_U, _L, _P, _L, _U, _L, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _U, _U, _U, \
|
||||
_U, _P, _P, _P, _P, _U, _L, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _U, _L, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_L, _U, _U, _U, _L, _U, _U, _U, \
|
||||
_L, _P, _P, _P, _P, _U, _U, _P, \
|
||||
_U, _L, _U, _U, _L, _L, _U, _L, \
|
||||
_U, _U, _L, _U, _L, _U, _L, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _L, _U, _L, _P
|
||||
#define _CTYPE_CP852_255 _S|_B
|
||||
#define _CTYPE_CP855_128_254 \
|
||||
_L, _U, _L, _U, _L, _U, _L, _U, \
|
||||
_L, _U, _L, _U, _L, _U, _L, _U, \
|
||||
_L, _U, _L, _U, _L, _U, _L, _U, \
|
||||
_L, _U, _L, _U, _L, _U, _L, _U, \
|
||||
_L, _U, _L, _U, _L, _U, _L, _U, \
|
||||
_L, _U, _L, _U, _L, _U, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _L, _U, _L, \
|
||||
_U, _P, _P, _P, _P, _L, _U, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _L, _U, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_L, _U, _L, _U, _L, _U, _L, _U, \
|
||||
_L, _P, _P, _P, _P, _U, _L, _P, \
|
||||
_U, _L, _U, _L, _U, _L, _U, _L, \
|
||||
_U, _L, _U, _L, _U, _L, _U, _P, \
|
||||
_P, _L, _U, _L, _U, _L, _U, _L, \
|
||||
_U, _L, _U, _L, _U, _P, _P
|
||||
#define _CTYPE_CP855_255 _S|_B
|
||||
#define _CTYPE_CP857_128_254 \
|
||||
_U, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _U, _U, \
|
||||
_U, _L, _U, _L, _L, _L, _L, _L, \
|
||||
_U, _U, _U, _L, _P, _U, _U, _L, \
|
||||
_L, _L, _L, _L, _L, _U, _U, _L, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _U, _U, _U, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _L, _U, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _U, _U, _U, 0, _U, _U, \
|
||||
_U, _P, _P, _P, _P, _P, _U, _P, \
|
||||
_U, _L, _U, _U, _L, _U, _P, 0, \
|
||||
_P, _U, _U, _U, _L, _L, _P, _P, \
|
||||
_P, _P, 0, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P
|
||||
#define _CTYPE_CP857_255 _S|_B
|
||||
#define _CTYPE_CP858_128_254 \
|
||||
_U, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _U, _U, \
|
||||
_U, _L, _U, _L, _L, _L, _L, _L, \
|
||||
_L, _U, _U, _L, _P, _U, _P, _L, \
|
||||
_L, _L, _L, _L, _L, _U, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _U, _U, _U, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _L, _U, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_L, _U, _U, _U, _U, _P, _U, _U, \
|
||||
_U, _P, _P, _P, _P, _P, _U, _P, \
|
||||
_U, _L, _U, _U, _L, _U, _P, _L, \
|
||||
_U, _U, _U, _U, _L, _U, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P
|
||||
#define _CTYPE_CP858_255 _S|_B
|
||||
#define _CTYPE_CP862_128_254 \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _P, _P, _P, _P, _L, \
|
||||
_L, _L, _L, _L, _L, _U, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_L, _L, _U, _L, _U, _L, _P, _L, \
|
||||
_U, _U, _U, _L, _P, _L, _L, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P
|
||||
#define _CTYPE_CP862_255 _S|_B
|
||||
#define _CTYPE_CP866_128_254 \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_U, _L, _U, _L, _U, _L, _U, _L, \
|
||||
_P, _P, _P, _P, _P, _P, _P
|
||||
#define _CTYPE_CP866_255 _S|_B
|
||||
#define _CTYPE_CP874_128_254 \
|
||||
_P, 0, 0, 0, 0, _P, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, _P, _P, _P, _P, _P, _P, _P, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
_S|_B, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, 0, 0, 0, 0, _P, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _U|_L, _U|_L, 0, 0, 0
|
||||
#define _CTYPE_CP874_255 0
|
||||
#define _CTYPE_CP1125_128_254 \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_U, _L, _U, _L, _U, _L, _U, _L, \
|
||||
_U, _L, _P, _P, _P, _P, _P
|
||||
#define _CTYPE_CP1125_255 _S|_B
|
||||
#define _CTYPE_CP1250_128_254 \
|
||||
_P, 0, _P, 0, _P, _P, _P, _P, \
|
||||
0, _P, _U, _P, _U, _U, _U, _U, \
|
||||
0, _P, _P, _P, _P, _P, _P, _P, \
|
||||
0, _P, _L, _P, _L, _L, _L, _L, \
|
||||
_S|_B, _P, _P, _U, _P, _U, _P, _P, \
|
||||
_P, _P, _U, _P, _P, _P, _P, _U, \
|
||||
_P, _P, _P, _L, _P, _P, _P, _P, \
|
||||
_P, _L, _L, _P, _U, _P, _L, _L, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _P, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _P, \
|
||||
_L, _L, _L, _L, _L, _L, _L
|
||||
#define _CTYPE_CP1250_255 _P
|
||||
#define _CTYPE_CP1251_128_254 \
|
||||
_U, _U, _P, _L, _P, _P, _P, _P, \
|
||||
_P, _P, _U, _P, _U, _U, _U, _U, \
|
||||
_L, _P, _P, _P, _P, _P, _P, _P, \
|
||||
0, _P, _L, _P, _L, _L, _L, _L, \
|
||||
_S|_B, _U, _L, _U, _P, _U, _P, _P, \
|
||||
_U, _P, _U, _P, _P, _P, _P, _U, \
|
||||
_P, _P, _U, _L, _L, _P, _P, _P, \
|
||||
_L, _P, _L, _P, _L, _U, _L, _L, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L
|
||||
#define _CTYPE_CP1251_255 _L
|
||||
#define _CTYPE_CP1252_128_254 \
|
||||
_P, 0, _P, _L, _P, _P, _P, _P, \
|
||||
_P, _P, _U, _P, _U, _U, 0, 0, \
|
||||
0, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _L, _P, _L, 0, _L, _U, \
|
||||
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _P, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _P, \
|
||||
_L, _L, _L, _L, _L, _L, _L
|
||||
#define _CTYPE_CP1252_255 _L
|
||||
#define _CTYPE_CP1253_128_254 \
|
||||
_P, 0, _P, _L, _P, _P, _P, _P, \
|
||||
0, _P, 0, _P, 0, 0, 0, 0, \
|
||||
0, _P, _P, _P, _P, _P, _P, _P, \
|
||||
0, _P, 0, _P, 0, 0, 0, 0, \
|
||||
_S|_B, _P, _U, _P, _P, _P, _P, _P, \
|
||||
_P, _P, 0, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_U, _U, _U, _P, _U, _P, _U, _U, \
|
||||
_L, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L
|
||||
#define _CTYPE_CP1253_255 _L
|
||||
#define _CTYPE_CP1254_128_254 \
|
||||
_P, 0, _P, _L, _P, _P, _P, _P, \
|
||||
_P, _P, _U, _P, _U, 0, 0, 0, \
|
||||
0, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _L, _P, _L, 0, 0, _U, \
|
||||
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _P, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _P, \
|
||||
_L, _L, _L, _L, _L, _L, _L
|
||||
#define _CTYPE_CP1254_255 _L
|
||||
#define _CTYPE_CP1255_128_254 \
|
||||
_P, 0, _P, _L, _P, _P, _P, _P, \
|
||||
_P, _P, 0, _P, 0, 0, 0, 0, \
|
||||
0, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, 0, _P, 0, 0, 0, 0, \
|
||||
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _U|_L, _U|_L, _U|_L, _P, \
|
||||
_P, 0, 0, 0, 0, 0, 0, 0, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, 0, 0, _P, _P
|
||||
#define _CTYPE_CP1255_255 0
|
||||
#define _CTYPE_CP1256_128_254 \
|
||||
_P, _U|_L, _P, _L, _P, _P, _P, _P, \
|
||||
_P, _P, _U|_L, _P, _U, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_U|_L, _P, _U|_L, _P, _L, _P, _P, _U|_L, \
|
||||
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _U|_L, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _P, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _P, _U|_L, _U|_L, _U|_L, \
|
||||
_L, _U|_L, _L, _U|_L, _U|_L, _U|_L, _U|_L, _L, \
|
||||
_L, _L, _L, _L, _U|_L, _U|_L, _L, _L, \
|
||||
_P, _P, _P, _P, _L, _P, _P, _P, \
|
||||
_P, _L, _P, _L, _L, _P, _P
|
||||
#define _CTYPE_CP1256_255 _U|_L
|
||||
#define _CTYPE_CP1257_128_254 \
|
||||
_P, 0, _P, 0, _P, _P, _P, _P, \
|
||||
0, _P, 0, _P, 0, _P, _P, _P, \
|
||||
0, _P, _P, _P, _P, _P, _P, _P, \
|
||||
0, _P, 0, _P, 0, _P, _P, 0, \
|
||||
_S|_B, 0, _P, _P, _P, 0, _P, _P, \
|
||||
_U, _P, _U, _P, _P, _P, _P, _U, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_L, _P, _L, _P, _P, _P, _P, _L, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _P, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _P, \
|
||||
_L, _L, _L, _L, _L, _L, _L
|
||||
#define _CTYPE_CP1257_255 _P
|
||||
#define _CTYPE_CP1258_128_254 \
|
||||
_P, 0, _P, _L, _P, _P, _P, _P, \
|
||||
_P, _P, 0, _P, _U, 0, 0, 0, \
|
||||
0, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, 0, _P, _L, 0, 0, _U, \
|
||||
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _P, _U, _U, _U, \
|
||||
_U, _U, _P, _U, _U, _U, _U, _P, \
|
||||
_U, _U, _U, _U, _U, _U, _P, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _P, _L, _L, _L, \
|
||||
_L, _L, _P, _L, _L, _L, _L, _P, \
|
||||
_L, _L, _L, _L, _L, _L, _P
|
||||
#define _CTYPE_CP1258_255 _L
|
||||
#define _CTYPE_CP20866_128_254 \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _S|_B, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _L, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _U, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U
|
||||
#define _CTYPE_CP20866_255 _U
|
||||
#define _CTYPE_CP21866_128_254 \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _S|_B, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _L, _L, _P, _L, _L, \
|
||||
_P, _P, _P, _P, _P, _L, _P, _P, \
|
||||
_P, _P, _P, _U, _U, _P, _U, _U, \
|
||||
_P, _P, _P, _P, _P, _U, _P, _P, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U
|
||||
#define _CTYPE_CP21866_255 _U
|
||||
#define _CTYPE_GEORGIAN_PS_128_254 \
|
||||
_P, 0, _P, _L, _P, _P, _P, _P, \
|
||||
_P, _P, _U, _P, _U, _U, 0, 0, \
|
||||
0, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _L, _P, _L, 0, _L, _U, \
|
||||
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _P, \
|
||||
_L, _L, _L, _L, _L, _L, _L
|
||||
#define _CTYPE_GEORGIAN_PS_255 _L
|
||||
#define _CTYPE_PT154_128_254 \
|
||||
_U, _U, _U, _L, _P, _P, _U, _U, \
|
||||
_U, _L, _U, _U, _U, _U, _U, _U, \
|
||||
_L, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_S|_B, _U, _L, _U, _U, _U, _U, _P, \
|
||||
_U, _P, _U, _P, _P, _L, _P, _U, \
|
||||
_P, _L, _U, _L, _L, _L, _P, _P, \
|
||||
_L, _P, _L, _P, _L, _U, _L, _L, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L
|
||||
#define _CTYPE_PT154_255 _L
|
||||
|
||||
|
||||
extern int __cp_index (const char *charset_ext);
|
||||
|
||||
#if defined(ALLOW_NEGATIVE_CTYPE_INDEX)
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
static _CONST
|
||||
#endif
|
||||
char __ctype_cp[26][128 + 256] = {
|
||||
{ _CTYPE_CP437_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP437_128_254,
|
||||
_CTYPE_CP437_255
|
||||
},
|
||||
{ _CTYPE_CP720_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP720_128_254,
|
||||
_CTYPE_CP720_255
|
||||
},
|
||||
{ _CTYPE_CP737_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP737_128_254,
|
||||
_CTYPE_CP737_255
|
||||
},
|
||||
{ _CTYPE_CP775_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP775_128_254,
|
||||
_CTYPE_CP775_255
|
||||
},
|
||||
{ _CTYPE_CP850_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP850_128_254,
|
||||
_CTYPE_CP850_255
|
||||
},
|
||||
{ _CTYPE_CP852_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP852_128_254,
|
||||
_CTYPE_CP852_255
|
||||
},
|
||||
{ _CTYPE_CP855_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP855_128_254,
|
||||
_CTYPE_CP855_255
|
||||
},
|
||||
{ _CTYPE_CP857_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP857_128_254,
|
||||
_CTYPE_CP857_255
|
||||
},
|
||||
{ _CTYPE_CP858_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP858_128_254,
|
||||
_CTYPE_CP858_255
|
||||
},
|
||||
{ _CTYPE_CP862_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP862_128_254,
|
||||
_CTYPE_CP862_255
|
||||
},
|
||||
{ _CTYPE_CP866_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP866_128_254,
|
||||
_CTYPE_CP866_255
|
||||
},
|
||||
{ _CTYPE_CP874_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP874_128_254,
|
||||
_CTYPE_CP874_255
|
||||
},
|
||||
{ _CTYPE_CP1125_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP1125_128_254,
|
||||
_CTYPE_CP1125_255
|
||||
},
|
||||
{ _CTYPE_CP1250_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP1250_128_254,
|
||||
_CTYPE_CP1250_255
|
||||
},
|
||||
{ _CTYPE_CP1251_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP1251_128_254,
|
||||
_CTYPE_CP1251_255
|
||||
},
|
||||
{ _CTYPE_CP1252_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP1252_128_254,
|
||||
_CTYPE_CP1252_255
|
||||
},
|
||||
{ _CTYPE_CP1253_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP1253_128_254,
|
||||
_CTYPE_CP1253_255
|
||||
},
|
||||
{ _CTYPE_CP1254_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP1254_128_254,
|
||||
_CTYPE_CP1254_255
|
||||
},
|
||||
{ _CTYPE_CP1255_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP1255_128_254,
|
||||
_CTYPE_CP1255_255
|
||||
},
|
||||
{ _CTYPE_CP1256_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP1256_128_254,
|
||||
_CTYPE_CP1256_255
|
||||
},
|
||||
{ _CTYPE_CP1257_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP1257_128_254,
|
||||
_CTYPE_CP1257_255
|
||||
},
|
||||
{ _CTYPE_CP1258_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP1258_128_254,
|
||||
_CTYPE_CP1258_255
|
||||
},
|
||||
{ _CTYPE_CP20866_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP20866_128_254,
|
||||
_CTYPE_CP20866_255
|
||||
},
|
||||
{ _CTYPE_CP21866_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP21866_128_254,
|
||||
_CTYPE_CP21866_255
|
||||
},
|
||||
{ _CTYPE_GEORGIAN_PS_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_GEORGIAN_PS_128_254,
|
||||
_CTYPE_GEORGIAN_PS_255
|
||||
},
|
||||
{ _CTYPE_PT154_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_PT154_128_254,
|
||||
_CTYPE_PT154_255
|
||||
},
|
||||
};
|
||||
|
||||
#else /* !defined(ALLOW_NEGATIVE_CTYPE_INDEX) */
|
||||
|
||||
static _CONST char __ctype_cp[26][1 + 256] = {
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP437_128_254,
|
||||
_CTYPE_CP437_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP720_128_254,
|
||||
_CTYPE_CP720_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP737_128_254,
|
||||
_CTYPE_CP737_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP775_128_254,
|
||||
_CTYPE_CP775_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP850_128_254,
|
||||
_CTYPE_CP850_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP852_128_254,
|
||||
_CTYPE_CP852_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP855_128_254,
|
||||
_CTYPE_CP855_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP857_128_254,
|
||||
_CTYPE_CP857_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP858_128_254,
|
||||
_CTYPE_CP858_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP862_128_254,
|
||||
_CTYPE_CP862_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP866_128_254,
|
||||
_CTYPE_CP866_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP874_128_254,
|
||||
_CTYPE_CP874_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP1125_128_254,
|
||||
_CTYPE_CP1125_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP1250_128_254,
|
||||
_CTYPE_CP1250_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP1251_128_254,
|
||||
_CTYPE_CP1251_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP1252_128_254,
|
||||
_CTYPE_CP1252_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP1253_128_254,
|
||||
_CTYPE_CP1253_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP1254_128_254,
|
||||
_CTYPE_CP1254_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP1255_128_254,
|
||||
_CTYPE_CP1255_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP1256_128_254,
|
||||
_CTYPE_CP1256_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP1257_128_254,
|
||||
_CTYPE_CP1257_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP1258_128_254,
|
||||
_CTYPE_CP1258_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP20866_128_254,
|
||||
_CTYPE_CP20866_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_CP21866_128_254,
|
||||
_CTYPE_CP21866_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_GEORGIAN_PS_128_254,
|
||||
_CTYPE_GEORGIAN_PS_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_PT154_128_254,
|
||||
_CTYPE_PT154_255
|
||||
},
|
||||
};
|
||||
|
||||
#endif /* ALLOW_NEGATIVE_CTYPE_INDEX */
|
@ -1,455 +0,0 @@
|
||||
/* ctype table definitions for ISO-8859-x charsets.
|
||||
Included by ctype_.c. */
|
||||
|
||||
#define _CTYPE_ISO_8859_1_128_254 \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _P, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _P, \
|
||||
_L, _L, _L, _L, _L, _L, _L
|
||||
#define _CTYPE_ISO_8859_1_255 _L
|
||||
#define _CTYPE_ISO_8859_2_128_254 \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_S|_B, _U, _P, _U, _P, _U, _U, _P, \
|
||||
_P, _U, _U, _U, _U, _P, _U, _U, \
|
||||
_P, _L, _P, _L, _P, _L, _L, _P, \
|
||||
_P, _L, _L, _L, _L, _P, _L, _L, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _P, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _P, \
|
||||
_L, _L, _L, _L, _L, _L, _L
|
||||
#define _CTYPE_ISO_8859_2_255 _P
|
||||
#define _CTYPE_ISO_8859_3_128_254 \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_S|_B, _U, _P, _P, _P, 0, _U, _P, \
|
||||
_P, _U, _U, _U, _U, _P, 0, _U, \
|
||||
_P, _L, _P, _P, _P, _P, _L, _P, \
|
||||
_P, _L, _L, _L, _L, _P, 0, _L, \
|
||||
_U, _U, _U, 0, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
0, _U, _U, _U, _U, _U, _U, _P, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _L, \
|
||||
_L, _L, _L, 0, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
0, _L, _L, _L, _L, _L, _L, _P, \
|
||||
_L, _L, _L, _L, _L, _L, _L
|
||||
#define _CTYPE_ISO_8859_3_255 _P
|
||||
#define _CTYPE_ISO_8859_4_128_254 \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_S|_B, _U, _L, _U, _P, _U, _U, _P, \
|
||||
_P, _U, _U, _U, _U, _P, _U, _P, \
|
||||
_P, _L, _P, _L, _P, _L, _L, _P, \
|
||||
_P, _L, _L, _L, _L, _P, _L, _L, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _P, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _P, \
|
||||
_L, _L, _L, _L, _L, _L, _L
|
||||
#define _CTYPE_ISO_8859_4_255 _L
|
||||
#define _CTYPE_ISO_8859_5_128_254 \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_S|_B, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _P, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_P, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _P, _L
|
||||
#define _CTYPE_ISO_8859_5_255 _L
|
||||
#define _CTYPE_ISO_8859_6_128_254 \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_S|_B, 0, 0, 0, _P, 0, 0, 0, \
|
||||
0, 0, 0, 0, _P, _P, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, _P, 0, 0, 0, _P, \
|
||||
0, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, 0, 0, 0, 0, 0, \
|
||||
_P, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0
|
||||
#define _CTYPE_ISO_8859_6_255 0
|
||||
#define _CTYPE_ISO_8859_7_128_254 \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, 0, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _U, _P, \
|
||||
_U, _U, _U, _P, _U, _P, _U, _U, \
|
||||
_L, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L
|
||||
#define _CTYPE_ISO_8859_7_255 0
|
||||
#define _CTYPE_ISO_8859_8_128_254 \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_S|_B, 0, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, _P, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, 0, 0, _P, _P
|
||||
#define _CTYPE_ISO_8859_8_255 0
|
||||
#define _CTYPE_ISO_8859_9_128_254 \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _P, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _P, \
|
||||
_L, _L, _L, _L, _L, _L, _L
|
||||
#define _CTYPE_ISO_8859_9_255 _L
|
||||
#define _CTYPE_ISO_8859_10_128_254 \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_S|_B, _U, _U, _U, _U, _U, _U, _P, \
|
||||
_U, _U, _U, _U, _U, _P, _U, _U, \
|
||||
_P, _L, _L, _L, _L, _L, _L, _P, \
|
||||
_L, _L, _L, _L, _L, _P, _L, _L, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L
|
||||
#define _CTYPE_ISO_8859_10_255 _L
|
||||
#define _CTYPE_ISO_8859_11_128_254 \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_S|_B, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _P, _U|_L, _U|_L, _P, _P, _P, _P, \
|
||||
_P, _P, _P, 0, 0, 0, 0, _P, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, _U|_L, \
|
||||
_U|_L, _U|_L, _U|_L, _U|_L, 0, 0, 0
|
||||
#define _CTYPE_ISO_8859_11_255 0
|
||||
#define _CTYPE_ISO_8859_13_128_254 \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_S|_B, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_U, _P, _U, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_L, _P, _L, _P, _P, _P, _P, _P, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _P, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _P, \
|
||||
_L, _L, _L, _L, _L, _L, _L
|
||||
#define _CTYPE_ISO_8859_13_255 _P
|
||||
#define _CTYPE_ISO_8859_14_128_254 \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_S|_B, _U, _L, _P, _U, _L, _U, _P, \
|
||||
_U, _P, _U, _L, _U, _P, _P, _U, \
|
||||
_U, _L, _U, _L, _U, _L, _P, _U, \
|
||||
_L, _L, _L, _U, _L, _U, _L, _L, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L
|
||||
#define _CTYPE_ISO_8859_14_255 _L
|
||||
#define _CTYPE_ISO_8859_15_128_254 \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_S|_B, _P, _P, _P, _P, _P, _U, _P, \
|
||||
_L, _P, _P, _P, _P, _P, _P, _P, \
|
||||
_P, _P, _P, _P, _U, _P, _P, _P, \
|
||||
_L, _P, _P, _P, _U, _L, _U, _P, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _P, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _P, \
|
||||
_L, _L, _L, _L, _L, _L, _L
|
||||
#define _CTYPE_ISO_8859_15_255 _L
|
||||
#define _CTYPE_ISO_8859_16_128_254 \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_C, _C, _C, _C, _C, _C, _C, _C, \
|
||||
_S|_B, _U, _L, _U, _P, _P, _U, _P, \
|
||||
_L, _P, _U, _P, _U, _P, _L, _U, \
|
||||
_P, _P, _U, _U, _U, _P, _P, _P, \
|
||||
_L, _L, _L, _P, _U, _L, _U, _L, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _U, \
|
||||
_U, _U, _U, _U, _U, _U, _U, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L, _L, \
|
||||
_L, _L, _L, _L, _L, _L, _L
|
||||
#define _CTYPE_ISO_8859_16_255 _L
|
||||
|
||||
extern int __iso_8859_index (const char *charset_ext);
|
||||
|
||||
#if defined(ALLOW_NEGATIVE_CTYPE_INDEX)
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
static _CONST
|
||||
#endif
|
||||
char __ctype_iso[15][128 + 256] = {
|
||||
{ _CTYPE_ISO_8859_1_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_1_128_254,
|
||||
_CTYPE_ISO_8859_1_255
|
||||
},
|
||||
{ _CTYPE_ISO_8859_2_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_2_128_254,
|
||||
_CTYPE_ISO_8859_2_255
|
||||
},
|
||||
{ _CTYPE_ISO_8859_3_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_3_128_254,
|
||||
_CTYPE_ISO_8859_3_255
|
||||
},
|
||||
{ _CTYPE_ISO_8859_4_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_4_128_254,
|
||||
_CTYPE_ISO_8859_4_255
|
||||
},
|
||||
{ _CTYPE_ISO_8859_5_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_5_128_254,
|
||||
_CTYPE_ISO_8859_5_255
|
||||
},
|
||||
{ _CTYPE_ISO_8859_6_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_6_128_254,
|
||||
_CTYPE_ISO_8859_6_255
|
||||
},
|
||||
{ _CTYPE_ISO_8859_7_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_7_128_254,
|
||||
_CTYPE_ISO_8859_7_255
|
||||
},
|
||||
{ _CTYPE_ISO_8859_8_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_8_128_254,
|
||||
_CTYPE_ISO_8859_8_255
|
||||
},
|
||||
{ _CTYPE_ISO_8859_9_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_9_128_254,
|
||||
_CTYPE_ISO_8859_9_255
|
||||
},
|
||||
{ _CTYPE_ISO_8859_10_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_10_128_254,
|
||||
_CTYPE_ISO_8859_10_255
|
||||
},
|
||||
{ _CTYPE_ISO_8859_11_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_11_128_254,
|
||||
_CTYPE_ISO_8859_11_255
|
||||
},
|
||||
{ _CTYPE_ISO_8859_13_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_13_128_254,
|
||||
_CTYPE_ISO_8859_13_255
|
||||
},
|
||||
{ _CTYPE_ISO_8859_14_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_14_128_254,
|
||||
_CTYPE_ISO_8859_14_255
|
||||
},
|
||||
{ _CTYPE_ISO_8859_15_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_15_128_254,
|
||||
_CTYPE_ISO_8859_15_255
|
||||
},
|
||||
{ _CTYPE_ISO_8859_16_128_254,
|
||||
0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_16_128_254,
|
||||
_CTYPE_ISO_8859_16_255
|
||||
},
|
||||
};
|
||||
|
||||
#else /* !defined(ALLOW_NEGATIVE_CTYPE_INDEX) */
|
||||
|
||||
static _CONST char __ctype_iso[15][1 + 256] = {
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_1_128_254,
|
||||
_CTYPE_ISO_8859_1_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_2_128_254,
|
||||
_CTYPE_ISO_8859_2_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_3_128_254,
|
||||
_CTYPE_ISO_8859_3_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_4_128_254,
|
||||
_CTYPE_ISO_8859_4_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_5_128_254,
|
||||
_CTYPE_ISO_8859_5_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_6_128_254,
|
||||
_CTYPE_ISO_8859_6_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_7_128_254,
|
||||
_CTYPE_ISO_8859_7_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_8_128_254,
|
||||
_CTYPE_ISO_8859_8_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_9_128_254,
|
||||
_CTYPE_ISO_8859_9_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_10_128_254,
|
||||
_CTYPE_ISO_8859_10_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_11_128_254,
|
||||
_CTYPE_ISO_8859_11_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_13_128_254,
|
||||
_CTYPE_ISO_8859_13_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_14_128_254,
|
||||
_CTYPE_ISO_8859_14_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_15_128_254,
|
||||
_CTYPE_ISO_8859_15_255
|
||||
},
|
||||
{ 0,
|
||||
_CTYPE_DATA_0_127,
|
||||
_CTYPE_ISO_8859_16_128_254,
|
||||
_CTYPE_ISO_8859_16_255
|
||||
},
|
||||
};
|
||||
|
||||
#endif /* ALLOW_NEGATIVE_CTYPE_INDEX */
|
@ -1,46 +0,0 @@
|
||||
/*
|
||||
FUNCTION
|
||||
<<isalnum>>---alphanumeric character predicate
|
||||
|
||||
INDEX
|
||||
isalnum
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int isalnum(int <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int isalnum(<[c]>);
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
<<isalnum>> is a macro which classifies ASCII integer values by table
|
||||
lookup. It is a predicate returning non-zero for alphabetic or
|
||||
numeric ASCII characters, and <<0>> for other arguments. It is defined
|
||||
for all integer values.
|
||||
|
||||
You can use a compiled subroutine instead of the macro definition by
|
||||
undefining the macro using `<<#undef isalnum>>'.
|
||||
|
||||
RETURNS
|
||||
<<isalnum>> returns non-zero if <[c]> is a letter (<<a>>--<<z>> or
|
||||
<<A>>--<<Z>>) or a digit (<<0>>--<<9>>).
|
||||
|
||||
PORTABILITY
|
||||
<<isalnum>> is ANSI C.
|
||||
|
||||
No OS subroutines are required.
|
||||
*/
|
||||
|
||||
#include <_ansi.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#undef isalnum
|
||||
|
||||
int
|
||||
_DEFUN(isalnum,(c),int c)
|
||||
{
|
||||
return(__ctype_ptr__[c+1] & (_U|_L|_N));
|
||||
}
|
||||
|
@ -1,44 +0,0 @@
|
||||
/*
|
||||
FUNCTION
|
||||
<<isalpha>>---alphabetic character predicate
|
||||
|
||||
INDEX
|
||||
isalpha
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int isalpha(int <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int isalpha(<[c]>);
|
||||
|
||||
DESCRIPTION
|
||||
<<isalpha>> is a macro which classifies ASCII integer values by table
|
||||
lookup. It is a predicate returning non-zero when <[c]> represents an
|
||||
alphabetic ASCII character, and 0 otherwise. It is defined only when
|
||||
<<isascii>>(<[c]>) is true or <[c]> is EOF.
|
||||
|
||||
You can use a compiled subroutine instead of the macro definition by
|
||||
undefining the macro using `<<#undef isalpha>>'.
|
||||
|
||||
RETURNS
|
||||
<<isalpha>> returns non-zero if <[c]> is a letter (<<A>>--<<Z>> or
|
||||
<<a>>--<<z>>).
|
||||
|
||||
PORTABILITY
|
||||
<<isalpha>> is ANSI C.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
|
||||
#include <_ansi.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#undef isalpha
|
||||
int
|
||||
_DEFUN(isalpha,(c),int c)
|
||||
{
|
||||
return(__ctype_ptr__[c+1] & (_U|_L));
|
||||
}
|
||||
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
FUNCTION
|
||||
<<isascii>>---ASCII character predicate
|
||||
|
||||
INDEX
|
||||
isascii
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int isascii(int <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int isascii(<[c]>);
|
||||
|
||||
DESCRIPTION
|
||||
<<isascii>> is a macro which returns non-zero when <[c]> is an ASCII
|
||||
character, and 0 otherwise. It is defined for all integer values.
|
||||
|
||||
You can use a compiled subroutine instead of the macro definition by
|
||||
undefining the macro using `<<#undef isascii>>'.
|
||||
|
||||
RETURNS
|
||||
<<isascii>> returns non-zero if the low order byte of <[c]> is in the range
|
||||
0 to 127 (<<0x00>>--<<0x7F>>).
|
||||
|
||||
PORTABILITY
|
||||
<<isascii>> is ANSI C.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
#include <_ansi.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
|
||||
#undef isascii
|
||||
|
||||
int
|
||||
_DEFUN(isascii,(c),int c)
|
||||
{
|
||||
return c >= 0 && c< 128;
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<isblank>>---blank character predicate
|
||||
|
||||
INDEX
|
||||
isblank
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int isblank(int <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int isblank(<[c]>);
|
||||
|
||||
DESCRIPTION
|
||||
<<isblank>> is a function which classifies ASCII integer values by table
|
||||
lookup. It is a predicate returning non-zero for blank characters, and 0
|
||||
for other characters.
|
||||
|
||||
RETURNS
|
||||
<<isblank>> returns non-zero if <[c]> is a blank character.
|
||||
|
||||
PORTABILITY
|
||||
<<isblank>> is C99.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
|
||||
#include <_ansi.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
|
||||
#undef isblank
|
||||
int
|
||||
_DEFUN(isblank,(c),int c)
|
||||
{
|
||||
return ((__ctype_ptr__[c+1] & _B) || (c == '\t'));
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<iscntrl>>---control character predicate
|
||||
|
||||
INDEX
|
||||
iscntrl
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int iscntrl(int <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int iscntrl(<[c]>);
|
||||
|
||||
DESCRIPTION
|
||||
<<iscntrl>> is a macro which classifies ASCII integer values by table
|
||||
lookup. It is a predicate returning non-zero for control characters, and 0
|
||||
for other characters. It is defined only when <<isascii>>(<[c]>) is
|
||||
true or <[c]> is EOF.
|
||||
|
||||
You can use a compiled subroutine instead of the macro definition by
|
||||
undefining the macro using `<<#undef iscntrl>>'.
|
||||
|
||||
RETURNS
|
||||
<<iscntrl>> returns non-zero if <[c]> is a delete character or ordinary
|
||||
control character (<<0x7F>> or <<0x00>>--<<0x1F>>).
|
||||
|
||||
PORTABILITY
|
||||
<<iscntrl>> is ANSI C.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
|
||||
#include <_ansi.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
|
||||
#undef iscntrl
|
||||
int
|
||||
_DEFUN(iscntrl,(c),int c)
|
||||
{
|
||||
return(__ctype_ptr__[c+1] & _C);
|
||||
}
|
||||
|
||||
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
FUNCTION
|
||||
<<isdigit>>---decimal digit predicate
|
||||
|
||||
INDEX
|
||||
isdigit
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int isdigit(int <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int isdigit(<[c]>);
|
||||
|
||||
DESCRIPTION
|
||||
<<isdigit>> is a macro which classifies ASCII integer values by table
|
||||
lookup. It is a predicate returning non-zero for decimal digits, and 0 for
|
||||
other characters. It is defined only when <<isascii>>(<[c]>) is true
|
||||
or <[c]> is EOF.
|
||||
|
||||
You can use a compiled subroutine instead of the macro definition by
|
||||
undefining the macro using `<<#undef isdigit>>'.
|
||||
|
||||
RETURNS
|
||||
<<isdigit>> returns non-zero if <[c]> is a decimal digit (<<0>>--<<9>>).
|
||||
|
||||
PORTABILITY
|
||||
<<isdigit>> is ANSI C.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
|
||||
#include <_ansi.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
#undef isdigit
|
||||
int
|
||||
_DEFUN(isdigit,(c),int c)
|
||||
{
|
||||
return(__ctype_ptr__[c+1] & _N);
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<islower>>---lowercase character predicate
|
||||
|
||||
INDEX
|
||||
islower
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int islower(int <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int islower(<[c]>);
|
||||
|
||||
DESCRIPTION
|
||||
<<islower>> is a macro which classifies ASCII integer values by table
|
||||
lookup. It is a predicate returning non-zero for minuscules
|
||||
(lowercase alphabetic characters), and 0 for other characters.
|
||||
It is defined only when <<isascii>>(<[c]>) is true or <[c]> is EOF.
|
||||
|
||||
You can use a compiled subroutine instead of the macro definition by
|
||||
undefining the macro using `<<#undef islower>>'.
|
||||
|
||||
RETURNS
|
||||
<<islower>> returns non-zero if <[c]> is a lowercase letter (<<a>>--<<z>>).
|
||||
|
||||
PORTABILITY
|
||||
<<islower>> is ANSI C.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
#include <_ansi.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#undef islower
|
||||
int
|
||||
_DEFUN(islower,(c),int c)
|
||||
{
|
||||
return ((__ctype_ptr__[c+1] & (_U|_L)) == _L);
|
||||
}
|
||||
|
@ -1,60 +0,0 @@
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<isprint>>, <<isgraph>>---printable character predicates
|
||||
|
||||
INDEX
|
||||
isprint
|
||||
INDEX
|
||||
isgraph
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int isprint(int <[c]>);
|
||||
int isgraph(int <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int isprint(<[c]>);
|
||||
int isgraph(<[c]>);
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
<<isprint>> is a macro which classifies ASCII integer values by table
|
||||
lookup. It is a predicate returning non-zero for printable
|
||||
characters, and 0 for other character arguments.
|
||||
It is defined only when <<isascii>>(<[c]>) is true or <[c]> is EOF.
|
||||
|
||||
You can use a compiled subroutine instead of the macro definition by
|
||||
undefining either macro using `<<#undef isprint>>' or `<<#undef isgraph>>'.
|
||||
|
||||
RETURNS
|
||||
<<isprint>> returns non-zero if <[c]> is a printing character,
|
||||
(<<0x20>>--<<0x7E>>).
|
||||
<<isgraph>> behaves identically to <<isprint>>, except that the space
|
||||
character (<<0x20>>) is excluded.
|
||||
|
||||
PORTABILITY
|
||||
<<isprint>> and <<isgraph>> are ANSI C.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
|
||||
#include <_ansi.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#undef isgraph
|
||||
int
|
||||
_DEFUN(isgraph,(c),int c)
|
||||
{
|
||||
return(__ctype_ptr__[c+1] & (_P|_U|_L|_N));
|
||||
}
|
||||
|
||||
|
||||
#undef isprint
|
||||
int
|
||||
_DEFUN(isprint,(c),int c)
|
||||
{
|
||||
return(__ctype_ptr__[c+1] & (_P|_U|_L|_N|_B));
|
||||
}
|
||||
|
@ -1,46 +0,0 @@
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<ispunct>>---punctuation character predicate
|
||||
|
||||
INDEX
|
||||
ispunct
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int ispunct(int <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int ispunct(<[c]>);
|
||||
|
||||
DESCRIPTION
|
||||
<<ispunct>> is a macro which classifies ASCII integer values by table
|
||||
lookup. It is a predicate returning non-zero for printable
|
||||
punctuation characters, and 0 for other characters. It is defined
|
||||
only when <<isascii>>(<[c]>) is true or <[c]> is EOF.
|
||||
|
||||
You can use a compiled subroutine instead of the macro definition by
|
||||
undefining the macro using `<<#undef ispunct>>'.
|
||||
|
||||
RETURNS
|
||||
<<ispunct>> returns non-zero if <[c]> is a printable punctuation character
|
||||
(<<isgraph(<[c]>) && !isalnum(<[c]>)>>).
|
||||
|
||||
PORTABILITY
|
||||
<<ispunct>> is ANSI C.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
|
||||
#include <_ansi.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
#undef ispunct
|
||||
int
|
||||
_DEFUN(ispunct,(c),int c)
|
||||
{
|
||||
return(__ctype_ptr__[c+1] & _P);
|
||||
}
|
||||
|
@ -1,44 +0,0 @@
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<isspace>>---whitespace character predicate
|
||||
|
||||
INDEX
|
||||
isspace
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int isspace(int <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int isspace(<[c]>);
|
||||
|
||||
DESCRIPTION
|
||||
<<isspace>> is a macro which classifies ASCII integer values by table
|
||||
lookup. It is a predicate returning non-zero for whitespace
|
||||
characters, and 0 for other characters. It is defined only when <<isascii>>(<[c]>) is true or <[c]> is EOF.
|
||||
|
||||
You can use a compiled subroutine instead of the macro definition by
|
||||
undefining the macro using `<<#undef isspace>>'.
|
||||
|
||||
RETURNS
|
||||
<<isspace>> returns non-zero if <[c]> is a space, tab, carriage return, new
|
||||
line, vertical tab, or formfeed (<<0x09>>--<<0x0D>>, <<0x20>>).
|
||||
|
||||
PORTABILITY
|
||||
<<isspace>> is ANSI C.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
#include <_ansi.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
#undef isspace
|
||||
int
|
||||
_DEFUN(isspace,(c),int c)
|
||||
{
|
||||
return(__ctype_ptr__[c+1] & _S);
|
||||
}
|
||||
|
@ -1,43 +0,0 @@
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<isupper>>---uppercase character predicate
|
||||
|
||||
INDEX
|
||||
isupper
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int isupper(int <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int isupper(<[c]>);
|
||||
|
||||
DESCRIPTION
|
||||
<<isupper>> is a macro which classifies ASCII integer values by table
|
||||
lookup. It is a predicate returning non-zero for uppercase letters
|
||||
(<<A>>--<<Z>>), and 0 for other characters. It is defined only when
|
||||
<<isascii>>(<[c]>) is true or <[c]> is EOF.
|
||||
|
||||
You can use a compiled subroutine instead of the macro definition by
|
||||
undefining the macro using `<<#undef isupper>>'.
|
||||
|
||||
RETURNS
|
||||
<<isupper>> returns non-zero if <[c]> is a uppercase letter (A-Z).
|
||||
|
||||
PORTABILITY
|
||||
<<isupper>> is ANSI C.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
#include <_ansi.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#undef isupper
|
||||
int
|
||||
_DEFUN(isupper,(c),int c)
|
||||
{
|
||||
return ((__ctype_ptr__[c+1] & (_U|_L)) == _U);
|
||||
}
|
||||
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
FUNCTION
|
||||
<<iswalnum>>---alphanumeric wide character test
|
||||
|
||||
INDEX
|
||||
iswalnum
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswalnum(wint_t <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswalnum(<[c]>)
|
||||
wint_t <[c]>;
|
||||
|
||||
DESCRIPTION
|
||||
<<iswalnum>> is a function which classifies wide-character values that
|
||||
are alphanumeric.
|
||||
|
||||
RETURNS
|
||||
<<iswalnum>> returns non-zero if <[c]> is a alphanumeric wide character.
|
||||
|
||||
PORTABILITY
|
||||
<<iswalnum>> is C99.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
#include <_ansi.h>
|
||||
#include <wctype.h>
|
||||
|
||||
int
|
||||
_DEFUN(iswalnum,(c),wint_t c)
|
||||
{
|
||||
return (iswalpha (c) || iswdigit (c));
|
||||
}
|
||||
|
@ -1,433 +0,0 @@
|
||||
/* Copyright (c) 2002 Red Hat Incorporated.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
The name of Red Hat Incorporated may not be used to endorse
|
||||
or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<iswalpha>>---alphabetic wide character test
|
||||
|
||||
INDEX
|
||||
iswalpha
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswalpha(wint_t <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswalpha(<[c]>)
|
||||
wint_t <[c]>;
|
||||
|
||||
DESCRIPTION
|
||||
<<iswalpha>> is a function which classifies wide-character values that
|
||||
are alphabetic.
|
||||
|
||||
RETURNS
|
||||
<<iswalpha>> returns non-zero if <[c]> is an alphabetic wide character.
|
||||
|
||||
PORTABILITY
|
||||
<<iswalpha>> is C99.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
#include <_ansi.h>
|
||||
#include <newlib.h>
|
||||
#include <wctype.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include "local.h"
|
||||
|
||||
#ifdef _MB_CAPABLE
|
||||
#include "utf8alpha.h"
|
||||
#endif /* _MB_CAPABLE */
|
||||
|
||||
int
|
||||
_DEFUN(iswalpha,(c), wint_t c)
|
||||
{
|
||||
#ifdef _MB_CAPABLE
|
||||
unsigned const char *table;
|
||||
unsigned char *ptr;
|
||||
unsigned char ctmp;
|
||||
int size;
|
||||
wint_t x;
|
||||
|
||||
c = _jp2uc (c);
|
||||
|
||||
/* Based on and tested against Unicode 5.2
|
||||
See utf8alpha.h for a description how to fetch the data. */
|
||||
x = (c >> 8);
|
||||
/* for some large sections, all characters are alphabetic so handle them here */
|
||||
if ((x >= 0x34 && x <= 0x4c) ||
|
||||
(x >= 0x4e && x <= 0x9e) ||
|
||||
(x >= 0xac && x <= 0xd6) ||
|
||||
(x >= 0x120 && x <= 0x122) ||
|
||||
(x >= 0x130 && x <= 0x133) ||
|
||||
(x >= 0x200 && x <= 0x2a5) ||
|
||||
(x >= 0x2a7 && x <= 0x2b6))
|
||||
return 1;
|
||||
|
||||
switch (x)
|
||||
{
|
||||
case 0x00:
|
||||
table = u0;
|
||||
size = sizeof(u0);
|
||||
break;
|
||||
case 0x01:
|
||||
case 0x11:
|
||||
case 0x15:
|
||||
case 0x1e:
|
||||
case 0xa0:
|
||||
case 0xa1:
|
||||
case 0xa2:
|
||||
case 0xa3:
|
||||
case 0xa5:
|
||||
case 0xf9:
|
||||
case 0xfc:
|
||||
case 0x2f8:
|
||||
case 0x2f9:
|
||||
return 1;
|
||||
case 0x02:
|
||||
table = u2;
|
||||
size = sizeof(u2);
|
||||
break;
|
||||
case 0x03:
|
||||
table = u3;
|
||||
size = sizeof(u3);
|
||||
break;
|
||||
case 0x04:
|
||||
table = u4;
|
||||
size = sizeof(u4);
|
||||
break;
|
||||
case 0x05:
|
||||
table = u5;
|
||||
size = sizeof(u5);
|
||||
break;
|
||||
case 0x06:
|
||||
table = u6;
|
||||
size = sizeof(u6);
|
||||
break;
|
||||
case 0x07:
|
||||
table = u7;
|
||||
size = sizeof(u7);
|
||||
break;
|
||||
case 0x08:
|
||||
table = u8;
|
||||
size = sizeof(u8);
|
||||
break;
|
||||
case 0x09:
|
||||
table = u9;
|
||||
size = sizeof(u9);
|
||||
break;
|
||||
case 0x0a:
|
||||
table = ua;
|
||||
size = sizeof(ua);
|
||||
break;
|
||||
case 0x0b:
|
||||
table = ub;
|
||||
size = sizeof(ub);
|
||||
break;
|
||||
case 0x0c:
|
||||
table = uc;
|
||||
size = sizeof(uc);
|
||||
break;
|
||||
case 0x0d:
|
||||
table = ud;
|
||||
size = sizeof(ud);
|
||||
break;
|
||||
case 0x0e:
|
||||
table = ue;
|
||||
size = sizeof(ue);
|
||||
break;
|
||||
case 0x0f:
|
||||
table = uf;
|
||||
size = sizeof(uf);
|
||||
break;
|
||||
case 0x10:
|
||||
table = u10;
|
||||
size = sizeof(u10);
|
||||
break;
|
||||
case 0x12:
|
||||
table = u12;
|
||||
size = sizeof(u12);
|
||||
break;
|
||||
case 0x13:
|
||||
table = u13;
|
||||
size = sizeof(u13);
|
||||
break;
|
||||
case 0x14:
|
||||
table = u14;
|
||||
size = sizeof(u14);
|
||||
break;
|
||||
case 0x16:
|
||||
table = u16;
|
||||
size = sizeof(u16);
|
||||
break;
|
||||
case 0x17:
|
||||
table = u17;
|
||||
size = sizeof(u17);
|
||||
break;
|
||||
case 0x18:
|
||||
table = u18;
|
||||
size = sizeof(u18);
|
||||
break;
|
||||
case 0x19:
|
||||
table = u19;
|
||||
size = sizeof(u19);
|
||||
break;
|
||||
case 0x1a:
|
||||
table = u1a;
|
||||
size = sizeof(u1a);
|
||||
break;
|
||||
case 0x1b:
|
||||
table = u1b;
|
||||
size = sizeof(u1b);
|
||||
break;
|
||||
case 0x1c:
|
||||
table = u1c;
|
||||
size = sizeof(u1c);
|
||||
break;
|
||||
case 0x1d:
|
||||
table = u1d;
|
||||
size = sizeof(u1d);
|
||||
break;
|
||||
case 0x1f:
|
||||
table = u1f;
|
||||
size = sizeof(u1f);
|
||||
break;
|
||||
case 0x20:
|
||||
table = u20;
|
||||
size = sizeof(u20);
|
||||
break;
|
||||
case 0x21:
|
||||
table = u21;
|
||||
size = sizeof(u21);
|
||||
break;
|
||||
case 0x24:
|
||||
table = u24;
|
||||
size = sizeof(u24);
|
||||
break;
|
||||
case 0x2c:
|
||||
table = u2c;
|
||||
size = sizeof(u2c);
|
||||
break;
|
||||
case 0x2d:
|
||||
table = u2d;
|
||||
size = sizeof(u2d);
|
||||
break;
|
||||
case 0x2e:
|
||||
table = u2e;
|
||||
size = sizeof(u2e);
|
||||
break;
|
||||
case 0x30:
|
||||
table = u30;
|
||||
size = sizeof(u30);
|
||||
break;
|
||||
case 0x31:
|
||||
table = u31;
|
||||
size = sizeof(u31);
|
||||
break;
|
||||
case 0x4d:
|
||||
table = u4d;
|
||||
size = sizeof(u4d);
|
||||
break;
|
||||
case 0x9f:
|
||||
table = u9f;
|
||||
size = sizeof(u9f);
|
||||
break;
|
||||
case 0xa4:
|
||||
table = ua4;
|
||||
size = sizeof(ua4);
|
||||
break;
|
||||
case 0xa6:
|
||||
table = ua6;
|
||||
size = sizeof(ua6);
|
||||
break;
|
||||
case 0xa7:
|
||||
table = ua7;
|
||||
size = sizeof(ua7);
|
||||
break;
|
||||
case 0xa8:
|
||||
table = ua8;
|
||||
size = sizeof(ua8);
|
||||
break;
|
||||
case 0xa9:
|
||||
table = ua9;
|
||||
size = sizeof(ua9);
|
||||
break;
|
||||
case 0xaa:
|
||||
table = uaa;
|
||||
size = sizeof(uaa);
|
||||
break;
|
||||
case 0xab:
|
||||
table = uab;
|
||||
size = sizeof(uab);
|
||||
break;
|
||||
case 0xd7:
|
||||
table = ud7;
|
||||
size = sizeof(ud7);
|
||||
break;
|
||||
case 0xfa:
|
||||
table = ufa;
|
||||
size = sizeof(ufa);
|
||||
break;
|
||||
case 0xfb:
|
||||
table = ufb;
|
||||
size = sizeof(ufb);
|
||||
break;
|
||||
case 0xfd:
|
||||
table = ufd;
|
||||
size = sizeof(ufd);
|
||||
break;
|
||||
case 0xfe:
|
||||
table = ufe;
|
||||
size = sizeof(ufe);
|
||||
break;
|
||||
case 0xff:
|
||||
table = uff;
|
||||
size = sizeof(uff);
|
||||
break;
|
||||
case 0x100:
|
||||
table = u100;
|
||||
size = sizeof(u100);
|
||||
break;
|
||||
case 0x101:
|
||||
table = u101;
|
||||
size = sizeof(u101);
|
||||
break;
|
||||
case 0x102:
|
||||
table = u102;
|
||||
size = sizeof(u102);
|
||||
break;
|
||||
case 0x103:
|
||||
table = u103;
|
||||
size = sizeof(u103);
|
||||
break;
|
||||
case 0x104:
|
||||
table = u104;
|
||||
size = sizeof(u104);
|
||||
break;
|
||||
case 0x108:
|
||||
table = u108;
|
||||
size = sizeof(u108);
|
||||
break;
|
||||
case 0x109:
|
||||
table = u109;
|
||||
size = sizeof(u109);
|
||||
break;
|
||||
case 0x10a:
|
||||
table = u10a;
|
||||
size = sizeof(u10a);
|
||||
break;
|
||||
case 0x10b:
|
||||
table = u10b;
|
||||
size = sizeof(u10b);
|
||||
break;
|
||||
case 0x10c:
|
||||
table = u10c;
|
||||
size = sizeof(u10c);
|
||||
break;
|
||||
case 0x110:
|
||||
table = u110;
|
||||
size = sizeof(u110);
|
||||
break;
|
||||
case 0x123:
|
||||
table = u123;
|
||||
size = sizeof(u123);
|
||||
break;
|
||||
case 0x124:
|
||||
table = u124;
|
||||
size = sizeof(u124);
|
||||
break;
|
||||
case 0x134:
|
||||
table = u134;
|
||||
size = sizeof(u134);
|
||||
break;
|
||||
case 0x1d4:
|
||||
table = u1d4;
|
||||
size = sizeof(u1d4);
|
||||
break;
|
||||
case 0x1d5:
|
||||
table = u1d5;
|
||||
size = sizeof(u1d5);
|
||||
break;
|
||||
case 0x1d6:
|
||||
table = u1d6;
|
||||
size = sizeof(u1d6);
|
||||
break;
|
||||
case 0x1d7:
|
||||
table = u1d7;
|
||||
size = sizeof(u1d7);
|
||||
break;
|
||||
case 0x1f1:
|
||||
table = u1f1;
|
||||
size = sizeof(u1f1);
|
||||
break;
|
||||
case 0x2a6:
|
||||
table = u2a6;
|
||||
size = sizeof(u2a6);
|
||||
break;
|
||||
case 0x2b7:
|
||||
table = u2b7;
|
||||
size = sizeof(u2b7);
|
||||
break;
|
||||
case 0x2fa:
|
||||
table = u2fa;
|
||||
size = sizeof(u2fa);
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
/* we have narrowed down to a section of 256 characters to check */
|
||||
/* now check if c matches the alphabetic wide-chars within that section */
|
||||
ptr = (unsigned char *)table;
|
||||
ctmp = (unsigned char)c;
|
||||
while (ptr < table + size)
|
||||
{
|
||||
if (ctmp == *ptr)
|
||||
return 1;
|
||||
if (ctmp < *ptr)
|
||||
return 0;
|
||||
/* otherwise c > *ptr */
|
||||
/* look for 0x0 as next element which indicates a range */
|
||||
++ptr;
|
||||
if (*ptr == 0x0)
|
||||
{
|
||||
/* we have a range..see if c falls within range */
|
||||
++ptr;
|
||||
if (ctmp <= *ptr)
|
||||
return 1;
|
||||
++ptr;
|
||||
}
|
||||
}
|
||||
/* not in table */
|
||||
return 0;
|
||||
#else
|
||||
return (c < (wint_t)0x100 ? isalpha (c) : 0);
|
||||
#endif /* _MB_CAPABLE */
|
||||
}
|
||||
|
@ -1,82 +0,0 @@
|
||||
/* Copyright (c) 2002 Red Hat Incorporated.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
The name of Red Hat Incorporated may not be used to endorse
|
||||
or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<iswblank>>---blank wide character test
|
||||
|
||||
INDEX
|
||||
iswblank
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswblank(wint_t <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswblank(<[c]>)
|
||||
wint_t <[c]>;
|
||||
|
||||
DESCRIPTION
|
||||
<<iswblank>> is a function which classifies wide-character values that
|
||||
are categorized as blank.
|
||||
|
||||
RETURNS
|
||||
<<iswblank>> returns non-zero if <[c]> is a blank wide character.
|
||||
|
||||
PORTABILITY
|
||||
<<iswblank>> is C99.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
#include <_ansi.h>
|
||||
#include <newlib.h>
|
||||
#include <wctype.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "local.h"
|
||||
|
||||
int
|
||||
_DEFUN(iswblank,(c), wint_t c)
|
||||
{
|
||||
#ifdef _MB_CAPABLE
|
||||
c = _jp2uc (c);
|
||||
/* Based on Unicode 5.2. Control char 09, plus all characters
|
||||
from general category "Zs", which are not marked as decomposition
|
||||
type "noBreak". */
|
||||
return (c == 0x0009 || c == 0x0020 ||
|
||||
c == 0x1680 || c == 0x180e ||
|
||||
(c >= 0x2000 && c <= 0x2006) ||
|
||||
(c >= 0x2008 && c <= 0x200a) ||
|
||||
c == 0x205f || c == 0x3000);
|
||||
#else
|
||||
return (c < 0x100 ? isblank (c) : 0);
|
||||
#endif /* _MB_CAPABLE */
|
||||
}
|
||||
|
@ -1,80 +0,0 @@
|
||||
/* Copyright (c) 2002 Red Hat Incorporated.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
The name of Red Hat Incorporated may not be used to endorse
|
||||
or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<iswcntrl>>---control wide character test
|
||||
|
||||
INDEX
|
||||
iswcntrl
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswcntrl(wint_t <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswcntrl(<[c]>)
|
||||
wint_t <[c]>;
|
||||
|
||||
DESCRIPTION
|
||||
<<iswcntrl>> is a function which classifies wide-character values that
|
||||
are categorized as control characters.
|
||||
|
||||
RETURNS
|
||||
<<iswcntrl>> returns non-zero if <[c]> is a control wide character.
|
||||
|
||||
PORTABILITY
|
||||
<<iswcntrl>> is C99.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
#include <_ansi.h>
|
||||
#include <newlib.h>
|
||||
#include <wctype.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "local.h"
|
||||
|
||||
int
|
||||
_DEFUN(iswcntrl,(c), wint_t c)
|
||||
{
|
||||
#ifdef _MB_CAPABLE
|
||||
c = _jp2uc (c);
|
||||
|
||||
/* Based on Unicode 5.2. All characters from general category "Cc", "Zl",
|
||||
and "Zp". */
|
||||
return ((c >= 0x0000 && c <= 0x001f) ||
|
||||
(c >= 0x007f && c <= 0x009f) ||
|
||||
c == 0x2028 || c == 0x2029);
|
||||
#else
|
||||
return (c < 0x100 ? iscntrl (c) : 0);
|
||||
#endif /* _MB_CAPABLE */
|
||||
}
|
||||
|
@ -1,71 +0,0 @@
|
||||
/*
|
||||
FUNCTION
|
||||
<<iswctype>>---extensible wide-character test
|
||||
|
||||
INDEX
|
||||
iswctype
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswctype(wint_t <[c]>, wctype_t <[desc]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswctype(<[c]>, <[desc]>)
|
||||
wint_t <[c]>;
|
||||
wctype_t <[desc]>;
|
||||
|
||||
DESCRIPTION
|
||||
<<iswctype>> is a function which classifies wide-character values using the
|
||||
wide-character test specified by <[desc]>.
|
||||
|
||||
RETURNS
|
||||
<<iswctype>> returns non-zero if and only if <[c]> matches the test specified by <[desc]>.
|
||||
If <[desc]> is unknown, zero is returned.
|
||||
|
||||
PORTABILITY
|
||||
<<iswctype>> is C99.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
#include <_ansi.h>
|
||||
#include <wctype.h>
|
||||
#include "local.h"
|
||||
|
||||
int
|
||||
_DEFUN(iswctype,(c, desc), wint_t c _AND wctype_t desc)
|
||||
{
|
||||
switch (desc)
|
||||
{
|
||||
case WC_ALNUM:
|
||||
return iswalnum (c);
|
||||
case WC_ALPHA:
|
||||
return iswalpha (c);
|
||||
case WC_BLANK:
|
||||
return iswblank (c);
|
||||
case WC_CNTRL:
|
||||
return iswcntrl (c);
|
||||
case WC_DIGIT:
|
||||
return iswdigit (c);
|
||||
case WC_GRAPH:
|
||||
return iswgraph (c);
|
||||
case WC_LOWER:
|
||||
return iswlower (c);
|
||||
case WC_PRINT:
|
||||
return iswprint (c);
|
||||
case WC_PUNCT:
|
||||
return iswpunct (c);
|
||||
case WC_SPACE:
|
||||
return iswspace (c);
|
||||
case WC_UPPER:
|
||||
return iswupper (c);
|
||||
case WC_XDIGIT:
|
||||
return iswxdigit (c);
|
||||
default:
|
||||
return 0; /* eliminate warning */
|
||||
}
|
||||
|
||||
/* otherwise unknown */
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
FUNCTION
|
||||
<<iswdigit>>---decimal digit wide character test
|
||||
|
||||
INDEX
|
||||
iswdigit
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswdigit(wint_t <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswdigit(<[c]>)
|
||||
wint_t <[c]>;
|
||||
|
||||
DESCRIPTION
|
||||
<<iswdigit>> is a function which classifies wide-character values that
|
||||
are decimal digits.
|
||||
|
||||
RETURNS
|
||||
<<iswdigit>> returns non-zero if <[c]> is a decimal digit wide character.
|
||||
|
||||
PORTABILITY
|
||||
<<iswdigit>> is C99.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
#include <_ansi.h>
|
||||
#include <wctype.h>
|
||||
|
||||
int
|
||||
_DEFUN(iswdigit,(c), wint_t c)
|
||||
{
|
||||
return (c >= (wint_t)'0' && c <= (wint_t)'9');
|
||||
}
|
||||
|
@ -1,66 +0,0 @@
|
||||
/* Copyright (c) 2002 Red Hat Incorporated.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
The name of Red Hat Incorporated may not be used to endorse
|
||||
or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<iswgraph>>---graphic wide character test
|
||||
|
||||
INDEX
|
||||
iswgraph
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswgraph(wint_t <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswgraph(<[c]>)
|
||||
wint_t <[c]>;
|
||||
|
||||
DESCRIPTION
|
||||
<<iswgraph>> is a function which classifies wide-character values that
|
||||
are graphic.
|
||||
|
||||
RETURNS
|
||||
<<iswgraph>> returns non-zero if <[c]> is a graphic wide character.
|
||||
|
||||
PORTABILITY
|
||||
<<iswgraph>> is C99.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
#include <_ansi.h>
|
||||
#include <wctype.h>
|
||||
|
||||
int
|
||||
_DEFUN(iswgraph,(c),wint_t c)
|
||||
{
|
||||
return (iswprint (c) && !iswspace (c));
|
||||
}
|
||||
|
@ -1,38 +0,0 @@
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<iswlower>>---lowercase wide character test
|
||||
|
||||
INDEX
|
||||
iswlower
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswlower(wint_t <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswlower(<[c]>)
|
||||
wint_t <[c]>;
|
||||
|
||||
DESCRIPTION
|
||||
<<iswlower>> is a function which classifies wide-character values that
|
||||
have uppercase translations.
|
||||
|
||||
RETURNS
|
||||
<<iswlower>> returns non-zero if <[c]> is a lowercase wide character.
|
||||
|
||||
PORTABILITY
|
||||
<<iswlower>> is C99.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
#include <_ansi.h>
|
||||
#include <wctype.h>
|
||||
|
||||
int
|
||||
_DEFUN(iswlower,(c),wint_t c)
|
||||
{
|
||||
return (towupper (c) != c);
|
||||
}
|
||||
|
@ -1,496 +0,0 @@
|
||||
/* Copyright (c) 2002 Red Hat Incorporated.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
The name of Red Hat Incorporated may not be used to endorse
|
||||
or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<iswprint>>---printable wide character test
|
||||
|
||||
INDEX
|
||||
iswprint
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswprint(wint_t <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswprint(<[c]>)
|
||||
wint_t <[c]>;
|
||||
|
||||
DESCRIPTION
|
||||
<<iswprint>> is a function which classifies wide-character values that
|
||||
are printable.
|
||||
|
||||
RETURNS
|
||||
<<iswprint>> returns non-zero if <[c]> is a printable wide character.
|
||||
|
||||
PORTABILITY
|
||||
<<iswprint>> is C99.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
#include <_ansi.h>
|
||||
#include <newlib.h>
|
||||
#include <wctype.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include "local.h"
|
||||
|
||||
#ifdef _MB_CAPABLE
|
||||
#include "utf8print.h"
|
||||
#endif /* _MB_CAPABLE */
|
||||
|
||||
int
|
||||
_DEFUN(iswprint,(c), wint_t c)
|
||||
{
|
||||
#ifdef _MB_CAPABLE
|
||||
unsigned const char *table;
|
||||
unsigned char *ptr;
|
||||
unsigned char ctmp;
|
||||
int size;
|
||||
wint_t x;
|
||||
|
||||
c = _jp2uc (c);
|
||||
|
||||
/* Based on and tested against Unicode 5.2
|
||||
See utf8print.h for a description how to fetch the data. */
|
||||
x = (c >> 8);
|
||||
/* for some large sections, all characters are printuation so handle them here */
|
||||
if ((x >= 0x33 && x <= 0x4c) ||
|
||||
(x >= 0x4e && x <= 0x9e) ||
|
||||
(x >= 0xa0 && x <= 0xa3) ||
|
||||
(x >= 0xac && x <= 0xd6) ||
|
||||
(x >= 0xe0 && x <= 0xf9) ||
|
||||
(x >= 0x120 && x <= 0x122) ||
|
||||
(x >= 0x130 && x <= 0x133) ||
|
||||
(x >= 0x200 && x <= 0x2a5) ||
|
||||
(x >= 0x2a7 && x <= 0x2b6) ||
|
||||
(x >= 0xf00 && x <= 0xffe) ||
|
||||
(x >= 0x1000 && x <= 0x10fe))
|
||||
return 1;
|
||||
|
||||
switch (x)
|
||||
{
|
||||
case 0x01:
|
||||
case 0x02:
|
||||
case 0x04:
|
||||
case 0x11:
|
||||
case 0x14:
|
||||
case 0x15:
|
||||
case 0x1e:
|
||||
case 0x22:
|
||||
case 0x25:
|
||||
case 0x28:
|
||||
case 0x29:
|
||||
case 0x2a:
|
||||
case 0xa5:
|
||||
case 0xfc:
|
||||
case 0x2f8:
|
||||
case 0x2f9:
|
||||
return 1;
|
||||
case 0x00:
|
||||
table = u0;
|
||||
size = sizeof(u0);
|
||||
break;
|
||||
case 0x03:
|
||||
table = u3;
|
||||
size = sizeof(u3);
|
||||
break;
|
||||
case 0x05:
|
||||
table = u5;
|
||||
size = sizeof(u5);
|
||||
break;
|
||||
case 0x06:
|
||||
table = u6;
|
||||
size = sizeof(u6);
|
||||
break;
|
||||
case 0x07:
|
||||
table = u7;
|
||||
size = sizeof(u7);
|
||||
break;
|
||||
case 0x08:
|
||||
table = u8;
|
||||
size = sizeof(u8);
|
||||
break;
|
||||
case 0x09:
|
||||
table = u9;
|
||||
size = sizeof(u9);
|
||||
break;
|
||||
case 0x0a:
|
||||
table = ua;
|
||||
size = sizeof(ua);
|
||||
break;
|
||||
case 0x0b:
|
||||
table = ub;
|
||||
size = sizeof(ub);
|
||||
break;
|
||||
case 0x0c:
|
||||
table = uc;
|
||||
size = sizeof(uc);
|
||||
break;
|
||||
case 0x0d:
|
||||
table = ud;
|
||||
size = sizeof(ud);
|
||||
break;
|
||||
case 0x0e:
|
||||
table = ue;
|
||||
size = sizeof(ue);
|
||||
break;
|
||||
case 0x0f:
|
||||
table = uf;
|
||||
size = sizeof(uf);
|
||||
break;
|
||||
case 0x10:
|
||||
table = u10;
|
||||
size = sizeof(u10);
|
||||
break;
|
||||
case 0x12:
|
||||
table = u12;
|
||||
size = sizeof(u12);
|
||||
break;
|
||||
case 0x13:
|
||||
table = u13;
|
||||
size = sizeof(u13);
|
||||
break;
|
||||
case 0x16:
|
||||
table = u16;
|
||||
size = sizeof(u16);
|
||||
break;
|
||||
case 0x17:
|
||||
table = u17;
|
||||
size = sizeof(u17);
|
||||
break;
|
||||
case 0x18:
|
||||
table = u18;
|
||||
size = sizeof(u18);
|
||||
break;
|
||||
case 0x19:
|
||||
table = u19;
|
||||
size = sizeof(u19);
|
||||
break;
|
||||
case 0x1a:
|
||||
table = u1a;
|
||||
size = sizeof(u1a);
|
||||
break;
|
||||
case 0x1b:
|
||||
table = u1b;
|
||||
size = sizeof(u1b);
|
||||
break;
|
||||
case 0x1c:
|
||||
table = u1c;
|
||||
size = sizeof(u1c);
|
||||
break;
|
||||
case 0x1d:
|
||||
table = u1d;
|
||||
size = sizeof(u1d);
|
||||
break;
|
||||
case 0x1f:
|
||||
table = u1f;
|
||||
size = sizeof(u1f);
|
||||
break;
|
||||
case 0x20:
|
||||
table = u20;
|
||||
size = sizeof(u20);
|
||||
break;
|
||||
case 0x21:
|
||||
table = u21;
|
||||
size = sizeof(u21);
|
||||
break;
|
||||
case 0x23:
|
||||
table = u23;
|
||||
size = sizeof(u23);
|
||||
break;
|
||||
case 0x24:
|
||||
table = u24;
|
||||
size = sizeof(u24);
|
||||
break;
|
||||
case 0x26:
|
||||
table = u26;
|
||||
size = sizeof(u26);
|
||||
break;
|
||||
case 0x27:
|
||||
table = u27;
|
||||
size = sizeof(u27);
|
||||
break;
|
||||
case 0x2b:
|
||||
table = u2b;
|
||||
size = sizeof(u2b);
|
||||
break;
|
||||
case 0x2c:
|
||||
table = u2c;
|
||||
size = sizeof(u2c);
|
||||
break;
|
||||
case 0x2d:
|
||||
table = u2d;
|
||||
size = sizeof(u2d);
|
||||
break;
|
||||
case 0x2e:
|
||||
table = u2e;
|
||||
size = sizeof(u2e);
|
||||
break;
|
||||
case 0x2f:
|
||||
table = u2f;
|
||||
size = sizeof(u2f);
|
||||
break;
|
||||
case 0x30:
|
||||
table = u30;
|
||||
size = sizeof(u30);
|
||||
break;
|
||||
case 0x31:
|
||||
table = u31;
|
||||
size = sizeof(u31);
|
||||
break;
|
||||
case 0x32:
|
||||
table = u32;
|
||||
size = sizeof(u32);
|
||||
break;
|
||||
case 0x4d:
|
||||
table = u4d;
|
||||
size = sizeof(u4d);
|
||||
break;
|
||||
case 0x9f:
|
||||
table = u9f;
|
||||
size = sizeof(u9f);
|
||||
break;
|
||||
case 0xa4:
|
||||
table = ua4;
|
||||
size = sizeof(ua4);
|
||||
break;
|
||||
case 0xa6:
|
||||
table = ua6;
|
||||
size = sizeof(ua6);
|
||||
break;
|
||||
case 0xa7:
|
||||
table = ua7;
|
||||
size = sizeof(ua7);
|
||||
break;
|
||||
case 0xa8:
|
||||
table = ua8;
|
||||
size = sizeof(ua8);
|
||||
break;
|
||||
case 0xa9:
|
||||
table = ua9;
|
||||
size = sizeof(ua9);
|
||||
break;
|
||||
case 0xaa:
|
||||
table = uaa;
|
||||
size = sizeof(uaa);
|
||||
break;
|
||||
case 0xab:
|
||||
table = uab;
|
||||
size = sizeof(uab);
|
||||
break;
|
||||
case 0xd7:
|
||||
table = ud7;
|
||||
size = sizeof(ud7);
|
||||
break;
|
||||
case 0xfa:
|
||||
table = ufa;
|
||||
size = sizeof(ufa);
|
||||
break;
|
||||
case 0xfb:
|
||||
table = ufb;
|
||||
size = sizeof(ufb);
|
||||
break;
|
||||
case 0xfd:
|
||||
table = ufd;
|
||||
size = sizeof(ufd);
|
||||
break;
|
||||
case 0xfe:
|
||||
table = ufe;
|
||||
size = sizeof(ufe);
|
||||
break;
|
||||
case 0xff:
|
||||
table = uff;
|
||||
size = sizeof(uff);
|
||||
break;
|
||||
case 0x100:
|
||||
table = u100;
|
||||
size = sizeof(u100);
|
||||
break;
|
||||
case 0x101:
|
||||
table = u101;
|
||||
size = sizeof(u101);
|
||||
break;
|
||||
case 0x102:
|
||||
table = u102;
|
||||
size = sizeof(u102);
|
||||
break;
|
||||
case 0x103:
|
||||
table = u103;
|
||||
size = sizeof(u103);
|
||||
break;
|
||||
case 0x104:
|
||||
table = u104;
|
||||
size = sizeof(u104);
|
||||
break;
|
||||
case 0x108:
|
||||
table = u108;
|
||||
size = sizeof(u108);
|
||||
break;
|
||||
case 0x109:
|
||||
table = u109;
|
||||
size = sizeof(u109);
|
||||
break;
|
||||
case 0x10a:
|
||||
table = u10a;
|
||||
size = sizeof(u10a);
|
||||
break;
|
||||
case 0x10b:
|
||||
table = u10b;
|
||||
size = sizeof(u10b);
|
||||
break;
|
||||
case 0x10c:
|
||||
table = u10c;
|
||||
size = sizeof(u10c);
|
||||
break;
|
||||
case 0x10e:
|
||||
table = u10e;
|
||||
size = sizeof(u10e);
|
||||
break;
|
||||
case 0x110:
|
||||
table = u110;
|
||||
size = sizeof(u110);
|
||||
break;
|
||||
case 0x123:
|
||||
table = u123;
|
||||
size = sizeof(u123);
|
||||
break;
|
||||
case 0x124:
|
||||
table = u124;
|
||||
size = sizeof(u124);
|
||||
break;
|
||||
case 0x134:
|
||||
table = u134;
|
||||
size = sizeof(u134);
|
||||
break;
|
||||
case 0x1d0:
|
||||
table = u1d0;
|
||||
size = sizeof(u1d0);
|
||||
break;
|
||||
case 0x1d1:
|
||||
table = u1d1;
|
||||
size = sizeof(u1d1);
|
||||
break;
|
||||
case 0x1d2:
|
||||
table = u1d2;
|
||||
size = sizeof(u1d2);
|
||||
break;
|
||||
case 0x1d3:
|
||||
table = u1d3;
|
||||
size = sizeof(u1d3);
|
||||
break;
|
||||
case 0x1d4:
|
||||
table = u1d4;
|
||||
size = sizeof(u1d4);
|
||||
break;
|
||||
case 0x1d5:
|
||||
table = u1d5;
|
||||
size = sizeof(u1d5);
|
||||
break;
|
||||
case 0x1d6:
|
||||
table = u1d6;
|
||||
size = sizeof(u1d6);
|
||||
break;
|
||||
case 0x1d7:
|
||||
table = u1d7;
|
||||
size = sizeof(u1d7);
|
||||
break;
|
||||
case 0x1f0:
|
||||
table = u1f0;
|
||||
size = sizeof(u1f0);
|
||||
break;
|
||||
case 0x1f1:
|
||||
table = u1f1;
|
||||
size = sizeof(u1f1);
|
||||
break;
|
||||
case 0x1f2:
|
||||
table = u1f2;
|
||||
size = sizeof(u1f2);
|
||||
break;
|
||||
case 0x2a6:
|
||||
table = u2a6;
|
||||
size = sizeof(u2a6);
|
||||
break;
|
||||
case 0x2b7:
|
||||
table = u2b7;
|
||||
size = sizeof(u2b7);
|
||||
break;
|
||||
case 0x2fa:
|
||||
table = u2fa;
|
||||
size = sizeof(u2fa);
|
||||
break;
|
||||
case 0xe00:
|
||||
table = ue00;
|
||||
size = sizeof(ue00);
|
||||
break;
|
||||
case 0xe01:
|
||||
table = ue01;
|
||||
size = sizeof(ue01);
|
||||
break;
|
||||
case 0xfff:
|
||||
table = ufff;
|
||||
size = sizeof(ufff);
|
||||
break;
|
||||
case 0x10ff:
|
||||
table = u10ff;
|
||||
size = sizeof(u10ff);
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
/* we have narrowed down to a section of 256 characters to check */
|
||||
/* now check if c matches the printuation wide-chars within that section */
|
||||
ptr = (unsigned char *)table;
|
||||
ctmp = (unsigned char)c;
|
||||
while (ptr < table + size)
|
||||
{
|
||||
if (ctmp == *ptr)
|
||||
return 1;
|
||||
if (ctmp < *ptr)
|
||||
return 0;
|
||||
/* otherwise c > *ptr */
|
||||
/* look for 0x0 as next element which indicates a range */
|
||||
++ptr;
|
||||
if (*ptr == 0x0)
|
||||
{
|
||||
/* we have a range..see if c falls within range */
|
||||
++ptr;
|
||||
if (ctmp <= *ptr)
|
||||
return 1;
|
||||
++ptr;
|
||||
}
|
||||
}
|
||||
/* not in table */
|
||||
return 0;
|
||||
#else
|
||||
return (c < (wint_t)0x100 ? isprint (c) : 0);
|
||||
#endif /* _MB_CAPABLE */
|
||||
}
|
||||
|
@ -1,70 +0,0 @@
|
||||
/* Copyright (c) 2002 Red Hat Incorporated.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
The name of Red Hat Incorporated may not be used to endorse
|
||||
or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<iswpunct>>---punctuation wide character test
|
||||
|
||||
INDEX
|
||||
iswpunct
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswpunct(wint_t <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswpunct(<[c]>)
|
||||
wint_t <[c]>;
|
||||
|
||||
DESCRIPTION
|
||||
<<iswpunct>> is a function which classifies wide-character values that
|
||||
are punctuation.
|
||||
|
||||
RETURNS
|
||||
<<iswpunct>> returns non-zero if <[c]> is a punctuation wide character.
|
||||
|
||||
PORTABILITY
|
||||
<<iswpunct>> is C99.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
#include <_ansi.h>
|
||||
#include <newlib.h>
|
||||
#include <wctype.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include "local.h"
|
||||
|
||||
int
|
||||
_DEFUN(iswpunct,(c), wint_t c)
|
||||
{
|
||||
return (!iswalnum (c) && iswgraph (c));
|
||||
}
|
||||
|
@ -1,83 +0,0 @@
|
||||
/* Copyright (c) 2002 Red Hat Incorporated.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
The name of Red Hat Incorporated may not be used to endorse
|
||||
or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<iswspace>>---whitespace wide character test
|
||||
|
||||
INDEX
|
||||
iswspace
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswspace(wint_t <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswspace(<[c]>)
|
||||
wint_t <[c]>;
|
||||
|
||||
DESCRIPTION
|
||||
<<iswspace>> is a function which classifies wide-character values that
|
||||
are categorized as whitespace.
|
||||
|
||||
RETURNS
|
||||
<<iswspace>> returns non-zero if <[c]> is a whitespace wide character.
|
||||
|
||||
PORTABILITY
|
||||
<<iswspace>> is C99.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
#include <_ansi.h>
|
||||
#include <newlib.h>
|
||||
#include <wctype.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include "local.h"
|
||||
|
||||
int
|
||||
_DEFUN(iswspace,(c), wint_t c)
|
||||
{
|
||||
#ifdef _MB_CAPABLE
|
||||
c = _jp2uc (c);
|
||||
/* Based on Unicode 5.2. Control chars 09-0D, plus all characters
|
||||
from general category "Zs", which are not marked as decomposition
|
||||
type "noBreak". */
|
||||
return ((c >= 0x0009 && c <= 0x000d) || c == 0x0020 ||
|
||||
c == 0x1680 || c == 0x180e ||
|
||||
(c >= 0x2000 && c <= 0x2006) ||
|
||||
(c >= 0x2008 && c <= 0x200a) ||
|
||||
c == 0x2028 || c == 0x2029 ||
|
||||
c == 0x205f || c == 0x3000);
|
||||
#else
|
||||
return (c < 0x100 ? isspace (c) : 0);
|
||||
#endif /* _MB_CAPABLE */
|
||||
}
|
||||
|
@ -1,38 +0,0 @@
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<iswupper>>---uppercase wide character test
|
||||
|
||||
INDEX
|
||||
iswupper
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswupper(wint_t <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswupper(<[c]>)
|
||||
wint_t <[c]>;
|
||||
|
||||
DESCRIPTION
|
||||
<<iswupper>> is a function which classifies wide-character values that
|
||||
have uppercase translations.
|
||||
|
||||
RETURNS
|
||||
<<iswupper>> returns non-zero if <[c]> is a uppercase wide character.
|
||||
|
||||
PORTABILITY
|
||||
<<iswupper>> is C99.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
#include <_ansi.h>
|
||||
#include <wctype.h>
|
||||
|
||||
int
|
||||
_DEFUN(iswupper,(c),wint_t c)
|
||||
{
|
||||
return (towlower (c) != c);
|
||||
}
|
||||
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
FUNCTION
|
||||
<<iswxdigit>>---hexadecimal digit wide character test
|
||||
|
||||
INDEX
|
||||
iswxdigit
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswxdigit(wint_t <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
int iswxdigit(<[c]>)
|
||||
wint_t <[c]>;
|
||||
|
||||
DESCRIPTION
|
||||
<<iswxdigit>> is a function which classifies wide character values that
|
||||
are hexadecimal digits.
|
||||
|
||||
RETURNS
|
||||
<<iswxdigit>> returns non-zero if <[c]> is a hexadecimal digit wide character.
|
||||
|
||||
PORTABILITY
|
||||
<<iswxdigit>> is C99.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
#include <_ansi.h>
|
||||
#include <wctype.h>
|
||||
|
||||
int
|
||||
_DEFUN(iswxdigit,(c), wint_t c)
|
||||
{
|
||||
return ((c >= (wint_t)'0' && c <= (wint_t)'9') ||
|
||||
(c >= (wint_t)'a' && c <= (wint_t)'f') ||
|
||||
(c >= (wint_t)'A' && c <= (wint_t)'F'));
|
||||
}
|
||||
|
@ -1,45 +0,0 @@
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<isxdigit>>---hexadecimal digit predicate
|
||||
|
||||
INDEX
|
||||
isxdigit
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int isxdigit(int <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int isxdigit(int <[c]>);
|
||||
|
||||
DESCRIPTION
|
||||
<<isxdigit>> is a macro which classifies ASCII integer values by table
|
||||
lookup. It is a predicate returning non-zero for hexadecimal digits,
|
||||
and <<0>> for other characters. It is defined only when
|
||||
<<isascii>>(<[c]>) is true or <[c]> is EOF.
|
||||
|
||||
You can use a compiled subroutine instead of the macro definition by
|
||||
undefining the macro using `<<#undef isxdigit>>'.
|
||||
|
||||
RETURNS
|
||||
<<isxdigit>> returns non-zero if <[c]> is a hexadecimal digit
|
||||
(<<0>>--<<9>>, <<a>>--<<f>>, or <<A>>--<<F>>).
|
||||
|
||||
PORTABILITY
|
||||
<<isxdigit>> is ANSI C.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
#include <_ansi.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
#undef isxdigit
|
||||
int
|
||||
_DEFUN(isxdigit,(c),int c)
|
||||
{
|
||||
return(__ctype_ptr__[c+1] & ((_X)|(_N)));
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,32 +0,0 @@
|
||||
/* wctrans constants */
|
||||
|
||||
#include <_ansi.h>
|
||||
|
||||
/* valid values for wctrans_t */
|
||||
#define WCT_TOLOWER 1
|
||||
#define WCT_TOUPPER 2
|
||||
|
||||
/* valid values for wctype_t */
|
||||
#define WC_ALNUM 1
|
||||
#define WC_ALPHA 2
|
||||
#define WC_BLANK 3
|
||||
#define WC_CNTRL 4
|
||||
#define WC_DIGIT 5
|
||||
#define WC_GRAPH 6
|
||||
#define WC_LOWER 7
|
||||
#define WC_PRINT 8
|
||||
#define WC_PUNCT 9
|
||||
#define WC_SPACE 10
|
||||
#define WC_UPPER 11
|
||||
#define WC_XDIGIT 12
|
||||
|
||||
extern char *__locale_charset(_NOARGS);
|
||||
|
||||
/* internal function to translate JP to Unicode */
|
||||
#ifdef __CYGWIN__
|
||||
/* Under Cygwin, the incoming wide character is already given in UTF due
|
||||
to the requirements of the underlying OS. */
|
||||
#define _jp2uc(c) (c)
|
||||
#else
|
||||
wint_t _EXFUN (_jp2uc, (wint_t));
|
||||
#endif
|
@ -1,41 +0,0 @@
|
||||
/*
|
||||
FUNCTION
|
||||
<<toascii>>---force integers to ASCII range
|
||||
|
||||
INDEX
|
||||
toascii
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int toascii(int <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int toascii(<[c]>);
|
||||
int (<[c]>);
|
||||
|
||||
DESCRIPTION
|
||||
<<toascii>> is a macro which coerces integers to the ASCII range (0--127) by zeroing any higher-order bits.
|
||||
|
||||
You can use a compiled subroutine instead of the macro definition by
|
||||
undefining this macro using `<<#undef toascii>>'.
|
||||
|
||||
RETURNS
|
||||
<<toascii>> returns integers between 0 and 127.
|
||||
|
||||
PORTABILITY
|
||||
<<toascii>> is not ANSI C.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
|
||||
#include <_ansi.h>
|
||||
#include <ctype.h>
|
||||
#undef toascii
|
||||
|
||||
int
|
||||
_DEFUN(toascii,(c),int c)
|
||||
{
|
||||
return (c)&0177;
|
||||
}
|
||||
|
@ -1,76 +0,0 @@
|
||||
/*
|
||||
FUNCTION
|
||||
<<tolower>>---translate characters to lowercase
|
||||
|
||||
INDEX
|
||||
tolower
|
||||
INDEX
|
||||
_tolower
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int tolower(int <[c]>);
|
||||
int _tolower(int <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int tolower(<[c]>);
|
||||
int _tolower(<[c]>);
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
<<tolower>> is a macro which converts uppercase characters to lowercase,
|
||||
leaving all other characters unchanged. It is only defined when
|
||||
<[c]> is an integer in the range <<EOF>> to <<255>>.
|
||||
|
||||
You can use a compiled subroutine instead of the macro definition by
|
||||
undefining this macro using `<<#undef tolower>>'.
|
||||
|
||||
<<_tolower>> performs the same conversion as <<tolower>>, but should
|
||||
only be used when <[c]> is known to be an uppercase character (<<A>>--<<Z>>).
|
||||
|
||||
RETURNS
|
||||
<<tolower>> returns the lowercase equivalent of <[c]> when it is a
|
||||
character between <<A>> and <<Z>>, and <[c]> otherwise.
|
||||
|
||||
<<_tolower>> returns the lowercase equivalent of <[c]> when it is a
|
||||
character between <<A>> and <<Z>>. If <[c]> is not one of these
|
||||
characters, the behaviour of <<_tolower>> is undefined.
|
||||
|
||||
PORTABILITY
|
||||
<<tolower>> is ANSI C. <<_tolower>> is not recommended for portable
|
||||
programs.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
|
||||
#include <_ansi.h>
|
||||
#include <ctype.h>
|
||||
#if defined (_MB_EXTENDED_CHARSETS_ISO) || defined (_MB_EXTENDED_CHARSETS_WINDOWS)
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <wctype.h>
|
||||
#include <wchar.h>
|
||||
#endif
|
||||
|
||||
#undef tolower
|
||||
int
|
||||
_DEFUN(tolower,(c),int c)
|
||||
{
|
||||
#if defined (_MB_EXTENDED_CHARSETS_ISO) || defined (_MB_EXTENDED_CHARSETS_WINDOWS)
|
||||
if ((unsigned char) c <= 0x7f)
|
||||
return isupper (c) ? c - 'A' + 'a' : c;
|
||||
else if (c != EOF && MB_CUR_MAX == 1 && isupper (c))
|
||||
{
|
||||
char s[MB_LEN_MAX] = { c, '\0' };
|
||||
wchar_t wc;
|
||||
if (mbtowc (&wc, s, 1) >= 0
|
||||
&& wctomb (s, (wchar_t) towlower ((wint_t) wc)) == 1)
|
||||
c = (unsigned char) s[0];
|
||||
}
|
||||
return c;
|
||||
#else
|
||||
return isupper(c) ? (c) - 'A' + 'a' : c;
|
||||
#endif
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
/*
|
||||
FUNCTION
|
||||
<<toupper>>---translate characters to uppercase
|
||||
|
||||
INDEX
|
||||
toupper
|
||||
INDEX
|
||||
_toupper
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int toupper(int <[c]>);
|
||||
int _toupper(int <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <ctype.h>
|
||||
int toupper(<[c]>);
|
||||
int _toupper(<[c]>);
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
<<toupper>> is a macro which converts lowercase characters to uppercase,
|
||||
leaving all other characters unchanged. It is only defined when
|
||||
<[c]> is an integer in the range <<EOF>> to <<255>>.
|
||||
|
||||
You can use a compiled subroutine instead of the macro definition by
|
||||
undefining this macro using `<<#undef toupper>>'.
|
||||
|
||||
<<_toupper>> performs the same conversion as <<toupper>>, but should
|
||||
only be used when <[c]> is known to be a lowercase character (<<a>>--<<z>>).
|
||||
|
||||
RETURNS
|
||||
<<toupper>> returns the uppercase equivalent of <[c]> when it is a
|
||||
character between <<a>> and <<z>>, and <[c]> otherwise.
|
||||
|
||||
<<_toupper>> returns the uppercase equivalent of <[c]> when it is a
|
||||
character between <<a>> and <<z>>. If <[c]> is not one of these
|
||||
characters, the behaviour of <<_toupper>> is undefined.
|
||||
|
||||
PORTABILITY
|
||||
<<toupper>> is ANSI C. <<_toupper>> is not recommended for portable programs.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
|
||||
#include <_ansi.h>
|
||||
#include <ctype.h>
|
||||
#if defined (_MB_EXTENDED_CHARSETS_ISO) || defined (_MB_EXTENDED_CHARSETS_WINDOWS)
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <wctype.h>
|
||||
#include <wchar.h>
|
||||
#endif
|
||||
|
||||
#undef toupper
|
||||
int
|
||||
_DEFUN(toupper,(c),int c)
|
||||
{
|
||||
#if defined (_MB_EXTENDED_CHARSETS_ISO) || defined (_MB_EXTENDED_CHARSETS_WINDOWS)
|
||||
if ((unsigned char) c <= 0x7f)
|
||||
return islower (c) ? c - 'a' + 'A' : c;
|
||||
else if (c != EOF && MB_CUR_MAX == 1 && islower (c))
|
||||
{
|
||||
char s[MB_LEN_MAX] = { c, '\0' };
|
||||
wchar_t wc;
|
||||
if (mbtowc (&wc, s, 1) >= 0
|
||||
&& wctomb (s, (wchar_t) towupper ((wint_t) wc)) == 1)
|
||||
c = (unsigned char) s[0];
|
||||
}
|
||||
return c;
|
||||
#else
|
||||
return islower (c) ? c - 'a' + 'A' : c;
|
||||
#endif
|
||||
}
|
@ -1,97 +0,0 @@
|
||||
/* Copyright (c) 2002 Red Hat Incorporated.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
The name of Red Hat Incorporated may not be used to endorse
|
||||
or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<towctrans>>---extensible wide-character translation
|
||||
|
||||
INDEX
|
||||
towctrans
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
wint_t towctrans(wint_t <[c]>, wctrans_t <[w]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
wint_t towctrans(<[c]>, <[w]>)
|
||||
wint_t <[c]>;
|
||||
wctrans_t <[w]>;
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
<<towctrans>> is a function which converts wide characters based on
|
||||
a specified translation type <[w]>. If the translation type is
|
||||
invalid or cannot be applied to the current character, no change
|
||||
to the character is made.
|
||||
|
||||
RETURNS
|
||||
<<towctrans>> returns the translated equivalent of <[c]> when it is a
|
||||
valid for the given translation, otherwise, it returns the input character.
|
||||
When the translation type is invalid, <<errno>> is set <<EINVAL>>.
|
||||
|
||||
PORTABILITY
|
||||
<<towctrans>> is C99.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
|
||||
#include <_ansi.h>
|
||||
#include <string.h>
|
||||
#include <reent.h>
|
||||
#include <wctype.h>
|
||||
#include <errno.h>
|
||||
#include "local.h"
|
||||
|
||||
wint_t
|
||||
_DEFUN (_towctrans_r, (r, c, w),
|
||||
struct _reent *r _AND
|
||||
wint_t c _AND
|
||||
wctrans_t w)
|
||||
{
|
||||
if (w == WCT_TOLOWER)
|
||||
return towlower (c);
|
||||
else if (w == WCT_TOUPPER)
|
||||
return towupper (c);
|
||||
else
|
||||
{
|
||||
r->_errno = EINVAL;
|
||||
return c;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef _REENT_ONLY
|
||||
wint_t
|
||||
_DEFUN (towctrans, (c, w),
|
||||
wint_t c _AND
|
||||
wctrans_t w)
|
||||
{
|
||||
return _towctrans_r (_REENT, c, w);
|
||||
}
|
||||
#endif /* !_REENT_ONLY */
|
@ -1,569 +0,0 @@
|
||||
/* Copyright (c) 2002 Red Hat Incorporated.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
The name of Red Hat Incorporated may not be used to endorse
|
||||
or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<towlower>>---translate wide characters to lowercase
|
||||
|
||||
INDEX
|
||||
towlower
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
wint_t towlower(wint_t <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
wint_t towlower(<[c]>)
|
||||
wint_t <[c]>;
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
<<towlower>> is a function which converts uppercase wide characters to
|
||||
lowercase, leaving all other characters unchanged.
|
||||
|
||||
RETURNS
|
||||
<<towlower>> returns the lowercase equivalent of <[c]> when it is a
|
||||
uppercase wide character; otherwise, it returns the input character.
|
||||
|
||||
PORTABILITY
|
||||
<<towlower>> is C99.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
|
||||
#include <_ansi.h>
|
||||
#include <newlib.h>
|
||||
#include <string.h>
|
||||
#include <reent.h>
|
||||
#include <ctype.h>
|
||||
#include <wctype.h>
|
||||
#include "local.h"
|
||||
|
||||
wint_t
|
||||
_DEFUN(towlower,(c), wint_t c)
|
||||
{
|
||||
#ifdef _MB_CAPABLE
|
||||
c = _jp2uc (c);
|
||||
/* Based on and tested against Unicode 5.2 */
|
||||
|
||||
/* Expression used to filter out the characters for the below code:
|
||||
|
||||
awk -F\; '{ if ( $14 != "" ) print $1; }' UnicodeData.txt
|
||||
*/
|
||||
if (c < 0x100)
|
||||
{
|
||||
if ((c >= 0x0041 && c <= 0x005a) ||
|
||||
(c >= 0x00c0 && c <= 0x00d6) ||
|
||||
(c >= 0x00d8 && c <= 0x00de))
|
||||
return (c + 0x20);
|
||||
|
||||
return c;
|
||||
}
|
||||
else if (c < 0x300)
|
||||
{
|
||||
if ((c >= 0x0100 && c <= 0x012e) ||
|
||||
(c >= 0x0132 && c <= 0x0136) ||
|
||||
(c >= 0x014a && c <= 0x0176) ||
|
||||
(c >= 0x01de && c <= 0x01ee) ||
|
||||
(c >= 0x01f8 && c <= 0x021e) ||
|
||||
(c >= 0x0222 && c <= 0x0232))
|
||||
{
|
||||
if (!(c & 0x01))
|
||||
return (c + 1);
|
||||
return c;
|
||||
}
|
||||
|
||||
if (c == 0x0130)
|
||||
return 0x0069;
|
||||
|
||||
if ((c >= 0x0139 && c <= 0x0147) ||
|
||||
(c >= 0x01cd && c <= 0x01db))
|
||||
{
|
||||
if (c & 0x01)
|
||||
return (c + 1);
|
||||
return c;
|
||||
}
|
||||
|
||||
if (c >= 0x178 && c <= 0x01f7)
|
||||
{
|
||||
wint_t k;
|
||||
switch (c)
|
||||
{
|
||||
case 0x0178:
|
||||
k = 0x00ff;
|
||||
break;
|
||||
case 0x0179:
|
||||
case 0x017b:
|
||||
case 0x017d:
|
||||
case 0x0182:
|
||||
case 0x0184:
|
||||
case 0x0187:
|
||||
case 0x018b:
|
||||
case 0x0191:
|
||||
case 0x0198:
|
||||
case 0x01a0:
|
||||
case 0x01a2:
|
||||
case 0x01a4:
|
||||
case 0x01a7:
|
||||
case 0x01ac:
|
||||
case 0x01af:
|
||||
case 0x01b3:
|
||||
case 0x01b5:
|
||||
case 0x01b8:
|
||||
case 0x01bc:
|
||||
case 0x01c5:
|
||||
case 0x01c8:
|
||||
case 0x01cb:
|
||||
case 0x01cd:
|
||||
case 0x01cf:
|
||||
case 0x01d1:
|
||||
case 0x01d3:
|
||||
case 0x01d5:
|
||||
case 0x01d7:
|
||||
case 0x01d9:
|
||||
case 0x01db:
|
||||
case 0x01f2:
|
||||
case 0x01f4:
|
||||
k = c + 1;
|
||||
break;
|
||||
case 0x0181:
|
||||
k = 0x0253;
|
||||
break;
|
||||
case 0x0186:
|
||||
k = 0x0254;
|
||||
break;
|
||||
case 0x0189:
|
||||
k = 0x0256;
|
||||
break;
|
||||
case 0x018a:
|
||||
k = 0x0257;
|
||||
break;
|
||||
case 0x018e:
|
||||
k = 0x01dd;
|
||||
break;
|
||||
case 0x018f:
|
||||
k = 0x0259;
|
||||
break;
|
||||
case 0x0190:
|
||||
k = 0x025b;
|
||||
break;
|
||||
case 0x0193:
|
||||
k = 0x0260;
|
||||
break;
|
||||
case 0x0194:
|
||||
k = 0x0263;
|
||||
break;
|
||||
case 0x0196:
|
||||
k = 0x0269;
|
||||
break;
|
||||
case 0x0197:
|
||||
k = 0x0268;
|
||||
break;
|
||||
case 0x019c:
|
||||
k = 0x026f;
|
||||
break;
|
||||
case 0x019d:
|
||||
k = 0x0272;
|
||||
break;
|
||||
case 0x019f:
|
||||
k = 0x0275;
|
||||
break;
|
||||
case 0x01a6:
|
||||
k = 0x0280;
|
||||
break;
|
||||
case 0x01a9:
|
||||
k = 0x0283;
|
||||
break;
|
||||
case 0x01ae:
|
||||
k = 0x0288;
|
||||
break;
|
||||
case 0x01b1:
|
||||
k = 0x028a;
|
||||
break;
|
||||
case 0x01b2:
|
||||
k = 0x028b;
|
||||
break;
|
||||
case 0x01b7:
|
||||
k = 0x0292;
|
||||
break;
|
||||
case 0x01c4:
|
||||
case 0x01c7:
|
||||
case 0x01ca:
|
||||
case 0x01f1:
|
||||
k = c + 2;
|
||||
break;
|
||||
case 0x01f6:
|
||||
k = 0x0195;
|
||||
break;
|
||||
case 0x01f7:
|
||||
k = 0x01bf;
|
||||
break;
|
||||
default:
|
||||
k = 0;
|
||||
}
|
||||
if (k != 0)
|
||||
return k;
|
||||
}
|
||||
else if (c == 0x0220)
|
||||
return 0x019e;
|
||||
else if (c >= 0x023a && c <= 0x024e)
|
||||
{
|
||||
wint_t k;
|
||||
switch (c)
|
||||
{
|
||||
case 0x023a:
|
||||
k = 0x2c65;
|
||||
break;
|
||||
case 0x023b:
|
||||
case 0x0241:
|
||||
case 0x0246:
|
||||
case 0x0248:
|
||||
case 0x024a:
|
||||
case 0x024c:
|
||||
case 0x024e:
|
||||
k = c + 1;
|
||||
break;
|
||||
case 0x023d:
|
||||
k = 0x019a;
|
||||
break;
|
||||
case 0x023e:
|
||||
k = 0x2c66;
|
||||
break;
|
||||
case 0x0243:
|
||||
k = 0x0180;
|
||||
break;
|
||||
case 0x0244:
|
||||
k = 0x0289;
|
||||
break;
|
||||
case 0x0245:
|
||||
k = 0x028c;
|
||||
break;
|
||||
default:
|
||||
k = 0;
|
||||
}
|
||||
if (k != 0)
|
||||
return k;
|
||||
}
|
||||
}
|
||||
else if (c < 0x0400)
|
||||
{
|
||||
if (c == 0x0370 || c == 0x0372 || c == 0x0376)
|
||||
return (c + 1);
|
||||
if (c >= 0x0391 && c <= 0x03ab && c != 0x03a2)
|
||||
return (c + 0x20);
|
||||
if (c >= 0x03d8 && c <= 0x03ee && !(c & 0x01))
|
||||
return (c + 1);
|
||||
if (c >= 0x0386 && c <= 0x03ff)
|
||||
{
|
||||
wint_t k;
|
||||
switch (c)
|
||||
{
|
||||
case 0x0386:
|
||||
k = 0x03ac;
|
||||
break;
|
||||
case 0x0388:
|
||||
k = 0x03ad;
|
||||
break;
|
||||
case 0x0389:
|
||||
k = 0x03ae;
|
||||
break;
|
||||
case 0x038a:
|
||||
k = 0x03af;
|
||||
break;
|
||||
case 0x038c:
|
||||
k = 0x03cc;
|
||||
break;
|
||||
case 0x038e:
|
||||
k = 0x03cd;
|
||||
break;
|
||||
case 0x038f:
|
||||
k = 0x03ce;
|
||||
break;
|
||||
case 0x03cf:
|
||||
k = 0x03d7;
|
||||
break;
|
||||
case 0x03f4:
|
||||
k = 0x03b8;
|
||||
break;
|
||||
case 0x03f7:
|
||||
k = 0x03f8;
|
||||
break;
|
||||
case 0x03f9:
|
||||
k = 0x03f2;
|
||||
break;
|
||||
case 0x03fa:
|
||||
k = 0x03fb;
|
||||
break;
|
||||
case 0x03fd:
|
||||
k = 0x037b;
|
||||
break;
|
||||
case 0x03fe:
|
||||
k = 0x037c;
|
||||
break;
|
||||
case 0x03ff:
|
||||
k = 0x037d;
|
||||
break;
|
||||
default:
|
||||
k = 0;
|
||||
}
|
||||
if (k != 0)
|
||||
return k;
|
||||
}
|
||||
}
|
||||
else if (c < 0x500)
|
||||
{
|
||||
if (c >= 0x0400 && c <= 0x040f)
|
||||
return (c + 0x50);
|
||||
|
||||
if (c >= 0x0410 && c <= 0x042f)
|
||||
return (c + 0x20);
|
||||
|
||||
if ((c >= 0x0460 && c <= 0x0480) ||
|
||||
(c >= 0x048a && c <= 0x04be) ||
|
||||
(c >= 0x04d0 && c <= 0x04fe))
|
||||
{
|
||||
if (!(c & 0x01))
|
||||
return (c + 1);
|
||||
return c;
|
||||
}
|
||||
|
||||
if (c == 0x04c0)
|
||||
return 0x04cf;
|
||||
|
||||
if (c >= 0x04c1 && c <= 0x04cd)
|
||||
{
|
||||
if (c & 0x01)
|
||||
return (c + 1);
|
||||
return c;
|
||||
}
|
||||
}
|
||||
else if (c < 0x1f00)
|
||||
{
|
||||
if ((c >= 0x0500 && c <= 0x050e) ||
|
||||
(c >= 0x0510 && c <= 0x0524) ||
|
||||
(c >= 0x1e00 && c <= 0x1e94) ||
|
||||
(c >= 0x1ea0 && c <= 0x1ef8))
|
||||
{
|
||||
if (!(c & 0x01))
|
||||
return (c + 1);
|
||||
return c;
|
||||
}
|
||||
|
||||
if (c >= 0x0531 && c <= 0x0556)
|
||||
return (c + 0x30);
|
||||
|
||||
if (c >= 0x10a0 && c <= 0x10c5)
|
||||
return (c + 0x1c60);
|
||||
|
||||
if (c == 0x1e9e)
|
||||
return 0x00df;
|
||||
|
||||
if (c >= 0x1efa && c <= 0x1efe && !(c & 0x01))
|
||||
return (c + 1);
|
||||
}
|
||||
else if (c < 0x2000)
|
||||
{
|
||||
if ((c >= 0x1f08 && c <= 0x1f0f) ||
|
||||
(c >= 0x1f18 && c <= 0x1f1d) ||
|
||||
(c >= 0x1f28 && c <= 0x1f2f) ||
|
||||
(c >= 0x1f38 && c <= 0x1f3f) ||
|
||||
(c >= 0x1f48 && c <= 0x1f4d) ||
|
||||
(c >= 0x1f68 && c <= 0x1f6f) ||
|
||||
(c >= 0x1f88 && c <= 0x1f8f) ||
|
||||
(c >= 0x1f98 && c <= 0x1f9f) ||
|
||||
(c >= 0x1fa8 && c <= 0x1faf))
|
||||
return (c - 0x08);
|
||||
|
||||
if (c >= 0x1f59 && c <= 0x1f5f)
|
||||
{
|
||||
if (c & 0x01)
|
||||
return (c - 0x08);
|
||||
return c;
|
||||
}
|
||||
|
||||
if (c >= 0x1fb8 && c <= 0x1ffc)
|
||||
{
|
||||
wint_t k;
|
||||
switch (c)
|
||||
{
|
||||
case 0x1fb8:
|
||||
case 0x1fb9:
|
||||
case 0x1fd8:
|
||||
case 0x1fd9:
|
||||
case 0x1fe8:
|
||||
case 0x1fe9:
|
||||
k = c - 0x08;
|
||||
break;
|
||||
case 0x1fba:
|
||||
case 0x1fbb:
|
||||
k = c - 0x4a;
|
||||
break;
|
||||
case 0x1fbc:
|
||||
k = 0x1fb3;
|
||||
break;
|
||||
case 0x1fc8:
|
||||
case 0x1fc9:
|
||||
case 0x1fca:
|
||||
case 0x1fcb:
|
||||
k = c - 0x56;
|
||||
break;
|
||||
case 0x1fcc:
|
||||
k = 0x1fc3;
|
||||
break;
|
||||
case 0x1fda:
|
||||
case 0x1fdb:
|
||||
k = c - 0x64;
|
||||
break;
|
||||
case 0x1fea:
|
||||
case 0x1feb:
|
||||
k = c - 0x70;
|
||||
break;
|
||||
case 0x1fec:
|
||||
k = 0x1fe5;
|
||||
break;
|
||||
case 0x1ff8:
|
||||
case 0x1ff9:
|
||||
k = c - 0x80;
|
||||
break;
|
||||
case 0x1ffa:
|
||||
case 0x1ffb:
|
||||
k = c - 0x7e;
|
||||
break;
|
||||
case 0x1ffc:
|
||||
k = 0x1ff3;
|
||||
break;
|
||||
default:
|
||||
k = 0;
|
||||
}
|
||||
if (k != 0)
|
||||
return k;
|
||||
}
|
||||
}
|
||||
else if (c < 0x2c00)
|
||||
{
|
||||
if (c >= 0x2160 && c <= 0x216f)
|
||||
return (c + 0x10);
|
||||
|
||||
if (c >= 0x24b6 && c <= 0x24cf)
|
||||
return (c + 0x1a);
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case 0x2126:
|
||||
return 0x03c9;
|
||||
case 0x212a:
|
||||
return 0x006b;
|
||||
case 0x212b:
|
||||
return 0x00e5;
|
||||
case 0x2132:
|
||||
return 0x214e;
|
||||
case 0x2183:
|
||||
return 0x2184;
|
||||
}
|
||||
}
|
||||
else if (c < 0x2d00)
|
||||
{
|
||||
if (c >= 0x2c00 && c <= 0x2c2e)
|
||||
return (c + 0x30);
|
||||
|
||||
if (c >= 0x2c80 && c <= 0x2ce2 && !(c & 0x01))
|
||||
return (c + 1);
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case 0x2c60:
|
||||
return 0x2c61;
|
||||
case 0x2c62:
|
||||
return 0x026b;
|
||||
case 0x2c63:
|
||||
return 0x1d7d;
|
||||
case 0x2c64:
|
||||
return 0x027d;
|
||||
case 0x2c67:
|
||||
case 0x2c69:
|
||||
case 0x2c6b:
|
||||
case 0x2c72:
|
||||
case 0x2c75:
|
||||
case 0x2ceb:
|
||||
case 0x2ced:
|
||||
return c + 1;
|
||||
case 0x2c6d:
|
||||
return 0x0251;
|
||||
case 0x2c6e:
|
||||
return 0x0271;
|
||||
case 0x2c6f:
|
||||
return 0x0250;
|
||||
case 0x2c70:
|
||||
return 0x0252;
|
||||
case 0x2c7e:
|
||||
return 0x023f;
|
||||
case 0x2c7f:
|
||||
return 0x0240;
|
||||
}
|
||||
}
|
||||
else if (c >= 0xa600 && c < 0xa800)
|
||||
{
|
||||
if ((c >= 0xa640 && c <= 0xa65e) ||
|
||||
(c >= 0xa662 && c <= 0xa66c) ||
|
||||
(c >= 0xa680 && c <= 0xa696) ||
|
||||
(c >= 0xa722 && c <= 0xa72e) ||
|
||||
(c >= 0xa732 && c <= 0xa76e) ||
|
||||
(c >= 0xa77f && c <= 0xa786))
|
||||
{
|
||||
if (!(c & 1))
|
||||
return (c + 1);
|
||||
return c;
|
||||
}
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case 0xa779:
|
||||
case 0xa77b:
|
||||
case 0xa77e:
|
||||
case 0xa78b:
|
||||
return (c + 1);
|
||||
case 0xa77d:
|
||||
return 0x1d79;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (c >= 0xff21 && c <= 0xff3a)
|
||||
return (c + 0x20);
|
||||
|
||||
if (c >= 0x10400 && c <= 0x10427)
|
||||
return (c + 0x28);
|
||||
}
|
||||
return c;
|
||||
#else
|
||||
return (c < 0x00ff ? (wint_t)(tolower ((int)c)) : c);
|
||||
#endif /* _MB_CAPABLE */
|
||||
}
|
||||
|
@ -1,590 +0,0 @@
|
||||
/* Copyright (c) 2002 Red Hat Incorporated.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
The name of Red Hat Incorporated may not be used to endorse
|
||||
or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<towupper>>---translate wide characters to uppercase
|
||||
|
||||
INDEX
|
||||
towupper
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
wint_t towupper(wint_t <[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
wint_t towupper(<[c]>)
|
||||
wint_t <[c]>;
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
<<towupper>> is a function which converts lowercase wide characters to
|
||||
uppercase, leaving all other characters unchanged.
|
||||
|
||||
RETURNS
|
||||
<<towupper>> returns the uppercase equivalent of <[c]> when it is a
|
||||
lowercase wide character, otherwise, it returns the input character.
|
||||
|
||||
PORTABILITY
|
||||
<<towupper>> is C99.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
|
||||
#include <_ansi.h>
|
||||
#include <newlib.h>
|
||||
#include <string.h>
|
||||
#include <reent.h>
|
||||
#include <ctype.h>
|
||||
#include <wctype.h>
|
||||
#include "local.h"
|
||||
|
||||
wint_t
|
||||
_DEFUN(towupper,(c), wint_t c)
|
||||
{
|
||||
#ifdef _MB_CAPABLE
|
||||
c = _jp2uc (c);
|
||||
/* Based on and tested against Unicode 5.2 */
|
||||
|
||||
/* Expression used to filter out the characters for the below code:
|
||||
|
||||
awk -F\; '{ if ( $13 != "" ) print $1; }' UnicodeData.txt
|
||||
*/
|
||||
if (c < 0x100)
|
||||
{
|
||||
if (c == 0x00b5)
|
||||
return 0x039c;
|
||||
|
||||
if ((c >= 0x00e0 && c <= 0x00fe && c != 0x00f7) ||
|
||||
(c >= 0x0061 && c <= 0x007a))
|
||||
return (c - 0x20);
|
||||
|
||||
if (c == 0xff)
|
||||
return 0x0178;
|
||||
|
||||
return c;
|
||||
}
|
||||
else if (c < 0x300)
|
||||
{
|
||||
if ((c >= 0x0101 && c <= 0x012f) ||
|
||||
(c >= 0x0133 && c <= 0x0137) ||
|
||||
(c >= 0x014b && c <= 0x0177) ||
|
||||
(c >= 0x01df && c <= 0x01ef) ||
|
||||
(c >= 0x01f9 && c <= 0x021f) ||
|
||||
(c >= 0x0223 && c <= 0x0233) ||
|
||||
(c >= 0x0247 && c <= 0x024f))
|
||||
{
|
||||
if (c & 0x01)
|
||||
return (c - 1);
|
||||
return c;
|
||||
}
|
||||
|
||||
if ((c >= 0x013a && c <= 0x0148) ||
|
||||
(c >= 0x01ce && c <= 0x01dc) ||
|
||||
c == 0x023c || c == 0x0242)
|
||||
{
|
||||
if (!(c & 0x01))
|
||||
return (c - 1);
|
||||
return c;
|
||||
}
|
||||
|
||||
if (c == 0x0131)
|
||||
return 0x0049;
|
||||
|
||||
if (c == 0x017a || c == 0x017c || c == 0x017e)
|
||||
return (c - 1);
|
||||
|
||||
if (c >= 0x017f && c <= 0x0292)
|
||||
{
|
||||
wint_t k;
|
||||
switch (c)
|
||||
{
|
||||
case 0x017f:
|
||||
k = 0x0053;
|
||||
break;
|
||||
case 0x0180:
|
||||
k = 0x0243;
|
||||
break;
|
||||
case 0x0183:
|
||||
k = 0x0182;
|
||||
break;
|
||||
case 0x0185:
|
||||
k = 0x0184;
|
||||
break;
|
||||
case 0x0188:
|
||||
k = 0x0187;
|
||||
break;
|
||||
case 0x018c:
|
||||
k = 0x018b;
|
||||
break;
|
||||
case 0x0192:
|
||||
k = 0x0191;
|
||||
break;
|
||||
case 0x0195:
|
||||
k = 0x01f6;
|
||||
break;
|
||||
case 0x0199:
|
||||
k = 0x0198;
|
||||
break;
|
||||
case 0x019a:
|
||||
k = 0x023d;
|
||||
break;
|
||||
case 0x019e:
|
||||
k = 0x0220;
|
||||
break;
|
||||
case 0x01a1:
|
||||
case 0x01a3:
|
||||
case 0x01a5:
|
||||
case 0x01a8:
|
||||
case 0x01ad:
|
||||
case 0x01b0:
|
||||
case 0x01b4:
|
||||
case 0x01b6:
|
||||
case 0x01b9:
|
||||
case 0x01bd:
|
||||
case 0x01c5:
|
||||
case 0x01c8:
|
||||
case 0x01cb:
|
||||
case 0x01f2:
|
||||
case 0x01f5:
|
||||
k = c - 1;
|
||||
break;
|
||||
case 0x01bf:
|
||||
k = 0x01f7;
|
||||
break;
|
||||
case 0x01c6:
|
||||
case 0x01c9:
|
||||
case 0x01cc:
|
||||
k = c - 2;
|
||||
break;
|
||||
case 0x01dd:
|
||||
k = 0x018e;
|
||||
break;
|
||||
case 0x01f3:
|
||||
k = 0x01f1;
|
||||
break;
|
||||
case 0x023f:
|
||||
k = 0x2c7e;
|
||||
break;
|
||||
case 0x0240:
|
||||
k = 0x2c7f;
|
||||
break;
|
||||
case 0x0250:
|
||||
k = 0x2c6f;
|
||||
break;
|
||||
case 0x0251:
|
||||
k = 0x2c6d;
|
||||
break;
|
||||
case 0x0252:
|
||||
k = 0x2c70;
|
||||
break;
|
||||
case 0x0253:
|
||||
k = 0x0181;
|
||||
break;
|
||||
case 0x0254:
|
||||
k = 0x0186;
|
||||
break;
|
||||
case 0x0256:
|
||||
k = 0x0189;
|
||||
break;
|
||||
case 0x0257:
|
||||
k = 0x018a;
|
||||
break;
|
||||
case 0x0259:
|
||||
k = 0x018f;
|
||||
break;
|
||||
case 0x025b:
|
||||
k = 0x0190;
|
||||
break;
|
||||
case 0x0260:
|
||||
k = 0x0193;
|
||||
break;
|
||||
case 0x0263:
|
||||
k = 0x0194;
|
||||
break;
|
||||
case 0x0268:
|
||||
k = 0x0197;
|
||||
break;
|
||||
case 0x0269:
|
||||
k = 0x0196;
|
||||
break;
|
||||
case 0x026b:
|
||||
k = 0x2c62;
|
||||
break;
|
||||
case 0x026f:
|
||||
k = 0x019c;
|
||||
break;
|
||||
case 0x0271:
|
||||
k = 0x2c6e;
|
||||
break;
|
||||
case 0x0272:
|
||||
k = 0x019d;
|
||||
break;
|
||||
case 0x0275:
|
||||
k = 0x019f;
|
||||
break;
|
||||
case 0x027d:
|
||||
k = 0x2c64;
|
||||
break;
|
||||
case 0x0280:
|
||||
k = 0x01a6;
|
||||
break;
|
||||
case 0x0283:
|
||||
k = 0x01a9;
|
||||
break;
|
||||
case 0x0288:
|
||||
k = 0x01ae;
|
||||
break;
|
||||
case 0x0289:
|
||||
k = 0x0244;
|
||||
break;
|
||||
case 0x028a:
|
||||
k = 0x01b1;
|
||||
break;
|
||||
case 0x028b:
|
||||
k = 0x01b2;
|
||||
break;
|
||||
case 0x028c:
|
||||
k = 0x0245;
|
||||
break;
|
||||
case 0x0292:
|
||||
k = 0x01b7;
|
||||
break;
|
||||
default:
|
||||
k = 0;
|
||||
}
|
||||
if (k != 0)
|
||||
return k;
|
||||
}
|
||||
}
|
||||
else if (c < 0x0400)
|
||||
{
|
||||
wint_t k;
|
||||
|
||||
if (c >= 0x03ad && c <= 0x03af)
|
||||
return (c - 0x25);
|
||||
|
||||
if (c >= 0x03b1 && c <= 0x03cb && c != 0x03c2)
|
||||
return (c - 0x20);
|
||||
|
||||
if (c >= 0x03d9 && c <= 0x03ef && (c & 1))
|
||||
return (c - 1);
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case 0x0345:
|
||||
k = 0x0399;
|
||||
break;
|
||||
case 0x0371:
|
||||
case 0x0373:
|
||||
case 0x0377:
|
||||
case 0x03f8:
|
||||
case 0x03fb:
|
||||
k = c - 1;
|
||||
break;
|
||||
case 0x037b:
|
||||
case 0x037c:
|
||||
case 0x037d:
|
||||
k = c + 0x82;
|
||||
break;
|
||||
case 0x03ac:
|
||||
k = 0x0386;
|
||||
break;
|
||||
case 0x03c2:
|
||||
k = 0x03a3;
|
||||
break;
|
||||
case 0x03cc:
|
||||
k = 0x038c;
|
||||
break;
|
||||
case 0x03cd:
|
||||
case 0x03ce:
|
||||
k = c - 0x3f;
|
||||
break;
|
||||
case 0x03d0:
|
||||
k = 0x0392;
|
||||
break;
|
||||
case 0x03d1:
|
||||
k = 0x0398;
|
||||
break;
|
||||
case 0x03d5:
|
||||
k = 0x03a6;
|
||||
break;
|
||||
case 0x03d6:
|
||||
k = 0x03a0;
|
||||
break;
|
||||
case 0x03d7:
|
||||
k = 0x03cf;
|
||||
break;
|
||||
case 0x03f0:
|
||||
k = 0x039a;
|
||||
break;
|
||||
case 0x03f1:
|
||||
k = 0x03a1;
|
||||
break;
|
||||
case 0x03f2:
|
||||
k = 0x03f9;
|
||||
break;
|
||||
case 0x03f5:
|
||||
k = 0x0395;
|
||||
break;
|
||||
default:
|
||||
k = 0;
|
||||
}
|
||||
if (k != 0)
|
||||
return k;
|
||||
}
|
||||
else if (c < 0x500)
|
||||
{
|
||||
if (c >= 0x0430 && c <= 0x044f)
|
||||
return (c - 0x20);
|
||||
|
||||
if (c >= 0x0450 && c <= 0x045f)
|
||||
return (c - 0x50);
|
||||
|
||||
if ((c >= 0x0461 && c <= 0x0481) ||
|
||||
(c >= 0x048b && c <= 0x04bf) ||
|
||||
(c >= 0x04d1 && c <= 0x04ff))
|
||||
{
|
||||
if (c & 0x01)
|
||||
return (c - 1);
|
||||
return c;
|
||||
}
|
||||
|
||||
if (c >= 0x04c2 && c <= 0x04ce)
|
||||
{
|
||||
if (!(c & 0x01))
|
||||
return (c - 1);
|
||||
return c;
|
||||
}
|
||||
|
||||
if (c == 0x04cf)
|
||||
return 0x04c0;
|
||||
|
||||
if (c >= 0x04f7 && c <= 0x04f9)
|
||||
return (c - 1);
|
||||
}
|
||||
else if (c < 0x0600)
|
||||
{
|
||||
if (c >= 0x0501 && c <= 0x0525 && (c & 1))
|
||||
return c - 1;
|
||||
|
||||
if (c >= 0x0561 && c <= 0x0586)
|
||||
return (c - 0x30);
|
||||
}
|
||||
else if (c < 0x1f00)
|
||||
{
|
||||
if (c == 0x1d79)
|
||||
return 0xa77d;
|
||||
|
||||
if (c == 0x1d7d)
|
||||
return 0x2c63;
|
||||
|
||||
if ((c >= 0x1e01 && c <= 0x1e95) ||
|
||||
(c >= 0x1ea1 && c <= 0x1eff))
|
||||
{
|
||||
if (c & 0x01)
|
||||
return (c - 1);
|
||||
return c;
|
||||
}
|
||||
|
||||
if (c == 0x1e9b)
|
||||
return 0x1e60;
|
||||
}
|
||||
else if (c < 0x2000)
|
||||
{
|
||||
|
||||
if ((c >= 0x1f00 && c <= 0x1f07) ||
|
||||
(c >= 0x1f10 && c <= 0x1f15) ||
|
||||
(c >= 0x1f20 && c <= 0x1f27) ||
|
||||
(c >= 0x1f30 && c <= 0x1f37) ||
|
||||
(c >= 0x1f40 && c <= 0x1f45) ||
|
||||
(c >= 0x1f60 && c <= 0x1f67) ||
|
||||
(c >= 0x1f80 && c <= 0x1f87) ||
|
||||
(c >= 0x1f90 && c <= 0x1f97) ||
|
||||
(c >= 0x1fa0 && c <= 0x1fa7))
|
||||
return (c + 0x08);
|
||||
|
||||
if (c >= 0x1f51 && c <= 0x1f57 && (c & 0x01))
|
||||
return (c + 0x08);
|
||||
|
||||
if (c >= 0x1f70 && c <= 0x1ff3)
|
||||
{
|
||||
wint_t k;
|
||||
switch (c)
|
||||
{
|
||||
case 0x1fb0:
|
||||
k = 0x1fb8;
|
||||
break;
|
||||
case 0x1fb1:
|
||||
k = 0x1fb9;
|
||||
break;
|
||||
case 0x1f70:
|
||||
k = 0x1fba;
|
||||
break;
|
||||
case 0x1f71:
|
||||
k = 0x1fbb;
|
||||
break;
|
||||
case 0x1fb3:
|
||||
k = 0x1fbc;
|
||||
break;
|
||||
case 0x1fbe:
|
||||
k = 0x0399;
|
||||
break;
|
||||
case 0x1f72:
|
||||
k = 0x1fc8;
|
||||
break;
|
||||
case 0x1f73:
|
||||
k = 0x1fc9;
|
||||
break;
|
||||
case 0x1f74:
|
||||
k = 0x1fca;
|
||||
break;
|
||||
case 0x1f75:
|
||||
k = 0x1fcb;
|
||||
break;
|
||||
case 0x1fc3:
|
||||
k = 0x1fcc;
|
||||
break;
|
||||
case 0x1fd0:
|
||||
k = 0x1fd8;
|
||||
break;
|
||||
case 0x1fd1:
|
||||
k = 0x1fd9;
|
||||
break;
|
||||
case 0x1f76:
|
||||
k = 0x1fda;
|
||||
break;
|
||||
case 0x1f77:
|
||||
k = 0x1fdb;
|
||||
break;
|
||||
case 0x1fe0:
|
||||
k = 0x1fe8;
|
||||
break;
|
||||
case 0x1fe1:
|
||||
k = 0x1fe9;
|
||||
break;
|
||||
case 0x1f7a:
|
||||
k = 0x1fea;
|
||||
break;
|
||||
case 0x1f7b:
|
||||
k = 0x1feb;
|
||||
break;
|
||||
case 0x1fe5:
|
||||
k = 0x1fec;
|
||||
break;
|
||||
case 0x1f78:
|
||||
k = 0x1ff8;
|
||||
break;
|
||||
case 0x1f79:
|
||||
k = 0x1ff9;
|
||||
break;
|
||||
case 0x1f7c:
|
||||
k = 0x1ffa;
|
||||
break;
|
||||
case 0x1f7d:
|
||||
k = 0x1ffb;
|
||||
break;
|
||||
case 0x1ff3:
|
||||
k = 0x1ffc;
|
||||
break;
|
||||
default:
|
||||
k = 0;
|
||||
}
|
||||
if (k != 0)
|
||||
return k;
|
||||
}
|
||||
}
|
||||
else if (c < 0x3000)
|
||||
{
|
||||
if (c == 0x214e)
|
||||
return 0x2132;
|
||||
|
||||
if (c == 0x2184)
|
||||
return 0x2183;
|
||||
|
||||
if (c >= 0x2170 && c <= 0x217f)
|
||||
return (c - 0x10);
|
||||
|
||||
if (c >= 0x24d0 && c <= 0x24e9)
|
||||
return (c - 0x1a);
|
||||
|
||||
if (c >= 0x2c30 && c <= 0x2c5e)
|
||||
return (c - 0x30);
|
||||
|
||||
if ((c >= 0x2c68 && c <= 0x2c6c && !(c & 1)) ||
|
||||
(c >= 0x2c81 && c <= 0x2ce3 && (c & 1)) ||
|
||||
c == 0x2c73 || c == 0x2c76 ||
|
||||
c == 0x2cec || c == 0x2cee)
|
||||
return (c - 1);
|
||||
|
||||
if (c >= 0x2c81 && c <= 0x2ce3 && (c & 1))
|
||||
return (c - 1);
|
||||
|
||||
if (c >= 0x2d00 && c <= 0x2d25)
|
||||
return (c - 0x1c60);
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case 0x2c61:
|
||||
return 0x2c60;
|
||||
case 0x2c65:
|
||||
return 0x023a;
|
||||
case 0x2c66:
|
||||
return 0x023e;
|
||||
}
|
||||
}
|
||||
else if (c >= 0xa000 && c < 0xb000)
|
||||
{
|
||||
if (((c >= 0xa641 && c <= 0xa65f) ||
|
||||
(c >= 0xa663 && c <= 0xa66d) ||
|
||||
(c >= 0xa681 && c <= 0xa697) ||
|
||||
(c >= 0xa723 && c <= 0xa72f) ||
|
||||
(c >= 0xa733 && c <= 0xa76f) ||
|
||||
(c >= 0xa77f && c <= 0xa787)) &&
|
||||
(c & 1))
|
||||
return (c - 1);
|
||||
|
||||
if (c == 0xa77a || c == 0xa77c || c == 0xa78c)
|
||||
return (c - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (c >= 0xff41 && c <= 0xff5a)
|
||||
return (c - 0x20);
|
||||
|
||||
if (c >= 0x10428 && c <= 0x1044f)
|
||||
return (c - 0x28);
|
||||
}
|
||||
return c;
|
||||
#else
|
||||
return (c < 0x00ff ? (wint_t)(toupper ((int)c)) : c);
|
||||
#endif /* _MB_CAPABLE */
|
||||
}
|
||||
|
@ -1,355 +0,0 @@
|
||||
/* Copyright (c) 2002 Red Hat Incorporated.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
The name of Red Hat Incorporated may not be used to endorse
|
||||
or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* Generated using UnicodeData.txt 5.2 */
|
||||
|
||||
/* Expression used to filter out the characters for the below tables:
|
||||
|
||||
awk -F\; \
|
||||
'{ \
|
||||
VAL = strtonum (sprintf("0x%s", $1)); \
|
||||
# All of general category "L", except for two Thai characters which \
|
||||
# are actually punctuation characters. Old Unicode weirdness. \
|
||||
# The character "COMBINING GREEK YPOGEGRAMMENI", as well as all Thai \
|
||||
# characters which are in "Mn" category. Old Unicode weirdness. \
|
||||
# All numerical digit or letter characters, except the ASCII variants. \
|
||||
# This is necessary due to the unfortunate ISO C definition for the \
|
||||
# iswdigit class, otherwise these characters are missing in iswalnum. \
|
||||
# All "Other Symbols" which are named as "LETTER" characters. \
|
||||
# \
|
||||
# Before running this test, make sure to expand all Unicode blocks \
|
||||
# which are just marked by their first and last character! \
|
||||
# \
|
||||
if ( (match($3, "^L") && VAL != 0x0e2f && VAL != 0x0e46) \
|
||||
|| (match($3, "^Mn") && (VAL == 0x0345 || match($2, "\\<CHARACTER\\>"))) \
|
||||
|| (match($3, "^N[dl]") && VAL >= 0x100) \
|
||||
|| (match($3, "^So") && match($2, "\\<LETTER\\>"))) \
|
||||
print $1; \
|
||||
}' UnicodeData.txt
|
||||
*/
|
||||
|
||||
static const unsigned char u0[] = {
|
||||
0x41, 0x0, 0x5a, 0x61, 0x0, 0x7a, 0xaa, 0xb5,
|
||||
0xba, 0xc0, 0x0, 0xd6, 0xd8, 0x0, 0xf6, 0xf8,
|
||||
0x0, 0xff };
|
||||
/* u1 all alphabetic */
|
||||
static const unsigned char u2[] = {
|
||||
0x00, 0x0, 0xc1, 0xc6, 0x0, 0xd1,
|
||||
0xe0, 0x0, 0xe4, 0xec, 0xee };
|
||||
static const unsigned char u3[] = {
|
||||
0x45, 0x70, 0x0, 0x74, 0x76, 0x77,
|
||||
0x7a, 0x0, 0x7d, 0x86, 0x88, 0x0, 0x8a, 0x8c,
|
||||
0x8e, 0x0, 0xa1, 0xa3, 0x0, 0xf5,
|
||||
0xf7, 0x0, 0xff };
|
||||
static const unsigned char u4[] = {
|
||||
0x00, 0x0, 0x81, 0x8a, 0x0, 0xff };
|
||||
static const unsigned char u5[] = {
|
||||
0x00, 0x0, 0x25, 0x31, 0x0, 0x56, 0x59,
|
||||
0x61, 0x0, 0x87, 0xd0, 0x0, 0xea,
|
||||
0xf0, 0x0, 0xf2 };
|
||||
static const unsigned char u6[] = {
|
||||
0x21, 0x0, 0x4a, 0x60, 0x0, 0x69,
|
||||
0x6e, 0x0, 0x6f, 0x71, 0x0, 0xd3,
|
||||
0xd5, 0xe5, 0x0, 0xe6, 0xee, 0x0, 0xfc, 0xff };
|
||||
static const unsigned char u7[] = {
|
||||
0x10, 0x12, 0x0, 0x2f, 0x4d, 0x0, 0xa5, 0xb1,
|
||||
0xc0, 0x0, 0xea, 0xf4, 0xf5, 0xfa };
|
||||
static const unsigned char u8[] = {
|
||||
0x00, 0x0, 0x15, 0x1a, 0x24, 0x28 };
|
||||
static const unsigned char u9[] = {
|
||||
0x04, 0x0, 0x39, 0x3d, 0x50, 0x58, 0x0, 0x61,
|
||||
0x66, 0x0, 0x6f, 0x71, 0x72, 0x79, 0x0, 0x7f,
|
||||
0x85, 0x0, 0x8c, 0x8f, 0x0, 0x90,
|
||||
0x93, 0x0, 0xa8, 0xaa, 0x0, 0xb0, 0xb2,
|
||||
0xb6, 0x0, 0xb9, 0xbd, 0xce, 0xdc, 0x0, 0xdd,
|
||||
0xdf, 0x0, 0xe1, 0xe6, 0x0, 0xf1 };
|
||||
static const unsigned char ua[] = {
|
||||
0x05, 0x0, 0x0a, 0x0f, 0x0, 0x10,
|
||||
0x13, 0x0, 0x28, 0x2a, 0x0, 0x30,
|
||||
0x32, 0x0, 0x33, 0x35, 0x0, 0x36,
|
||||
0x38, 0x0, 0x39, 0x59, 0x0, 0x5c,
|
||||
0x5e, 0x66, 0x0, 0x6f, 0x72, 0x0, 0x74,
|
||||
0x85, 0x0, 0x8d, 0x8f, 0x0, 0x91,
|
||||
0x93, 0x0, 0xa8, 0xaa, 0x0, 0xb0,
|
||||
0xb2, 0x0, 0xb3, 0xb5, 0x0, 0xb9,
|
||||
0xbd, 0xd0, 0xe0, 0xe1, 0xe6, 0x0, 0xef };
|
||||
static const unsigned char ub[] = {
|
||||
0x05, 0x0, 0x0c, 0x0f, 0x0, 0x10,
|
||||
0x13, 0x0, 0x28, 0x2a, 0x0, 0x30,
|
||||
0x32, 0x0, 0x33, 0x35, 0x0, 0x39, 0x3d,
|
||||
0x5c, 0x0, 0x5d, 0x5f, 0x0, 0x61,
|
||||
0x66, 0x0, 0x6f, 0x71, 0x83, 0x85, 0x0, 0x8a,
|
||||
0x8e, 0x0, 0x90, 0x92, 0x0, 0x95,
|
||||
0x99, 0x0, 0x9a, 0x9c, 0x9e, 0x0, 0x9f,
|
||||
0xa3, 0x0, 0xa4, 0xa8, 0x0, 0xaa,
|
||||
0xae, 0x0, 0xb9, 0xd0, 0xe6, 0x0, 0xef };
|
||||
static const unsigned char uc[] = {
|
||||
0x05, 0x0, 0x0c, 0x0e, 0x0, 0x10,
|
||||
0x12, 0x0, 0x28, 0x2a, 0x0, 0x33,
|
||||
0x35, 0x0, 0x39, 0x3d, 0x58, 0x59,
|
||||
0x60, 0x0, 0x61, 0x66, 0x0, 0x6f,
|
||||
0x85, 0x0, 0x8c, 0x8e, 0x0, 0x90,
|
||||
0x92, 0x0, 0xa8, 0xaa, 0x0, 0xb3,
|
||||
0xb5, 0x0, 0xb9, 0xbd, 0xde, 0xe0, 0x0, 0xe1,
|
||||
0xe6, 0x0, 0xef };
|
||||
static const unsigned char ud[] = {
|
||||
0x05, 0x0, 0x0c, 0x0e, 0x0, 0x10,
|
||||
0x12, 0x0, 0x28, 0x2a, 0x0, 0x39, 0x3d,
|
||||
0x60, 0x0, 0x61, 0x66, 0x0, 0x6f,
|
||||
0x7a, 0x0, 0x7f, 0x85, 0x0, 0x96, 0x9a,
|
||||
0x0, 0xb1, 0xb3, 0x0, 0xbb, 0xbd,
|
||||
0xc0, 0x0, 0xc6 };
|
||||
static const unsigned char ue[] = {
|
||||
0x01, 0x0, 0x2e, 0x30, 0x0, 0x3a, 0x40,
|
||||
0x0, 0x45, 0x47, 0x0, 0x4e, 0x50, 0x0, 0x59,
|
||||
0x81, 0x0, 0x82, 0x84, 0x87, 0x0, 0x88, 0x8a,
|
||||
0x8d, 0x94, 0x0, 0x97, 0x99, 0x0, 0x9f, 0xa1,
|
||||
0x0, 0xa3, 0xa5, 0xa7, 0xaa, 0x0, 0xab, 0xad,
|
||||
0x0, 0xb0, 0xb2, 0x0, 0xb3, 0xbd, 0xc0, 0x0,
|
||||
0xc4, 0xc6, 0xd0, 0x0, 0xd9, 0xdc, 0x0, 0xdd };
|
||||
static const unsigned char uf[] = {
|
||||
0x00, 0x20, 0x0, 0x29, 0x40, 0x0, 0x47, 0x49,
|
||||
0x0, 0x6c, 0x88, 0x0, 0x8b };
|
||||
static const unsigned char u10[] = {
|
||||
0x00, 0x0, 0x2a, 0x3f, 0x0, 0x49,
|
||||
0x50, 0x0, 0x55, 0x5a, 0x0, 0x5d,
|
||||
0x61, 0x65, 0x66, 0x6e, 0x0, 0x70,
|
||||
0x75, 0x0, 0x81, 0x8e, 0x90, 0x0, 0x99,
|
||||
0xa0, 0x0, 0xc5, 0xd0, 0x0, 0xfa, 0xfc };
|
||||
/* u11 all alphabetic */
|
||||
static const unsigned char u12[] = {
|
||||
0x00, 0x0, 0x48, 0x4a, 0x0, 0x4d,
|
||||
0x50, 0x0, 0x56, 0x58, 0x5a, 0x0, 0x5d,
|
||||
0x60, 0x0, 0x88, 0x8a, 0x0, 0x8d,
|
||||
0x90, 0x0, 0xb0, 0xb2, 0x0, 0xb5,
|
||||
0xb8, 0x0, 0xbe, 0xc0, 0xc2, 0x0, 0xc5,
|
||||
0xc8, 0x0, 0xd6, 0xd8, 0x0, 0xff };
|
||||
static const unsigned char u13[] = {
|
||||
0x00, 0x0, 0x10, 0x12, 0x0, 0x15,
|
||||
0x18, 0x0, 0x5a, 0x80, 0x0, 0x8f,
|
||||
0xa0, 0x0, 0xf4 };
|
||||
static const unsigned char u14[] = {
|
||||
0x01, 0x0, 0xff };
|
||||
/* u15 all alphabetic */
|
||||
static const unsigned char u16[] = {
|
||||
0x00, 0x0, 0x6c, 0x6f, 0x0, 0x7f,
|
||||
0x81, 0x0, 0x9a, 0xa0, 0x0, 0xea,
|
||||
0xee, 0x0, 0xf0 };
|
||||
static const unsigned char u17[] = {
|
||||
0x00, 0x0, 0x0c, 0x0e, 0x0, 0x11,
|
||||
0x20, 0x0, 0x31, 0x40, 0x0, 0x51,
|
||||
0x60, 0x0, 0x6c, 0x6e, 0x0, 0x70,
|
||||
0x80, 0x0, 0xb3, 0xd7, 0xdc, 0xe0, 0x0, 0xe9 };
|
||||
static const unsigned char u18[] = {
|
||||
0x10, 0x0, 0x19, 0x20, 0x0, 0x77,
|
||||
0x80, 0x0, 0xa8, 0xaa, 0xb0, 0x0, 0xf5 };
|
||||
static const unsigned char u19[] = {
|
||||
0x00, 0x0, 0x1c, 0x46, 0x0, 0x6d,
|
||||
0x70, 0x0, 0x74, 0x80, 0x0, 0xab,
|
||||
0xc1, 0x0, 0xc7, 0xd0, 0x0, 0xda };
|
||||
static const unsigned char u1a[] = {
|
||||
0x00, 0x0, 0x16, 0x20, 0x0, 0x54,
|
||||
0x80, 0x0, 0x89, 0x90, 0x0, 0x99, 0xa7 };
|
||||
static const unsigned char u1b[] = {
|
||||
0x05, 0x0, 0x33, 0x45, 0x0, 0x4b,
|
||||
0x50, 0x0, 0x59, 0x83, 0x0, 0xa0,
|
||||
0xae, 0x0, 0xb9 };
|
||||
static const unsigned char u1c[] = {
|
||||
0x00, 0x0, 0x23, 0x40, 0x0, 0x49,
|
||||
0x4d, 0x0, 0x7d, 0xe9, 0x0, 0xec,
|
||||
0xee, 0x0, 0xf1 };
|
||||
static const unsigned char u1d[] = {
|
||||
0x00, 0x0, 0xbf };
|
||||
/* u1e all alphabetic */
|
||||
static const unsigned char u1f[] = {
|
||||
0x00, 0x0, 0x15, 0x18, 0x0, 0x1d,
|
||||
0x20, 0x0, 0x45, 0x48, 0x0, 0x4d, 0x50, 0x0, 0x57, 0x59,
|
||||
0x5b, 0x5d, 0x5f, 0x0, 0x7d, 0x80, 0x0, 0xb4,
|
||||
0xb6, 0x0, 0xbc, 0xbe, 0xc2, 0x0, 0xc4, 0xc6,
|
||||
0x0, 0xcc, 0xd0, 0x0, 0xd3, 0xd6, 0x0, 0xdb,
|
||||
0xe0, 0x0, 0xec, 0xf2, 0x0, 0xf4, 0xf6, 0x0,
|
||||
0xfc };
|
||||
static const unsigned char u20[] = {
|
||||
0x71, 0x7f, 0x90, 0x0, 0x94 };
|
||||
static const unsigned char u21[] = {
|
||||
0x02, 0x07, 0x0a, 0x0, 0x13, 0x15,
|
||||
0x19, 0x0, 0x1d, 0x24, 0x26, 0x28, 0x0, 0x2d,
|
||||
0x2f, 0x0, 0x39, 0x3c, 0x0, 0x3f,
|
||||
0x45, 0x0, 0x49, 0x4e, 0x60, 0x0, 0x88 };
|
||||
static const unsigned char u24[] = {
|
||||
0x9c, 0x0, 0xe9 };
|
||||
static const unsigned char u2c[] = {
|
||||
0x00, 0x0, 0x2e, 0x30, 0x0, 0x5e,
|
||||
0x60, 0x0, 0xe4, 0xeb, 0x0, 0xee };
|
||||
static const unsigned char u2d[] = {
|
||||
0x00, 0x0, 0x25, 0x30, 0x0, 0x65, 0x6f,
|
||||
0x80, 0x0, 0x96, 0xa0, 0x0, 0xa6,
|
||||
0xa8, 0x0, 0xae, 0xb0, 0x0, 0xb6,
|
||||
0xb8, 0x0, 0xbe, 0xc0, 0x0, 0xc6,
|
||||
0xc8, 0x0, 0xce, 0xd0, 0x0, 0xd6,
|
||||
0xd8, 0x0, 0xde };
|
||||
static const unsigned char u2e[] = {
|
||||
0x2f };
|
||||
static const unsigned char u30[] = {
|
||||
0x05, 0x0, 0x07, 0x21, 0x0,
|
||||
0x29, 0x31, 0x0, 0x35, 0x38, 0x0, 0x3c, 0x41,
|
||||
0x0, 0x96, 0x9d, 0x0, 0x9f, 0xa1, 0x0, 0xfa,
|
||||
0xfc, 0x0, 0xff };
|
||||
static const unsigned char u31[] = {
|
||||
0x05, 0x0, 0x2d, 0x31, 0x0,
|
||||
0x8e, 0xa0, 0x0, 0xb7, 0xf0, 0x0, 0xff };
|
||||
/* u34 to u4c all alphabetic */
|
||||
static const unsigned char u4d[] = {
|
||||
0x00, 0x0, 0xb5 };
|
||||
/* u4e to u9e all alphabetic */
|
||||
static const unsigned char u9f[] = {
|
||||
0x00, 0x0, 0xcb };
|
||||
/* ua0 to ua3 all alphabetic */
|
||||
static const unsigned char ua4[] = {
|
||||
0x00, 0x0, 0x8c, 0xd0, 0x0, 0xfd };
|
||||
/* ua5 all alphabetic */
|
||||
static const unsigned char ua6[] = {
|
||||
0x00, 0x0, 0x0c, 0x10, 0x0, 0x2b,
|
||||
0x40, 0x0, 0x5f, 0x62, 0x0, 0x6e,
|
||||
0x7f, 0x0, 0x97, 0xa0, 0x0, 0xef };
|
||||
static const unsigned char ua7[] = {
|
||||
0x17, 0x0, 0x1f, 0x22, 0x0, 0x88,
|
||||
0x8b, 0x8c,
|
||||
0xfb, 0x0, 0xff };
|
||||
static const unsigned char ua8[] = {
|
||||
0x00, 0x01, 0x03, 0x0, 0x05, 0x07, 0x0, 0x0a,
|
||||
0x0c, 0x0, 0x22, 0x40, 0x0, 0x73,
|
||||
0x82, 0x0, 0xb3, 0xd0, 0x0, 0xd9,
|
||||
0xf2, 0x0, 0xf7, 0xfb };
|
||||
static const unsigned char ua9[] = {
|
||||
0x00, 0x0, 0x25, 0x30, 0x0, 0x46,
|
||||
0x60, 0x0, 0x7c, 0x84, 0x0, 0xb2,
|
||||
0xcf, 0x0, 0xd9 };
|
||||
static const unsigned char uaa[] = {
|
||||
0x00, 0x0, 0x28, 0x40, 0x0, 0x42,
|
||||
0x44, 0x0, 0x4b, 0x50, 0x0, 0x59,
|
||||
0x60, 0x0, 0x76, 0x7a, 0x80, 0x0, 0xaf,
|
||||
0xb1, 0xb5, 0xb6, 0xb9, 0x0, 0xbd,
|
||||
0xc0, 0xc2, 0xdb, 0x0, 0xdd };
|
||||
static const unsigned char uab[] = {
|
||||
0xc0, 0x0, 0xe2, 0xf0, 0x0, 0xf9 };
|
||||
/* uac to ud6 all alphabetic */
|
||||
static const unsigned char ud7[] = {
|
||||
0x00, 0x0, 0xa3, 0xb0, 0x0, 0xc6,
|
||||
0xcb, 0x0, 0xfb };
|
||||
/* uf9 all alphabetic */
|
||||
static const unsigned char ufa[] = {
|
||||
0x00, 0x0, 0x2d, 0x30, 0x0, 0x6d,
|
||||
0x70, 0x0, 0xd9 };
|
||||
static const unsigned char ufb[] = {
|
||||
0x00, 0x0, 0x06, 0x13, 0x0, 0x17, 0x1d,
|
||||
0x1f, 0x0, 0x28, 0x2a, 0x0, 0x36, 0x38, 0x0,
|
||||
0x3c, 0x3e, 0x40, 0x0, 0x41, 0x43, 0x0, 0x44,
|
||||
0x46, 0x0, 0xb1, 0xd3, 0x0, 0xff };
|
||||
/* ufc all alphabetic */
|
||||
static const unsigned char ufd[] = {
|
||||
0x00, 0x0, 0x3d, 0x50, 0x0,
|
||||
0x8f, 0x92, 0x0, 0xc7, 0xf0, 0x0, 0xfb };
|
||||
static const unsigned char ufe[] = {
|
||||
0x70,
|
||||
0x0, 0x74, 0x76, 0x0, 0xfc };
|
||||
static const unsigned char uff[] = {
|
||||
0x10, 0x0, 0x19,
|
||||
0x21, 0x0, 0x3a, 0x41, 0x0, 0x5a, 0x66, 0x0,
|
||||
0xbe, 0xc2, 0x0, 0xc7, 0xca, 0x0, 0xcf, 0xd2,
|
||||
0x0, 0xd7, 0xda, 0x0, 0xdc };
|
||||
static const unsigned char u100[] = {
|
||||
0x00, 0x0, 0x0b, 0x0d, 0x0, 0x26,
|
||||
0x28, 0x0, 0x3a, 0x3c, 0x3d, 0x3f, 0x0, 0x4d,
|
||||
0x50, 0x0, 0x5d, 0x80, 0x0, 0xfa };
|
||||
static const unsigned char u101[] = {
|
||||
0x40, 0x0, 0x74 };
|
||||
static const unsigned char u102[] = {
|
||||
0x80, 0x0, 0x9c, 0xa0, 0x0, 0xd0 };
|
||||
static const unsigned char u103[] = {
|
||||
0x00, 0x0, 0x1e, 0x30, 0x0, 0x4a,
|
||||
0x80, 0x0, 0x9d, 0xa0, 0x0, 0xc3,
|
||||
0xc8, 0x0, 0xcf, 0xd1, 0x0, 0xd5 };
|
||||
static const unsigned char u104[] = {
|
||||
0x00, 0x0, 0x9d, 0xa0, 0x0, 0xa9 };
|
||||
static const unsigned char u108[] = {
|
||||
0x00, 0x0, 0x05, 0x08, 0x0a, 0x0, 0x35,
|
||||
0x37, 0x38, 0x3c, 0x3f, 0x0, 0x55 };
|
||||
static const unsigned char u109[] = {
|
||||
0x00, 0x0, 0x15, 0x20, 0x0, 0x39 };
|
||||
static const unsigned char u10a[] = {
|
||||
0x00, 0x10, 0x0, 0x13, 0x15, 0x0, 0x17,
|
||||
0x19, 0x0, 0x33, 0x60, 0x0, 0x7c };
|
||||
static const unsigned char u10b[] = {
|
||||
0x00, 0x0, 0x35, 0x40, 0x0, 0x55,
|
||||
0x60, 0x0, 0x72 };
|
||||
static const unsigned char u10c[] = {
|
||||
0x00, 0x0, 0x48 };
|
||||
static const unsigned char u110[] = {
|
||||
0x83, 0x0, 0xaf };
|
||||
/* u120 to u122 all alphabetic */
|
||||
static const unsigned char u123[] = {
|
||||
0x00, 0x0, 0x6e };
|
||||
static const unsigned char u124[] = {
|
||||
0x00, 0x0, 0x62 };
|
||||
/* u130 to u133 all alphabetic */
|
||||
static const unsigned char u134[] = {
|
||||
0x00, 0x0, 0x2e };
|
||||
static const unsigned char u1d4[] = {
|
||||
0x00, 0x0, 0x54, 0x56, 0x0, 0x9c,
|
||||
0x9e, 0x0, 0x9f, 0xa2, 0xa5, 0x0, 0xa6,
|
||||
0xa9, 0x0, 0xac, 0xae, 0x0, 0xb9, 0xbb,
|
||||
0xbd, 0x0, 0xc3, 0xc5, 0x0, 0xff };
|
||||
static const unsigned char u1d5[] = {
|
||||
0x00, 0x0, 0x05, 0x07, 0x0,
|
||||
0x0a, 0x0d, 0x0, 0x14, 0x16, 0x0, 0x1c, 0x1e,
|
||||
0x0, 0x39, 0x3b, 0x0, 0x3e, 0x40, 0x0, 0x44,
|
||||
0x46, 0x4a, 0x0, 0x50, 0x52, 0x0, 0xff };
|
||||
static const unsigned char u1d6[] = {
|
||||
0x00, 0x0, 0xa5, 0xa8, 0x0, 0xc0,
|
||||
0xc2, 0x0, 0xda, 0xdc, 0x0, 0xfa,
|
||||
0xfc, 0x0, 0xff };
|
||||
static const unsigned char u1d7[] = {
|
||||
0x00, 0x0, 0x14, 0x16, 0x0, 0x34,
|
||||
0x36, 0x0, 0x4e, 0x50, 0x0, 0x6e,
|
||||
0x70, 0x0, 0x88, 0x8a, 0x0, 0xa8,
|
||||
0xaa, 0x0, 0xc2, 0xc4, 0x0, 0xcb,
|
||||
0xce, 0x0, 0xff };
|
||||
static const unsigned char u1f1[] = {
|
||||
0x10, 0x0, 0x2c, 0x31, 0x3d, 0x3f, 0x42, 0x46,
|
||||
0x57, 0x5f, 0x79, 0x7b, 0x7c, 0x7f, 0x8a };
|
||||
/* u200 to u2a5 all alphabetic */
|
||||
static const unsigned char u2a6[] = {
|
||||
0x00, 0x0, 0xd6 };
|
||||
/* u2a7 to u2b6 all alphabetic */
|
||||
static const unsigned char u2b7[] = {
|
||||
0x00, 0x0, 0x34 };
|
||||
/* u2f8 to u2f9 all alphabetic */
|
||||
static const unsigned char u2fa[] = {
|
||||
0x00, 0x0, 0x1d };
|
@ -1,389 +0,0 @@
|
||||
/* Copyright (c) 2002 Red Hat Incorporated.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
The name of Red Hat Incorporated may not be used to endorse
|
||||
or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* Generated using UnicodeData.txt 5.2 */
|
||||
|
||||
/* Expression used to filter out the characters for the below tables:
|
||||
|
||||
awk -F\; \
|
||||
'{ \
|
||||
VAL = strtonum (sprintf("0x%s", $1)); \
|
||||
# All valid characters except from categories Cc (C0 or C1 control code), \
|
||||
# Cs (Surrogates), Zl (Line separator), and Zp (Paragraph separator).\
|
||||
# \
|
||||
# Before running this test, make sure to expand all Unicode blocks \
|
||||
# which are just marked by their first and last character! \
|
||||
# \
|
||||
if (!match($3, "^C[cs]") && !match($3, "^Z[lp]")) \
|
||||
print $1; \
|
||||
}' UnicodeData.txt
|
||||
*/
|
||||
static const unsigned char u0[] = {
|
||||
0x20, 0x0, 0x7e, 0xa0, 0x0, 0xff };
|
||||
/* u1 is all-print */
|
||||
/* u2 is all-print */
|
||||
static const unsigned char u3[] = {
|
||||
0x00, 0x0, 0x77, 0x7a, 0x0, 0x7e,
|
||||
0x84, 0x0, 0x8a, 0x8c, 0x8e, 0x0,
|
||||
0xa1, 0xa3, 0x0, 0xff };
|
||||
/* u4 is all-print */
|
||||
static const unsigned char u5[] = {
|
||||
0x00, 0x0, 0x25, 0x31, 0x0,
|
||||
0x56, 0x59, 0x0, 0x5f, 0x61, 0x0, 0x87, 0x89,
|
||||
0x0, 0x8a, 0x91, 0x0, 0xc7, 0xd0, 0x0, 0xea,
|
||||
0xf0, 0x0, 0xf4 };
|
||||
static const unsigned char u6[] = {
|
||||
0x00, 0x0, 0x03, 0x06, 0x0, 0x1b, 0x1e, 0x1f,
|
||||
0x21, 0x0, 0x5e, 0x60, 0x0, 0xff };
|
||||
static const unsigned char u7[] = {
|
||||
0x00, 0x0, 0x0d, 0x0f, 0x0, 0x4a, 0x4d, 0x0, 0xb1,
|
||||
0xc0, 0x0, 0xfa };
|
||||
static const unsigned char u8[] = {
|
||||
0x00, 0x0, 0x2d, 0x30, 0x0, 0x3e, };
|
||||
static const unsigned char u9[] = {
|
||||
0x00, 0x0, 0x39, 0x3c, 0x0, 0x4e, 0x50, 0x0, 0x55,
|
||||
0x58, 0x0, 0x72, 0x79, 0x0, 0x7f, 0x81, 0x0, 0x83,
|
||||
0x85, 0x0, 0x8c, 0x8f, 0x0, 0x90, 0x93, 0x0, 0xa8,
|
||||
0xaa, 0x0, 0xb0, 0xb2, 0xb6, 0x0, 0xb9, 0xbc,
|
||||
0x0, 0xc4, 0xc7, 0xc8, 0xcb, 0x0, 0xce,
|
||||
0xd7, 0xdc, 0x0, 0xdd, 0xdf, 0x0, 0xe3, 0xe6,
|
||||
0x0, 0xfb };
|
||||
static const unsigned char ua[] = {
|
||||
0x01, 0x0, 0x03, 0x05, 0x0, 0x0a, 0x0f, 0x0,
|
||||
0x10, 0x13, 0x0, 0x28, 0x2a, 0x0, 0x30, 0x32,
|
||||
0x0, 0x33, 0x35, 0x0, 0x36, 0x38, 0x0, 0x39,
|
||||
0x3c, 0x3e, 0x0, 0x42, 0x47, 0x0, 0x48, 0x4b,
|
||||
0x0, 0x4d, 0x51, 0x59, 0x0, 0x5c, 0x5e, 0x66, 0x0,
|
||||
0x75, 0x81, 0x0, 0x83, 0x85, 0x0, 0x8d,
|
||||
0x8f, 0x0, 0x91, 0x93, 0x0, 0xa8, 0xaa, 0x0,
|
||||
0xb0, 0xb2, 0x0, 0xb3, 0xb5, 0x0, 0xb9, 0xbc,
|
||||
0x0, 0xc5, 0xc7, 0x0, 0xc9, 0xcb, 0x0, 0xcd,
|
||||
0xd0, 0xe0, 0x0, 0xe3, 0xe6, 0x0, 0xef, 0xf1 };
|
||||
static const unsigned char ub[] = {
|
||||
0x01, 0x0, 0x03,
|
||||
0x05, 0x0, 0x0c, 0x0f, 0x0, 0x10, 0x13, 0x0,
|
||||
0x28, 0x2a, 0x0, 0x30, 0x32, 0x0, 0x33, 0x35,
|
||||
0x0, 0x39, 0x3c, 0x0, 0x44, 0x47, 0x0, 0x48,
|
||||
0x4b, 0x0, 0x4d, 0x56, 0x0, 0x57, 0x5c, 0x0,
|
||||
0x5d, 0x5f, 0x0, 0x63, 0x66, 0x0, 0x71, 0x82,
|
||||
0x0, 0x83, 0x85, 0x0, 0x8a, 0x8e, 0x0, 0x90,
|
||||
0x92, 0x0, 0x95, 0x99, 0x0, 0x9a, 0x9c, 0x9e,
|
||||
0x0, 0x9f, 0xa3, 0x0, 0xa4, 0xa8, 0x0, 0xaa,
|
||||
0xae, 0x0, 0xb9, 0xbe, 0x0,
|
||||
0xc2, 0xc6, 0x0, 0xc8, 0xca, 0x0, 0xcd, 0xd0,
|
||||
0xd7, 0xe6, 0xe7, 0x0, 0xfa };
|
||||
static const unsigned char uc[] = {
|
||||
0x01, 0x0, 0x03, 0x05, 0x0,
|
||||
0x0c, 0x0e, 0x0, 0x10, 0x12, 0x0, 0x28, 0x2a,
|
||||
0x0, 0x33, 0x35, 0x0, 0x39, 0x3d, 0x0, 0x44,
|
||||
0x46, 0x0, 0x48, 0x4a, 0x0, 0x4d, 0x55, 0x0,
|
||||
0x56, 0x58, 0x59, 0x60, 0x0, 0x63, 0x66, 0x0, 0x6f,
|
||||
0x78, 0x0, 0x7f, 0x82, 0x83, 0x85, 0x0, 0x8c,
|
||||
0x8e, 0x0, 0x90, 0x92, 0x0, 0xa8, 0xaa, 0x0, 0xb3,
|
||||
0xb5, 0x0, 0xb9, 0xbc, 0x0, 0xc4, 0xc6, 0x0, 0xc8,
|
||||
0xca, 0x0, 0xcd, 0xd5, 0x0, 0xd6, 0xde, 0xe0, 0x0,
|
||||
0xe3, 0xe6, 0x0, 0xef, 0xf1, 0xf2 };
|
||||
static const unsigned char ud[] = {
|
||||
0x02, 0x0, 0x03, 0x05,
|
||||
0x0, 0x0c, 0x0e, 0x0, 0x10, 0x12, 0x0, 0x28,
|
||||
0x2a, 0x0, 0x39, 0x3d, 0x0, 0x44, 0x46, 0x0,
|
||||
0x48, 0x4a, 0x0, 0x4d, 0x57, 0x60, 0x0, 0x63,
|
||||
0x66, 0x0, 0x75, 0x79, 0x0, 0x7f, 0x82, 0x0, 0x83,
|
||||
0x85, 0x0, 0x96, 0x9a, 0x0, 0xb1, 0xb3, 0x0, 0xbb,
|
||||
0xbd, 0xc0, 0x0, 0xc6, 0xca, 0xcf, 0x0, 0xd4, 0xd6,
|
||||
0xd8, 0x0, 0xdf, 0xf2, 0x0, 0xf4 };
|
||||
static const unsigned char ue[] = {
|
||||
0x01, 0x0,
|
||||
0x3a, 0x3f, 0x0, 0x5b, 0x81, 0x0, 0x82, 0x84,
|
||||
0x87, 0x0, 0x88, 0x8a, 0x8d, 0x94, 0x0, 0x97,
|
||||
0x99, 0x0, 0x9f, 0xa1, 0x0, 0xa3, 0xa5, 0xa7,
|
||||
0xaa, 0x0, 0xab, 0xad, 0x0, 0xb9, 0xbb, 0x0,
|
||||
0xbd, 0xc0, 0x0, 0xc4, 0xc6, 0xc8, 0x0, 0xcd,
|
||||
0xd0, 0x0, 0xd9, 0xdc, 0x0, 0xdd };
|
||||
static const unsigned char uf[] = {
|
||||
0x00, 0x0, 0x47, 0x49, 0x0, 0x6c,
|
||||
0x71, 0x0, 0x8b, 0x90, 0x0, 0x97,
|
||||
0x99, 0x0, 0xbc, 0xbe, 0x0, 0xcc,
|
||||
0xce, 0x0, 0xd8 };
|
||||
static const unsigned char u10[] = {
|
||||
0x00, 0x0, 0xc5, 0xd0, 0x0, 0xfc };
|
||||
/* u11 is all-print */
|
||||
static const unsigned char u12[] = {
|
||||
0x00, 0x0, 0x48, 0x4a, 0x0, 0x4d, 0x50, 0x0, 0x56,
|
||||
0x58, 0x5a, 0x0, 0x5d, 0x60, 0x0, 0x88,
|
||||
0x8a, 0x0, 0x8d, 0x90, 0x0, 0xb0, 0xb2,
|
||||
0x0, 0xb5, 0xb8, 0x0, 0xbe, 0xc0, 0xc2, 0x0,
|
||||
0xc5, 0xc8, 0x0, 0xd6, 0xd8, 0x0, 0xff };
|
||||
static const unsigned char u13[] = {
|
||||
0x00, 0x0, 0x10, 0x12, 0x0, 0x15,
|
||||
0x18, 0x0, 0x5a, 0x5f, 0x0, 0x7c,
|
||||
0x80, 0x0, 0x99, 0xa0, 0x0, 0xf4 };
|
||||
/* u14 is all-print */
|
||||
/* u15 is all-print */
|
||||
static const unsigned char u16[] = {
|
||||
0x00, 0x0, 0x9c, 0xa0, 0x0, 0xf0 };
|
||||
static const unsigned char u17[] = {
|
||||
0x00, 0x0, 0x0c, 0x0e, 0x0, 0x14, 0x20,
|
||||
0x0, 0x36, 0x40, 0x0, 0x53, 0x60, 0x0, 0x6c,
|
||||
0x6e, 0x0, 0x70, 0x72, 0x0, 0x73, 0x80, 0x0,
|
||||
0xdd, 0xe0, 0x0, 0xe9, 0xf0, 0x0, 0xf9 };
|
||||
static const unsigned char u18[] = {
|
||||
0x00, 0x0, 0x0e, 0x10,
|
||||
0x0, 0x19, 0x20, 0x0, 0x77, 0x80, 0x0, 0xaa,
|
||||
0xb0, 0x0, 0xf5 };
|
||||
static const unsigned char u19[] = {
|
||||
0x00, 0x0, 0x1c, 0x20, 0x0, 0x2b,
|
||||
0x30, 0x0, 0x3b, 0x40, 0x44, 0x0, 0x6d,
|
||||
0x70, 0x0, 0x74, 0x80, 0x0, 0xab,
|
||||
0xb0, 0x0, 0xc9, 0xd0, 0x0, 0xda,
|
||||
0xde, 0x0, 0xff };
|
||||
static const unsigned char u1a[] = {
|
||||
0x00, 0x0, 0x1b, 0x1e, 0x0, 0x5e,
|
||||
0x60, 0x0, 0x7c, 0x7f, 0x0, 0x89,
|
||||
0x90, 0x0, 0x99, 0xa0, 0x0, 0xad };
|
||||
static const unsigned char u1b[] = {
|
||||
0x00, 0x0, 0x4b, 0x50, 0x0, 0x7c,
|
||||
0x80, 0x0, 0xaa, 0xae, 0x0, 0xb9 };
|
||||
static const unsigned char u1c[] = {
|
||||
0x00, 0x0, 0x37, 0x3b, 0x0, 0x49,
|
||||
0x4d, 0x0, 0x7f, 0xd0, 0x0, 0xf2 };
|
||||
static const unsigned char u1d[] = {
|
||||
0x00, 0x0, 0xe6, 0xfd, 0x0, 0xff };
|
||||
/* u1e is all-print */
|
||||
static const unsigned char u1f[] = {
|
||||
0x00, 0x0,
|
||||
0x15, 0x18, 0x0, 0x1d, 0x20, 0x0, 0x45, 0x48,
|
||||
0x0, 0x4d, 0x50, 0x0, 0x57, 0x59, 0x5b, 0x5d,
|
||||
0x5f, 0x0, 0x7d, 0x80, 0x0, 0xb4, 0xb6, 0x0,
|
||||
0xc4, 0xc6, 0x0, 0xd3, 0xd6, 0x0, 0xdb, 0xdd,
|
||||
0x0, 0xef, 0xf2, 0x0, 0xf4, 0xf6, 0x0, 0xfe };
|
||||
static const unsigned char u20[] = {
|
||||
0x00, 0x0, 0x27, 0x2a, 0x0, 0x64,
|
||||
0x6a, 0x0, 0x71, 0x74, 0x0, 0x8e,
|
||||
0x90, 0x0, 0x94, 0xa0, 0x0, 0xb8,
|
||||
0xd0, 0x0, 0xf0 };
|
||||
static const unsigned char u21[] = {
|
||||
0x00, 0x0, 0x89, 0x90, 0x0, 0xff };
|
||||
/* u22 is all-print */
|
||||
static const unsigned char u23[] = {
|
||||
0x00, 0x0, 0xe8 };
|
||||
static const unsigned char u24[] = {
|
||||
0x00, 0x0, 0x26, 0x40, 0x0, 0x4a,
|
||||
0x60, 0x0, 0xff };
|
||||
/* u25 is all-print */
|
||||
static const unsigned char u26[] = {
|
||||
0x00, 0x0, 0xcd, 0xcf, 0x0, 0xe1,
|
||||
0xe3, 0xe8, 0x0, 0xff };
|
||||
static const unsigned char u27[] = {
|
||||
0x01, 0x0, 0x04, 0x06, 0x0, 0x09,
|
||||
0x0c, 0x0, 0x27, 0x29, 0x0, 0x4b, 0x4d,
|
||||
0x4f, 0x0, 0x52, 0x56, 0x0, 0x5e,
|
||||
0x61, 0x0, 0x94, 0x98, 0x0, 0xaf,
|
||||
0xb1, 0x0, 0xbe, 0xc0, 0x0, 0xca, 0xcc,
|
||||
0xd0, 0x0, 0xff };
|
||||
/* u28 to u2a are all-print */
|
||||
static const unsigned char u2b[] = {
|
||||
0x00, 0x0, 0x4c, 0x50, 0x0, 0x59 };
|
||||
static const unsigned char u2c[] = {
|
||||
0x00, 0x0, 0x2e, 0x30, 0x0, 0x5e,
|
||||
0x60, 0x0, 0xf1, 0xf9, 0x0, 0xff };
|
||||
static const unsigned char u2d[] = {
|
||||
0x00, 0x0, 0x25, 0x30, 0x0, 0x65, 0x6f,
|
||||
0x80, 0x0, 0x96, 0xa0, 0x0, 0xa6,
|
||||
0xa8, 0x0, 0xae, 0xb0, 0x0, 0xb6,
|
||||
0xb8, 0x0, 0xbe, 0xc0, 0x0, 0xc6,
|
||||
0xc8, 0x0, 0xce, 0xd0, 0x0, 0xd6,
|
||||
0xd8, 0x0, 0xde, 0xe0, 0x0, 0xff };
|
||||
static const unsigned char u2e[] = {
|
||||
0x00, 0x0, 0x31, 0x80, 0x0, 0x99,
|
||||
0x9b, 0x0, 0xf3 };
|
||||
static const unsigned char u2f[] = {
|
||||
0x00, 0x0, 0xd5, 0xf0, 0x0, 0xfb };
|
||||
static const unsigned char u30[] = {
|
||||
0x00, 0x0,
|
||||
0x3f, 0x41, 0x0, 0x96, 0x99, 0x0, 0xff };
|
||||
static const unsigned char u31[] = {
|
||||
0x05, 0x0, 0x2d, 0x31, 0x0, 0x8e,
|
||||
0x90, 0x0, 0xb7, 0xc0, 0x0, 0xe3,
|
||||
0xf0, 0x0, 0xff };
|
||||
static const unsigned char u32[] = {
|
||||
0x00, 0x0, 0x1e, 0x20, 0x0, 0xfe };
|
||||
/* u33 to u4c is all-print */
|
||||
static const unsigned char u4d[] = {
|
||||
0x00, 0x0, 0xb5, 0xc0, 0x0, 0xff };
|
||||
/* u4e to u9e is all-print */
|
||||
static const unsigned char u9f[] = {
|
||||
0x00, 0x0, 0xcb };
|
||||
/* ua0 to ua3 is all-print */
|
||||
static const unsigned char ua4[] = {
|
||||
0x00, 0x0, 0x8c, 0x90, 0x0, 0xc6,
|
||||
0xd0, 0x0, 0xff };
|
||||
/* ua5 is all-print */
|
||||
static const unsigned char ua6[] = {
|
||||
0x00, 0x0, 0x2b, 0x40, 0x0, 0x5f,
|
||||
0x62, 0x0, 0x73, 0x7c, 0x0, 0x97,
|
||||
0xa0, 0x0, 0xf7 };
|
||||
static const unsigned char ua7[] = {
|
||||
0x00, 0x0, 0x8c, 0xfb, 0x0, 0xff };
|
||||
static const unsigned char ua8[] = {
|
||||
0x00, 0x0, 0x2b, 0x30, 0x0, 0x39,
|
||||
0x40, 0x0, 0x77, 0x80, 0x0, 0xc4,
|
||||
0xce, 0x0, 0xd9, 0xe0, 0x0, 0xfb };
|
||||
static const unsigned char ua9[] = {
|
||||
0x00, 0x0, 0x53, 0x5f, 0x0, 0x7c,
|
||||
0x80, 0x0, 0xcd, 0xcf, 0x0, 0xd9,
|
||||
0xde, 0xdf };
|
||||
static const unsigned char uaa[] = {
|
||||
0x00, 0x0, 0x36, 0x40, 0x0, 0x4d,
|
||||
0x50, 0x0, 0x59, 0x5c, 0x0, 0x7b,
|
||||
0x80, 0x0, 0xc2, 0xdb, 0x0, 0xdf };
|
||||
static const unsigned char uab[] = {
|
||||
0xc0, 0x0, 0xed, 0xf0, 0x0, 0xf9 };
|
||||
/* uac to ud6 is all-print */
|
||||
static const unsigned char ud7[] = {
|
||||
0x00, 0x0, 0xa3, 0xb0, 0x0, 0xc6,
|
||||
0xcb, 0x0, 0xfb };
|
||||
/* ud8 to udf are UTF-16 surrogates, non-printable */
|
||||
/* ue0 to uf9 is all-print */
|
||||
static const unsigned char ufa[] = {
|
||||
0x00, 0x0, 0x2d, 0x30, 0x0, 0x6d,
|
||||
0x70, 0x0, 0xd9 };
|
||||
static const unsigned char ufb[] = {
|
||||
0x00, 0x0, 0x06, 0x13, 0x0, 0x17,
|
||||
0x1d, 0x0, 0x36, 0x38, 0x0, 0x3c,
|
||||
0x3e, 0x40, 0x41, 0x43, 0x44,
|
||||
0x46, 0x0, 0xb1, 0xd3, 0x0, 0xff };
|
||||
/* ufc is all-print */
|
||||
static const unsigned char ufd[] = {
|
||||
0x00, 0x0, 0x3f, 0x50, 0x0, 0x8f,
|
||||
0x92, 0x0, 0xc7, 0xf0, 0x0, 0xfd };
|
||||
static const unsigned char ufe[] = {
|
||||
0x00, 0x0, 0x19, 0x20, 0x0, 0x26,
|
||||
0x30, 0x0, 0x52, 0x54, 0x0, 0x66,
|
||||
0x68, 0x0, 0x6b, 0x70, 0x0, 0x74,
|
||||
0x76, 0x0, 0xfc, 0xff };
|
||||
static const unsigned char uff[] = {
|
||||
0x01, 0x0, 0xbe, 0xc2, 0x0, 0xc7, 0xca, 0x0,
|
||||
0xcf, 0xd2, 0x0, 0xd7, 0xda, 0x0, 0xdc, 0xe0,
|
||||
0x0, 0xe6, 0xe8, 0x0, 0xee, 0xf9, 0x0, 0xfd };
|
||||
static const unsigned char u100[] = {
|
||||
0x00, 0x0, 0x0b, 0x0d, 0x0, 0x26,
|
||||
0x28, 0x0, 0x3a, 0x3c, 0x3d, 0x3f, 0x0, 0x4d,
|
||||
0x50, 0x0, 0x5d, 0x80, 0x0, 0xfa };
|
||||
static const unsigned char u101[] = {
|
||||
0x00, 0x0, 0x02, 0x07, 0x0, 0x33,
|
||||
0x37, 0x0, 0x8a, 0x90, 0x0, 0x9b,
|
||||
0xd0, 0x0, 0xfd };
|
||||
static const unsigned char u102[] = {
|
||||
0x80, 0x0, 0x9c, 0xa0, 0x0, 0xd0 };
|
||||
static const unsigned char u103[] = {
|
||||
0x00, 0x0, 0x1e, 0x20, 0x0, 0x23,
|
||||
0x30, 0x0, 0x4a, 0x80, 0x0, 0x9d,
|
||||
0x9f, 0x0, 0xc3, 0xc8, 0x0, 0xd5 };
|
||||
static const unsigned char u104[] = {
|
||||
0x00, 0x0, 0x9d, 0xa0, 0x0, 0xa9 };
|
||||
static const unsigned char u108[] = {
|
||||
0x00, 0x0, 0x05, 0x08, 0x0a, 0x0, 0x35,
|
||||
0x37, 0x38, 0x3c, 0x3f, 0x0, 0x55,
|
||||
0x57, 0x0, 0x5f };
|
||||
static const unsigned char u109[] = {
|
||||
0x00, 0x0, 0x1b, 0x1f, 0x0, 0x39, 0x3f };
|
||||
static const unsigned char u10a[] = {
|
||||
0x00, 0x0, 0x03, 0x05, 0x06, 0x0c, 0x0, 0x13,
|
||||
0x15, 0x0, 0x17, 0x19, 0x0, 0x33,
|
||||
0x38, 0x0, 0x3a, 0x3f, 0x0, 0x47,
|
||||
0x50, 0x0, 0x58, 0x60, 0x0, 0x7f };
|
||||
static const unsigned char u10b[] = {
|
||||
0x00, 0x0, 0x35, 0x39, 0x0, 0x55,
|
||||
0x58, 0x0, 0x72, 0x78, 0x0, 0x7f };
|
||||
static const unsigned char u10c[] = {
|
||||
0x00, 0x0, 0x48 };
|
||||
static const unsigned char u10e[] = {
|
||||
0x60, 0x0, 0x7e };
|
||||
static const unsigned char u110[] = {
|
||||
0x80, 0x0, 0xc1 };
|
||||
/* u120 to u122 is all-print */
|
||||
static const unsigned char u123[] = {
|
||||
0x00, 0x0, 0x6e };
|
||||
static const unsigned char u124[] = {
|
||||
0x00, 0x0, 0x62, 0x70, 0x0, 0x73 };
|
||||
/* u130 to u133 is all-print */
|
||||
static const unsigned char u134[] = {
|
||||
0x00, 0x0, 0x2e };
|
||||
static const unsigned char u1d0[] = {
|
||||
0x00, 0x0, 0xf5 };
|
||||
static const unsigned char u1d1[] = {
|
||||
0x00, 0x0, 0x26, 0x29, 0x0, 0xdd };
|
||||
static const unsigned char u1d2[] = {
|
||||
0x00, 0x0, 0x45 };
|
||||
static const unsigned char u1d3[] = {
|
||||
0x00, 0x0, 0x56, 0x60, 0x0, 0x71 };
|
||||
static const unsigned char u1d4[] = {
|
||||
0x00, 0x0, 0x54, 0x56, 0x0, 0x9c, 0x9e, 0x0,
|
||||
0x9f, 0xa2, 0xa5, 0x0, 0xa6, 0xa9, 0x0, 0xac,
|
||||
0xae, 0x0, 0xb9, 0xbb, 0xbd, 0x0, 0xc3,
|
||||
0xc5, 0x0, 0xff };
|
||||
static const unsigned char u1d5[] = {
|
||||
0x00, 0x0, 0x05, 0x07, 0x0, 0x0a,
|
||||
0x0d, 0x0, 0x14, 0x16, 0x0, 0x1c, 0x1e, 0x0,
|
||||
0x39, 0x3b, 0x0, 0x3e, 0x40, 0x0, 0x44, 0x46,
|
||||
0x4a, 0x0, 0x50, 0x52, 0x0, 0xff };
|
||||
static const unsigned char u1d6[] = {
|
||||
0x00, 0x0, 0xa5, 0xa8, 0x0, 0xff };
|
||||
static const unsigned char u1d7[] = {
|
||||
0x00, 0x0, 0xcb, 0xce, 0x0, 0xff };
|
||||
static const unsigned char u1f0[] = {
|
||||
0x00, 0x0, 0x2b, 0x30, 0x0, 0x93 };
|
||||
static const unsigned char u1f1[] = {
|
||||
0x00, 0x0, 0x0a, 0x10, 0x0, 0x2e,
|
||||
0x31, 0x3d, 0x3f, 0x42, 0x46, 0x4a, 0x0, 0x4e,
|
||||
0x57, 0x5f, 0x79, 0x7b, 0x7c, 0x7f, 0x8a, 0x0,
|
||||
0x8c, 0x8d, 0x90 };
|
||||
static const unsigned char u1f2[] = {
|
||||
0x00, 0x10, 0x0, 0x31, 0x40, 0x0, 0x48 };
|
||||
/* u200 to u2a5 is all-print */
|
||||
static const unsigned char u2a6[] = {
|
||||
0x00, 0x0, 0xd6 };
|
||||
/* u2a7 to u2b6 is all-print */
|
||||
static const unsigned char u2b7[] = {
|
||||
0x00, 0x0, 0x34 };
|
||||
/* u2f8 to u2f9 is all-print */
|
||||
static const unsigned char u2fa[] = {
|
||||
0x00,
|
||||
0x0, 0x1d };
|
||||
static const unsigned char ue00[] = {
|
||||
0x01, 0x20, 0x0, 0x7f };
|
||||
static const unsigned char ue01[] = {
|
||||
0x00, 0x0, 0xef };
|
||||
/* uf00 to uffe is all-print */
|
||||
static const unsigned char ufff[] = {
|
||||
0x00, 0x0, 0xfd };
|
||||
/* u1000 to u10fe is all-print */
|
||||
static const unsigned char u10ff[] = {
|
||||
0x00, 0x0, 0xfd };
|
@ -1,94 +0,0 @@
|
||||
/* Copyright (c) 2002 Red Hat Incorporated.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
The name of Red Hat Incorporated may not be used to endorse
|
||||
or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<wctrans>>---get wide-character translation type
|
||||
|
||||
INDEX
|
||||
wctrans
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
wctrans_t wctrans(const char *<[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
wctrans_t wctrans(<[c]>)
|
||||
const char * <[c]>;
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
<<wctrans>> is a function which takes a string <[c]> and gives back
|
||||
the appropriate wctrans_t type value associated with the string,
|
||||
if one exists. The following values are guaranteed to be recognized:
|
||||
"tolower" and "toupper".
|
||||
|
||||
RETURNS
|
||||
<<wctrans>> returns 0 and sets <<errno>> to <<EINVAL>> if the
|
||||
given name is invalid. Otherwise, it returns a valid non-zero wctrans_t
|
||||
value.
|
||||
|
||||
PORTABILITY
|
||||
<<wctrans>> is C99.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
|
||||
#include <_ansi.h>
|
||||
#include <string.h>
|
||||
#include <reent.h>
|
||||
#include <wctype.h>
|
||||
#include <errno.h>
|
||||
#include "local.h"
|
||||
|
||||
wctrans_t
|
||||
_DEFUN (_wctrans_r, (r, c),
|
||||
struct _reent *r _AND
|
||||
const char *c)
|
||||
{
|
||||
if (!strcmp (c, "tolower"))
|
||||
return WCT_TOLOWER;
|
||||
else if (!strcmp (c, "toupper"))
|
||||
return WCT_TOUPPER;
|
||||
else
|
||||
{
|
||||
r->_errno = EINVAL;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef _REENT_ONLY
|
||||
wctrans_t
|
||||
_DEFUN (wctrans, (c),
|
||||
const char *c)
|
||||
{
|
||||
return _wctrans_r (_REENT, c);
|
||||
}
|
||||
#endif /* !_REENT_ONLY */
|
@ -1,137 +0,0 @@
|
||||
/* Copyright (c) 2002 Red Hat Incorporated.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
The name of Red Hat Incorporated may not be used to endorse
|
||||
or promote products derived from this software without specific
|
||||
prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL RED HAT INCORPORATED BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
FUNCTION
|
||||
<<wctype>>---get wide-character classification type
|
||||
|
||||
INDEX
|
||||
wctype
|
||||
|
||||
ANSI_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
wctype_t wctype(const char *<[c]>);
|
||||
|
||||
TRAD_SYNOPSIS
|
||||
#include <wctype.h>
|
||||
wctype_t wctype(<[c]>)
|
||||
const char * <[c]>;
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
<<wctype>> is a function which takes a string <[c]> and gives back
|
||||
the appropriate wctype_t type value associated with the string,
|
||||
if one exists. The following values are guaranteed to be recognized:
|
||||
"alnum", "alpha", "blank", "cntrl", "digit", "graph", "lower", "print",
|
||||
"punct", "space", "upper", and "xdigit".
|
||||
|
||||
RETURNS
|
||||
<<wctype>> returns 0 and sets <<errno>> to <<EINVAL>> if the
|
||||
given name is invalid. Otherwise, it returns a valid non-zero wctype_t
|
||||
value.
|
||||
|
||||
PORTABILITY
|
||||
<<wctype>> is C99.
|
||||
|
||||
No supporting OS subroutines are required.
|
||||
*/
|
||||
|
||||
#include <_ansi.h>
|
||||
#include <string.h>
|
||||
#include <reent.h>
|
||||
#include <wctype.h>
|
||||
#include <errno.h>
|
||||
#include "local.h"
|
||||
|
||||
wctype_t
|
||||
_DEFUN (_wctype_r, (r, c),
|
||||
struct _reent *r _AND
|
||||
const char *c)
|
||||
{
|
||||
switch (*c)
|
||||
{
|
||||
case 'a':
|
||||
if (!strcmp (c, "alnum"))
|
||||
return WC_ALNUM;
|
||||
else if (!strcmp (c, "alpha"))
|
||||
return WC_ALPHA;
|
||||
break;
|
||||
case 'b':
|
||||
if (!strcmp (c, "blank"))
|
||||
return WC_BLANK;
|
||||
break;
|
||||
case 'c':
|
||||
if (!strcmp (c, "cntrl"))
|
||||
return WC_CNTRL;
|
||||
break;
|
||||
case 'd':
|
||||
if (!strcmp (c, "digit"))
|
||||
return WC_DIGIT;
|
||||
break;
|
||||
case 'g':
|
||||
if (!strcmp (c, "graph"))
|
||||
return WC_GRAPH;
|
||||
break;
|
||||
case 'l':
|
||||
if (!strcmp (c, "lower"))
|
||||
return WC_LOWER;
|
||||
break;
|
||||
case 'p':
|
||||
if (!strcmp (c, "print"))
|
||||
return WC_PRINT;
|
||||
else if (!strcmp (c, "punct"))
|
||||
return WC_PUNCT;
|
||||
break;
|
||||
case 's':
|
||||
if (!strcmp (c, "space"))
|
||||
return WC_SPACE;
|
||||
break;
|
||||
case 'u':
|
||||
if (!strcmp (c, "upper"))
|
||||
return WC_UPPER;
|
||||
break;
|
||||
case 'x':
|
||||
if (!strcmp (c, "xdigit"))
|
||||
return WC_XDIGIT;
|
||||
break;
|
||||
}
|
||||
|
||||
/* otherwise invalid */
|
||||
r->_errno = EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef _REENT_ONLY
|
||||
wctype_t
|
||||
_DEFUN (wctype, (c),
|
||||
const char *c)
|
||||
{
|
||||
return _wctype_r (_REENT, c);
|
||||
}
|
||||
#endif /* !_REENT_ONLY */
|
@ -1,118 +0,0 @@
|
||||
|
||||
OUTPUT_FORMAT(pei-i386)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
|
||||
. = SIZEOF_HEADERS;
|
||||
. = ALIGN(__section_alignment__);
|
||||
|
||||
.text __image_base__ + . :
|
||||
{
|
||||
*(.text)
|
||||
*(SORT(.text$*))
|
||||
*(.text.*)
|
||||
*(.gnu.linkonce.t.*)
|
||||
*(.glue_7t)
|
||||
*(.glue_7)
|
||||
___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
|
||||
LONG (-1);*(.ctors); *(.ctor); *(SORT(.ctors.*)); LONG (0);
|
||||
___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
|
||||
LONG (-1); *(.dtors); *(.dtor); *(SORT(.dtors.*)); LONG (0);
|
||||
*(.fini)
|
||||
|
||||
. = ALIGN(16) ;
|
||||
___crt_xc_start__ = . ;
|
||||
*(SORT(.CRT$XC*)) /* C initialization */
|
||||
___crt_xc_end__ = . ;
|
||||
___crt_xi_start__ = . ;
|
||||
*(SORT(.CRT$XI*)) /* C++ initialization */
|
||||
___crt_xi_end__ = . ;
|
||||
___crt_xl_start__ = . ;
|
||||
*(SORT(.CRT$XL*)) /* TLS callbacks */
|
||||
/* ___crt_xl_end__ is defined in the TLS Directory support code */
|
||||
___crt_xp_start__ = . ;
|
||||
*(SORT(.CRT$XP*)) /* Pre-termination */
|
||||
___crt_xp_end__ = . ;
|
||||
___crt_xt_start__ = . ;
|
||||
*(SORT(.CRT$XT*)) /* Termination */
|
||||
___crt_xt_end__ = . ;
|
||||
|
||||
. = ALIGN(16) ;
|
||||
|
||||
*(.rdata)
|
||||
*(SORT(.rdata$*))
|
||||
__rt_psrelocs_start = .;
|
||||
*(.rdata_runtime_pseudo_reloc)
|
||||
__rt_psrelocs_end = .;
|
||||
}
|
||||
__rt_psrelocs_size = __rt_psrelocs_end - __rt_psrelocs_start;
|
||||
___RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
|
||||
__RUNTIME_PSEUDO_RELOC_LIST_END__ = .;
|
||||
___RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;
|
||||
__RUNTIME_PSEUDO_RELOC_LIST__ = . - __rt_psrelocs_size;
|
||||
|
||||
.data ALIGN(__section_alignment__):
|
||||
{
|
||||
PROVIDE ( __data_start__ = .) ;
|
||||
*(.data)
|
||||
*(.data2)
|
||||
*(SORT(.data$*))
|
||||
*(.jcr)
|
||||
__CRT_MT = .;
|
||||
LONG(0);
|
||||
PROVIDE ( __data_end__ = .) ;
|
||||
*(.data_cygwin_nocopy)
|
||||
}
|
||||
|
||||
.bss ALIGN(__section_alignment__):
|
||||
{
|
||||
__bss_start__ = . ;
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
__bss_end__ = . ;
|
||||
}
|
||||
|
||||
.edata ALIGN(__section_alignment__):
|
||||
{
|
||||
*(.edata)
|
||||
}
|
||||
|
||||
/DISCARD/ :
|
||||
{
|
||||
*(.debug$S)
|
||||
*(.debug$T)
|
||||
*(.debug$F)
|
||||
*(.drectve)
|
||||
*(.note.GNU-stack)
|
||||
*(.eh_frame)
|
||||
*(.comment)
|
||||
*(.debug_abbrev)
|
||||
*(.debug_info)
|
||||
*(.debug_line)
|
||||
*(.debug_frame)
|
||||
*(.debug_loc)
|
||||
*(.debug_pubnames)
|
||||
*(.debug_aranges)
|
||||
*(.debug_ranges)
|
||||
}
|
||||
|
||||
.idata ALIGN(__section_alignment__):
|
||||
{
|
||||
SORT(*)(.idata$2)
|
||||
SORT(*)(.idata$3)
|
||||
/* These zeroes mark the end of the import list. */
|
||||
LONG (0); LONG (0); LONG (0); LONG (0); LONG (0);
|
||||
SORT(*)(.idata$4)
|
||||
SORT(*)(.idata$5)
|
||||
SORT(*)(.idata$6)
|
||||
SORT(*)(.idata$7)
|
||||
}
|
||||
|
||||
.reloc ALIGN(__section_alignment__) :
|
||||
{
|
||||
*(.reloc)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,16 +0,0 @@
|
||||
/* The errno variable is stored in the reentrancy structure. This
|
||||
function returns its address for use by the macro errno defined in
|
||||
errno.h. */
|
||||
|
||||
#include <errno.h>
|
||||
#include <reent.h>
|
||||
|
||||
#ifndef _REENT_ONLY
|
||||
|
||||
int *
|
||||
__errno ()
|
||||
{
|
||||
return &_REENT->_errno;
|
||||
}
|
||||
|
||||
#endif
|
@ -1,133 +0,0 @@
|
||||
/* Provide support for both ANSI and non-ANSI environments. */
|
||||
|
||||
/* Some ANSI environments are "broken" in the sense that __STDC__ cannot be
|
||||
relied upon to have it's intended meaning. Therefore we must use our own
|
||||
concoction: _HAVE_STDC. Always use _HAVE_STDC instead of __STDC__ in newlib
|
||||
sources!
|
||||
|
||||
To get a strict ANSI C environment, define macro __STRICT_ANSI__. This will
|
||||
"comment out" the non-ANSI parts of the ANSI header files (non-ANSI header
|
||||
files aren't affected). */
|
||||
|
||||
#ifndef _ANSIDECL_H_
|
||||
#define _ANSIDECL_H_
|
||||
|
||||
#include <newlib.h>
|
||||
#include <sys/config.h>
|
||||
|
||||
/* First try to figure out whether we really are in an ANSI C environment. */
|
||||
/* FIXME: This probably needs some work. Perhaps sys/config.h can be
|
||||
prevailed upon to give us a clue. */
|
||||
|
||||
#ifdef __STDC__
|
||||
#define _HAVE_STDC
|
||||
#endif
|
||||
|
||||
/* ISO C++. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if !(defined(_BEGIN_STD_C) && defined(_END_STD_C))
|
||||
#ifdef _HAVE_STD_CXX
|
||||
#define _BEGIN_STD_C namespace std { extern "C" {
|
||||
#define _END_STD_C } }
|
||||
#else
|
||||
#define _BEGIN_STD_C extern "C" {
|
||||
#define _END_STD_C }
|
||||
#endif
|
||||
#if defined(__GNUC__) && \
|
||||
( (__GNUC__ >= 4) || \
|
||||
( (__GNUC__ >= 3) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 3) ) )
|
||||
#define _NOTHROW __attribute__ ((nothrow))
|
||||
#else
|
||||
#define _NOTHROW throw()
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#define _BEGIN_STD_C
|
||||
#define _END_STD_C
|
||||
#define _NOTHROW
|
||||
#endif
|
||||
|
||||
#ifdef _HAVE_STDC
|
||||
#define _PTR void *
|
||||
#define _AND ,
|
||||
#define _NOARGS void
|
||||
#define _CONST const
|
||||
#define _VOLATILE volatile
|
||||
#define _SIGNED signed
|
||||
#define _DOTS , ...
|
||||
#define _VOID void
|
||||
#ifdef __CYGWIN__
|
||||
#define _EXFUN_NOTHROW(name, proto) __cdecl name proto _NOTHROW
|
||||
#define _EXFUN(name, proto) __cdecl name proto
|
||||
#define _EXPARM(name, proto) (* __cdecl name) proto
|
||||
#define _EXFNPTR(name, proto) (__cdecl * name) proto
|
||||
#else
|
||||
#define _EXFUN_NOTHROW(name, proto) name proto _NOTHROW
|
||||
#define _EXFUN(name, proto) name proto
|
||||
#define _EXPARM(name, proto) (* name) proto
|
||||
#define _EXFNPTR(name, proto) (* name) proto
|
||||
#endif
|
||||
#define _DEFUN(name, arglist, args) name(args)
|
||||
#define _DEFUN_VOID(name) name(_NOARGS)
|
||||
#define _CAST_VOID (void)
|
||||
#ifndef _LONG_DOUBLE
|
||||
#define _LONG_DOUBLE long double
|
||||
#endif
|
||||
#ifndef _LONG_LONG_TYPE
|
||||
#define _LONG_LONG_TYPE long long
|
||||
#endif
|
||||
#ifndef _PARAMS
|
||||
#define _PARAMS(paramlist) paramlist
|
||||
#endif
|
||||
#else
|
||||
#define _PTR char *
|
||||
#define _AND ;
|
||||
#define _NOARGS
|
||||
#define _CONST
|
||||
#define _VOLATILE
|
||||
#define _SIGNED
|
||||
#define _DOTS
|
||||
#define _VOID void
|
||||
#define _EXFUN(name, proto) name()
|
||||
#define _EXFUN_NOTHROW(name, proto) name()
|
||||
#define _DEFUN(name, arglist, args) name arglist args;
|
||||
#define _DEFUN_VOID(name) name()
|
||||
#define _CAST_VOID
|
||||
#define _LONG_DOUBLE double
|
||||
#define _LONG_LONG_TYPE long
|
||||
#ifndef _PARAMS
|
||||
#define _PARAMS(paramlist) ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Support gcc's __attribute__ facility. */
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define _ATTRIBUTE(attrs) __attribute__ (attrs)
|
||||
#else
|
||||
#define _ATTRIBUTE(attrs)
|
||||
#endif
|
||||
|
||||
/* The traditional meaning of 'extern inline' for GCC is not
|
||||
to emit the function body unless the address is explicitly
|
||||
taken. However this behaviour is changing to match the C99
|
||||
standard, which uses 'extern inline' to indicate that the
|
||||
function body *must* be emitted. If we are using GCC, but do
|
||||
not have the new behaviour, we need to use extern inline; if
|
||||
we are using a new GCC with the C99-compatible behaviour, or
|
||||
a non-GCC compiler (which we will have to hope is C99, since
|
||||
there is no other way to achieve the effect of omitting the
|
||||
function if it isn't referenced) we just use plain 'inline',
|
||||
which c99 defines to mean more-or-less the same as the Gnu C
|
||||
'extern inline'. */
|
||||
#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
|
||||
/* We're using GCC, but without the new C99-compatible behaviour. */
|
||||
#define _ELIDABLE_INLINE extern __inline__ _ATTRIBUTE ((__always_inline__))
|
||||
#else
|
||||
/* We're using GCC in C99 mode, or an unknown compiler which
|
||||
we just have to hope obeys the C99 semantics of inline. */
|
||||
#define _ELIDABLE_INLINE __inline__
|
||||
#endif
|
||||
|
||||
#endif /* _ANSIDECL_H_ */
|
@ -1,40 +0,0 @@
|
||||
/* internal use only -- mapping of "system calls" for libraries that lose
|
||||
and only provide C names, so that we end up in violation of ANSI */
|
||||
#ifndef __SYSLIST_H
|
||||
#define __SYSLIST_H
|
||||
|
||||
#ifdef MISSING_SYSCALL_NAMES
|
||||
#define _close close
|
||||
#define _execve execve
|
||||
#define _fcntl fcntl
|
||||
#define _fork fork
|
||||
#define _fstat fstat
|
||||
#define _getpid getpid
|
||||
#define _gettimeofday gettimeofday
|
||||
#define _isatty isatty
|
||||
#define _kill kill
|
||||
#define _link link
|
||||
#define _lseek lseek
|
||||
#define _mkdir mkdir
|
||||
#define _open open
|
||||
#define _read read
|
||||
#define _sbrk sbrk
|
||||
#define _stat stat
|
||||
#define _times times
|
||||
#define _unlink unlink
|
||||
#define _wait wait
|
||||
#define _write write
|
||||
#endif /* MISSING_SYSCALL_NAMES */
|
||||
|
||||
#if defined MISSING_SYSCALL_NAMES || !defined HAVE_OPENDIR
|
||||
/* If the system call interface is missing opendir, readdir, and
|
||||
closedir, there is an implementation of these functions in
|
||||
libc/posix that is implemented using open, getdents, and close.
|
||||
Note, these functions are currently not in the libc/syscalls
|
||||
directory. */
|
||||
#define _opendir opendir
|
||||
#define _readdir readdir
|
||||
#define _closedir closedir
|
||||
#endif /* MISSING_SYSCALL_NAMES || !HAVE_OPENDIR */
|
||||
|
||||
#endif /* !__SYSLIST_H_ */
|
@ -1,21 +0,0 @@
|
||||
/* libc/include/alloca.h - Allocate memory on stack */
|
||||
|
||||
/* Written 2000 by Werner Almesberger */
|
||||
/* Rearranged for general inclusion by stdlib.h.
|
||||
2001, Corinna Vinschen <vinschen@redhat.com> */
|
||||
|
||||
#ifndef _NEWLIB_ALLOCA_H
|
||||
#define _NEWLIB_ALLOCA_H
|
||||
|
||||
#include "_ansi.h"
|
||||
#include <sys/reent.h>
|
||||
|
||||
#undef alloca
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define alloca(size) __builtin_alloca(size)
|
||||
#else
|
||||
void * _EXFUN(alloca,(size_t));
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,69 +0,0 @@
|
||||
/* $NetBSD: ar.h,v 1.4 1994/10/26 00:55:43 cgd Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* (c) UNIX System Laboratories, Inc.
|
||||
* All or some portions of this file are derived from material licensed
|
||||
* to the University of California by American Telephone and Telegraph
|
||||
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
||||
* the permission of UNIX System Laboratories, Inc.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Hugh Smith at The University of Guelph.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ar.h 8.2 (Berkeley) 1/21/94
|
||||
*/
|
||||
|
||||
#ifndef _AR_H_
|
||||
#define _AR_H_
|
||||
|
||||
/* Pre-4BSD archives had these magic numbers in them. */
|
||||
#define OARMAG1 0177555
|
||||
#define OARMAG2 0177545
|
||||
|
||||
#define ARMAG "!<arch>\n" /* ar "magic number" */
|
||||
#define SARMAG 8 /* strlen(ARMAG); */
|
||||
|
||||
#define AR_EFMT1 "#1/" /* extended format #1 */
|
||||
|
||||
struct ar_hdr {
|
||||
char ar_name[16]; /* name */
|
||||
char ar_date[12]; /* modification time */
|
||||
char ar_uid[6]; /* user id */
|
||||
char ar_gid[6]; /* group id */
|
||||
char ar_mode[8]; /* octal file permissions */
|
||||
char ar_size[10]; /* size in bytes */
|
||||
#define ARFMAG "`\n"
|
||||
char ar_fmag[2]; /* consistency check */
|
||||
};
|
||||
|
||||
#endif /* !_AR_H_ */
|
@ -1,33 +0,0 @@
|
||||
/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software
|
||||
* is freely granted, provided that this notice is preserved.
|
||||
*/
|
||||
|
||||
#ifndef _ARGZ_H_
|
||||
#define _ARGZ_H_
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "_ansi.h"
|
||||
|
||||
_BEGIN_STD_C
|
||||
|
||||
/* The newlib implementation of these functions assumes that sizeof(char) == 1. */
|
||||
error_t argz_create (char *const argv[], char **argz, size_t *argz_len);
|
||||
error_t argz_create_sep (const char *string, int sep, char **argz, size_t *argz_len);
|
||||
size_t argz_count (const char *argz, size_t argz_len);
|
||||
void argz_extract (char *argz, size_t argz_len, char **argv);
|
||||
void argz_stringify (char *argz, size_t argz_len, int sep);
|
||||
error_t argz_add (char **argz, size_t *argz_len, const char *str);
|
||||
error_t argz_add_sep (char **argz, size_t *argz_len, const char *str, int sep);
|
||||
error_t argz_append (char **argz, size_t *argz_len, const char *buf, size_t buf_len);
|
||||
error_t argz_delete (char **argz, size_t *argz_len, char *entry);
|
||||
error_t argz_insert (char **argz, size_t *argz_len, char *before, const char *entry);
|
||||
char * argz_next (char *argz, size_t argz_len, const char *entry);
|
||||
error_t argz_replace (char **argz, size_t *argz_len, const char *str, const char *with, unsigned *replace_count);
|
||||
|
||||
_END_STD_C
|
||||
|
||||
#endif /* _ARGZ_H_ */
|
@ -1,50 +0,0 @@
|
||||
/*
|
||||
assert.h
|
||||
*/
|
||||
#ifndef _NEWLIB_ASSERT_H
|
||||
#define _NEWLIB_ASSERT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "_ansi.h"
|
||||
|
||||
#undef assert
|
||||
|
||||
#ifdef NDEBUG /* required by ANSI standard */
|
||||
# define assert(__e) ((void)0)
|
||||
#else
|
||||
# define assert(__e) ((__e) ? (void)0 : __assert_func (__FILE__, __LINE__, \
|
||||
__ASSERT_FUNC, #__e))
|
||||
|
||||
# ifndef __ASSERT_FUNC
|
||||
/* Use g++'s demangled names in C++. */
|
||||
# if defined __cplusplus && defined __GNUC__
|
||||
# define __ASSERT_FUNC __PRETTY_FUNCTION__
|
||||
|
||||
/* C99 requires the use of __func__. */
|
||||
# elif __STDC_VERSION__ >= 199901L
|
||||
# define __ASSERT_FUNC __func__
|
||||
|
||||
/* Older versions of gcc don't have __func__ but can use __FUNCTION__. */
|
||||
# elif __GNUC__ >= 2
|
||||
# define __ASSERT_FUNC __FUNCTION__
|
||||
|
||||
/* failed to detect __func__ support. */
|
||||
# else
|
||||
# define __ASSERT_FUNC ((char *) 0)
|
||||
# endif
|
||||
# endif /* !__ASSERT_FUNC */
|
||||
#endif /* !NDEBUG */
|
||||
|
||||
void _EXFUN(__assert, (const char *, int, const char *)
|
||||
_ATTRIBUTE ((__noreturn__)));
|
||||
void _EXFUN(__assert_func, (const char *, int, const char *, const char *)
|
||||
_ATTRIBUTE ((__noreturn__)));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _NEWLIB_ASSERT_H */
|
@ -1,124 +0,0 @@
|
||||
/* $NetBSD: complex.h,v 1.3 2010/09/15 16:11:30 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Written by Matthias Drochner.
|
||||
* Public domain.
|
||||
*/
|
||||
|
||||
#ifndef _COMPLEX_H
|
||||
#define _COMPLEX_H
|
||||
|
||||
#define complex _Complex
|
||||
#define _Complex_I 1.0fi
|
||||
#define I _Complex_I
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* 7.3.5 Trigonometric functions */
|
||||
/* 7.3.5.1 The cacos functions */
|
||||
double complex cacos(double complex);
|
||||
float complex cacosf(float complex);
|
||||
|
||||
/* 7.3.5.2 The casin functions */
|
||||
double complex casin(double complex);
|
||||
float complex casinf(float complex);
|
||||
|
||||
/* 7.3.5.1 The catan functions */
|
||||
double complex catan(double complex);
|
||||
float complex catanf(float complex);
|
||||
|
||||
/* 7.3.5.1 The ccos functions */
|
||||
double complex ccos(double complex);
|
||||
float complex ccosf(float complex);
|
||||
|
||||
/* 7.3.5.1 The csin functions */
|
||||
double complex csin(double complex);
|
||||
float complex csinf(float complex);
|
||||
|
||||
/* 7.3.5.1 The ctan functions */
|
||||
double complex ctan(double complex);
|
||||
float complex ctanf(float complex);
|
||||
|
||||
/* 7.3.6 Hyperbolic functions */
|
||||
/* 7.3.6.1 The cacosh functions */
|
||||
double complex cacosh(double complex);
|
||||
float complex cacoshf(float complex);
|
||||
|
||||
/* 7.3.6.2 The casinh functions */
|
||||
double complex casinh(double complex);
|
||||
float complex casinhf(float complex);
|
||||
|
||||
/* 7.3.6.3 The catanh functions */
|
||||
double complex catanh(double complex);
|
||||
float complex catanhf(float complex);
|
||||
|
||||
/* 7.3.6.4 The ccosh functions */
|
||||
double complex ccosh(double complex);
|
||||
float complex ccoshf(float complex);
|
||||
|
||||
/* 7.3.6.5 The csinh functions */
|
||||
double complex csinh(double complex);
|
||||
float complex csinhf(float complex);
|
||||
|
||||
/* 7.3.6.6 The ctanh functions */
|
||||
double complex ctanh(double complex);
|
||||
float complex ctanhf(float complex);
|
||||
|
||||
/* 7.3.7 Exponential and logarithmic functions */
|
||||
/* 7.3.7.1 The cexp functions */
|
||||
double complex cexp(double complex);
|
||||
float complex cexpf(float complex);
|
||||
|
||||
/* 7.3.7.2 The clog functions */
|
||||
double complex clog(double complex);
|
||||
float complex clogf(float complex);
|
||||
|
||||
/* 7.3.8 Power and absolute-value functions */
|
||||
/* 7.3.8.1 The cabs functions */
|
||||
/*#ifndef __LIBM0_SOURCE__
|
||||
/* avoid conflict with historical cabs(struct complex) */
|
||||
/* double cabs(double complex) __RENAME(__c99_cabs);
|
||||
float cabsf(float complex) __RENAME(__c99_cabsf);
|
||||
#endif
|
||||
*/
|
||||
double cabs(double complex) ;
|
||||
float cabsf(float complex) ;
|
||||
|
||||
/* 7.3.8.2 The cpow functions */
|
||||
double complex cpow(double complex, double complex);
|
||||
float complex cpowf(float complex, float complex);
|
||||
|
||||
/* 7.3.8.3 The csqrt functions */
|
||||
double complex csqrt(double complex);
|
||||
float complex csqrtf(float complex);
|
||||
|
||||
/* 7.3.9 Manipulation functions */
|
||||
/* 7.3.9.1 The carg functions */
|
||||
double carg(double complex);
|
||||
float cargf(float complex);
|
||||
|
||||
/* 7.3.9.2 The cimag functions */
|
||||
double cimag(double complex);
|
||||
float cimagf(float complex);
|
||||
/*long double cimagl(long double complex); */
|
||||
|
||||
/* 7.3.9.3 The conj functions */
|
||||
double complex conj(double complex);
|
||||
float complex conjf(float complex);
|
||||
/*long double complex conjl(long double complex); */
|
||||
|
||||
/* 7.3.9.4 The cproj functions */
|
||||
double complex cproj(double complex);
|
||||
float complex cprojf(float complex);
|
||||
/*long double complex cprojl(long double complex); */
|
||||
|
||||
/* 7.3.9.5 The creal functions */
|
||||
double creal(double complex);
|
||||
float crealf(float complex);
|
||||
/*long double creall(long double complex); */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* ! _COMPLEX_H */
|
@ -1,113 +0,0 @@
|
||||
#ifndef _CTYPE_H_
|
||||
#define _CTYPE_H_
|
||||
|
||||
#include "_ansi.h"
|
||||
|
||||
_BEGIN_STD_C
|
||||
|
||||
int _EXFUN(isalnum, (int __c));
|
||||
int _EXFUN(isalpha, (int __c));
|
||||
int _EXFUN(iscntrl, (int __c));
|
||||
int _EXFUN(isdigit, (int __c));
|
||||
int _EXFUN(isgraph, (int __c));
|
||||
int _EXFUN(islower, (int __c));
|
||||
int _EXFUN(isprint, (int __c));
|
||||
int _EXFUN(ispunct, (int __c));
|
||||
int _EXFUN(isspace, (int __c));
|
||||
int _EXFUN(isupper, (int __c));
|
||||
int _EXFUN(isxdigit,(int __c));
|
||||
int _EXFUN(tolower, (int __c));
|
||||
int _EXFUN(toupper, (int __c));
|
||||
|
||||
#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L
|
||||
int _EXFUN(isblank, (int __c));
|
||||
#endif
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
int _EXFUN(isascii, (int __c));
|
||||
int _EXFUN(toascii, (int __c));
|
||||
#define _tolower(__c) ((unsigned char)(__c) - 'A' + 'a')
|
||||
#define _toupper(__c) ((unsigned char)(__c) - 'a' + 'A')
|
||||
#endif
|
||||
|
||||
#define _U 01
|
||||
#define _L 02
|
||||
#define _N 04
|
||||
#define _S 010
|
||||
#define _P 020
|
||||
#define _C 040
|
||||
#define _X 0100
|
||||
#define _B 0200
|
||||
|
||||
#ifndef _MB_CAPABLE
|
||||
_CONST
|
||||
#endif
|
||||
extern __IMPORT char *__ctype_ptr__;
|
||||
|
||||
#ifndef __cplusplus
|
||||
/* These macros are intentionally written in a manner that will trigger
|
||||
a gcc -Wall warning if the user mistakenly passes a 'char' instead
|
||||
of an int containing an 'unsigned char'. Note that the sizeof will
|
||||
always be 1, which is what we want for mapping EOF to __ctype_ptr__[0];
|
||||
the use of a raw index inside the sizeof triggers the gcc warning if
|
||||
__c was of type char, and sizeof masks side effects of the extra __c.
|
||||
Meanwhile, the real index to __ctype_ptr__+1 must be cast to int,
|
||||
since isalpha(0x100000001LL) must equal isalpha(1), rather than being
|
||||
an out-of-bounds reference on a 64-bit machine. */
|
||||
#define __ctype_lookup(__c) ((__ctype_ptr__+sizeof(""[__c]))[(int)(__c)])
|
||||
|
||||
#define isalpha(__c) (__ctype_lookup(__c)&(_U|_L))
|
||||
#define isupper(__c) ((__ctype_lookup(__c)&(_U|_L))==_U)
|
||||
#define islower(__c) ((__ctype_lookup(__c)&(_U|_L))==_L)
|
||||
#define isdigit(__c) (__ctype_lookup(__c)&_N)
|
||||
#define isxdigit(__c) (__ctype_lookup(__c)&(_X|_N))
|
||||
#define isspace(__c) (__ctype_lookup(__c)&_S)
|
||||
#define ispunct(__c) (__ctype_lookup(__c)&_P)
|
||||
#define isalnum(__c) (__ctype_lookup(__c)&(_U|_L|_N))
|
||||
#define isprint(__c) (__ctype_lookup(__c)&(_P|_U|_L|_N|_B))
|
||||
#define isgraph(__c) (__ctype_lookup(__c)&(_P|_U|_L|_N))
|
||||
#define iscntrl(__c) (__ctype_lookup(__c)&_C)
|
||||
|
||||
#if defined(__GNUC__) && \
|
||||
(!defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901L)
|
||||
#define isblank(__c) \
|
||||
__extension__ ({ __typeof__ (__c) __x = (__c); \
|
||||
(__ctype_lookup(__x)&_B) || (int) (__x) == '\t';})
|
||||
#endif
|
||||
|
||||
|
||||
/* Non-gcc versions will get the library versions, and will be
|
||||
slightly slower. These macros are not NLS-aware so they are
|
||||
disabled if the system supports the extended character sets. */
|
||||
# if defined(__GNUC__)
|
||||
# if !defined (_MB_EXTENDED_CHARSETS_ISO) && !defined (_MB_EXTENDED_CHARSETS_WINDOWS)
|
||||
# define toupper(__c) \
|
||||
__extension__ ({ __typeof__ (__c) __x = (__c); \
|
||||
islower (__x) ? (int) __x - 'a' + 'A' : (int) __x;})
|
||||
# define tolower(__c) \
|
||||
__extension__ ({ __typeof__ (__c) __x = (__c); \
|
||||
isupper (__x) ? (int) __x - 'A' + 'a' : (int) __x;})
|
||||
# else /* _MB_EXTENDED_CHARSETS* */
|
||||
/* Allow a gcc warning if the user passed 'char', but defer to the
|
||||
function. */
|
||||
# define toupper(__c) \
|
||||
__extension__ ({ __typeof__ (__c) __x = (__c); \
|
||||
(void) __ctype_ptr__[__x]; (toupper) (__x);})
|
||||
# define tolower(__c) \
|
||||
__extension__ ({ __typeof__ (__c) __x = (__c); \
|
||||
(void) __ctype_ptr__[__x]; (tolower) (__x);})
|
||||
# endif /* _MB_EXTENDED_CHARSETS* */
|
||||
# endif /* __GNUC__ */
|
||||
#endif /* !__cplusplus */
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
#define isascii(__c) ((unsigned)(__c)<=0177)
|
||||
#define toascii(__c) ((__c)&0177)
|
||||
#endif
|
||||
|
||||
/* For C++ backward-compatibility only. */
|
||||
extern __IMPORT _CONST char _ctype_[];
|
||||
|
||||
_END_STD_C
|
||||
|
||||
#endif /* _CTYPE_H_ */
|
@ -1,15 +0,0 @@
|
||||
#ifndef _DIRENT_H_
|
||||
#define _DIRENT_H_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <sys/dirent.h>
|
||||
|
||||
#if !defined(MAXNAMLEN) && !defined(_POSIX_SOURCE)
|
||||
#define MAXNAMLEN 1024
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /*_DIRENT_H_*/
|
@ -1,15 +0,0 @@
|
||||
/* envlock.h -- header file for env routines. */
|
||||
|
||||
#ifndef _INCLUDE_ENVLOCK_H_
|
||||
#define _INCLUDE_ENVLOCK_H_
|
||||
|
||||
#include <_ansi.h>
|
||||
#include <sys/reent.h>
|
||||
|
||||
#define ENV_LOCK __env_lock(reent_ptr)
|
||||
#define ENV_UNLOCK __env_unlock(reent_ptr)
|
||||
|
||||
void _EXFUN(__env_lock,(struct _reent *reent));
|
||||
void _EXFUN(__env_unlock,(struct _reent *reent));
|
||||
|
||||
#endif /* _INCLUDE_ENVLOCK_H_ */
|
@ -1,16 +0,0 @@
|
||||
/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software
|
||||
* is freely granted, provided that this notice is preserved.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
/* The newlib implementation of these functions assumes that sizeof(char) == 1. */
|
||||
char * envz_entry (const char *envz, size_t envz_len, const char *name);
|
||||
char * envz_get (const char *envz, size_t envz_len, const char *name);
|
||||
error_t envz_add (char **envz, size_t *envz_len, const char *name, const char *value);
|
||||
error_t envz_merge (char **envz, size_t *envz_len, const char *envz2, size_t envz2_len, int override);
|
||||
void envz_remove(char **envz, size_t *envz_len, const char *name);
|
||||
void envz_strip (char **envz, size_t *envz_len);
|
@ -1,11 +0,0 @@
|
||||
#ifndef __ERRNO_H__
|
||||
#define __ERRNO_H__
|
||||
|
||||
#ifndef __error_t_defined
|
||||
typedef int error_t;
|
||||
#define __error_t_defined 1
|
||||
#endif
|
||||
|
||||
#include <sys/errno.h>
|
||||
|
||||
#endif /* !__ERRNO_H__ */
|
@ -1,13 +0,0 @@
|
||||
#ifndef _FASTMATH_H_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#define _FASTMATH_H_
|
||||
|
||||
#include <math.h>
|
||||
#include <machine/fastmath.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _FASTMATH_H_ */
|
@ -1 +0,0 @@
|
||||
#include <sys/fcntl.h>
|
@ -1,105 +0,0 @@
|
||||
#ifndef _FENV_H_
|
||||
#define _FENV_H_
|
||||
|
||||
/* FPU status word exception flags */
|
||||
#define FE_INVALID 0x01
|
||||
#define FE_DENORMAL 0x02
|
||||
#define FE_DIVBYZERO 0x04
|
||||
#define FE_OVERFLOW 0x08
|
||||
#define FE_UNDERFLOW 0x10
|
||||
#define FE_INEXACT 0x20
|
||||
#define FE_ALL_EXCEPT (FE_INVALID | FE_DENORMAL | FE_DIVBYZERO \
|
||||
| FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)
|
||||
|
||||
/* FPU control word rounding flags */
|
||||
#define FE_TONEAREST 0x0000
|
||||
#define FE_DOWNWARD 0x0400
|
||||
#define FE_UPWARD 0x0800
|
||||
#define FE_TOWARDZERO 0x0c00
|
||||
|
||||
/* The MXCSR exception flags are the same as the
|
||||
FE flags. */
|
||||
#define __MXCSR_EXCEPT_FLAG_SHIFT 0
|
||||
|
||||
/* How much to shift FE status word exception flags
|
||||
to get the MXCSR exeptions masks, */
|
||||
#define __MXCSR_EXCEPT_MASK_SHIFT 7
|
||||
|
||||
/* How much to shift FE control word rounding flags
|
||||
to get MXCSR rounding flags, */
|
||||
#define __MXCSR_ROUND_FLAG_SHIFT 3
|
||||
|
||||
#ifndef RC_INVOKED
|
||||
/*
|
||||
For now, support only for the basic abstraction of flags that are
|
||||
either set or clear. fexcept_t could be structure that holds more
|
||||
info about the fp environment.
|
||||
*/
|
||||
typedef unsigned short fexcept_t;
|
||||
|
||||
/* This 32-byte struct represents the entire floating point
|
||||
environment as stored by fnstenv or fstenv, augmented by
|
||||
the contents of the MXCSR register, as stored by stmxcsr
|
||||
(if CPU supports it). */
|
||||
typedef struct
|
||||
{
|
||||
unsigned short __control_word;
|
||||
unsigned short __unused0;
|
||||
unsigned short __status_word;
|
||||
unsigned short __unused1;
|
||||
unsigned short __tag_word;
|
||||
unsigned short __unused2;
|
||||
unsigned int __ip_offset; /* instruction pointer offset */
|
||||
unsigned short __ip_selector;
|
||||
unsigned short __opcode;
|
||||
unsigned int __data_offset;
|
||||
unsigned short __data_selector;
|
||||
unsigned short __unused3;
|
||||
unsigned int __mxcsr; /* contents of the MXCSR register */
|
||||
} fenv_t;
|
||||
|
||||
|
||||
/*The C99 standard (7.6.9) allows us to define implementation-specific macros for
|
||||
different fp environments */
|
||||
|
||||
/* The default Intel x87 floating point environment (64-bit mantissa) */
|
||||
#define FE_PC64_ENV ((const fenv_t *)-1)
|
||||
|
||||
/* The floating point environment set by MSVCRT _fpreset (53-bit mantissa) */
|
||||
#define FE_PC53_ENV ((const fenv_t *)-2)
|
||||
|
||||
/* The FE_DFL_ENV macro is required by standard.
|
||||
fesetenv will use the environment set at app startup.*/
|
||||
#define FE_DFL_ENV ((const fenv_t *) 0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*TODO: Some of these could be inlined */
|
||||
/* 7.6.2 Exception */
|
||||
|
||||
extern int __cdecl feclearexcept (int);
|
||||
extern int __cdecl fegetexceptflag (fexcept_t * flagp, int excepts);
|
||||
extern int __cdecl feraiseexcept (int excepts );
|
||||
extern int __cdecl fesetexceptflag (const fexcept_t *, int);
|
||||
extern int __cdecl fetestexcept (int excepts);
|
||||
|
||||
/* 7.6.3 Rounding */
|
||||
|
||||
extern int __cdecl fegetround (void);
|
||||
extern int __cdecl fesetround (int mode);
|
||||
|
||||
/* 7.6.4 Environment */
|
||||
|
||||
extern int __cdecl fegetenv (fenv_t * envp);
|
||||
extern int __cdecl fesetenv (const fenv_t * );
|
||||
extern int __cdecl feupdateenv (const fenv_t *);
|
||||
extern int __cdecl feholdexcept (fenv_t *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* Not RC_INVOKED */
|
||||
|
||||
#endif /* ndef _FENV_H */
|
@ -1,55 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD: src/include/fnmatch.h,v 1.10 2002/03/23 17:24:53 imp Exp $
|
||||
* @(#)fnmatch.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
|
||||
#ifndef _FNMATCH_H_
|
||||
#define _FNMATCH_H_
|
||||
|
||||
#define FNM_NOMATCH 1 /* Match failed. */
|
||||
|
||||
#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */
|
||||
#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */
|
||||
#define FNM_PERIOD 0x04 /* Period must be matched by period. */
|
||||
|
||||
#if defined(_GNU_SOURCE) || !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
|
||||
#define FNM_LEADING_DIR 0x08 /* Ignore /<tail> after Imatch. */
|
||||
#define FNM_CASEFOLD 0x10 /* Case insensitive search. */
|
||||
#define FNM_IGNORECASE FNM_CASEFOLD
|
||||
#define FNM_FILE_NAME FNM_PATHNAME
|
||||
#endif
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
int fnmatch(const char *, const char *, int);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_FNMATCH_H_ */
|
@ -1,190 +0,0 @@
|
||||
/****************************************************************************
|
||||
|
||||
getopt.h - Read command line options
|
||||
|
||||
AUTHOR: Gregory Pietsch
|
||||
CREATED Thu Jan 09 22:37:00 1997
|
||||
|
||||
DESCRIPTION:
|
||||
|
||||
The getopt() function parses the command line arguments. Its arguments argc
|
||||
and argv are the argument count and array as passed to the main() function
|
||||
on program invocation. The argument optstring is a list of available option
|
||||
characters. If such a character is followed by a colon (`:'), the option
|
||||
takes an argument, which is placed in optarg. If such a character is
|
||||
followed by two colons, the option takes an optional argument, which is
|
||||
placed in optarg. If the option does not take an argument, optarg is NULL.
|
||||
|
||||
The external variable optind is the index of the next array element of argv
|
||||
to be processed; it communicates from one call to the next which element to
|
||||
process.
|
||||
|
||||
The getopt_long() function works like getopt() except that it also accepts
|
||||
long options started by two dashes `--'. If these take values, it is either
|
||||
in the form
|
||||
|
||||
--arg=value
|
||||
|
||||
or
|
||||
|
||||
--arg value
|
||||
|
||||
It takes the additional arguments longopts which is a pointer to the first
|
||||
element of an array of type GETOPT_LONG_OPTION_T, defined below. The last
|
||||
element of the array has to be filled with NULL for the name field.
|
||||
|
||||
The longind pointer points to the index of the current long option relative
|
||||
to longopts if it is non-NULL.
|
||||
|
||||
The getopt() function returns the option character if the option was found
|
||||
successfully, `:' if there was a missing parameter for one of the options,
|
||||
`?' for an unknown option character, and EOF for the end of the option list.
|
||||
|
||||
The getopt_long() function's return value is described below.
|
||||
|
||||
The function getopt_long_only() is identical to getopt_long(), except that a
|
||||
plus sign `+' can introduce long options as well as `--'.
|
||||
|
||||
Describe how to deal with options that follow non-option ARGV-elements.
|
||||
|
||||
If the caller did not specify anything, the default is REQUIRE_ORDER if the
|
||||
environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise.
|
||||
|
||||
REQUIRE_ORDER means don't recognize them as options; stop option processing
|
||||
when the first non-option is seen. This is what Unix does. This mode of
|
||||
operation is selected by either setting the environment variable
|
||||
POSIXLY_CORRECT, or using `+' as the first character of the optstring
|
||||
parameter.
|
||||
|
||||
PERMUTE is the default. We permute the contents of ARGV as we scan, so that
|
||||
eventually all the non-options are at the end. This allows options to be
|
||||
given in any order, even with programs that were not written to expect this.
|
||||
|
||||
RETURN_IN_ORDER is an option available to programs that were written to
|
||||
expect options and other ARGV-elements in any order and that care about the
|
||||
ordering of the two. We describe each non-option ARGV-element as if it were
|
||||
the argument of an option with character code 1. Using `-' as the first
|
||||
character of the optstring parameter selects this mode of operation.
|
||||
|
||||
The special argument `--' forces an end of option-scanning regardless of the
|
||||
value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause
|
||||
getopt() and friends to return EOF with optind != argc.
|
||||
|
||||
COPYRIGHT NOTICE AND DISCLAIMER:
|
||||
|
||||
Copyright (C) 1997 Gregory Pietsch
|
||||
|
||||
This file and the accompanying getopt.c implementation file are hereby
|
||||
placed in the public domain without restrictions. Just give the author
|
||||
credit, don't claim you wrote it or prevent anyone else from using it.
|
||||
|
||||
Gregory Pietsch's current e-mail address:
|
||||
gpietsch@comcast.net
|
||||
****************************************************************************/
|
||||
|
||||
/* This is a glibc-extension header file. */
|
||||
|
||||
#ifndef GETOPT_H
|
||||
#define GETOPT_H
|
||||
|
||||
#include <_ansi.h>
|
||||
|
||||
/* include files needed by this include file */
|
||||
|
||||
#define no_argument 0
|
||||
#define required_argument 1
|
||||
#define optional_argument 2
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* types defined by this include file */
|
||||
struct option
|
||||
{
|
||||
char *name; /* the name of the long option */
|
||||
int has_arg; /* one of the above macros */
|
||||
int *flag; /* determines if getopt_long() returns a
|
||||
* value for a long option; if it is
|
||||
* non-NULL, 0 is returned as a function
|
||||
* value and the value of val is stored in
|
||||
* the area pointed to by flag. Otherwise,
|
||||
* val is returned. */
|
||||
int val; /* determines the value to return if flag is
|
||||
* NULL. */
|
||||
|
||||
};
|
||||
|
||||
/* While getopt.h is a glibc extension, the following are newlib extensions.
|
||||
* They are optionally included via the __need_getopt_newlib flag. */
|
||||
|
||||
#ifdef __need_getopt_newlib
|
||||
|
||||
/* macros defined by this include file */
|
||||
#define NO_ARG no_argument
|
||||
#define REQUIRED_ARG required_argument
|
||||
#define OPTIONAL_ARG optional_argument
|
||||
|
||||
/* The GETOPT_DATA_INITIALIZER macro is used to initialize a statically-
|
||||
allocated variable of type struct getopt_data. */
|
||||
#define GETOPT_DATA_INITIALIZER {0,0,0,0,0}
|
||||
|
||||
/* These #defines are to make accessing the reentrant functions easier. */
|
||||
#define getopt_r __getopt_r
|
||||
#define getopt_long_r __getopt_long_r
|
||||
#define getopt_long_only_r __getopt_long_only_r
|
||||
|
||||
/* The getopt_data structure is for reentrancy. Its members are similar to
|
||||
the externally-defined variables. */
|
||||
typedef struct getopt_data
|
||||
{
|
||||
char *optarg;
|
||||
int optind, opterr, optopt, optwhere;
|
||||
} getopt_data;
|
||||
|
||||
#endif /* __need_getopt_newlib */
|
||||
|
||||
/* externally-defined variables */
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
extern int opterr;
|
||||
extern int optopt;
|
||||
|
||||
/* function prototypes */
|
||||
int _EXFUN (getopt,
|
||||
(int __argc, char *const __argv[], const char *__optstring));
|
||||
|
||||
int _EXFUN (getopt_long,
|
||||
(int __argc, char *const __argv[], const char *__shortopts,
|
||||
const struct option * __longopts, int *__longind));
|
||||
|
||||
int _EXFUN (getopt_long_only,
|
||||
(int __argc, char *const __argv[], const char *__shortopts,
|
||||
const struct option * __longopts, int *__longind));
|
||||
|
||||
#ifdef __need_getopt_newlib
|
||||
int _EXFUN (__getopt_r,
|
||||
(int __argc, char *const __argv[], const char *__optstring,
|
||||
struct getopt_data * __data));
|
||||
|
||||
int _EXFUN (__getopt_long_r,
|
||||
(int __argc, char *const __argv[], const char *__shortopts,
|
||||
const struct option * __longopts, int *__longind,
|
||||
struct getopt_data * __data));
|
||||
|
||||
int _EXFUN (__getopt_long_only_r,
|
||||
(int __argc, char *const __argv[], const char *__shortopts,
|
||||
const struct option * __longopts, int *__longind,
|
||||
struct getopt_data * __data));
|
||||
#endif /* __need_getopt_newlib */
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* GETOPT_H */
|
||||
|
||||
/* END OF FILE getopt.h */
|
@ -1,89 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Guido van Rossum.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)glob.h 8.1 (Berkeley) 6/2/93
|
||||
* $FreeBSD: src/include/glob.h,v 1.6 2002/03/23 17:24:53 imp Exp $
|
||||
*/
|
||||
|
||||
#ifndef _GLOB_H_
|
||||
#define _GLOB_H_
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
struct stat;
|
||||
typedef struct {
|
||||
int gl_pathc; /* Count of total paths so far. */
|
||||
int gl_matchc; /* Count of paths matching pattern. */
|
||||
int gl_offs; /* Reserved at beginning of gl_pathv. */
|
||||
int gl_flags; /* Copy of flags parameter to glob. */
|
||||
char **gl_pathv; /* List of paths matching pattern. */
|
||||
/* Copy of errfunc parameter to glob. */
|
||||
int (*gl_errfunc)(const char *, int);
|
||||
|
||||
/*
|
||||
* Alternate filesystem access methods for glob; replacement
|
||||
* versions of closedir(3), readdir(3), opendir(3), stat(2)
|
||||
* and lstat(2).
|
||||
*/
|
||||
void (*gl_closedir)(void *);
|
||||
struct dirent *(*gl_readdir)(void *);
|
||||
void *(*gl_opendir)(const char *);
|
||||
int (*gl_lstat)(const char *, struct stat *);
|
||||
int (*gl_stat)(const char *, struct stat *);
|
||||
} glob_t;
|
||||
|
||||
#define GLOB_APPEND 0x0001 /* Append to output from previous call. */
|
||||
#define GLOB_DOOFFS 0x0002 /* Use gl_offs. */
|
||||
#define GLOB_ERR 0x0004 /* Return on error. */
|
||||
#define GLOB_MARK 0x0008 /* Append / to matching directories. */
|
||||
#define GLOB_NOCHECK 0x0010 /* Return pattern itself if nothing matches. */
|
||||
#define GLOB_NOSORT 0x0020 /* Don't sort. */
|
||||
|
||||
#define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */
|
||||
#define GLOB_BRACE 0x0080 /* Expand braces ala csh. */
|
||||
#define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */
|
||||
#define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */
|
||||
#define GLOB_QUOTE 0x0400 /* Quote special chars with \. */
|
||||
#define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */
|
||||
#define GLOB_LIMIT 0x1000 /* limit number of returned paths */
|
||||
|
||||
/* backwards compatibility, this is the old name for this option */
|
||||
#define GLOB_MAXPATH GLOB_LIMIT
|
||||
|
||||
#define GLOB_NOSPACE (-1) /* Malloc call failed. */
|
||||
#define GLOB_ABEND (-2) /* Unignored error. */
|
||||
|
||||
__BEGIN_DECLS
|
||||
int glob(const char *, int, int (*)(const char *, int), glob_t *);
|
||||
void globfree(glob_t *);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_GLOB_H_ */
|
@ -1,94 +0,0 @@
|
||||
/* $NetBSD: grp.h,v 1.7 1995/04/29 05:30:40 cgd Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* (c) UNIX System Laboratories, Inc.
|
||||
* All or some portions of this file are derived from material licensed
|
||||
* to the University of California by American Telephone and Telegraph
|
||||
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
|
||||
* the permission of UNIX System Laboratories, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)grp.h 8.2 (Berkeley) 1/21/94
|
||||
*/
|
||||
|
||||
#ifndef _GRP_H_
|
||||
#define _GRP_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef __CYGWIN__
|
||||
#include <cygwin/grp.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
|
||||
#define _PATH_GROUP "/etc/group"
|
||||
#endif
|
||||
|
||||
struct group {
|
||||
char *gr_name; /* group name */
|
||||
char *gr_passwd; /* group password */
|
||||
gid_t gr_gid; /* group id */
|
||||
char **gr_mem; /* group members */
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef __INSIDE_CYGWIN__
|
||||
struct group *getgrgid (gid_t);
|
||||
struct group *getgrnam (const char *);
|
||||
int getgrnam_r (const char *, struct group *,
|
||||
char *, size_t, struct group **);
|
||||
int getgrgid_r (gid_t, struct group *,
|
||||
char *, size_t, struct group **);
|
||||
#ifndef _POSIX_SOURCE
|
||||
struct group *getgrent (void);
|
||||
void setgrent (void);
|
||||
void endgrent (void);
|
||||
#ifndef __CYGWIN__
|
||||
void setgrfile (const char *);
|
||||
#endif /* !__CYGWIN__ */
|
||||
#ifndef _XOPEN_SOURCE
|
||||
#ifndef __CYGWIN__
|
||||
char *group_from_gid (gid_t, int);
|
||||
int setgroupent (int);
|
||||
#endif /* !__CYGWIN__ */
|
||||
int initgroups (const char *, gid_t);
|
||||
#endif /* !_XOPEN_SOURCE */
|
||||
#endif /* !_POSIX_SOURCE */
|
||||
#endif /* !__INSIDE_CYGWIN__ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !_GRP_H_ */
|
@ -1,103 +0,0 @@
|
||||
/* Threads compatibility routines for libgcc2. */
|
||||
/* Compile this one with gcc. */
|
||||
/* Copyright (C) 1997, 1998, 2004, 2008, 2009 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_GTHR_H
|
||||
#define GCC_GTHR_H
|
||||
|
||||
typedef unsigned int __gthread_key_t;
|
||||
|
||||
typedef struct {
|
||||
volatile int done;
|
||||
int started;
|
||||
} __gthread_once_t;
|
||||
|
||||
typedef struct {
|
||||
volatile int counter;
|
||||
} __gthread_mutex_t;
|
||||
|
||||
|
||||
void *tls_alloc(void);
|
||||
|
||||
static int __gthread_mutex_lock (__gthread_mutex_t *mutex)
|
||||
{
|
||||
__mutex_lock(&mutex->counter);
|
||||
return 0;
|
||||
};
|
||||
|
||||
static int __gthread_mutex_unlock (__gthread_mutex_t *mutex)
|
||||
{
|
||||
mutex->counter = 0;
|
||||
return 0;
|
||||
};
|
||||
|
||||
static inline int __gthread_key_create (__gthread_key_t *__key,
|
||||
void (*__dtor) (void *) __attribute__((unused)))
|
||||
{
|
||||
int __status = 0;
|
||||
void *__tls_index = tls_alloc();
|
||||
if (__tls_index != NULL)
|
||||
{
|
||||
*__key = (unsigned int)__tls_index;
|
||||
|
||||
#ifdef MINGW32_SUPPORTS_MT_EH /* FIXME */
|
||||
/* Mingw runtime will run the dtors in reverse order for each thread
|
||||
when the thread exits. */
|
||||
// __status = __mingwthr_key_dtor (*__key, __dtor);
|
||||
#endif
|
||||
|
||||
}
|
||||
else
|
||||
__status = (int) ENOMEM;
|
||||
return __status;
|
||||
}
|
||||
|
||||
|
||||
static inline void *
|
||||
__gthread_getspecific (__gthread_key_t __key)
|
||||
{
|
||||
void *val;
|
||||
__asm__ __volatile__(
|
||||
"movl %%fs:(%1), %0"
|
||||
:"=r"(val)
|
||||
:"r"(__key));
|
||||
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline int
|
||||
__gthread_setspecific (__gthread_key_t __key, const void *__ptr)
|
||||
{
|
||||
if(!(__key & 3))
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"movl %0, %%fs:(%1)"
|
||||
::"r"(__ptr),"r"(__key));
|
||||
return 0;
|
||||
}
|
||||
else return EINVAL;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2003-2004, Artem B. Bityuckiy, SoftMine Corporation.
|
||||
* Rights transferred to Franklin Electronic Publishers.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
#ifndef _ICONV_H_
|
||||
#define _ICONV_H_
|
||||
|
||||
#include <_ansi.h>
|
||||
#include <reent.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/_types.h>
|
||||
|
||||
/* iconv_t: charset conversion descriptor type */
|
||||
typedef _iconv_t iconv_t;
|
||||
|
||||
_BEGIN_STD_C
|
||||
|
||||
#ifndef _REENT_ONLY
|
||||
iconv_t
|
||||
_EXFUN(iconv_open, (_CONST char *, _CONST char *));
|
||||
|
||||
size_t
|
||||
_EXFUN(iconv, (iconv_t, char **, size_t *, char **, size_t *));
|
||||
|
||||
int
|
||||
_EXFUN(iconv_close, (iconv_t));
|
||||
#endif
|
||||
|
||||
iconv_t
|
||||
_EXFUN(_iconv_open_r, (struct _reent *, _CONST char *, _CONST char *));
|
||||
|
||||
size_t
|
||||
_EXFUN(_iconv_r, (struct _reent *, iconv_t, _CONST char **,
|
||||
size_t *, char **, size_t *));
|
||||
|
||||
int
|
||||
_EXFUN(_iconv_close_r, (struct _reent *, iconv_t));
|
||||
|
||||
_END_STD_C
|
||||
|
||||
#endif /* #ifndef _ICONV_H_ */
|
@ -1,256 +0,0 @@
|
||||
#ifndef _IEEE_FP_H_
|
||||
#define _IEEE_FP_H_
|
||||
|
||||
#include "_ansi.h"
|
||||
|
||||
#include <machine/ieeefp.h>
|
||||
|
||||
_BEGIN_STD_C
|
||||
|
||||
/* FIXME FIXME FIXME:
|
||||
Neither of __ieee_{float,double}_shape_tape seem to be used anywhere
|
||||
except in libm/test. If that is the case, please delete these from here.
|
||||
If that is not the case, please insert documentation here describing why
|
||||
they're needed. */
|
||||
|
||||
#ifdef __IEEE_BIG_ENDIAN
|
||||
|
||||
typedef union
|
||||
{
|
||||
double value;
|
||||
struct
|
||||
{
|
||||
unsigned int sign : 1;
|
||||
unsigned int exponent: 11;
|
||||
unsigned int fraction0:4;
|
||||
unsigned int fraction1:16;
|
||||
unsigned int fraction2:16;
|
||||
unsigned int fraction3:16;
|
||||
|
||||
} number;
|
||||
struct
|
||||
{
|
||||
unsigned int sign : 1;
|
||||
unsigned int exponent: 11;
|
||||
unsigned int quiet:1;
|
||||
unsigned int function0:3;
|
||||
unsigned int function1:16;
|
||||
unsigned int function2:16;
|
||||
unsigned int function3:16;
|
||||
} nan;
|
||||
struct
|
||||
{
|
||||
unsigned long msw;
|
||||
unsigned long lsw;
|
||||
} parts;
|
||||
long aslong[2];
|
||||
} __ieee_double_shape_type;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __IEEE_LITTLE_ENDIAN
|
||||
|
||||
typedef union
|
||||
{
|
||||
double value;
|
||||
struct
|
||||
{
|
||||
#ifdef __SMALL_BITFIELDS
|
||||
unsigned int fraction3:16;
|
||||
unsigned int fraction2:16;
|
||||
unsigned int fraction1:16;
|
||||
unsigned int fraction0: 4;
|
||||
#else
|
||||
unsigned int fraction1:32;
|
||||
unsigned int fraction0:20;
|
||||
#endif
|
||||
unsigned int exponent :11;
|
||||
unsigned int sign : 1;
|
||||
} number;
|
||||
struct
|
||||
{
|
||||
#ifdef __SMALL_BITFIELDS
|
||||
unsigned int function3:16;
|
||||
unsigned int function2:16;
|
||||
unsigned int function1:16;
|
||||
unsigned int function0:3;
|
||||
#else
|
||||
unsigned int function1:32;
|
||||
unsigned int function0:19;
|
||||
#endif
|
||||
unsigned int quiet:1;
|
||||
unsigned int exponent: 11;
|
||||
unsigned int sign : 1;
|
||||
} nan;
|
||||
struct
|
||||
{
|
||||
unsigned long lsw;
|
||||
unsigned long msw;
|
||||
} parts;
|
||||
|
||||
long aslong[2];
|
||||
|
||||
} __ieee_double_shape_type;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __IEEE_BIG_ENDIAN
|
||||
|
||||
typedef union
|
||||
{
|
||||
float value;
|
||||
struct
|
||||
{
|
||||
unsigned int sign : 1;
|
||||
unsigned int exponent: 8;
|
||||
unsigned int fraction0: 7;
|
||||
unsigned int fraction1: 16;
|
||||
} number;
|
||||
struct
|
||||
{
|
||||
unsigned int sign:1;
|
||||
unsigned int exponent:8;
|
||||
unsigned int quiet:1;
|
||||
unsigned int function0:6;
|
||||
unsigned int function1:16;
|
||||
} nan;
|
||||
long p1;
|
||||
|
||||
} __ieee_float_shape_type;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __IEEE_LITTLE_ENDIAN
|
||||
|
||||
typedef union
|
||||
{
|
||||
float value;
|
||||
struct
|
||||
{
|
||||
unsigned int fraction0: 7;
|
||||
unsigned int fraction1: 16;
|
||||
unsigned int exponent: 8;
|
||||
unsigned int sign : 1;
|
||||
} number;
|
||||
struct
|
||||
{
|
||||
unsigned int function1:16;
|
||||
unsigned int function0:6;
|
||||
unsigned int quiet:1;
|
||||
unsigned int exponent:8;
|
||||
unsigned int sign:1;
|
||||
} nan;
|
||||
long p1;
|
||||
|
||||
} __ieee_float_shape_type;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* FLOATING ROUNDING */
|
||||
|
||||
typedef int fp_rnd;
|
||||
#define FP_RN 0 /* Round to nearest */
|
||||
#define FP_RM 1 /* Round down */
|
||||
#define FP_RP 2 /* Round up */
|
||||
#define FP_RZ 3 /* Round to zero (trunate) */
|
||||
|
||||
fp_rnd _EXFUN(fpgetround,(void));
|
||||
fp_rnd _EXFUN(fpsetround, (fp_rnd));
|
||||
|
||||
/* EXCEPTIONS */
|
||||
|
||||
typedef int fp_except;
|
||||
#define FP_X_INV 0x10 /* Invalid operation */
|
||||
#define FP_X_DX 0x80 /* Divide by zero */
|
||||
#define FP_X_OFL 0x04 /* Overflow exception */
|
||||
#define FP_X_UFL 0x02 /* Underflow exception */
|
||||
#define FP_X_IMP 0x01 /* imprecise exception */
|
||||
|
||||
fp_except _EXFUN(fpgetmask,(void));
|
||||
fp_except _EXFUN(fpsetmask,(fp_except));
|
||||
fp_except _EXFUN(fpgetsticky,(void));
|
||||
fp_except _EXFUN(fpsetsticky, (fp_except));
|
||||
|
||||
/* INTEGER ROUNDING */
|
||||
|
||||
typedef int fp_rdi;
|
||||
#define FP_RDI_TOZ 0 /* Round to Zero */
|
||||
#define FP_RDI_RD 1 /* Follow float mode */
|
||||
|
||||
fp_rdi _EXFUN(fpgetroundtoi,(void));
|
||||
fp_rdi _EXFUN(fpsetroundtoi,(fp_rdi));
|
||||
|
||||
#undef isnan
|
||||
#undef isinf
|
||||
|
||||
int _EXFUN(isnan, (double));
|
||||
int _EXFUN(isinf, (double));
|
||||
int _EXFUN(finite, (double));
|
||||
|
||||
|
||||
|
||||
int _EXFUN(isnanf, (float));
|
||||
int _EXFUN(isinff, (float));
|
||||
int _EXFUN(finitef, (float));
|
||||
|
||||
#define __IEEE_DBL_EXPBIAS 1023
|
||||
#define __IEEE_FLT_EXPBIAS 127
|
||||
|
||||
#define __IEEE_DBL_EXPLEN 11
|
||||
#define __IEEE_FLT_EXPLEN 8
|
||||
|
||||
|
||||
#define __IEEE_DBL_FRACLEN (64 - (__IEEE_DBL_EXPLEN + 1))
|
||||
#define __IEEE_FLT_FRACLEN (32 - (__IEEE_FLT_EXPLEN + 1))
|
||||
|
||||
#define __IEEE_DBL_MAXPOWTWO ((double)(1L << 32 - 2) * (1L << (32-11) - 32 + 1))
|
||||
#define __IEEE_FLT_MAXPOWTWO ((float)(1L << (32-8) - 1))
|
||||
|
||||
#define __IEEE_DBL_NAN_EXP 0x7ff
|
||||
#define __IEEE_FLT_NAN_EXP 0xff
|
||||
|
||||
#ifndef __ieeefp_isnanf
|
||||
#define __ieeefp_isnanf(x) (((*(long *)&(x) & 0x7f800000L)==0x7f800000L) && \
|
||||
((*(long *)&(x) & 0x007fffffL)!=0000000000L))
|
||||
#endif
|
||||
#define isnanf(x) __ieeefp_isnanf(x)
|
||||
|
||||
#ifndef __ieeefp_isinff
|
||||
#define __ieeefp_isinff(x) (((*(long *)&(x) & 0x7f800000L)==0x7f800000L) && \
|
||||
((*(long *)&(x) & 0x007fffffL)==0000000000L))
|
||||
#endif
|
||||
#define isinff(x) __ieeefp_isinff(x)
|
||||
|
||||
#ifndef __ieeefp_finitef
|
||||
#define __ieeefp_finitef(x) (((*(long *)&(x) & 0x7f800000L)!=0x7f800000L))
|
||||
#endif
|
||||
#define finitef(x) __ieeefp_finitef(x)
|
||||
|
||||
#ifdef _DOUBLE_IS_32BITS
|
||||
#undef __IEEE_DBL_EXPBIAS
|
||||
#define __IEEE_DBL_EXPBIAS __IEEE_FLT_EXPBIAS
|
||||
|
||||
#undef __IEEE_DBL_EXPLEN
|
||||
#define __IEEE_DBL_EXPLEN __IEEE_FLT_EXPLEN
|
||||
|
||||
#undef __IEEE_DBL_FRACLEN
|
||||
#define __IEEE_DBL_FRACLEN __IEEE_FLT_FRACLEN
|
||||
|
||||
#undef __IEEE_DBL_MAXPOWTWO
|
||||
#define __IEEE_DBL_MAXPOWTWO __IEEE_FLT_MAXPOWTWO
|
||||
|
||||
#undef __IEEE_DBL_NAN_EXP
|
||||
#define __IEEE_DBL_NAN_EXP __IEEE_FLT_NAN_EXP
|
||||
|
||||
#undef __ieee_double_shape_type
|
||||
#define __ieee_double_shape_type __ieee_float_shape_type
|
||||
|
||||
#endif /* _DOUBLE_IS_32BITS */
|
||||
|
||||
_END_STD_C
|
||||
|
||||
#endif /* _IEEE_FP_H_ */
|
@ -1,290 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2004, 2005 by
|
||||
* Ralf Corsepius, Ulm/Germany. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software
|
||||
* is freely granted, provided that this notice is preserved.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file inttypes.h
|
||||
*/
|
||||
|
||||
#ifndef _INTTYPES_H
|
||||
#define _INTTYPES_H
|
||||
|
||||
#include <stdint.h>
|
||||
#define __need_wchar_t
|
||||
#include <stddef.h>
|
||||
|
||||
#define __STRINGIFY(a) #a
|
||||
|
||||
/* 8-bit types */
|
||||
#define __PRI8(x) __STRINGIFY(x)
|
||||
#define __SCN8(x) __STRINGIFY(hh##x)
|
||||
|
||||
|
||||
#define PRId8 __PRI8(d)
|
||||
#define PRIi8 __PRI8(i)
|
||||
#define PRIo8 __PRI8(o)
|
||||
#define PRIu8 __PRI8(u)
|
||||
#define PRIx8 __PRI8(x)
|
||||
#define PRIX8 __PRI8(X)
|
||||
|
||||
#define SCNd8 __SCN8(d)
|
||||
#define SCNi8 __SCN8(i)
|
||||
#define SCNo8 __SCN8(o)
|
||||
#define SCNu8 __SCN8(u)
|
||||
#define SCNx8 __SCN8(x)
|
||||
|
||||
|
||||
#define PRIdLEAST8 __PRI8(d)
|
||||
#define PRIiLEAST8 __PRI8(i)
|
||||
#define PRIoLEAST8 __PRI8(o)
|
||||
#define PRIuLEAST8 __PRI8(u)
|
||||
#define PRIxLEAST8 __PRI8(x)
|
||||
#define PRIXLEAST8 __PRI8(X)
|
||||
|
||||
#define SCNdLEAST8 __SCN8(d)
|
||||
#define SCNiLEAST8 __SCN8(i)
|
||||
#define SCNoLEAST8 __SCN8(o)
|
||||
#define SCNuLEAST8 __SCN8(u)
|
||||
#define SCNxLEAST8 __SCN8(x)
|
||||
|
||||
|
||||
#define PRIdFAST8 __PRI8(d)
|
||||
#define PRIiFAST8 __PRI8(i)
|
||||
#define PRIoFAST8 __PRI8(o)
|
||||
#define PRIuFAST8 __PRI8(u)
|
||||
#define PRIxFAST8 __PRI8(x)
|
||||
#define PRIXFAST8 __PRI8(X)
|
||||
|
||||
#define SCNdFAST8 __SCN8(d)
|
||||
#define SCNiFAST8 __SCN8(i)
|
||||
#define SCNoFAST8 __SCN8(o)
|
||||
#define SCNuFAST8 __SCN8(u)
|
||||
#define SCNxFAST8 __SCN8(x)
|
||||
|
||||
/* 16-bit types */
|
||||
#define __PRI16(x) __STRINGIFY(x)
|
||||
#define __SCN16(x) __STRINGIFY(h##x)
|
||||
|
||||
|
||||
#define PRId16 __PRI16(d)
|
||||
#define PRIi16 __PRI16(i)
|
||||
#define PRIo16 __PRI16(o)
|
||||
#define PRIu16 __PRI16(u)
|
||||
#define PRIx16 __PRI16(x)
|
||||
#define PRIX16 __PRI16(X)
|
||||
|
||||
#define SCNd16 __SCN16(d)
|
||||
#define SCNi16 __SCN16(i)
|
||||
#define SCNo16 __SCN16(o)
|
||||
#define SCNu16 __SCN16(u)
|
||||
#define SCNx16 __SCN16(x)
|
||||
|
||||
|
||||
#define PRIdLEAST16 __PRI16(d)
|
||||
#define PRIiLEAST16 __PRI16(i)
|
||||
#define PRIoLEAST16 __PRI16(o)
|
||||
#define PRIuLEAST16 __PRI16(u)
|
||||
#define PRIxLEAST16 __PRI16(x)
|
||||
#define PRIXLEAST16 __PRI16(X)
|
||||
|
||||
#define SCNdLEAST16 __SCN16(d)
|
||||
#define SCNiLEAST16 __SCN16(i)
|
||||
#define SCNoLEAST16 __SCN16(o)
|
||||
#define SCNuLEAST16 __SCN16(u)
|
||||
#define SCNxLEAST16 __SCN16(x)
|
||||
|
||||
|
||||
#define PRIdFAST16 __PRI16(d)
|
||||
#define PRIiFAST16 __PRI16(i)
|
||||
#define PRIoFAST16 __PRI16(o)
|
||||
#define PRIuFAST16 __PRI16(u)
|
||||
#define PRIxFAST16 __PRI16(x)
|
||||
#define PRIXFAST16 __PRI16(X)
|
||||
|
||||
#define SCNdFAST16 __SCN16(d)
|
||||
#define SCNiFAST16 __SCN16(i)
|
||||
#define SCNoFAST16 __SCN16(o)
|
||||
#define SCNuFAST16 __SCN16(u)
|
||||
#define SCNxFAST16 __SCN16(x)
|
||||
|
||||
/* 32-bit types */
|
||||
#if __have_long32
|
||||
#define __PRI32(x) __STRINGIFY(l##x)
|
||||
#define __SCN32(x) __STRINGIFY(l##x)
|
||||
#else
|
||||
#define __PRI32(x) __STRINGIFY(x)
|
||||
#define __SCN32(x) __STRINGIFY(x)
|
||||
#endif
|
||||
|
||||
#define PRId32 __PRI32(d)
|
||||
#define PRIi32 __PRI32(i)
|
||||
#define PRIo32 __PRI32(o)
|
||||
#define PRIu32 __PRI32(u)
|
||||
#define PRIx32 __PRI32(x)
|
||||
#define PRIX32 __PRI32(X)
|
||||
|
||||
#define SCNd32 __SCN32(d)
|
||||
#define SCNi32 __SCN32(i)
|
||||
#define SCNo32 __SCN32(o)
|
||||
#define SCNu32 __SCN32(u)
|
||||
#define SCNx32 __SCN32(x)
|
||||
|
||||
|
||||
#define PRIdLEAST32 __PRI32(d)
|
||||
#define PRIiLEAST32 __PRI32(i)
|
||||
#define PRIoLEAST32 __PRI32(o)
|
||||
#define PRIuLEAST32 __PRI32(u)
|
||||
#define PRIxLEAST32 __PRI32(x)
|
||||
#define PRIXLEAST32 __PRI32(X)
|
||||
|
||||
#define SCNdLEAST32 __SCN32(d)
|
||||
#define SCNiLEAST32 __SCN32(i)
|
||||
#define SCNoLEAST32 __SCN32(o)
|
||||
#define SCNuLEAST32 __SCN32(u)
|
||||
#define SCNxLEAST32 __SCN32(x)
|
||||
|
||||
|
||||
#define PRIdFAST32 __PRI32(d)
|
||||
#define PRIiFAST32 __PRI32(i)
|
||||
#define PRIoFAST32 __PRI32(o)
|
||||
#define PRIuFAST32 __PRI32(u)
|
||||
#define PRIxFAST32 __PRI32(x)
|
||||
#define PRIXFAST32 __PRI32(X)
|
||||
|
||||
#define SCNdFAST32 __SCN32(d)
|
||||
#define SCNiFAST32 __SCN32(i)
|
||||
#define SCNoFAST32 __SCN32(o)
|
||||
#define SCNuFAST32 __SCN32(u)
|
||||
#define SCNxFAST32 __SCN32(x)
|
||||
|
||||
|
||||
/* 64-bit types */
|
||||
#if __have_long64
|
||||
#define __PRI64(x) __STRINGIFY(l##x)
|
||||
#define __SCN64(x) __STRINGIFY(l##x)
|
||||
#elif __have_longlong64
|
||||
#define __PRI64(x) __STRINGIFY(ll##x)
|
||||
#define __SCN64(x) __STRINGIFY(ll##x)
|
||||
#else
|
||||
#define __PRI64(x) __STRINGIFY(x)
|
||||
#define __SCN64(x) __STRINGIFY(x)
|
||||
#endif
|
||||
|
||||
#define PRId64 __PRI64(d)
|
||||
#define PRIi64 __PRI64(i)
|
||||
#define PRIo64 __PRI64(o)
|
||||
#define PRIu64 __PRI64(u)
|
||||
#define PRIx64 __PRI64(x)
|
||||
#define PRIX64 __PRI64(X)
|
||||
|
||||
#define SCNd64 __SCN64(d)
|
||||
#define SCNi64 __SCN64(i)
|
||||
#define SCNo64 __SCN64(o)
|
||||
#define SCNu64 __SCN64(u)
|
||||
#define SCNx64 __SCN64(x)
|
||||
|
||||
#if __int64_t_defined
|
||||
#define PRIdLEAST64 __PRI64(d)
|
||||
#define PRIiLEAST64 __PRI64(i)
|
||||
#define PRIoLEAST64 __PRI64(o)
|
||||
#define PRIuLEAST64 __PRI64(u)
|
||||
#define PRIxLEAST64 __PRI64(x)
|
||||
#define PRIXLEAST64 __PRI64(X)
|
||||
|
||||
#define SCNdLEAST64 __SCN64(d)
|
||||
#define SCNiLEAST64 __SCN64(i)
|
||||
#define SCNoLEAST64 __SCN64(o)
|
||||
#define SCNuLEAST64 __SCN64(u)
|
||||
#define SCNxLEAST64 __SCN64(x)
|
||||
|
||||
|
||||
#define PRIdFAST64 __PRI64(d)
|
||||
#define PRIiFAST64 __PRI64(i)
|
||||
#define PRIoFAST64 __PRI64(o)
|
||||
#define PRIuFAST64 __PRI64(u)
|
||||
#define PRIxFAST64 __PRI64(x)
|
||||
#define PRIXFAST64 __PRI64(X)
|
||||
|
||||
#define SCNdFAST64 __SCN64(d)
|
||||
#define SCNiFAST64 __SCN64(i)
|
||||
#define SCNoFAST64 __SCN64(o)
|
||||
#define SCNuFAST64 __SCN64(u)
|
||||
#define SCNxFAST64 __SCN64(x)
|
||||
#endif
|
||||
|
||||
/* max-bit types */
|
||||
#if __have_long64
|
||||
#define __PRIMAX(x) __STRINGIFY(l##x)
|
||||
#define __SCNMAX(x) __STRINGIFY(l##x)
|
||||
#elif __have_longlong64
|
||||
#define __PRIMAX(x) __STRINGIFY(ll##x)
|
||||
#define __SCNMAX(x) __STRINGIFY(ll##x)
|
||||
#else
|
||||
#define __PRIMAX(x) __STRINGIFY(x)
|
||||
#define __SCNMAX(x) __STRINGIFY(x)
|
||||
#endif
|
||||
|
||||
#define PRIdMAX __PRIMAX(d)
|
||||
#define PRIiMAX __PRIMAX(i)
|
||||
#define PRIoMAX __PRIMAX(o)
|
||||
#define PRIuMAX __PRIMAX(u)
|
||||
#define PRIxMAX __PRIMAX(x)
|
||||
#define PRIXMAX __PRIMAX(X)
|
||||
|
||||
#define SCNdMAX __SCNMAX(d)
|
||||
#define SCNiMAX __SCNMAX(i)
|
||||
#define SCNoMAX __SCNMAX(o)
|
||||
#define SCNuMAX __SCNMAX(u)
|
||||
#define SCNxMAX __SCNMAX(x)
|
||||
|
||||
/* ptr types */
|
||||
#if __have_long64
|
||||
#define __PRIPTR(x) __STRINGIFY(l##x)
|
||||
#define __SCNPTR(x) __STRINGIFY(l##x)
|
||||
#elif __have_longlong64
|
||||
#define __PRIPTR(x) __STRINGIFY(ll##x)
|
||||
#define __SCNPTR(x) __STRINGIFY(ll##x)
|
||||
#else
|
||||
#define __PRIPTR(x) __STRINGIFY(x)
|
||||
#define __SCNPTR(x) __STRINGIFY(x)
|
||||
#endif
|
||||
|
||||
#define PRIdPTR __PRIPTR(d)
|
||||
#define PRIiPTR __PRIPTR(i)
|
||||
#define PRIoPTR __PRIPTR(o)
|
||||
#define PRIuPTR __PRIPTR(u)
|
||||
#define PRIxPTR __PRIPTR(x)
|
||||
#define PRIXPTR __PRIPTR(X)
|
||||
|
||||
#define SCNdPTR __SCNPTR(d)
|
||||
#define SCNiPTR __SCNPTR(i)
|
||||
#define SCNoPTR __SCNPTR(o)
|
||||
#define SCNuPTR __SCNPTR(u)
|
||||
#define SCNxPTR __SCNPTR(x)
|
||||
|
||||
|
||||
typedef struct {
|
||||
intmax_t quot;
|
||||
intmax_t rem;
|
||||
} imaxdiv_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern intmax_t imaxabs(intmax_t j);
|
||||
extern imaxdiv_t imaxdiv(intmax_t numer, intmax_t denomer);
|
||||
extern intmax_t strtoimax(const char *__restrict, char **__restrict, int);
|
||||
extern uintmax_t strtoumax(const char *__restrict, char **__restrict, int);
|
||||
extern intmax_t wcstoimax(const wchar_t *__restrict, wchar_t **__restrict, int);
|
||||
extern uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,428 +0,0 @@
|
||||
#ifndef __KOS_32_SYS_H__
|
||||
#define __KOS_32_SYS_H__
|
||||
|
||||
|
||||
#include <newlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef CONFIG_DEBUF
|
||||
#define DBG(format,...) printf(format,##__VA_ARGS__)
|
||||
#else
|
||||
#define DBG(format,...)
|
||||
#endif
|
||||
|
||||
typedef unsigned int color_t;
|
||||
|
||||
typedef union __attribute__((packed))
|
||||
{
|
||||
uint32_t val;
|
||||
struct
|
||||
{
|
||||
short x;
|
||||
short y;
|
||||
};
|
||||
}pos_t;
|
||||
|
||||
typedef union __attribute__((packed))
|
||||
{
|
||||
uint32_t val;
|
||||
struct
|
||||
{
|
||||
uint8_t state;
|
||||
uint8_t code;
|
||||
uint16_t ctrl_key;
|
||||
};
|
||||
}oskey_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned handle;
|
||||
unsigned io_code;
|
||||
void *input;
|
||||
int inp_size;
|
||||
void *output;
|
||||
int out_size;
|
||||
}ioctl_t;
|
||||
|
||||
|
||||
static inline
|
||||
void DefineButton(uint32_t x_w, uint32_t y_h, uint32_t id, uint32_t color)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(8),
|
||||
"b"(x_w),
|
||||
"c"(y_h),
|
||||
"d"(id),
|
||||
"S"(color));
|
||||
|
||||
|
||||
};
|
||||
|
||||
static inline
|
||||
void BeginDraw(void)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40" ::"a"(12),"b"(1));
|
||||
};
|
||||
|
||||
static inline
|
||||
void EndDraw(void)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40" ::"a"(12),"b"(2));
|
||||
};
|
||||
|
||||
static inline void DrawWindow(int x, int y, int w, int h, char *name,
|
||||
color_t workcolor, uint32_t style)
|
||||
{
|
||||
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(0),
|
||||
"b"((x << 16) | (w & 0xFFFF)),
|
||||
"c"((y << 16) | (h & 0xFFFF)),
|
||||
"d"((style << 24) | (workcolor & 0xFFFFFF)),
|
||||
"D"(name));
|
||||
};
|
||||
|
||||
static inline
|
||||
pos_t get_mouse_pos(void)
|
||||
{
|
||||
pos_t val;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"int $0x40 \n\t"
|
||||
"rol $16, %%eax"
|
||||
:"=a"(val)
|
||||
:"a"(37),"b"(1));
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline
|
||||
pos_t get_cursor_pos(void)
|
||||
{
|
||||
pos_t val;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"int $0x40 \n\t"
|
||||
"rol $16, %%eax"
|
||||
:"=a"(val)
|
||||
:"a"(37),"b"(0));
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline
|
||||
uint32_t get_mouse_buttons(void)
|
||||
{
|
||||
uint32_t val;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(37),"b"(2));
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline
|
||||
uint32_t get_mouse_wheels(void)
|
||||
{
|
||||
uint32_t val;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"int $0x40 \n\t"
|
||||
"rol $16, %%eax"
|
||||
:"=a"(val)
|
||||
:"a"(37),"b"(7));
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline
|
||||
uint32_t wait_for_event(uint32_t time)
|
||||
{
|
||||
uint32_t val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(23), "b"(time));
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline uint32_t check_os_event()
|
||||
{
|
||||
uint32_t val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(11));
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline
|
||||
uint32_t get_tick_count(void)
|
||||
{
|
||||
uint32_t val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(26),"b"(9));
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline
|
||||
oskey_t get_key(void)
|
||||
{
|
||||
oskey_t val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(2));
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline
|
||||
uint32_t get_os_button()
|
||||
{
|
||||
uint32_t val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(17));
|
||||
return val>>8;
|
||||
};
|
||||
|
||||
static inline uint32_t get_service(char *name)
|
||||
{
|
||||
uint32_t retval = 0;
|
||||
asm volatile ("int $0x40"
|
||||
:"=a"(retval)
|
||||
:"a"(68),"b"(16),"c"(name)
|
||||
:"memory");
|
||||
|
||||
return retval;
|
||||
};
|
||||
|
||||
static inline int call_service(ioctl_t *io)
|
||||
{
|
||||
int retval;
|
||||
|
||||
asm volatile("int $0x40"
|
||||
:"=a"(retval)
|
||||
:"a"(68),"b"(17),"c"(io)
|
||||
:"memory","cc");
|
||||
|
||||
return retval;
|
||||
};
|
||||
|
||||
|
||||
static inline
|
||||
void draw_line(int xs, int ys, int xe, int ye, color_t color)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(38), "d"(color),
|
||||
"b"((xs << 16) | xe),
|
||||
"c"((ys << 16) | ye));
|
||||
}
|
||||
|
||||
|
||||
|
||||
static inline
|
||||
void draw_bar(int x, int y, int w, int h, color_t color)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(13), "d"(color),
|
||||
"b"((x << 16) | w),
|
||||
"c"((y << 16) | h));
|
||||
}
|
||||
|
||||
static inline
|
||||
void draw_bitmap(void *bitmap, int x, int y, int w, int h)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(7), "b"(bitmap),
|
||||
"c"((w << 16) | h),
|
||||
"d"((x << 16) | y));
|
||||
}
|
||||
|
||||
static inline
|
||||
void draw_text_sys(const char *text, int x, int y, int len, color_t color)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(4),"d"(text),
|
||||
"b"((x << 16) | y),
|
||||
"S"(len),"c"(color));
|
||||
}
|
||||
|
||||
static inline void yield(void)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(68), "b"(1));
|
||||
};
|
||||
|
||||
static inline void delay(uint32_t time)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(5), "b"(time)
|
||||
:"memory");
|
||||
};
|
||||
|
||||
static inline
|
||||
void *user_alloc(size_t size)
|
||||
{
|
||||
void *val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(68),"b"(12),"c"(size));
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline
|
||||
int user_free(void *mem)
|
||||
{
|
||||
int val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(68),"b"(12),"c"(mem));
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline
|
||||
int *user_unmap(void *base, size_t offset, size_t size)
|
||||
{
|
||||
void *val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(68),"b"(26),"c"(base),"d"(offset),"S"(size));
|
||||
return val;
|
||||
}
|
||||
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
{
|
||||
void *data;
|
||||
size_t size;
|
||||
};
|
||||
unsigned long long raw;
|
||||
}ufile_t;
|
||||
|
||||
|
||||
static inline ufile_t load_file(const char *path)
|
||||
{
|
||||
ufile_t uf;
|
||||
|
||||
__asm__ __volatile__ (
|
||||
"int $0x40"
|
||||
:"=A"(uf.raw)
|
||||
:"a" (68), "b"(27),"c"(path));
|
||||
|
||||
return uf;
|
||||
};
|
||||
|
||||
|
||||
static inline int GetScreenSize()
|
||||
{
|
||||
int retval;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(retval)
|
||||
:"a"(61), "b"(1));
|
||||
return retval;
|
||||
}
|
||||
|
||||
static inline
|
||||
uint32_t load_cursor(void *path, uint32_t flags)
|
||||
{
|
||||
uint32_t val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(37), "b"(4), "c"(path), "d"(flags));
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline
|
||||
uint32_t set_cursor(uint32_t cursor)
|
||||
{
|
||||
uint32_t old;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(old)
|
||||
:"a"(37), "b"(5), "c"(cursor));
|
||||
return old;
|
||||
}
|
||||
|
||||
static inline
|
||||
int destroy_cursor(uint32_t cursor)
|
||||
{
|
||||
int ret;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(ret)
|
||||
:"a"(37), "b"(6), "c"(cursor)
|
||||
:"memory");
|
||||
return ret;
|
||||
};
|
||||
|
||||
static inline void get_proc_info(char *info)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:
|
||||
:"a"(9), "b"(info), "c"(-1));
|
||||
}
|
||||
|
||||
static inline
|
||||
void* user_realloc(void *mem, size_t size)
|
||||
{
|
||||
void *val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(68),"b"(20),"c"(size),"d"(mem)
|
||||
:"memory");
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
void *get_resource(void *data, uint32_t id);
|
||||
|
||||
struct blit_call
|
||||
{
|
||||
int dstx;
|
||||
int dsty;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int srcx;
|
||||
int srcy;
|
||||
int srcw;
|
||||
int srch;
|
||||
|
||||
unsigned char *bitmap;
|
||||
int stride;
|
||||
};
|
||||
|
||||
void Blit(void *bitmap, int dst_x, int dst_y,
|
||||
int src_x, int src_y, int w, int h,
|
||||
int src_w, int src_h, int stride);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,316 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD: src/include/langinfo.h,v 1.5 2002/03/23 17:24:53 imp Exp $
|
||||
*/
|
||||
|
||||
#ifndef _LANGINFO_H_
|
||||
#define _LANGINFO_H_
|
||||
|
||||
#include <newlib.h>
|
||||
#include <sys/config.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
typedef int nl_item;
|
||||
|
||||
enum __nl_item
|
||||
{
|
||||
/* POSIX and BSD defined items have to stick to the original values
|
||||
to maintain backward compatibility. */
|
||||
_NL_CTYPE_CODESET_NAME = 0, /* codeset name */
|
||||
#define CODESET _NL_CTYPE_CODESET_NAME
|
||||
D_T_FMT, /* string for formatting date and time */
|
||||
#define D_T_FMT D_T_FMT
|
||||
D_FMT, /* date format string */
|
||||
#define D_FMT D_FMT
|
||||
T_FMT, /* time format string */
|
||||
#define T_FMT T_FMT
|
||||
T_FMT_AMPM, /* a.m. or p.m. time formatting string */
|
||||
#define T_FMT_AMPM T_FMT_AMPM
|
||||
AM_STR, /* Ante Meridian affix */
|
||||
#define AM_STR AM_STR
|
||||
PM_STR, /* Post Meridian affix */
|
||||
#define PM_STR PM_STR
|
||||
|
||||
/* week day names */
|
||||
DAY_1,
|
||||
#define DAY_1 DAY_1
|
||||
DAY_2,
|
||||
#define DAY_2 DAY_2
|
||||
DAY_3,
|
||||
#define DAY_3 DAY_3
|
||||
DAY_4,
|
||||
#define DAY_4 DAY_4
|
||||
DAY_5,
|
||||
#define DAY_5 DAY_5
|
||||
DAY_6,
|
||||
#define DAY_6 DAY_6
|
||||
DAY_7,
|
||||
#define DAY_7 DAY_7
|
||||
|
||||
/* abbreviated week day names */
|
||||
ABDAY_1,
|
||||
#define ABDAY_1 ABDAY_1
|
||||
ABDAY_2,
|
||||
#define ABDAY_2 ABDAY_2
|
||||
ABDAY_3,
|
||||
#define ABDAY_3 ABDAY_3
|
||||
ABDAY_4,
|
||||
#define ABDAY_4 ABDAY_4
|
||||
ABDAY_5,
|
||||
#define ABDAY_5 ABDAY_5
|
||||
ABDAY_6,
|
||||
#define ABDAY_6 ABDAY_6
|
||||
ABDAY_7,
|
||||
#define ABDAY_7 ABDAY_7
|
||||
|
||||
/* month names */
|
||||
MON_1,
|
||||
#define MON_1 MON_1
|
||||
MON_2,
|
||||
#define MON_2 MON_2
|
||||
MON_3,
|
||||
#define MON_3 MON_3
|
||||
MON_4,
|
||||
#define MON_4 MON_4
|
||||
MON_5,
|
||||
#define MON_5 MON_5
|
||||
MON_6,
|
||||
#define MON_6 MON_6
|
||||
MON_7,
|
||||
#define MON_7 MON_7
|
||||
MON_8,
|
||||
#define MON_8 MON_8
|
||||
MON_9,
|
||||
#define MON_9 MON_9
|
||||
MON_10,
|
||||
#define MON_10 MON_10
|
||||
MON_11,
|
||||
#define MON_11 MON_11
|
||||
MON_12,
|
||||
#define MON_12 MON_12
|
||||
|
||||
/* abbreviated month names */
|
||||
ABMON_1,
|
||||
#define ABMON_1 ABMON_1
|
||||
ABMON_2,
|
||||
#define ABMON_2 ABMON_2
|
||||
ABMON_3,
|
||||
#define ABMON_3 ABMON_3
|
||||
ABMON_4,
|
||||
#define ABMON_4 ABMON_4
|
||||
ABMON_5,
|
||||
#define ABMON_5 ABMON_5
|
||||
ABMON_6,
|
||||
#define ABMON_6 ABMON_6
|
||||
ABMON_7,
|
||||
#define ABMON_7 ABMON_7
|
||||
ABMON_8,
|
||||
#define ABMON_8 ABMON_8
|
||||
ABMON_9,
|
||||
#define ABMON_9 ABMON_9
|
||||
ABMON_10,
|
||||
#define ABMON_10 ABMON_10
|
||||
ABMON_11,
|
||||
#define ABMON_11 ABMON_11
|
||||
ABMON_12,
|
||||
#define ABMON_12 ABMON_12
|
||||
|
||||
ERA, /* era description segments */
|
||||
#define ERA ERA
|
||||
ERA_D_FMT, /* era date format string */
|
||||
#define ERA_D_FMT ERA_D_FMT
|
||||
ERA_D_T_FMT, /* era date and time format string */
|
||||
#define ERA_D_T_FMT ERA_D_T_FMT
|
||||
ERA_T_FMT, /* era time format string */
|
||||
#define ERA_T_FMT ERA_T_FMT
|
||||
ALT_DIGITS, /* alternative symbols for digits */
|
||||
#define ALT_DIGITS ALT_DIGITS
|
||||
|
||||
RADIXCHAR, /* radix char */
|
||||
#define RADIXCHAR RADIXCHAR
|
||||
THOUSEP, /* separator for thousands */
|
||||
#define THOUSEP THOUSEP
|
||||
|
||||
YESEXPR, /* affirmative response expression */
|
||||
#define YESEXPR YESEXPR
|
||||
NOEXPR, /* negative response expression */
|
||||
#define NOEXPR NOEXPR
|
||||
YESSTR, /* affirmative response for yes/no queries */
|
||||
#define YESSTR YESSTR
|
||||
NOSTR, /* negative response for yes/no queries */
|
||||
#define NOSTR NOSTR
|
||||
|
||||
CRNCYSTR, /* currency symbol */
|
||||
#define CRNCYSTR CRNCYSTR
|
||||
|
||||
D_MD_ORDER, /* month/day order (BSD extension) */
|
||||
#define D_MD_ORDER D_MD_ORDER
|
||||
|
||||
_NL_TIME_DATE_FMT = 84, /* date fmt used by date(1) (GNU extension) */
|
||||
#define _DATE_FMT _NL_TIME_DATE_FMT
|
||||
|
||||
#ifdef __HAVE_LOCALE_INFO__
|
||||
_NL_CTYPE_MB_CUR_MAX,
|
||||
_NL_MESSAGES_CODESET,
|
||||
|
||||
#ifdef __HAVE_LOCALE_INFO_EXTENDED__
|
||||
|
||||
/* NOTE:
|
||||
|
||||
Always maintain the order and position of existing entries!
|
||||
Always append new entry to the list, prior to the definition
|
||||
of _NL_LOCALE_EXTENDED_LAST_ENTRY. */
|
||||
|
||||
_NL_LOCALE_EXTENDED_FIRST_ENTRY,
|
||||
|
||||
_NL_CTYPE_OUTDIGITS0_MB,
|
||||
_NL_CTYPE_OUTDIGITS1_MB,
|
||||
_NL_CTYPE_OUTDIGITS2_MB,
|
||||
_NL_CTYPE_OUTDIGITS3_MB,
|
||||
_NL_CTYPE_OUTDIGITS4_MB,
|
||||
_NL_CTYPE_OUTDIGITS5_MB,
|
||||
_NL_CTYPE_OUTDIGITS6_MB,
|
||||
_NL_CTYPE_OUTDIGITS7_MB,
|
||||
_NL_CTYPE_OUTDIGITS8_MB,
|
||||
_NL_CTYPE_OUTDIGITS9_MB,
|
||||
_NL_CTYPE_OUTDIGITS0_WC,
|
||||
_NL_CTYPE_OUTDIGITS1_WC,
|
||||
_NL_CTYPE_OUTDIGITS2_WC,
|
||||
_NL_CTYPE_OUTDIGITS3_WC,
|
||||
_NL_CTYPE_OUTDIGITS4_WC,
|
||||
_NL_CTYPE_OUTDIGITS5_WC,
|
||||
_NL_CTYPE_OUTDIGITS6_WC,
|
||||
_NL_CTYPE_OUTDIGITS7_WC,
|
||||
_NL_CTYPE_OUTDIGITS8_WC,
|
||||
_NL_CTYPE_OUTDIGITS9_WC,
|
||||
|
||||
_NL_TIME_CODESET,
|
||||
_NL_TIME_WMON_1,
|
||||
_NL_TIME_WMON_2,
|
||||
_NL_TIME_WMON_3,
|
||||
_NL_TIME_WMON_4,
|
||||
_NL_TIME_WMON_5,
|
||||
_NL_TIME_WMON_6,
|
||||
_NL_TIME_WMON_7,
|
||||
_NL_TIME_WMON_8,
|
||||
_NL_TIME_WMON_9,
|
||||
_NL_TIME_WMON_10,
|
||||
_NL_TIME_WMON_11,
|
||||
_NL_TIME_WMON_12,
|
||||
_NL_TIME_WMONTH_1,
|
||||
_NL_TIME_WMONTH_2,
|
||||
_NL_TIME_WMONTH_3,
|
||||
_NL_TIME_WMONTH_4,
|
||||
_NL_TIME_WMONTH_5,
|
||||
_NL_TIME_WMONTH_6,
|
||||
_NL_TIME_WMONTH_7,
|
||||
_NL_TIME_WMONTH_8,
|
||||
_NL_TIME_WMONTH_9,
|
||||
_NL_TIME_WMONTH_10,
|
||||
_NL_TIME_WMONTH_11,
|
||||
_NL_TIME_WMONTH_12,
|
||||
_NL_TIME_WWDAY_1,
|
||||
_NL_TIME_WWDAY_2,
|
||||
_NL_TIME_WWDAY_3,
|
||||
_NL_TIME_WWDAY_4,
|
||||
_NL_TIME_WWDAY_5,
|
||||
_NL_TIME_WWDAY_6,
|
||||
_NL_TIME_WWDAY_7,
|
||||
_NL_TIME_WWEEKDAY_1,
|
||||
_NL_TIME_WWEEKDAY_2,
|
||||
_NL_TIME_WWEEKDAY_3,
|
||||
_NL_TIME_WWEEKDAY_4,
|
||||
_NL_TIME_WWEEKDAY_5,
|
||||
_NL_TIME_WWEEKDAY_6,
|
||||
_NL_TIME_WWEEKDAY_7,
|
||||
_NL_TIME_WT_FMT,
|
||||
_NL_TIME_WD_FMT,
|
||||
_NL_TIME_WD_T_FMT,
|
||||
_NL_TIME_WAM_STR,
|
||||
_NL_TIME_WPM_STR,
|
||||
_NL_TIME_WDATE_FMT,
|
||||
_NL_TIME_WT_FMT_AMPM,
|
||||
_NL_TIME_WERA,
|
||||
_NL_TIME_WERA_D_FMT,
|
||||
_NL_TIME_WERA_D_T_FMT,
|
||||
_NL_TIME_WERA_T_FMT,
|
||||
_NL_TIME_WALT_DIGITS,
|
||||
|
||||
_NL_NUMERIC_CODESET,
|
||||
_NL_NUMERIC_GROUPING,
|
||||
_NL_NUMERIC_DECIMAL_POINT_WC,
|
||||
_NL_NUMERIC_THOUSANDS_SEP_WC,
|
||||
|
||||
_NL_MONETARY_INT_CURR_SYMBOL,
|
||||
_NL_MONETARY_CURRENCY_SYMBOL,
|
||||
_NL_MONETARY_MON_DECIMAL_POINT,
|
||||
_NL_MONETARY_MON_THOUSANDS_SEP,
|
||||
_NL_MONETARY_MON_GROUPING,
|
||||
_NL_MONETARY_POSITIVE_SIGN,
|
||||
_NL_MONETARY_NEGATIVE_SIGN,
|
||||
_NL_MONETARY_INT_FRAC_DIGITS,
|
||||
_NL_MONETARY_FRAC_DIGITS,
|
||||
_NL_MONETARY_P_CS_PRECEDES,
|
||||
_NL_MONETARY_P_SEP_BY_SPACE,
|
||||
_NL_MONETARY_N_CS_PRECEDES,
|
||||
_NL_MONETARY_N_SEP_BY_SPACE,
|
||||
_NL_MONETARY_P_SIGN_POSN,
|
||||
_NL_MONETARY_N_SIGN_POSN,
|
||||
_NL_MONETARY_INT_P_CS_PRECEDES,
|
||||
_NL_MONETARY_INT_P_SEP_BY_SPACE,
|
||||
_NL_MONETARY_INT_N_CS_PRECEDES,
|
||||
_NL_MONETARY_INT_N_SEP_BY_SPACE,
|
||||
_NL_MONETARY_INT_P_SIGN_POSN,
|
||||
_NL_MONETARY_INT_N_SIGN_POSN,
|
||||
_NL_MONETARY_CODESET,
|
||||
_NL_MONETARY_WINT_CURR_SYMBOL,
|
||||
_NL_MONETARY_WCURRENCY_SYMBOL,
|
||||
_NL_MONETARY_WMON_DECIMAL_POINT,
|
||||
_NL_MONETARY_WMON_THOUSANDS_SEP,
|
||||
_NL_MONETARY_WPOSITIVE_SIGN,
|
||||
_NL_MONETARY_WNEGATIVE_SIGN,
|
||||
|
||||
_NL_MESSAGES_WYESEXPR,
|
||||
_NL_MESSAGES_WNOEXPR,
|
||||
_NL_MESSAGES_WYESSTR,
|
||||
_NL_MESSAGES_WNOSTR,
|
||||
|
||||
_NL_COLLATE_CODESET,
|
||||
|
||||
/* This MUST be the last entry since it's used to check for an array
|
||||
index in nl_langinfo(). */
|
||||
_NL_LOCALE_EXTENDED_LAST_ENTRY
|
||||
|
||||
#endif /* __HAVE_LOCALE_INFO_EXTENDED__ */
|
||||
#endif /* __HAVE_LOCALE_INFO__ */
|
||||
|
||||
};
|
||||
|
||||
__BEGIN_DECLS
|
||||
char *nl_langinfo(nl_item);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_LANGINFO_H_ */
|
@ -1,23 +0,0 @@
|
||||
/*
|
||||
* libgen.h - defined by XPG4
|
||||
*/
|
||||
|
||||
#ifndef _LIBGEN_H_
|
||||
#define _LIBGEN_H_
|
||||
|
||||
#include "_ansi.h"
|
||||
#include <sys/reent.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
char *_EXFUN(basename, (char *));
|
||||
char *_EXFUN(dirname, (char *));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _LIBGEN_H_ */
|
||||
|
@ -1,146 +0,0 @@
|
||||
#ifndef _LIBC_LIMITS_H_
|
||||
# define _LIBC_LIMITS_H_ 1
|
||||
|
||||
#include <newlib.h>
|
||||
|
||||
# ifdef _MB_LEN_MAX
|
||||
# define MB_LEN_MAX _MB_LEN_MAX
|
||||
# else
|
||||
# define MB_LEN_MAX 1
|
||||
# endif
|
||||
|
||||
/* Maximum number of positional arguments, if _WANT_IO_POS_ARGS. */
|
||||
# ifndef NL_ARGMAX
|
||||
# define NL_ARGMAX 32
|
||||
# endif
|
||||
|
||||
/* if do not have #include_next support, then we
|
||||
have to define the limits here. */
|
||||
# if !defined __GNUC__ || __GNUC__ < 2
|
||||
|
||||
# ifndef _LIMITS_H
|
||||
# define _LIMITS_H 1
|
||||
|
||||
# include <sys/config.h>
|
||||
|
||||
/* Number of bits in a `char'. */
|
||||
# undef CHAR_BIT
|
||||
# define CHAR_BIT 8
|
||||
|
||||
/* Minimum and maximum values a `signed char' can hold. */
|
||||
# undef SCHAR_MIN
|
||||
# define SCHAR_MIN (-128)
|
||||
# undef SCHAR_MAX
|
||||
# define SCHAR_MAX 127
|
||||
|
||||
/* Maximum value an `unsigned char' can hold. (Minimum is 0). */
|
||||
# undef UCHAR_MAX
|
||||
# define UCHAR_MAX 255
|
||||
|
||||
/* Minimum and maximum values a `char' can hold. */
|
||||
# ifdef __CHAR_UNSIGNED__
|
||||
# undef CHAR_MIN
|
||||
# define CHAR_MIN 0
|
||||
# undef CHAR_MAX
|
||||
# define CHAR_MAX 255
|
||||
# else
|
||||
# undef CHAR_MIN
|
||||
# define CHAR_MIN (-128)
|
||||
# undef CHAR_MAX
|
||||
# define CHAR_MAX 127
|
||||
# endif
|
||||
|
||||
/* Minimum and maximum values a `signed short int' can hold. */
|
||||
# undef SHRT_MIN
|
||||
/* For the sake of 16 bit hosts, we may not use -32768 */
|
||||
# define SHRT_MIN (-32767-1)
|
||||
# undef SHRT_MAX
|
||||
# define SHRT_MAX 32767
|
||||
|
||||
/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
|
||||
# undef USHRT_MAX
|
||||
# define USHRT_MAX 65535
|
||||
|
||||
/* Minimum and maximum values a `signed int' can hold. */
|
||||
# ifndef __INT_MAX__
|
||||
# define __INT_MAX__ 2147483647
|
||||
# endif
|
||||
# undef INT_MIN
|
||||
# define INT_MIN (-INT_MAX-1)
|
||||
# undef INT_MAX
|
||||
# define INT_MAX __INT_MAX__
|
||||
|
||||
/* Maximum value an `unsigned int' can hold. (Minimum is 0). */
|
||||
# undef UINT_MAX
|
||||
# define UINT_MAX (INT_MAX * 2U + 1)
|
||||
|
||||
/* Minimum and maximum values a `signed long int' can hold.
|
||||
(Same as `int'). */
|
||||
# ifndef __LONG_MAX__
|
||||
# if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) || defined (__sparcv9)
|
||||
# define __LONG_MAX__ 9223372036854775807L
|
||||
# else
|
||||
# define __LONG_MAX__ 2147483647L
|
||||
# endif /* __alpha__ || sparc64 */
|
||||
# endif
|
||||
# undef LONG_MIN
|
||||
# define LONG_MIN (-LONG_MAX-1)
|
||||
# undef LONG_MAX
|
||||
# define LONG_MAX __LONG_MAX__
|
||||
|
||||
/* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
|
||||
# undef ULONG_MAX
|
||||
# define ULONG_MAX (LONG_MAX * 2UL + 1)
|
||||
|
||||
# ifndef __LONG_LONG_MAX__
|
||||
# define __LONG_LONG_MAX__ 9223372036854775807LL
|
||||
# endif
|
||||
|
||||
# if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
/* Minimum and maximum values a `signed long long int' can hold. */
|
||||
# undef LLONG_MIN
|
||||
# define LLONG_MIN (-LLONG_MAX-1)
|
||||
# undef LLONG_MAX
|
||||
# define LLONG_MAX __LONG_LONG_MAX__
|
||||
|
||||
/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
|
||||
# undef ULLONG_MAX
|
||||
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1)
|
||||
# endif
|
||||
|
||||
# if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
|
||||
/* Minimum and maximum values a `signed long long int' can hold. */
|
||||
# undef LONG_LONG_MIN
|
||||
# define LONG_LONG_MIN (-LONG_LONG_MAX-1)
|
||||
# undef LONG_LONG_MAX
|
||||
# define LONG_LONG_MAX __LONG_LONG_MAX__
|
||||
|
||||
/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
|
||||
# undef ULONG_LONG_MAX
|
||||
# define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1)
|
||||
# endif
|
||||
|
||||
# endif /* _LIMITS_H */
|
||||
# endif /* GCC 2. */
|
||||
|
||||
#endif /* !_LIBC_LIMITS_H_ */
|
||||
|
||||
#if defined __GNUC__ && !defined _GCC_LIMITS_H_
|
||||
/* `_GCC_LIMITS_H_' is what GCC's file defines. */
|
||||
# include_next <limits.h>
|
||||
#endif /* __GNUC__ && !_GCC_LIMITS_H_ */
|
||||
|
||||
#ifndef _POSIX2_RE_DUP_MAX
|
||||
/* The maximum number of repeated occurrences of a regular expression
|
||||
* permitted when using the interval notation `\{M,N\}'. */
|
||||
#define _POSIX2_RE_DUP_MAX 255
|
||||
#endif /* _POSIX2_RE_DUP_MAX */
|
||||
|
||||
#ifndef ARG_MAX
|
||||
#define ARG_MAX 4096
|
||||
#endif
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 4096
|
||||
#endif
|
||||
|
@ -1,65 +0,0 @@
|
||||
/*
|
||||
locale.h
|
||||
Values appropriate for the formatting of monetary and other
|
||||
numberic quantities.
|
||||
*/
|
||||
|
||||
#ifndef _LOCALE_H_
|
||||
#define _LOCALE_H_
|
||||
|
||||
#include "_ansi.h"
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#define LC_ALL 0
|
||||
#define LC_COLLATE 1
|
||||
#define LC_CTYPE 2
|
||||
#define LC_MONETARY 3
|
||||
#define LC_NUMERIC 4
|
||||
#define LC_TIME 5
|
||||
#define LC_MESSAGES 6
|
||||
|
||||
_BEGIN_STD_C
|
||||
|
||||
struct lconv
|
||||
{
|
||||
char *decimal_point;
|
||||
char *thousands_sep;
|
||||
char *grouping;
|
||||
char *int_curr_symbol;
|
||||
char *currency_symbol;
|
||||
char *mon_decimal_point;
|
||||
char *mon_thousands_sep;
|
||||
char *mon_grouping;
|
||||
char *positive_sign;
|
||||
char *negative_sign;
|
||||
char int_frac_digits;
|
||||
char frac_digits;
|
||||
char p_cs_precedes;
|
||||
char p_sep_by_space;
|
||||
char n_cs_precedes;
|
||||
char n_sep_by_space;
|
||||
char p_sign_posn;
|
||||
char n_sign_posn;
|
||||
char int_n_cs_precedes;
|
||||
char int_n_sep_by_space;
|
||||
char int_n_sign_posn;
|
||||
char int_p_cs_precedes;
|
||||
char int_p_sep_by_space;
|
||||
char int_p_sign_posn;
|
||||
};
|
||||
|
||||
#ifndef _REENT_ONLY
|
||||
char *_EXFUN(setlocale,(int category, const char *locale));
|
||||
struct lconv *_EXFUN(localeconv,(void));
|
||||
#endif
|
||||
|
||||
struct _reent;
|
||||
char *_EXFUN(_setlocale_r,(struct _reent *, int category, const char *locale));
|
||||
struct lconv *_EXFUN(_localeconv_r,(struct _reent *));
|
||||
|
||||
_END_STD_C
|
||||
|
||||
#endif /* _LOCALE_H_ */
|
@ -1,121 +0,0 @@
|
||||
/*
|
||||
* $Id: _default_types.h,v 1.2 2008/06/11 22:14:54 jjohnstn Exp $
|
||||
*/
|
||||
|
||||
#ifndef _MACHINE__DEFAULT_TYPES_H
|
||||
#define _MACHINE__DEFAULT_TYPES_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Guess on types by examining *_MIN / *_MAX defines.
|
||||
*/
|
||||
#if defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ >= 3 ) \
|
||||
&& defined(__GNUC_MINOR__) && (__GNUC_MINOR__ > 2 ))
|
||||
/* GCC >= 3.3.0 has __<val>__ implicitly defined. */
|
||||
#define __EXP(x) __##x##__
|
||||
#else
|
||||
/* Fall back to POSIX versions from <limits.h> */
|
||||
#define __EXP(x) x
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#if __EXP(SCHAR_MAX) == 0x7f
|
||||
typedef signed char __int8_t ;
|
||||
typedef unsigned char __uint8_t ;
|
||||
#define ___int8_t_defined 1
|
||||
#endif
|
||||
|
||||
#if __EXP(INT_MAX) == 0x7fff
|
||||
typedef signed int __int16_t;
|
||||
typedef unsigned int __uint16_t;
|
||||
#define ___int16_t_defined 1
|
||||
#elif __EXP(SHRT_MAX) == 0x7fff
|
||||
typedef signed short __int16_t;
|
||||
typedef unsigned short __uint16_t;
|
||||
#define ___int16_t_defined 1
|
||||
#elif __EXP(SCHAR_MAX) == 0x7fff
|
||||
typedef signed char __int16_t;
|
||||
typedef unsigned char __uint16_t;
|
||||
#define ___int16_t_defined 1
|
||||
#endif
|
||||
|
||||
#if ___int16_t_defined
|
||||
typedef __int16_t __int_least16_t;
|
||||
typedef __uint16_t __uint_least16_t;
|
||||
#define ___int_least16_t_defined 1
|
||||
|
||||
#if !___int8_t_defined
|
||||
typedef __int16_t __int_least8_t;
|
||||
typedef __uint16_t __uint_least8_t;
|
||||
#define ___int_least8_t_defined 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if __EXP(INT_MAX) == 0x7fffffffL
|
||||
typedef signed int __int32_t;
|
||||
typedef unsigned int __uint32_t;
|
||||
#define ___int32_t_defined 1
|
||||
#elif __EXP(LONG_MAX) == 0x7fffffffL
|
||||
typedef signed long __int32_t;
|
||||
typedef unsigned long __uint32_t;
|
||||
#define ___int32_t_defined 1
|
||||
#elif __EXP(SHRT_MAX) == 0x7fffffffL
|
||||
typedef signed short __int32_t;
|
||||
typedef unsigned short __uint32_t;
|
||||
#define ___int32_t_defined 1
|
||||
#elif __EXP(SCHAR_MAX) == 0x7fffffffL
|
||||
typedef signed char __int32_t;
|
||||
typedef unsigned char __uint32_t;
|
||||
#define ___int32_t_defined 1
|
||||
#endif
|
||||
|
||||
#if ___int32_t_defined
|
||||
typedef __int32_t __int_least32_t;
|
||||
typedef __uint32_t __uint_least32_t;
|
||||
#define ___int_least32_t_defined 1
|
||||
|
||||
#if !___int8_t_defined
|
||||
typedef __int32_t __int_least8_t;
|
||||
typedef __uint32_t __uint_least8_t;
|
||||
#define ___int_least8_t_defined 1
|
||||
#endif
|
||||
#if !___int16_t_defined
|
||||
typedef __int32_t __int_least16_t;
|
||||
typedef __uint32_t __uint_least16_t;
|
||||
#define ___int_least16_t_defined 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if __EXP(LONG_MAX) > 0x7fffffff
|
||||
typedef signed long __int64_t;
|
||||
typedef unsigned long __uint64_t;
|
||||
#define ___int64_t_defined 1
|
||||
|
||||
/* GCC has __LONG_LONG_MAX__ */
|
||||
#elif defined(__LONG_LONG_MAX__) && (__LONG_LONG_MAX__ > 0x7fffffff)
|
||||
typedef signed long long __int64_t;
|
||||
typedef unsigned long long __uint64_t;
|
||||
#define ___int64_t_defined 1
|
||||
|
||||
/* POSIX mandates LLONG_MAX in <limits.h> */
|
||||
#elif defined(LLONG_MAX) && (LLONG_MAX > 0x7fffffff)
|
||||
typedef signed long long __int64_t;
|
||||
typedef unsigned long long __uint64_t;
|
||||
#define ___int64_t_defined 1
|
||||
|
||||
#elif __EXP(INT_MAX) > 0x7fffffff
|
||||
typedef signed int __int64_t;
|
||||
typedef unsigned int __uint64_t;
|
||||
#define ___int64_t_defined 1
|
||||
#endif
|
||||
|
||||
#undef __EXP
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _MACHINE__DEFAULT_TYPES_H */
|
@ -1,8 +0,0 @@
|
||||
/*
|
||||
* $Id: _types.h,v 1.3 2007/09/07 21:16:25 jjohnstn Exp $
|
||||
*/
|
||||
|
||||
#ifndef _MACHINE__TYPES_H
|
||||
#define _MACHINE__TYPES_H
|
||||
#include <machine/_default_types.h>
|
||||
#endif
|
@ -1 +0,0 @@
|
||||
/* dummy header file to support BSD compiler */
|
@ -1,20 +0,0 @@
|
||||
#ifndef __MACHINE_ENDIAN_H__
|
||||
|
||||
#include <sys/config.h>
|
||||
|
||||
#ifndef BIG_ENDIAN
|
||||
#define BIG_ENDIAN 4321
|
||||
#endif
|
||||
#ifndef LITTLE_ENDIAN
|
||||
#define LITTLE_ENDIAN 1234
|
||||
#endif
|
||||
|
||||
#ifndef BYTE_ORDER
|
||||
#if defined(__IEEE_LITTLE_ENDIAN) || defined(__IEEE_BYTES_LITTLE_ENDIAN)
|
||||
#define BYTE_ORDER LITTLE_ENDIAN
|
||||
#else
|
||||
#define BYTE_ORDER BIG_ENDIAN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* __MACHINE_ENDIAN_H__ */
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user