renamed ase to qse
This commit is contained in:
1109
qse/include/ase/awk/Awk.hpp
Normal file
1109
qse/include/ase/awk/Awk.hpp
Normal file
File diff suppressed because it is too large
Load Diff
98
qse/include/ase/awk/StdAwk.hpp
Normal file
98
qse/include/ase/awk/StdAwk.hpp
Normal file
@ -0,0 +1,98 @@
|
||||
/*
|
||||
* $Id: StdAwk.hpp 499 2008-12-16 09:42:48Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_AWK_STDAWK_HPP_
|
||||
#define _ASE_AWK_STDAWK_HPP_
|
||||
|
||||
#include <ase/awk/Awk.hpp>
|
||||
|
||||
/////////////////////////////////
|
||||
ASE_BEGIN_NAMESPACE(ASE)
|
||||
/////////////////////////////////
|
||||
|
||||
/**
|
||||
* Provides a more useful AWK interpreter by overriding primitive methods,
|
||||
* the file handler, the pipe handler and implementing common AWK intrinsic
|
||||
* functions.
|
||||
*/
|
||||
class StdAwk: public Awk
|
||||
{
|
||||
public:
|
||||
StdAwk ();
|
||||
int open ();
|
||||
int run (const char_t* main, const char_t** args, size_t nargs);
|
||||
|
||||
protected:
|
||||
|
||||
// intrinsic functions
|
||||
int sin (Run& run, Return& ret, const Argument* args, size_t nargs,
|
||||
const char_t* name, size_t len);
|
||||
int cos (Run& run, Return& ret, const Argument* args, size_t nargs,
|
||||
const char_t* name, size_t len);
|
||||
int tan (Run& run, Return& ret, const Argument* args, size_t nargs,
|
||||
const char_t* name, size_t len);
|
||||
int atan (Run& run, Return& ret, const Argument* args, size_t nargs,
|
||||
const char_t* name, size_t len);
|
||||
int atan2 (Run& run, Return& ret, const Argument* args, size_t nargs,
|
||||
const char_t* name, size_t len);
|
||||
int log (Run& run, Return& ret, const Argument* args, size_t nargs,
|
||||
const char_t* name, size_t len);
|
||||
int exp (Run& run, Return& ret, const Argument* args, size_t nargs,
|
||||
const char_t* name, size_t len);
|
||||
int sqrt (Run& run, Return& ret, const Argument* args, size_t nargs,
|
||||
const char_t* name, size_t len);
|
||||
int fnint (Run& run, Return& ret, const Argument* args, size_t nargs,
|
||||
const char_t* name, size_t len);
|
||||
int rand (Run& run, Return& ret, const Argument* args, size_t nargs,
|
||||
const char_t* name, size_t len);
|
||||
int srand (Run& run, Return& ret, const Argument* args, size_t nargs,
|
||||
const char_t* name, size_t len);
|
||||
int systime (Run& run, Return& ret, const Argument* args, size_t nargs,
|
||||
const char_t* name, size_t len);
|
||||
int strftime (Run& run, Return& ret, const Argument* args, size_t nargs,
|
||||
const char_t* name, size_t len);
|
||||
int strfgmtime (Run& run, Return& ret, const Argument* args, size_t nargs,
|
||||
const char_t* name, size_t len);
|
||||
int system (Run& run, Return& ret, const Argument* args, size_t nargs,
|
||||
const char_t* name, size_t len);
|
||||
|
||||
// pipe io handlers
|
||||
int openPipe (Pipe& io);
|
||||
int closePipe (Pipe& io);
|
||||
ssize_t readPipe (Pipe& io, char_t* buf, size_t len);
|
||||
ssize_t writePipe (Pipe& io, char_t* buf, size_t len);
|
||||
int flushPipe (Pipe& io);
|
||||
|
||||
// file io handlers
|
||||
int openFile (File& io);
|
||||
int closeFile (File& io);
|
||||
ssize_t readFile (File& io, char_t* buf, size_t len);
|
||||
ssize_t writeFile (File& io, char_t* buf, size_t len);
|
||||
int flushFile (File& io);
|
||||
|
||||
// primitive handlers
|
||||
void* allocMem (size_t n);
|
||||
void* reallocMem (void* ptr, size_t n);
|
||||
void freeMem (void* ptr);
|
||||
|
||||
bool_t isType (cint_t c, ccls_type_t type);
|
||||
cint_t transCase (cint_t c, ccls_type_t type);
|
||||
|
||||
real_t pow (real_t x, real_t y);
|
||||
int vsprintf (char_t* buf, size_t size,
|
||||
const char_t* fmt, va_list arg);
|
||||
|
||||
protected:
|
||||
unsigned int seed;
|
||||
};
|
||||
|
||||
/////////////////////////////////
|
||||
ASE_END_NAMESPACE(ASE)
|
||||
/////////////////////////////////
|
||||
|
||||
#endif
|
||||
|
||||
|
1210
qse/include/ase/awk/awk.h
Normal file
1210
qse/include/ase/awk/awk.h
Normal file
File diff suppressed because it is too large
Load Diff
9
qse/include/ase/awk/makefile.am
Normal file
9
qse/include/ase/awk/makefile.am
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
pkginclude_HEADERS = awk.h
|
||||
|
||||
if ENABLE_CXX
|
||||
pkginclude_HEADERS += Awk.hpp StdAwk.hpp
|
||||
endif
|
||||
|
||||
pkgincludedir= $(includedir)/ase/awk
|
||||
CLEANFILES = *dist
|
417
qse/include/ase/awk/makefile.in
Normal file
417
qse/include/ase/awk/makefile.in
Normal file
@ -0,0 +1,417 @@
|
||||
# makefile.in generated by automake 1.10.1 from makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
@ENABLE_CXX_TRUE@am__append_1 = Awk.hpp StdAwk.hpp
|
||||
subdir = include/ase/awk
|
||||
DIST_COMMON = $(am__pkginclude_HEADERS_DIST) $(srcdir)/makefile.am \
|
||||
$(srcdir)/makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/include/ase/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__pkginclude_HEADERS_DIST = awk.h Awk.hpp StdAwk.hpp
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(pkgincludedir)"
|
||||
pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER)
|
||||
HEADERS = $(pkginclude_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
pkgincludedir = $(includedir)/ase/awk
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BUILD_CJ = @BUILD_CJ@
|
||||
BUILD_JNI = @BUILD_JNI@
|
||||
BUILD_MODE = @BUILD_MODE@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CFLAGS_JNI = @CFLAGS_JNI@
|
||||
CJ = @CJ@
|
||||
CJFLAGS = @CJFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GREP = @GREP@
|
||||
HAVE_CXX = @HAVE_CXX@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
JAR = @JAR@
|
||||
JAR_PATH = @JAR_PATH@
|
||||
JAVAC = @JAVAC@
|
||||
JAVAC_PATH = @JAVAC_PATH@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBM = @LIBM@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
RM = @RM@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
pkginclude_HEADERS = awk.h $(am__append_1)
|
||||
CLEANFILES = *dist
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/makefile.in: $(srcdir)/makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/ase/awk/makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign include/ase/awk/makefile
|
||||
.PRECIOUS: makefile
|
||||
makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-pkgincludeHEADERS: $(pkginclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)"
|
||||
@list='$(pkginclude_HEADERS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \
|
||||
$(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-pkgincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkginclude_HEADERS)'; for p in $$list; do \
|
||||
f=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: makefile $(HEADERS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(pkgincludedir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f makefile
|
||||
distclean-am: clean-am distclean-generic distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-pkgincludeHEADERS
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-pkgincludeHEADERS
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool ctags distclean distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-pkgincludeHEADERS install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-pkgincludeHEADERS
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
97
qse/include/ase/cmn/chr.h
Normal file
97
qse/include/ase/cmn/chr.h
Normal file
@ -0,0 +1,97 @@
|
||||
/*
|
||||
* $Id: ctype.h 223 2008-06-26 06:44:41Z baconevi $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_CMN_CHR_H_
|
||||
#define _ASE_CMN_CHR_H_
|
||||
|
||||
#include <ase/types.h>
|
||||
#include <ase/macros.h>
|
||||
|
||||
/* gets a pointer to the default memory manager */
|
||||
#define ASE_CCLS_GETDFL() (ase_ccls)
|
||||
|
||||
/* sets a pointer to the default memory manager */
|
||||
#define ASE_CCLS_SETDFL(m) ((ase_ccls)=(m))
|
||||
|
||||
#define ASE_CCLS_IS(ccls,c,type) ((ccls)->is((ccls)->data,c,type))
|
||||
#define ASE_CCLS_TO(ccls,c,type) ((ccls)->to((ccls)->data,c,type))
|
||||
|
||||
#define ASE_CCLS_ISUPPER(ccls,c) ASE_CCLS_IS(ccls,c,ASE_CCLS_UPPER)
|
||||
#define ASE_CCLS_ISLOWER(ccls,c) ASE_CCLS_IS(ccls,c,ASE_CCLS_LOWER)
|
||||
#define ASE_CCLS_ISALPHA(ccls,c) ASE_CCLS_IS(ccls,c,ASE_CCLS_ALPHA)
|
||||
#define ASE_CCLS_ISDIGIT(ccls,c) ASE_CCLS_IS(ccls,c,ASE_CCLS_DIGIT)
|
||||
#define ASE_CCLS_ISXDIGIT(ccls,c) ASE_CCLS_IS(ccls,c,ASE_CCLS_XDIGIT)
|
||||
#define ASE_CCLS_ISALNUM(ccls,c) ASE_CCLS_IS(ccls,c,ASE_CCLS_ALNUM)
|
||||
#define ASE_CCLS_ISSPACE(ccls,c) ASE_CCLS_IS(ccls,c,ASE_CCLS_SPACE)
|
||||
#define ASE_CCLS_ISPRINT(ccls,c) ASE_CCLS_IS(ccls,c,ASE_CCLS_PRINT)
|
||||
#define ASE_CCLS_ISGRAPH(ccls,c) ASE_CCLS_IS(ccls,c,ASE_CCLS_GRAPH)
|
||||
#define ASE_CCLS_ISCNTRL(ccls,c) ASE_CCLS_IS(ccls,c,ASE_CCLS_CNTRL)
|
||||
#define ASE_CCLS_ISPUNCT(ccls,c) ASE_CCLS_IS(ccls,c,ASE_CCLS_PUNCT)
|
||||
#define ASE_CCLS_TOUPPER(ccls,c) ASE_CCLS_TO(ccls,c,ASE_CCLS_UPPER)
|
||||
#define ASE_CCLS_TOLOWER(ccls,c) ASE_CCLS_TO(ccls,c,ASE_CCLS_LOWER)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern ase_ccls_t* ase_ccls;
|
||||
|
||||
ase_bool_t ase_ccls_is (
|
||||
ase_cint_t c,
|
||||
ase_ccls_type_t type
|
||||
);
|
||||
|
||||
ase_cint_t ase_ccls_to (
|
||||
ase_cint_t c,
|
||||
ase_ccls_type_t type
|
||||
);
|
||||
|
||||
|
||||
|
||||
ase_size_t ase_mblen (
|
||||
const ase_mchar_t* mb,
|
||||
ase_size_t mblen
|
||||
);
|
||||
|
||||
/****f* ase.cmn.chr/ase_mbtowc
|
||||
* NAME
|
||||
* ase_mbtowc - convert a multibyte sequence to a wide character.
|
||||
*
|
||||
* RETURN
|
||||
* The ase_mbtowc() function returns 0 if an invalid multibyte sequence is
|
||||
* detected, mblen + 1 if the sequence is incomplete. It returns the number
|
||||
* of bytes processed to form a wide character.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_size_t ase_mbtowc (
|
||||
const ase_mchar_t* mb,
|
||||
ase_size_t mblen,
|
||||
ase_wchar_t* wc
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.chr/ase_wctomb
|
||||
* NAME
|
||||
* ase_wctomb - convert a wide character to a multibyte sequence
|
||||
*
|
||||
* RETURN
|
||||
* The ase_wctomb() functions returns 0 if the wide character is illegal,
|
||||
* mblen + 1 if mblen is not large enough to hold the multibyte sequence.
|
||||
* On successful conversion, it returns the number of bytes in the sequence.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_size_t ase_wctomb (
|
||||
ase_wchar_t wc,
|
||||
ase_mchar_t* mb,
|
||||
ase_size_t mblen
|
||||
);
|
||||
/******/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
260
qse/include/ase/cmn/dll.h
Normal file
260
qse/include/ase/cmn/dll.h
Normal file
@ -0,0 +1,260 @@
|
||||
/*
|
||||
* $Id: map.h 223 2008-06-26 06:44:41Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_CMN_DLL_H_
|
||||
#define _ASE_CMN_DLL_H_
|
||||
|
||||
#include <ase/types.h>
|
||||
#include <ase/macros.h>
|
||||
|
||||
/*
|
||||
* Doubly Linked List
|
||||
*/
|
||||
typedef struct ase_dll_t ase_dll_t;
|
||||
typedef struct ase_dll_node_t ase_dll_node_t;
|
||||
|
||||
/* data copier */
|
||||
typedef void* (*ase_dll_copier_t) (ase_dll_t* dll, void* dptr, ase_size_t dlen);
|
||||
|
||||
/* data freeer */
|
||||
typedef void (*ase_dll_freeer_t) (ase_dll_t* dll, void* dptr, ase_size_t dlen);
|
||||
|
||||
/* node visitor */
|
||||
typedef int (*ase_dll_walker_t) (
|
||||
ase_dll_t* dll, ase_dll_node_t* node, void* arg);
|
||||
|
||||
struct ase_dll_t
|
||||
{
|
||||
ase_mmgr_t* mmgr;
|
||||
|
||||
ase_dll_copier_t copier;
|
||||
ase_dll_freeer_t freeer;
|
||||
|
||||
ase_size_t size;
|
||||
ase_dll_node_t* head;
|
||||
ase_dll_node_t* tail;
|
||||
};
|
||||
|
||||
struct ase_dll_node_t
|
||||
{
|
||||
void* dptr; /* pointer to the beginning of data */
|
||||
ase_size_t dlen; /* length of data in bytes */
|
||||
ase_dll_node_t* next; /* pointer to the next node */
|
||||
ase_dll_node_t* prev; /* pointer to the prev node */
|
||||
};
|
||||
|
||||
|
||||
enum ase_dll_walk_t
|
||||
{
|
||||
ASE_DLL_WALK_STOP = 0,
|
||||
ASE_DLL_WALK_FORWARD = 1
|
||||
};
|
||||
|
||||
#define ASE_DLL_COPIER_INLINE ase_dll_copyinline
|
||||
|
||||
#define ASE_DLL_HEAD(dll) ((dll)->head)
|
||||
#define ASE_DLL_TAIL(dll) ((dll)->tail)
|
||||
#define ASE_DLL_SIZE(dll) ((dll)->size)
|
||||
|
||||
#define ASE_DLL_DPTR(n) ((n)->dptr)
|
||||
#define ASE_DLL_DLEN(n) ((n)->dlen)
|
||||
#define ASE_DLL_NEXT(n) ((n)->next)
|
||||
#define ASE_DLL_PREV(n) ((n)->prev)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NAME: creates a doubly linked list with extension area
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* The ase_dll_open() function creates an empty doubly linked list.
|
||||
* If the memory manager mmgr is ASE_NULL, the function gets the default
|
||||
* memory manager with ASE_MMGR_GETMMGR() and uses it if it is not ASE_NULL.
|
||||
* The extension area is allocated when the positive extension size extension
|
||||
* is specified. It calls the extension initialization function initializer
|
||||
* after initializing the main area. The extension initializer is passed
|
||||
* the pointer to the doubly linked list created.
|
||||
*
|
||||
* RETURNS:
|
||||
* the pointer to a newly created doubly linked list on success.
|
||||
* ASE_NULL on failure.
|
||||
*
|
||||
* WARNING:
|
||||
* In the debug build, it fails the assertion if ASE_MMGR_SETMMGR() returns
|
||||
* ASE_NULL when ASE_NULL is passed as the first parameter. In the release
|
||||
* build, it returns ASE_NULL if such a thing happens.
|
||||
*/
|
||||
|
||||
ase_dll_t* ase_dll_open (
|
||||
ase_mmgr_t* mmgr /* memory manager */ ,
|
||||
ase_size_t ext /* size of extension area in bytes */
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME destroys a singly linked list
|
||||
*/
|
||||
void ase_dll_close (
|
||||
ase_dll_t* dll /* a singly linked list */
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME deletes all elements of a singly linked list
|
||||
*/
|
||||
void ase_dll_clear (
|
||||
ase_dll_t* dll /* a singly linked list */
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME specifies how to clone an element
|
||||
*
|
||||
* DESCRIPTION
|
||||
* A special copier ASE_DLL_COPIER_INLINE is provided. This copier enables
|
||||
* you to copy the data inline to the internal node. No freeer is invoked
|
||||
* when the node is freeed.
|
||||
*
|
||||
* You may set the copier to ASE_NULL to perform no special operation
|
||||
* when the data pointer is rememebered.
|
||||
*/
|
||||
void ase_dll_setcopier (
|
||||
ase_dll_t* dll /* a singly linked list */,
|
||||
ase_dll_copier_t copier /* a element copier */
|
||||
);
|
||||
|
||||
ase_dll_copier_t ase_dll_getcopier (
|
||||
ase_dll_t* dll /* a singly linked list */
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME specifies how to destroy an element
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The freeer is called when a node containing the element is destroyed.
|
||||
*/
|
||||
void ase_dll_setfreeer (
|
||||
ase_dll_t* dll /* a singly linked list */,
|
||||
ase_dll_freeer_t freeer /* a element freeer */
|
||||
);
|
||||
|
||||
ase_dll_freeer_t ase_dll_getfreeer (
|
||||
ase_dll_t* dll /* a singly linked list */
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME Gets the pointer to the extension area
|
||||
* RETURN the pointer to the extension area
|
||||
*/
|
||||
void* ase_dll_getxtn (
|
||||
ase_dll_t* dll /* a singly linked list */
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME: get the pointer to the memory manager in use
|
||||
*/
|
||||
ase_mmgr_t* ase_dll_getmmgr (
|
||||
ase_dll_t* dll /* a singly linked list */
|
||||
);
|
||||
|
||||
void ase_dll_setmmgr (ase_dll_t* dll, ase_mmgr_t* mmgr);
|
||||
|
||||
/*
|
||||
* NAME Gets the number of elements held in a singly linked list
|
||||
* RETURN the number of elements the list holds
|
||||
*/
|
||||
ase_size_t ase_dll_getsize (
|
||||
ase_dll_t* dll /* a singly linked list */
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME Gets the head(first) node
|
||||
* RETURN the tail node of a singly linked list
|
||||
*/
|
||||
ase_dll_node_t* ase_dll_gethead (
|
||||
ase_dll_t* dll /* a singly linked list */
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME Gets the tail(last) node
|
||||
* RETURN the tail node of a singly linked list
|
||||
*/
|
||||
ase_dll_node_t* ase_dll_gettail (
|
||||
ase_dll_t* dll /* a singly linked list */
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME Inserts data before a positional node given
|
||||
*
|
||||
* DESCRIPTION
|
||||
* Inserts data.
|
||||
*/
|
||||
ase_dll_node_t* ase_dll_insert (
|
||||
ase_dll_t* dll /* a singly linked list */,
|
||||
ase_dll_node_t* pos /* a node before which a new node is inserted */,
|
||||
void* dptr /* the pointer to the data */ ,
|
||||
ase_size_t dlen /* the length of the data in bytes */
|
||||
);
|
||||
|
||||
ase_dll_node_t* ase_dll_pushhead (
|
||||
ase_dll_t* dll /* a singly linked list */,
|
||||
void* dptr,
|
||||
ase_size_t dlen
|
||||
);
|
||||
|
||||
ase_dll_node_t* ase_dll_pushtail (
|
||||
ase_dll_t* dll /* a singly linked list */,
|
||||
void* dptr,
|
||||
ase_size_t dlen
|
||||
);
|
||||
|
||||
void ase_dll_delete (
|
||||
ase_dll_t* dll,
|
||||
ase_dll_node_t* pos
|
||||
);
|
||||
|
||||
void ase_dll_pophead (
|
||||
ase_dll_t* dll
|
||||
);
|
||||
|
||||
void ase_dll_poptail (
|
||||
ase_dll_t* dll
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME Traverses s singly linked list
|
||||
*
|
||||
* DESCRIPTION
|
||||
* A singly linked list allows uni-directional in-order traversal.
|
||||
* The ase_dll_walk() function traverses a singly linkked list from its
|
||||
* head node down to its tail node as long as the walker function returns
|
||||
* ASE_DLL_WALK_FORWARD. A walker can return ASE_DLL_WALK_STOP to cause
|
||||
* immediate stop of traversal.
|
||||
* For each node, the walker function is called and it is passed three
|
||||
* parameters: the singly linked list, the visiting node, and the
|
||||
* user-defined data passed as the third parameter in a call to the
|
||||
* ase_dll_walk() function.
|
||||
*/
|
||||
void ase_dll_walk (
|
||||
ase_dll_t* dll /* a singly linked list */,
|
||||
ase_dll_walker_t walker /* a user-defined walker function */,
|
||||
void* arg /* pointer to user-defined data */
|
||||
);
|
||||
|
||||
/*
|
||||
* Causes a singly linked list to copy in data to a node.
|
||||
* Use ASE_DLL_COPIER_INLINE instead.
|
||||
*/
|
||||
void* ase_dll_copyinline (
|
||||
ase_dll_t* dll /* a singly linked list */,
|
||||
void* data /* pointer to data to copy */ ,
|
||||
ase_size_t len /* length of data in bytes */
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
152
qse/include/ase/cmn/fio.h
Normal file
152
qse/include/ase/cmn/fio.h
Normal file
@ -0,0 +1,152 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef _ASE_CMN_FIO_H_
|
||||
#define _ASE_CMN_FIO_H_
|
||||
|
||||
#include <ase/types.h>
|
||||
#include <ase/macros.h>
|
||||
|
||||
enum ase_fio_open_flag_t
|
||||
{
|
||||
/* treat the file name pointer as a handle pointer */
|
||||
ASE_FIO_HANDLE = (1 << 0),
|
||||
|
||||
ASE_FIO_READ = (1 << 1),
|
||||
ASE_FIO_WRITE = (1 << 2),
|
||||
ASE_FIO_APPEND = (1 << 3),
|
||||
|
||||
ASE_FIO_CREATE = (1 << 4),
|
||||
ASE_FIO_TRUNCATE = (1 << 5),
|
||||
ASE_FIO_EXCLUSIVE = (1 << 6),
|
||||
ASE_FIO_SYNC = (1 << 7),
|
||||
|
||||
/* for ms windows only */
|
||||
ASE_FIO_NOSHRD = (1 << 16),
|
||||
ASE_FIO_NOSHWR = (1 << 17)
|
||||
};
|
||||
|
||||
/* seek origin */
|
||||
enum ase_fio_seek_origin_t
|
||||
{
|
||||
ASE_FIO_BEGIN = 0,
|
||||
ASE_FIO_CURRENT = 1,
|
||||
ASE_FIO_END = 2
|
||||
};
|
||||
|
||||
#ifdef _WIN32
|
||||
/* <winnt.h> typedef PVOID HANDLE; */
|
||||
typedef void* ase_fio_hnd_t;
|
||||
#else
|
||||
typedef int ase_fio_hnd_t;
|
||||
#endif
|
||||
|
||||
/* file offset */
|
||||
typedef ase_int64_t ase_fio_off_t;
|
||||
typedef enum ase_fio_seek_origin_t ase_fio_ori_t;
|
||||
|
||||
typedef struct ase_fio_t ase_fio_t;
|
||||
|
||||
struct ase_fio_t
|
||||
{
|
||||
ase_mmgr_t* mmgr;
|
||||
ase_fio_hnd_t handle;
|
||||
};
|
||||
|
||||
#define ASE_FIO_MMGR(fio) ((fio)->mmgr)
|
||||
#define ASE_FIO_HANDLE(fio) ((fio)->handle)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/****f* ase.fio/ase_fio_open
|
||||
* NAME
|
||||
* ase_fio_open - open a file
|
||||
*
|
||||
* DESCRIPTION
|
||||
* To open a file, you should set the flags with at least one of
|
||||
* ASE_FIO_READ, ASE_FIO_WRITE, ASE_FIO_APPEND.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_fio_t* ase_fio_open (
|
||||
ase_mmgr_t* mmgr,
|
||||
ase_size_t ext,
|
||||
const ase_char_t* path,
|
||||
int flags,
|
||||
int mode
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.fio/ase_fio_close
|
||||
* NAME
|
||||
* ase_fio_close - close a file
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_fio_close (
|
||||
ase_fio_t* fio
|
||||
);
|
||||
/******/
|
||||
|
||||
ase_fio_t* ase_fio_init (
|
||||
ase_fio_t* fio,
|
||||
ase_mmgr_t* mmgr,
|
||||
const ase_char_t* path,
|
||||
int flags,
|
||||
int mode
|
||||
);
|
||||
|
||||
void ase_fio_fini (
|
||||
ase_fio_t* fio
|
||||
);
|
||||
|
||||
ase_fio_hnd_t ase_fio_gethandle (
|
||||
ase_fio_t* fio
|
||||
);
|
||||
|
||||
/****f* ase.cmn.fio/ase_fio_sethandle
|
||||
* SYNOPSIS
|
||||
* ase_fio_sethandle - set the file handle
|
||||
* WARNING
|
||||
* Avoid using this function if you don't know what you are doing.
|
||||
* You may have to retrieve the previous handle using ase_fio_gethandle()
|
||||
* to take relevant actions before resetting it with ase_fio_sethandle().
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_fio_sethandle (
|
||||
ase_fio_t* fio,
|
||||
ase_fio_hnd_t handle
|
||||
);
|
||||
/******/
|
||||
|
||||
ase_fio_off_t ase_fio_seek (
|
||||
ase_fio_t* fio,
|
||||
ase_fio_off_t offset,
|
||||
ase_fio_ori_t origin
|
||||
);
|
||||
|
||||
int ase_fio_truncate (
|
||||
ase_fio_t* fio,
|
||||
ase_fio_off_t size
|
||||
);
|
||||
|
||||
ase_ssize_t ase_fio_read (
|
||||
ase_fio_t* fio,
|
||||
void* buf,
|
||||
ase_size_t size
|
||||
);
|
||||
|
||||
ase_ssize_t ase_fio_write (
|
||||
ase_fio_t* fio,
|
||||
const void* buf,
|
||||
ase_size_t size
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
74
qse/include/ase/cmn/io.h
Normal file
74
qse/include/ase/cmn/io.h
Normal file
@ -0,0 +1,74 @@
|
||||
/*
|
||||
* $Id: sysapi.h,v 1.56 2006/03/21 16:15:16 bacon Ease $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_CMN_IO_H_
|
||||
#define _ASE_CMN_IO_H_
|
||||
|
||||
#include <ase/types.h>
|
||||
#include <ase/macros.h>
|
||||
|
||||
/* flags for ase_open */
|
||||
enum
|
||||
{
|
||||
ASE_OPEN_READ = (1 << 0),
|
||||
ASE_OPEN_WRITE = (1 << 1),
|
||||
ASE_OPEN_CREATE = (1 << 2),
|
||||
ASE_OPEN_TRUNCATE = (1 << 3),
|
||||
ASE_OPEN_EXCLUSIVE = (1 << 4),
|
||||
ASE_OPEN_APPEND = (1 << 5),
|
||||
ASE_OPEN_NONBLOCK = (1 << 6)
|
||||
};
|
||||
|
||||
/* origin for ase_seek */
|
||||
enum
|
||||
{
|
||||
ASE_SEEK_BEGIN = 0,
|
||||
ASE_SEEK_CURRENT = 1,
|
||||
ASE_SEEK_END = 2
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
ase_hnd_t ase_open (
|
||||
const ase_char_t* path,
|
||||
int flag,
|
||||
...
|
||||
);
|
||||
|
||||
int ase_close (
|
||||
ase_hnd_t handle
|
||||
);
|
||||
|
||||
ase_ssize_t ase_read (
|
||||
ase_hnd_t handle,
|
||||
void* buf,
|
||||
ase_size_t sz
|
||||
);
|
||||
|
||||
ase_ssize_t ase_write (
|
||||
ase_hnd_t handle,
|
||||
const void* data,
|
||||
ase_size_t sz
|
||||
);
|
||||
|
||||
ase_off_t ase_seek (
|
||||
ase_hnd_t handle,
|
||||
ase_off_t offset,
|
||||
int origin
|
||||
);
|
||||
|
||||
/*
|
||||
int ase_hstat (ase_hnd_t handle, ase_stat_t* buf);
|
||||
int ase_hchmod (ase_hnd_t handle, ase_mode_t mode);
|
||||
*/
|
||||
int ase_htruncate (ase_hnd_t handle, ase_off_t size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
477
qse/include/ase/cmn/lda.h
Normal file
477
qse/include/ase/cmn/lda.h
Normal file
@ -0,0 +1,477 @@
|
||||
/*
|
||||
* $Id: lda.h 363 2008-09-04 10:58:08Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_CMN_LDA_H_
|
||||
#define _ASE_CMN_LDA_H_
|
||||
|
||||
#include <ase/types.h>
|
||||
#include <ase/macros.h>
|
||||
|
||||
/****o* ase.cmn.lda/linear dynamic array
|
||||
* DESCRIPTION
|
||||
* <ase/cmn/lda.h> provides a linear dynamic array. It grows as more items
|
||||
* are added. T
|
||||
*
|
||||
* #include <ase/cmn/lda.h>
|
||||
******
|
||||
*/
|
||||
|
||||
enum ase_lda_walk_t
|
||||
{
|
||||
ASE_LDA_WALK_STOP = 0,
|
||||
ASE_LDA_WALK_FORWARD = 1,
|
||||
ASE_LDA_WALK_BACKWARD = 2
|
||||
};
|
||||
|
||||
typedef struct ase_lda_t ase_lda_t;
|
||||
typedef struct ase_lda_node_t ase_lda_node_t;
|
||||
typedef enum ase_lda_walk_t ase_lda_walk_t;
|
||||
|
||||
#define ASE_LDA_COPIER_SIMPLE ((ase_lda_copier_t)1)
|
||||
#define ASE_LDA_COPIER_INLINE ((ase_lda_copier_t)2)
|
||||
|
||||
#define ASE_LDA_INVALID ((ase_size_t)-1)
|
||||
|
||||
#define ASE_LDA_SIZE(lda) ((lda)->size)
|
||||
#define ASE_LDA_CAPA(lda) ((lda)->capa)
|
||||
|
||||
#define ASE_LDA_NODE(lda,index) ((lda)->node[index])
|
||||
#define ASE_LDA_DPTR(lda,index) ((lda)->node[index]->dptr)
|
||||
#define ASE_LDA_DLEN(lda,index) ((lda)->node[index]->dlen)
|
||||
|
||||
#define ASE_LDA_MMGR(lda) ((lda)->mmgr)
|
||||
#define ASE_LDA_XTN(lda) ((void*)(((ase_lda_t*)lda) + 1))
|
||||
|
||||
#define ASE_LDA_COPIER(lda) ((lda)->copier)
|
||||
#define ASE_LDA_FREEER(lda) ((lda)->freeer)
|
||||
#define ASE_LDA_COMPER(lda) ((lda)->comper)
|
||||
#define ASE_LDA_KEEPER(lda) ((lda)->keeper)
|
||||
#define ASE_LDA_SIZER(lda) ((lda)->sizer)
|
||||
|
||||
|
||||
|
||||
/****b* ase.cmn.lda/ase_lda_copier_t
|
||||
* NAME
|
||||
* ase_lda_copier_t - define a node contruction callback
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_lda_copier_t defines a callback function for node construction.
|
||||
* A node is contructed when a user adds data to a list. The user can
|
||||
* define how the data to add can be maintained in the list. A singly
|
||||
* linked list not specified with any copiers stores the data pointer and
|
||||
* the data length into a node. A special copier ASE_LDA_COPIER_INLINE copies
|
||||
* the contents of the data a user provided into the node. You can use the
|
||||
* ase_lda_setcopier() function to change the copier.
|
||||
*
|
||||
* A copier should return the pointer to the copied data. If it fails to copy
|
||||
* data, it may return ASE_NULL. You need to set a proper freeer to free up
|
||||
* memory allocated for copy.
|
||||
*
|
||||
* SEE ALSO
|
||||
* ase_lda_setcopier, ase_lda_getcopier, ASE_LDA_COPIER
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
typedef void* (*ase_lda_copier_t) (
|
||||
ase_lda_t* lda /* a lda */,
|
||||
void* dptr /* the pointer to data to copy */,
|
||||
ase_size_t dlen /* the length of data to copy */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****b* ase.cmn.lda/ase_lda_freeer_t
|
||||
* NAME
|
||||
* ase_lda_freeer_t - define a node destruction callback
|
||||
* SYNOPSIS
|
||||
*/
|
||||
typedef void (*ase_lda_freeer_t) (
|
||||
ase_lda_t* lda /* a lda */,
|
||||
void* dptr /* the pointer to data to free */,
|
||||
ase_size_t dlen /* the length of data to free */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****t* ase.cmn.lda/ase_lda_comper_t
|
||||
* NAME
|
||||
* ase_lda_comper_t - define a data comparator
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_lda_comper_t type defines a key comparator that is called when
|
||||
* the list needs to compare data. A linear dynamic array is created with a
|
||||
* default comparator that performs bitwise comparison.
|
||||
*
|
||||
* The comparator should return 0 if the data are the same and a non-zero
|
||||
* integer otherwise.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
typedef int (*ase_lda_comper_t) (
|
||||
ase_lda_t* lda /* a linear dynamic array */,
|
||||
const void* dptr1 /* a data pointer */,
|
||||
ase_size_t dlen1 /* a data length */,
|
||||
const void* dptr2 /* a data pointer */,
|
||||
ase_size_t dlen2 /* a data length */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****t* ase.cmn.lda/ase_lda_keeper_t
|
||||
* NAME
|
||||
* ase_lda_keeper_t - define a value keeper
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_lda_keeper_t type defines a value keeper that is called when
|
||||
* a value is retained in the context that it should be destroyed because
|
||||
* it is identical to a new value. Two values are identical if their beginning
|
||||
* pointers and their lengths are equal.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
typedef void (*ase_lda_keeper_t) (
|
||||
ase_lda_t* lda /* a lda */,
|
||||
void* vptr /* the pointer to a value */,
|
||||
ase_size_t vlen /* the length of a value */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****t* ase.cmn.lda/ase_lda_sizer_t
|
||||
* NAME
|
||||
* ase_lda_sizer_t - define an array size calculator
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_lda_sizer_t type defines an array size claculator that is called
|
||||
* when the array needs to be resized.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
typedef ase_size_t (*ase_lda_sizer_t) (
|
||||
ase_lda_t* lda, /* a linear dynamic array */
|
||||
ase_size_t hint /* a sizing hint */
|
||||
);
|
||||
/******/
|
||||
|
||||
typedef ase_lda_walk_t (*ase_lda_walker_t) (
|
||||
ase_lda_t* lda /* a linear dynamic array */,
|
||||
ase_size_t index /* the index to the visited node */,
|
||||
void* arg /* user-defined data */
|
||||
);
|
||||
|
||||
/****s* ase.cmn.lda/ase_lda_t
|
||||
* NAME
|
||||
* ase_lda_t - define a linear dynamic array
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
struct ase_lda_t
|
||||
{
|
||||
ase_mmgr_t* mmgr; /* memory manager */
|
||||
|
||||
ase_lda_copier_t copier; /* data copier */
|
||||
ase_lda_freeer_t freeer; /* data freeer */
|
||||
ase_lda_comper_t comper; /* data comparator */
|
||||
ase_lda_keeper_t keeper; /* data keeper */
|
||||
ase_lda_sizer_t sizer; /* size calculator */
|
||||
ase_byte_t scale; /* scale factor */
|
||||
ase_size_t size; /* the number of items */
|
||||
ase_size_t capa; /* capacity */
|
||||
ase_lda_node_t** node;
|
||||
};
|
||||
/******/
|
||||
|
||||
/****s*
|
||||
* NAME
|
||||
* ase_lda_node_t - define a linear dynamic array node
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
struct ase_lda_node_t
|
||||
{
|
||||
void* dptr;
|
||||
ase_size_t dlen;
|
||||
};
|
||||
/******/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/****f* ase.cmn.lda/ase_lda_open
|
||||
* NAME
|
||||
* ase_lda_open - create a linear dynamic array
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_lda_t* ase_lda_open (
|
||||
ase_mmgr_t* lda,
|
||||
ase_size_t ext,
|
||||
ase_size_t capa
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.lda/ase_lda_close
|
||||
* NAME
|
||||
* ase_lda_close - destroy a linear dynamic array
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_lda_close (
|
||||
ase_lda_t* lda
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.lda/ase_lda_init
|
||||
* NAME
|
||||
* ase_lda_init - initialize a linear dynamic array
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_lda_t* ase_lda_init (
|
||||
ase_lda_t* lda,
|
||||
ase_mmgr_t* mmgr,
|
||||
ase_size_t capa
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.lda/ase_lda_fini
|
||||
* NAME
|
||||
* ase_lda_fini - deinitialize a linear dynamic array
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_lda_fini (
|
||||
ase_lda_t* lda
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.lda/ase_lda_getxtn
|
||||
* NAME
|
||||
* ase_lda_getxtn - get the pointer to the extension
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_lda_getxtn() function returns the pointer to the extension.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void* ase_lda_getxtn (
|
||||
ase_lda_t* lda /* a linear dynamic array */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.lda/ase_lda_getmmgr
|
||||
* NAME
|
||||
* ase_lda_getmmgr - get the memory manager
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_mmgr_t* ase_lda_getmmgr (
|
||||
ase_lda_t* lda /* a linear dynamic array */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.lda/ase_lda_setmmgr
|
||||
* NAME
|
||||
* ase_lda_setmmgr - set the memory manager
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_lda_setmmgr (
|
||||
ase_lda_t* lda /* a linear dynamic array */,
|
||||
ase_mmgr_t* mmgr /* a memory manager */
|
||||
);
|
||||
/******/
|
||||
|
||||
int ase_lda_getscale (
|
||||
ase_lda_t* lda /* a lda */
|
||||
);
|
||||
|
||||
/****f* ase.cmn.lda/ase_lda_setscale
|
||||
* NAME
|
||||
* ase_lda_setscale - set the scale factor
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_lda_setscale() function sets the scale factor of the length
|
||||
* of a key and a value. A scale factor determines the actual length of
|
||||
* a key and a value in bytes. A lda is created with a scale factor of 1.
|
||||
* The scale factor should be larger than 0 and less than 256.
|
||||
*
|
||||
* NOTES
|
||||
* It is a bad idea to change the scale factor when a lda is not empty.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_lda_setscale (
|
||||
ase_lda_t* lda /* a lda */,
|
||||
int scale /* a scale factor */
|
||||
);
|
||||
/******/
|
||||
|
||||
ase_lda_copier_t ase_lda_getcopier (
|
||||
ase_lda_t* lda /* a lda */
|
||||
);
|
||||
|
||||
/****f* ase.cmn.lda/ase_lda_setcopier
|
||||
* NAME
|
||||
* ase_lda_setcopier - specify how to clone an element
|
||||
*
|
||||
* DESCRIPTION
|
||||
* A special copier ASE_LDA_COPIER_INLINE is provided. This copier enables
|
||||
* you to copy the data inline to the internal node. No freeer is invoked
|
||||
* when the node is freeed.
|
||||
*
|
||||
* You may set the copier to ASE_NULL to perform no special operation
|
||||
* when the data pointer is rememebered.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_lda_setcopier (
|
||||
ase_lda_t* lda /* a lda */,
|
||||
ase_lda_copier_t copier /* an element copier */
|
||||
);
|
||||
/******/
|
||||
|
||||
ase_lda_freeer_t ase_lda_getfreeer (
|
||||
ase_lda_t* lda /* a lda */
|
||||
);
|
||||
|
||||
/****f* ase.cmn.lda/ase_lda_setfreeer
|
||||
* NAME
|
||||
* ase_lda_setfreeer - specify how to destroy an element
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The freeer is called when a node containing the element is destroyed.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_lda_setfreeer (
|
||||
ase_lda_t* lda /* a lda */,
|
||||
ase_lda_freeer_t freeer /* an element freeer */
|
||||
);
|
||||
/******/
|
||||
|
||||
ase_lda_keeper_t ase_lda_getkeeper (
|
||||
ase_lda_t* lda
|
||||
);
|
||||
|
||||
void ase_lda_setkeeper (
|
||||
ase_lda_t* lda,
|
||||
ase_lda_keeper_t keeper
|
||||
);
|
||||
|
||||
ase_lda_sizer_t ase_lda_getsizer (
|
||||
ase_lda_t* lda
|
||||
);
|
||||
|
||||
void ase_lda_setsizer (
|
||||
ase_lda_t* lda,
|
||||
ase_lda_sizer_t sizer
|
||||
);
|
||||
|
||||
ase_size_t ase_lda_getsize (
|
||||
ase_lda_t* lda
|
||||
);
|
||||
|
||||
ase_size_t ase_lda_getcapa (
|
||||
ase_lda_t* lda
|
||||
);
|
||||
|
||||
ase_lda_t* ase_lda_setcapa (
|
||||
ase_lda_t* lda,
|
||||
ase_size_t capa
|
||||
);
|
||||
|
||||
ase_size_t ase_lda_search (
|
||||
ase_lda_t* lda,
|
||||
ase_size_t pos,
|
||||
const void* dptr,
|
||||
ase_size_t dlen
|
||||
);
|
||||
|
||||
ase_size_t ase_lda_rsearch (
|
||||
ase_lda_t* lda,
|
||||
ase_size_t pos,
|
||||
const void* dptr,
|
||||
ase_size_t dlen
|
||||
);
|
||||
|
||||
ase_size_t ase_lda_upsert (
|
||||
ase_lda_t* lda,
|
||||
ase_size_t index,
|
||||
void* dptr,
|
||||
ase_size_t dlen
|
||||
);
|
||||
|
||||
ase_size_t ase_lda_insert (
|
||||
ase_lda_t* lda,
|
||||
ase_size_t index,
|
||||
void* dptr,
|
||||
ase_size_t dlen
|
||||
);
|
||||
|
||||
ase_size_t ase_lda_update (
|
||||
ase_lda_t* lda,
|
||||
ase_size_t pos,
|
||||
void* dptr,
|
||||
ase_size_t dlen
|
||||
);
|
||||
|
||||
/****f* ase.cmn.lda/ase_lda_delete
|
||||
* NAME
|
||||
* ase_lda_delete - delete data
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_lda_delete() function deletes the as many data as the count
|
||||
* from the index.
|
||||
*
|
||||
* RETURN
|
||||
* The ase_lda_delete() function returns the number of data deleted.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_size_t ase_lda_delete (
|
||||
ase_lda_t* lda,
|
||||
ase_size_t index,
|
||||
ase_size_t count
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.lda/ase_lda_uplete
|
||||
* NAME
|
||||
* ase_lda_uplete - delete data node
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_lda_uplete() function deletes data node without compaction.
|
||||
*
|
||||
* RETURN
|
||||
* The ase_lda_uplete() function returns the number of data affected.
|
||||
*
|
||||
*/
|
||||
ase_size_t ase_lda_uplete (
|
||||
ase_lda_t* lda,
|
||||
ase_size_t index,
|
||||
ase_size_t count
|
||||
);
|
||||
/******/
|
||||
|
||||
void ase_lda_clear (
|
||||
ase_lda_t* lda
|
||||
);
|
||||
|
||||
void ase_lda_walk (
|
||||
ase_lda_t* lda,
|
||||
ase_lda_walker_t walker,
|
||||
void* arg
|
||||
);
|
||||
|
||||
void ase_lda_rwalk (
|
||||
ase_lda_t* lda,
|
||||
ase_lda_walker_t walker,
|
||||
void* arg
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
7
qse/include/ase/cmn/makefile.am
Normal file
7
qse/include/ase/cmn/makefile.am
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
pkginclude_HEADERS = mem.h chr.h str.h lda.h map.h rex.h sll.h dll.h opt.h fio.h tio.h sio.h time.h
|
||||
|
||||
pkgincludedir= $(includedir)/ase/cmn
|
||||
|
||||
CLEANFILES = *dist
|
||||
|
415
qse/include/ase/cmn/makefile.in
Normal file
415
qse/include/ase/cmn/makefile.in
Normal file
@ -0,0 +1,415 @@
|
||||
# makefile.in generated by automake 1.10.1 from makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = include/ase/cmn
|
||||
DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/makefile.am \
|
||||
$(srcdir)/makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/include/ase/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(pkgincludedir)"
|
||||
pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER)
|
||||
HEADERS = $(pkginclude_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
pkgincludedir = $(includedir)/ase/cmn
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BUILD_CJ = @BUILD_CJ@
|
||||
BUILD_JNI = @BUILD_JNI@
|
||||
BUILD_MODE = @BUILD_MODE@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CFLAGS_JNI = @CFLAGS_JNI@
|
||||
CJ = @CJ@
|
||||
CJFLAGS = @CJFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GREP = @GREP@
|
||||
HAVE_CXX = @HAVE_CXX@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
JAR = @JAR@
|
||||
JAR_PATH = @JAR_PATH@
|
||||
JAVAC = @JAVAC@
|
||||
JAVAC_PATH = @JAVAC_PATH@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBM = @LIBM@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
RM = @RM@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
pkginclude_HEADERS = mem.h chr.h str.h lda.h map.h rex.h sll.h dll.h opt.h fio.h tio.h sio.h time.h
|
||||
CLEANFILES = *dist
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/makefile.in: $(srcdir)/makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/ase/cmn/makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign include/ase/cmn/makefile
|
||||
.PRECIOUS: makefile
|
||||
makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-pkgincludeHEADERS: $(pkginclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)"
|
||||
@list='$(pkginclude_HEADERS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \
|
||||
$(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-pkgincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkginclude_HEADERS)'; for p in $$list; do \
|
||||
f=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: makefile $(HEADERS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(pkgincludedir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f makefile
|
||||
distclean-am: clean-am distclean-generic distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-pkgincludeHEADERS
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-pkgincludeHEADERS
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool ctags distclean distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-pkgincludeHEADERS install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-pkgincludeHEADERS
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
566
qse/include/ase/cmn/map.h
Normal file
566
qse/include/ase/cmn/map.h
Normal file
@ -0,0 +1,566 @@
|
||||
/*
|
||||
* $Id: map.h 496 2008-12-15 09:56:48Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_CMN_MAP_H_
|
||||
#define _ASE_CMN_MAP_H_
|
||||
|
||||
#include <ase/types.h>
|
||||
#include <ase/macros.h>
|
||||
|
||||
/****o* ase.cmn.map/hash map
|
||||
* DESCRIPTION
|
||||
* A hash map maintains buckets for key/value pairs with the same key hash
|
||||
* chained under the same bucket.
|
||||
*
|
||||
* #include <ase/cmn/map.h>
|
||||
*
|
||||
* EXAMPLES
|
||||
* void f (void)
|
||||
* {
|
||||
* }
|
||||
******
|
||||
*/
|
||||
|
||||
/* values that can be returned by ase_map_walker_t */
|
||||
enum ase_map_walk_t
|
||||
{
|
||||
ASE_MAP_WALK_STOP = 0,
|
||||
ASE_MAP_WALK_FORWARD = 1
|
||||
};
|
||||
|
||||
enum ase_map_id_t
|
||||
{
|
||||
ASE_MAP_KEY = 0,
|
||||
ASE_MAP_VAL = 1
|
||||
};
|
||||
|
||||
typedef struct ase_map_t ase_map_t;
|
||||
typedef struct ase_map_pair_t ase_map_pair_t;
|
||||
typedef enum ase_map_walk_t ase_map_walk_t;
|
||||
typedef enum ase_map_id_t ase_map_id_t;
|
||||
|
||||
/****b* ase.cmn.map/ase_map_copier_t
|
||||
* NAME
|
||||
* ase_map_copier_t - define a pair contruction callback
|
||||
* SYNOPSIS
|
||||
*/
|
||||
typedef void* (*ase_map_copier_t) (
|
||||
ase_map_t* map /* a map */,
|
||||
void* dptr /* the pointer to a key or a value */,
|
||||
ase_size_t dlen /* the length of a key or a value */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****b* ase.cmn.map/ase_map_freeer_t
|
||||
* NAME
|
||||
* ase_map_freeer_t - define a key/value destruction callback
|
||||
* SYNOPSIS
|
||||
*/
|
||||
typedef void (*ase_map_freeer_t) (
|
||||
ase_map_t* map /* a map */,
|
||||
void* dptr /* the pointer to a key or a value */,
|
||||
ase_size_t dlen /* the length of a key or a value */
|
||||
);
|
||||
/******/
|
||||
|
||||
/* key hasher */
|
||||
typedef ase_size_t (*ase_map_hasher_t) (
|
||||
ase_map_t* map /* a map */,
|
||||
const void* kptr /* the pointer to a key */,
|
||||
ase_size_t klen /* the length of a key in bytes */
|
||||
);
|
||||
|
||||
/****t* ase.cmn.map/ase_map_comper_t
|
||||
* NAME
|
||||
* ase_map_comper_t - define a key comparator
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_map_comper_t type defines a key comparator that is called when
|
||||
* the map needs to compare keys. A map is created with a default comparator
|
||||
* which performs bitwise comparison between two keys.
|
||||
*
|
||||
* The comparator should return 0 if the keys are the same and a non-zero
|
||||
* integer otherwise.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
typedef int (*ase_map_comper_t) (
|
||||
ase_map_t* map /* a map */,
|
||||
const void* kptr1 /* the pointer to a key */,
|
||||
ase_size_t klen1 /* the length of a key */,
|
||||
const void* kptr2 /* the pointer to a key */,
|
||||
ase_size_t klen2 /* the length of a key */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****t* ase.cmn.map/ase_map_keeper_t
|
||||
* NAME
|
||||
* ase_map_keeper_t - define a value keeper
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_map_keeper_t type defines a value keeper that is called when
|
||||
* a value is retained in the context that it should be destroyed because
|
||||
* it is identical to a new value. Two values are identical if their beginning
|
||||
* pointers and their lengths are equal.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
typedef void (*ase_map_keeper_t) (
|
||||
ase_map_t* map /* a map */,
|
||||
void* vptr /* the pointer to a value */,
|
||||
ase_size_t vlen /* the length of a value */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****t* ase.cmn.map/ase_map_sizer_t
|
||||
* NAME
|
||||
* ase_map_sizer_t - define a bucket size calculator
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_map_sizer_T type defines a bucket size claculator that is called
|
||||
* when a map should resize the bucket. The current bucket size +1 is passed
|
||||
* as the hint.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
typedef ase_size_t (*ase_map_sizer_t) (
|
||||
ase_map_t* map, /* a map */
|
||||
ase_size_t hint /* a sizing hint */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****t* ase.cmn.map/ase_map_walker_t
|
||||
* NAME
|
||||
* ase_map_walker_t - define a pair visitor
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
typedef ase_map_walk_t (*ase_map_walker_t) (
|
||||
ase_map_t* map /* a map */,
|
||||
ase_map_pair_t* pair /* the pointer to a key/value pair */,
|
||||
void* arg /* the pointer to user-defined data */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****s* ase.cmn.map/ase_map_pair_t
|
||||
* NAME
|
||||
* ase_map_pair_t - define a pair
|
||||
*
|
||||
* DESCRIPTION
|
||||
* A pair is composed of a key and a value. It maintains pointers to the
|
||||
* beginning of a key and a value plus their length. The length is scaled
|
||||
* down with the scale factor specified in an owning map. Use macros defined
|
||||
* in the SEE ALSO section below to access individual fields.
|
||||
*
|
||||
* SEE ALSO
|
||||
* ASE_MAP_KPTR, ASE_MAP_KLEN, ASE_MAP_VPTR, ASE_MAP_VLEN
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
struct ase_map_pair_t
|
||||
{
|
||||
void* kptr; /* the pointer to a key */
|
||||
ase_size_t klen; /* the length of a key */
|
||||
void* vptr; /* the pointer to a value */
|
||||
ase_size_t vlen; /* the length of a value */
|
||||
ase_map_pair_t* next; /* the next pair under the same slot */
|
||||
};
|
||||
/*****/
|
||||
|
||||
/****s* ase.cmn.map/ase_map_t
|
||||
* NAME
|
||||
* ase_map_t - define a hash map
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
struct ase_map_t
|
||||
{
|
||||
ase_mmgr_t* mmgr;
|
||||
ase_map_copier_t copier[2];
|
||||
ase_map_freeer_t freeer[2];
|
||||
ase_map_hasher_t hasher; /* key hasher */
|
||||
ase_map_comper_t comper; /* key comparator */
|
||||
ase_map_keeper_t keeper; /* value keeper */
|
||||
ase_map_sizer_t sizer; /* bucket capacity recalculator */
|
||||
ase_byte_t scale[2]; /* length scale */
|
||||
ase_byte_t factor; /* load factor */
|
||||
ase_byte_t filler0;
|
||||
ase_size_t size;
|
||||
ase_size_t capa;
|
||||
ase_size_t threshold;
|
||||
ase_map_pair_t** bucket;
|
||||
};
|
||||
/******/
|
||||
|
||||
#define ASE_MAP_COPIER_SIMPLE ((ase_map_copier_t)1)
|
||||
#define ASE_MAP_COPIER_INLINE ((ase_map_copier_t)2)
|
||||
|
||||
/****d* ase.cmn.map/ASE_MAP_SIZE
|
||||
* NAME
|
||||
* ASE_MAP_SIZE - get the number of pairs
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ASE_MAP_SIZE() macro returns the number of pairs in a map.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
#define ASE_MAP_SIZE(m) ((m)->size)
|
||||
/*****/
|
||||
|
||||
/****d* ase.cmn.map/ASE_MAP_CAPA
|
||||
* NAME
|
||||
* ASE_MAP_CAPA - get the capacity of a map
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ASE_MAP_CAPA() macro returns the maximum number of pairs a map can hold.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
#define ASE_MAP_CAPA(m) ((m)->capa)
|
||||
/*****/
|
||||
|
||||
#define ASE_MAP_MMGR(m) ((m)->mmgr)
|
||||
#define ASE_MAP_XTN(m) ((void*)(((ase_map_t*)m) + 1))
|
||||
|
||||
#define ASE_MAP_KCOPIER(m) ((m)->copier[ASE_MAP_KEY])
|
||||
#define ASE_MAP_VCOPIER(m) ((m)->copier[ASE_MAP_VAL])
|
||||
#define ASE_MAP_KFREEER(m) ((m)->freeer[ASE_MAP_KEY])
|
||||
#define ASE_MAP_VFREEER(m) ((m)->freeer[ASE_MAP_VAL])
|
||||
#define ASE_MAP_HASHER(m) ((m)->hasher)
|
||||
#define ASE_MAP_COMPER(m) ((m)->comper)
|
||||
#define ASE_MAP_KEEPER(m) ((m)->keeper)
|
||||
#define ASE_MAP_SIZER(m) ((m)->sizer)
|
||||
|
||||
#define ASE_MAP_FACTOR(m) ((m)->factor)
|
||||
#define ASE_MAP_KSCALE(m) ((m)->scale[ASE_MAP_KEY])
|
||||
#define ASE_MAP_VSCALE(m) ((m)->scale[ASE_MAP_VAL])
|
||||
|
||||
#define ASE_MAP_KPTR(p) ((p)->kptr)
|
||||
#define ASE_MAP_KLEN(p) ((p)->klen)
|
||||
#define ASE_MAP_VPTR(p) ((p)->vptr)
|
||||
#define ASE_MAP_VLEN(p) ((p)->vlen)
|
||||
#define ASE_MAP_NEXT(p) ((p)->next)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/****f* ase.cmn.map/ase_map_open
|
||||
* NAME
|
||||
* ase_map_open - creates a hash map
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_map_open() function creates a hash map with a dynamic array
|
||||
* bucket and a list of values chained. The initial capacity should be larger
|
||||
* than 0. The load factor should be between 0 and 100 inclusive and the load
|
||||
* factor of 0 disables bucket resizing. If you need extra space associated
|
||||
* with a map, you may pass a non-zero value as the second parameter.
|
||||
* The ASE_MAP_XTN() macro and the ase_map_getxtn() function
|
||||
* return the pointer to the beginning of the extension.
|
||||
*
|
||||
* RETURN
|
||||
* The ase_map_open() function returns an ase_map_t pointer on success and
|
||||
* ASE_NULL on failure.
|
||||
*
|
||||
* SEE ALSO
|
||||
* ASE_MAP_XTN, ase_map_getxtn
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_map_t* ase_map_open (
|
||||
ase_mmgr_t* mmgr /* a memory manager */,
|
||||
ase_size_t ext /* extension size in bytes */,
|
||||
ase_size_t capa /* initial capacity */,
|
||||
int factor /* load factor */
|
||||
);
|
||||
/******/
|
||||
|
||||
|
||||
/****f* ase.cmn.map/ase_map_close
|
||||
* NAME
|
||||
* ase_map_close - destroy a hash map
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_map_close() function destroys a hash map.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_map_close (
|
||||
ase_map_t* map /* a map */
|
||||
);
|
||||
/******/
|
||||
|
||||
ase_map_t* ase_map_init (
|
||||
ase_map_t* map,
|
||||
ase_mmgr_t* mmgr,
|
||||
ase_size_t capa,
|
||||
int factor
|
||||
);
|
||||
|
||||
void ase_map_fini (
|
||||
ase_map_t* map
|
||||
);
|
||||
|
||||
void* ase_map_getxtn (
|
||||
ase_map_t* map
|
||||
);
|
||||
|
||||
ase_mmgr_t* ase_map_getmmgr (
|
||||
ase_map_t* map
|
||||
);
|
||||
|
||||
void ase_map_setmmgr (
|
||||
ase_map_t* map,
|
||||
ase_mmgr_t* mmgr
|
||||
);
|
||||
|
||||
/* get the number of key/value pairs in a map */
|
||||
ase_size_t ase_map_getsize (
|
||||
ase_map_t* map /* a map */
|
||||
);
|
||||
|
||||
ase_size_t ase_map_getcapa (
|
||||
ase_map_t* map /* a map */
|
||||
);
|
||||
|
||||
int ase_map_getscale (
|
||||
ase_map_t* map /* a map */,
|
||||
ase_map_id_t id /* ASE_MAP_KEY or ASE_MAP_VAL */
|
||||
);
|
||||
|
||||
/****f* ase.cmn.map/ase_map_setscale
|
||||
* NAME
|
||||
* ase_map_setscale - set the scale factor
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_map_setscale() function sets the scale factor of the length
|
||||
* of a key and a value. A scale factor determines the actual length of
|
||||
* a key and a value in bytes. A map is created with a scale factor of 1.
|
||||
* The scale factor should be larger than 0 and less than 256.
|
||||
*
|
||||
* NOTES
|
||||
* It is a bad idea to change the scale factor when a map is not empty.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_map_setscale (
|
||||
ase_map_t* map /* a map */,
|
||||
ase_map_id_t id /* ASE_MAP_KEY or ASE_MAP_VAL */,
|
||||
int scale /* a scale factor */
|
||||
);
|
||||
/******/
|
||||
|
||||
ase_map_copier_t ase_map_getcopier (
|
||||
ase_map_t* map /* a map */,
|
||||
ase_map_id_t id /* ASE_MAP_KEY or ASE_MAP_VAL */
|
||||
);
|
||||
|
||||
/****f* ase.cmn.map/ase_map_setcopier
|
||||
* NAME
|
||||
* ase_map_setcopier - specify how to clone an element
|
||||
*
|
||||
* DESCRIPTION
|
||||
* A special copier ASE_MAP_COPIER_INLINE is provided. This copier enables
|
||||
* you to copy the data inline to the internal node. No freeer is invoked
|
||||
* when the node is freeed.
|
||||
*
|
||||
* You may set the copier to ASE_NULL to perform no special operation
|
||||
* when the data pointer is rememebered.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_map_setcopier (
|
||||
ase_map_t* map /* a map */,
|
||||
ase_map_id_t id /* ASE_MAP_KEY or ASE_MAP_VAL */,
|
||||
ase_map_copier_t copier /* an element copier */
|
||||
);
|
||||
/******/
|
||||
|
||||
ase_map_freeer_t ase_map_getfreeer (
|
||||
ase_map_t* map /* a map */,
|
||||
ase_map_id_t id /* ASE_MAP_KEY or ASE_MAP_VAL */
|
||||
);
|
||||
|
||||
/****f* ase.cmn.map/ase_map_setfreeer
|
||||
* NAME
|
||||
* ase_map_setfreeer - specify how to destroy an element
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The freeer is called when a node containing the element is destroyed.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_map_setfreeer (
|
||||
ase_map_t* map /* a map */,
|
||||
ase_map_id_t id /* ASE_MAP_KEY or ASE_MAP_VAL */,
|
||||
ase_map_freeer_t freeer /* an element freeer */
|
||||
);
|
||||
/******/
|
||||
|
||||
|
||||
ase_map_hasher_t ase_map_gethasher (
|
||||
ase_map_t* map
|
||||
);
|
||||
|
||||
void ase_map_sethasher (
|
||||
ase_map_t* map,
|
||||
ase_map_hasher_t hasher
|
||||
);
|
||||
|
||||
ase_map_comper_t ase_map_getcomper (
|
||||
ase_map_t* map
|
||||
);
|
||||
|
||||
void ase_map_setcomper (
|
||||
ase_map_t* map,
|
||||
ase_map_comper_t comper
|
||||
);
|
||||
|
||||
ase_map_keeper_t ase_map_getkeeper (
|
||||
ase_map_t* map
|
||||
);
|
||||
|
||||
void ase_map_setkeeper (
|
||||
ase_map_t* map,
|
||||
ase_map_keeper_t keeper
|
||||
);
|
||||
|
||||
ase_map_sizer_t ase_map_getsizer (
|
||||
ase_map_t* map
|
||||
);
|
||||
|
||||
/* the sizer function is passed a map object and map->capa + 1 */
|
||||
void ase_map_setsizer (
|
||||
ase_map_t* map,
|
||||
ase_map_sizer_t sizer
|
||||
);
|
||||
|
||||
int ase_map_put (
|
||||
ase_map_t* map,
|
||||
void* kptr,
|
||||
ase_size_t klen,
|
||||
void* vptr,
|
||||
ase_size_t vlen,
|
||||
ase_map_pair_t** px
|
||||
);
|
||||
|
||||
/****f* ase.cmn.map/ase_map_search
|
||||
* NAME
|
||||
* ase_map_search - find a pair with a matching key
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_map_search() function searches a map to find a pair with a
|
||||
* matching key. It returns the pointer to the pair found. If it fails
|
||||
* to find one, it returns ASE_NULL.
|
||||
*
|
||||
* RETURN
|
||||
* The ase_map_search() function returns the pointer to the pair with a
|
||||
* maching key, and ASE_NULL if no match is found.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_map_pair_t* ase_map_search (
|
||||
ase_map_t* map /* a map */,
|
||||
const void* kptr /* the pointer to a key */,
|
||||
ase_size_t klen /* the size of the key in bytes */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.map/ase_map_upsert
|
||||
* NAME
|
||||
* ase_map_upsert - update an existing pair or inesrt a new pair
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_map_upsert() function searches a map for the pair with a matching
|
||||
* key. If one is found, it updates the pair. Otherwise, it inserts a new
|
||||
* pair with a key and a value. It returns the pointer to the pair updated
|
||||
* or inserted.
|
||||
*
|
||||
* RETURN
|
||||
* The ase_map_upsert() function returns a pointer to the updated or inserted
|
||||
* pair on success, and ASE_NULL on failure.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_map_pair_t* ase_map_upsert (
|
||||
ase_map_t* map /* a map */,
|
||||
void* kptr /* the pointer to a key */,
|
||||
ase_size_t klen /* the length of the key in bytes */,
|
||||
void* vptr /* the pointer to a value */,
|
||||
ase_size_t vlen /* the length of the value in bytes */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.map/ase_map_insert
|
||||
* NAME
|
||||
* ase_map_insert - insert a new pair with a key and a value
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_map_insert() function inserts a new pair with the key and the value
|
||||
* given. If there exists a pair with the key given, the function returns
|
||||
* ASE_NULL without channging the value.
|
||||
*
|
||||
* RETURN
|
||||
* The ase_map_insert() function returns a pointer to the pair created on
|
||||
* success, and ASE_NULL on failure.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_map_pair_t* ase_map_insert (
|
||||
ase_map_t* map /* a map */,
|
||||
void* kptr /* the pointer to a key */,
|
||||
ase_size_t klen /* the length of the key in bytes */,
|
||||
void* vptr /* the pointer to a value */,
|
||||
ase_size_t vlen /* the length of the value in bytes */
|
||||
);
|
||||
/******/
|
||||
|
||||
/* update the value of a existing pair with a matching key */
|
||||
ase_map_pair_t* ase_map_update (
|
||||
ase_map_t* map /* a map */,
|
||||
void* kptr /* the pointer to a key */,
|
||||
ase_size_t klen /* the length of the key in bytes */,
|
||||
void* vptr /* the pointer to a value */,
|
||||
ase_size_t vlen /* the length of the value in bytes */
|
||||
);
|
||||
|
||||
/* delete a pair with a matching key */
|
||||
int ase_map_delete (
|
||||
ase_map_t* map /* a map */,
|
||||
const void* kptr /* the pointer to a key */,
|
||||
ase_size_t klen /* the size of the key in bytes */
|
||||
);
|
||||
|
||||
/* clear a map */
|
||||
void ase_map_clear (
|
||||
ase_map_t* map /* a map */
|
||||
);
|
||||
|
||||
/* traverse a map */
|
||||
void ase_map_walk (
|
||||
ase_map_t* map /* a map */,
|
||||
ase_map_walker_t walker /* the pointer to the function for each pair */,
|
||||
void* arg /* a pointer to user-specific data */
|
||||
);
|
||||
|
||||
/* get the pointer to the first pair in the map. */
|
||||
ase_map_pair_t* ase_map_getfirstpair (
|
||||
ase_map_t* map /* a map */,
|
||||
ase_size_t* buckno
|
||||
);
|
||||
|
||||
/* get the pointer to the next pair in the map. */
|
||||
ase_map_pair_t* ase_map_getnextpair (
|
||||
ase_map_t* map /* a map */,
|
||||
ase_map_pair_t* pair,
|
||||
ase_size_t* buckno
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
198
qse/include/ase/cmn/mem.h
Normal file
198
qse/include/ase/cmn/mem.h
Normal file
@ -0,0 +1,198 @@
|
||||
/*
|
||||
* $Id: mem.h 337 2008-08-20 09:17:25Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_CMN_MEM_H_
|
||||
#define _ASE_CMN_MEM_H_
|
||||
|
||||
#include <ase/types.h>
|
||||
#include <ase/macros.h>
|
||||
|
||||
/* gets a pointer to the default memory manager */
|
||||
#define ASE_MMGR_GETDFL() (ase_mmgr)
|
||||
|
||||
/* sets a pointer to the default memory manager */
|
||||
#define ASE_MMGR_SETDFL(m) ((ase_mmgr)=(m))
|
||||
|
||||
/* allocate a memory block */
|
||||
#define ASE_MMGR_ALLOC(mmgr,size) \
|
||||
((mmgr)->alloc((mmgr)->data,size))
|
||||
|
||||
/* reallocate a memory block */
|
||||
#define ASE_MMGR_REALLOC(mmgr,ptr,size) \
|
||||
((mmgr)->realloc((mmgr)->data,ptr,size))
|
||||
|
||||
/* free a memory block */
|
||||
#define ASE_MMGR_FREE(mmgr,ptr) \
|
||||
((mmgr)->free((mmgr)->data,ptr))
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NAME: holds a pointer to the default memory manager
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* The ASE_MMGR_GETDFL() macro returns the default memory manager.
|
||||
* You may use ASE_MMGR_SETDFL() to change the default memory manager.
|
||||
*/
|
||||
extern ase_mmgr_t* ase_mmgr;
|
||||
|
||||
/*
|
||||
* NAME: copy a memory block
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* The ase_memcpy() functions copies n bytes from the source memory block src
|
||||
* to the destinaion memory block dst.
|
||||
*
|
||||
* RETURNS: the destination memory block dst.
|
||||
*
|
||||
* WARNING:
|
||||
* The memory blocks should not overlap. Use the ase_memmove() function if
|
||||
* they overlap.
|
||||
*/
|
||||
|
||||
void* ase_memcpy (
|
||||
void* dst /* a pointer to the destination memory block */ ,
|
||||
const void* src /* a pointer to the source memory block */ ,
|
||||
ase_size_t n /* the number of bytes to copy */
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME: copy a memory block with more care
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* The ase_memmove() functions copies n bytes from the source memory block src
|
||||
* to the destinaion memory block dst without corrupting overlapping zone.
|
||||
*
|
||||
* RETURNS: the destination memory block dst.
|
||||
*/
|
||||
void* ase_memmove (
|
||||
void* dst /* a pointer to the destination memory block */,
|
||||
const void* src /* a pointer to the source memory block */,
|
||||
ase_size_t n /* the number of bytes to copy */
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME: fill a memory block
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* The ase_memset() function fills leading n bytes of the destination
|
||||
* memory block dst with the byte val.
|
||||
*
|
||||
* RETURNS: the destination memory block dst
|
||||
*/
|
||||
void* ase_memset (
|
||||
void* dst /* a pointer to the destination memory block */,
|
||||
int val /* the byte to fill the memory block with */,
|
||||
ase_size_t n /* the number of bytes to fill */
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME: compare memory blocks
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* The ase_memcmp() function compares leading n bytes of two memory blocks
|
||||
* s1 and s2.
|
||||
*
|
||||
* RETURNS:
|
||||
* 0 if two memory ares have the same leadning n bytes.
|
||||
* a positive number if the first different byte of s1 is greater than that
|
||||
* of s2.
|
||||
* a negative number if the first different byte of s1 is less than that of s2.
|
||||
*/
|
||||
int ase_memcmp (
|
||||
const void* s1 /* a pointer to the first memory block to compare */,
|
||||
const void* s2 /* a pointer to the second memory block to compare */,
|
||||
ase_size_t n /* the number of bytes to compare */
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME: find a byte forward in a memory block
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* The ase_membyte() function scans the memory block s from the first byte
|
||||
* up to the nth byte in search of the byte val. If it finds a match,
|
||||
* it aborts scanning the memory block and returns the pointer to the matching
|
||||
* location.
|
||||
*
|
||||
* RETURNS:
|
||||
* ASE_NULL if the byte val is not found.
|
||||
* The pointer to the location in the memory block s matching the byte val
|
||||
* if a match is found.
|
||||
*/
|
||||
void* ase_membyte (
|
||||
const void* s /* a pointer to the memory block to scan */,
|
||||
int val /* a byte to find */,
|
||||
ase_size_t n /* the number of bytes to scan */
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME: find a byte backward in a memory block
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* The ase_memrbyte() function scans the memory block s from the nth byte
|
||||
* backward to the first byte in search of the byte val. If it finds a match,
|
||||
* it aborts scanning the memory block and returns the pointer to the matching
|
||||
* location.
|
||||
*
|
||||
* RETURNS:
|
||||
* ASE_NULL if the byte val is not found.
|
||||
* The pointer to the location in the memory block s matching the byte val
|
||||
* if a match is found.
|
||||
*/
|
||||
void* ase_memrbyte (
|
||||
const void* s /* a pointer to the memory block to scan */,
|
||||
int val /* a byte to find */,
|
||||
ase_size_t n /* the number of bytes to scan */
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME: find a block of bytes forward in a memory block
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* The ase_memmem() functions scans the first hl bytes of the memory block hs
|
||||
* in search of the byte block nd of the length nl bytes.
|
||||
*
|
||||
* RETURNS:
|
||||
* ASE_NULL if the byte val is not found.
|
||||
* The pointer to the location in the memory block s matching the byte val
|
||||
* if a match is found.
|
||||
*
|
||||
* RETURNS:
|
||||
* ASE_NULL if no match is found.
|
||||
* The pointer to the start of the matching location if a match is found.
|
||||
*/
|
||||
void* ase_memmem (
|
||||
const void* hs /* a pointer to the memory block to scan */,
|
||||
ase_size_t hl /* the number of bytes to scan */,
|
||||
const void* nd /* a pointer to the byte block to find */,
|
||||
ase_size_t nl /* the number of bytes in the block */
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME: find a block of bytes backward in a memory block
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* The ase_memrmem() functions scans the first hl bytes of the memory block hs
|
||||
* backward in search of the byte block nd of the length nl bytes.
|
||||
*
|
||||
* RETURNS:
|
||||
* ASE_NULL if no match is found.
|
||||
* The pointer to the start of the matching location if a match is found.
|
||||
*/
|
||||
void* ase_memrmem (
|
||||
const void* hs /* a pointer to the memory block to scan */,
|
||||
ase_size_t hl /* the number of bytes to scan */,
|
||||
const void* nd /* a pointer to the byte block to find */,
|
||||
ase_size_t nl /* the number of bytes in the block */
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
63
qse/include/ase/cmn/opt.h
Normal file
63
qse/include/ase/cmn/opt.h
Normal file
@ -0,0 +1,63 @@
|
||||
/*
|
||||
* $Id: getopt.h 290 2008-07-27 06:16:54Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_CMN_OPT_H_
|
||||
#define _ASE_CMN_OPT_H_
|
||||
|
||||
#include <ase/types.h>
|
||||
#include <ase/macros.h>
|
||||
|
||||
typedef struct ase_opt_t ase_opt_t;
|
||||
typedef struct ase_opt_lng_t ase_opt_lng_t;
|
||||
|
||||
struct ase_opt_lng_t
|
||||
{
|
||||
const ase_char_t* str;
|
||||
ase_cint_t val;
|
||||
};
|
||||
|
||||
struct ase_opt_t
|
||||
{
|
||||
/* input */
|
||||
const ase_char_t* str; /* option string */
|
||||
ase_opt_lng_t* lng; /* long options */
|
||||
|
||||
/* output */
|
||||
ase_cint_t opt; /* character checked for validity */
|
||||
ase_char_t* arg; /* argument associated with an option */
|
||||
|
||||
/* output */
|
||||
const ase_char_t* lngopt;
|
||||
|
||||
/* input + output */
|
||||
int ind; /* index into parent argv vector */
|
||||
|
||||
/* input + output - internal*/
|
||||
ase_char_t* cur;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/****f* ase.cmn.opt/ase_getopt
|
||||
* NAME
|
||||
* ase_getopt - parse command line options
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_cint_t ase_getopt (
|
||||
int argc /* argument count */,
|
||||
ase_char_t* const* argv /* argument array */,
|
||||
ase_opt_t* opt /* option configuration */
|
||||
);
|
||||
/******/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
94
qse/include/ase/cmn/rex.h
Normal file
94
qse/include/ase/cmn/rex.h
Normal file
@ -0,0 +1,94 @@
|
||||
/*
|
||||
* $Id: rex.h 223 2008-06-26 06:44:41Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_CMN_REX_H_
|
||||
#define _ASE_CMN_REX_H_
|
||||
|
||||
#include <ase/types.h>
|
||||
#include <ase/macros.h>
|
||||
|
||||
/*
|
||||
* Regular Esseression Syntax
|
||||
* A regular expression is zero or more branches, separated by '|'.
|
||||
* ......
|
||||
* ......
|
||||
*
|
||||
* Compiled form of a regular expression:
|
||||
*
|
||||
* | expression |
|
||||
* | header | branch | branch | branch |
|
||||
* | nb | el | na | bl | cmd | arg | cmd | arg | na | bl | cmd | arg | na | bl | cmd |
|
||||
*
|
||||
* nb: the number of branches
|
||||
* el: the length of a expression including the length of nb and el
|
||||
* na: the number of atoms
|
||||
* bl: the length of a branch including the length of na and bl
|
||||
* cmd: The command and repetition info encoded together.
|
||||
* Some commands require an argument to follow them but some other don't.
|
||||
* It is encoded as follows:
|
||||
*
|
||||
* Subexpressions can be nested by having the command "GROUP"
|
||||
* and a subexpression as its argument.
|
||||
*
|
||||
* Examples:
|
||||
* a.c -> |1|6|5|ORD_CHAR(no bound)|a|ANY_CHAR(no bound)|ORD_CHAR(no bound)|c|
|
||||
* ab|xy -> |2|10|4|ORD_CHAR(no bound)|a|ORD_CHAR(no bound)|b|4|ORD_CHAR(no bound)|x|ORD_CHAR(no bound)|y|
|
||||
*/
|
||||
|
||||
#define ASE_REX_NA(code) (*(ase_size_t*)(code))
|
||||
|
||||
#define ASE_REX_LEN(code) \
|
||||
(*(ase_size_t*)((ase_byte_t*)(code)+ASE_SIZEOF(ase_size_t)))
|
||||
|
||||
enum ase_rex_option_t
|
||||
{
|
||||
ASE_REX_IGNORECASE = (1 << 0)
|
||||
};
|
||||
|
||||
enum ase_rex_errnum_t
|
||||
{
|
||||
ASE_REX_ENOERR = 0,
|
||||
ASE_REX_ENOMEM,
|
||||
ASE_REX_ERECUR, /* recursion too deep */
|
||||
ASE_REX_ERPAREN, /* a right parenthesis is expected */
|
||||
ASE_REX_ERBRACKET, /* a right bracket is expected */
|
||||
ASE_REX_ERBRACE, /* a right brace is expected */
|
||||
ASE_REX_EUNBALPAR, /* unbalanced parenthesis */
|
||||
ASE_REX_ECOLON, /* a colon is expected */
|
||||
ASE_REX_ECRANGE, /* invalid character range */
|
||||
ASE_REX_ECCLASS, /* invalid character class */
|
||||
ASE_REX_EBRANGE, /* invalid boundary range */
|
||||
ASE_REX_EEND, /* unexpected end of the pattern */
|
||||
ASE_REX_EGARBAGE /* garbage after the pattern */
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void* ase_buildrex (
|
||||
ase_mmgr_t* mmgr, ase_size_t depth,
|
||||
const ase_char_t* ptn, ase_size_t len, int* errnum);
|
||||
|
||||
int ase_matchrex (
|
||||
ase_mmgr_t* mmgr, ase_ccls_t* ccls, ase_size_t depth,
|
||||
void* code, int option,
|
||||
const ase_char_t* str, ase_size_t len,
|
||||
const ase_char_t** match_ptr, ase_size_t* match_len, int* errnum);
|
||||
|
||||
void ase_freerex (ase_mmgr_t* mmgr, void* code);
|
||||
|
||||
ase_bool_t ase_isemptyrex (void* code);
|
||||
|
||||
#if 0
|
||||
void ase_dprintrex (ase_rex_t* rex, void* rex);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
142
qse/include/ase/cmn/sio.h
Normal file
142
qse/include/ase/cmn/sio.h
Normal file
@ -0,0 +1,142 @@
|
||||
/*
|
||||
* $Id: sio.h,v 1.29 2005/12/26 05:38:24 bacon Ease $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_CMN_SIO_H_
|
||||
#define _ASE_CMN_SIO_H_
|
||||
|
||||
#include <ase/types.h>
|
||||
#include <ase/macros.h>
|
||||
#include <ase/cmn/fio.h>
|
||||
#include <ase/cmn/tio.h>
|
||||
|
||||
enum ase_sio_open_flag_t
|
||||
{
|
||||
ASE_SIO_HANDLE = ASE_FIO_HANDLE,
|
||||
|
||||
ASE_SIO_READ = ASE_FIO_READ,
|
||||
ASE_SIO_WRITE = ASE_FIO_WRITE,
|
||||
ASE_SIO_APPEND = ASE_FIO_APPEND,
|
||||
|
||||
ASE_SIO_CREATE = ASE_FIO_CREATE,
|
||||
ASE_SIO_TRUNCATE = ASE_FIO_TRUNCATE,
|
||||
ASE_SIO_EXCLUSIVE = ASE_FIO_EXCLUSIVE,
|
||||
ASE_SIO_SYNC = ASE_FIO_SYNC,
|
||||
|
||||
ASE_SIO_NOSHRD = ASE_FIO_NOSHRD,
|
||||
ASE_SIO_NOSHWR = ASE_FIO_NOSHWR
|
||||
};
|
||||
|
||||
typedef ase_fio_off_t ase_sio_off_t;
|
||||
typedef ase_fio_hnd_t ase_sio_hnd_t;
|
||||
|
||||
typedef struct ase_sio_t ase_sio_t;
|
||||
|
||||
struct ase_sio_t
|
||||
{
|
||||
ase_mmgr_t* mmgr;
|
||||
ase_fio_t fio;
|
||||
ase_tio_t tio;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern ase_sio_t* ase_sio_in;
|
||||
extern ase_sio_t* ase_sio_out;
|
||||
extern ase_sio_t* ase_sio_err;
|
||||
|
||||
ase_sio_t* ase_sio_open (
|
||||
ase_mmgr_t* mmgr,
|
||||
ase_size_t ext,
|
||||
const ase_char_t* file,
|
||||
int flags
|
||||
);
|
||||
|
||||
void ase_sio_close (
|
||||
ase_sio_t* sio
|
||||
);
|
||||
|
||||
ase_sio_t* ase_sio_init (
|
||||
ase_sio_t* sio,
|
||||
ase_mmgr_t* mmgr,
|
||||
const ase_char_t* file,
|
||||
int flags
|
||||
);
|
||||
|
||||
void ase_sio_fini (
|
||||
ase_sio_t* sio
|
||||
);
|
||||
|
||||
ase_fio_hnd_t ase_sio_gethandle (
|
||||
ase_sio_t* sio
|
||||
);
|
||||
|
||||
ase_ssize_t ase_sio_flush (
|
||||
ase_sio_t* sio
|
||||
);
|
||||
|
||||
void ase_sio_purge (
|
||||
ase_sio_t* sio
|
||||
);
|
||||
|
||||
ase_ssize_t ase_sio_getc (
|
||||
ase_sio_t* sio,
|
||||
ase_char_t* c
|
||||
);
|
||||
|
||||
ase_ssize_t ase_sio_gets (
|
||||
ase_sio_t* sio,
|
||||
ase_char_t* buf,
|
||||
ase_size_t size
|
||||
);
|
||||
|
||||
ase_ssize_t ase_sio_getsx (
|
||||
ase_sio_t* sio,
|
||||
ase_char_t* buf,
|
||||
ase_size_t size
|
||||
);
|
||||
|
||||
ase_ssize_t ase_sio_getstr (
|
||||
ase_sio_t* sio,
|
||||
ase_str_t* buf
|
||||
);
|
||||
|
||||
ase_ssize_t ase_sio_putc (
|
||||
ase_sio_t* sio,
|
||||
ase_char_t c
|
||||
);
|
||||
|
||||
ase_ssize_t ase_sio_puts (
|
||||
ase_sio_t* sio,
|
||||
const ase_char_t* str
|
||||
);
|
||||
|
||||
ase_ssize_t ase_sio_putsx (
|
||||
ase_sio_t* sio,
|
||||
const ase_char_t* str,
|
||||
ase_size_t size
|
||||
);
|
||||
|
||||
#if 0
|
||||
ase_ssize_t ase_sio_putsn (ase_sio_t* sio, ...);
|
||||
ase_ssize_t ase_sio_putsxn (ase_sio_t* sio, ...);
|
||||
ase_ssize_t ase_sio_putsv (ase_sio_t* sio, ase_va_list ap);
|
||||
ase_ssize_t ase_sio_putsxv (ase_sio_t* sio, ase_va_list ap);
|
||||
|
||||
/* WARNING:
|
||||
* getpos may not return the desired postion because of the buffering
|
||||
*/
|
||||
int ase_sio_getpos (ase_sio_t* sio, ase_sio_off_t* pos);
|
||||
int ase_sio_setpos (ase_sio_t* sio, ase_sio_off_t pos);
|
||||
int ase_sio_rewind (ase_sio_t* sio);
|
||||
int ase_sio_movetoend (ase_sio_t* sio);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
582
qse/include/ase/cmn/sll.h
Normal file
582
qse/include/ase/cmn/sll.h
Normal file
@ -0,0 +1,582 @@
|
||||
/*
|
||||
* $Id: sll.h 223 2008-06-26 06:44:41Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_CMN_SLL_H_
|
||||
#define _ASE_CMN_SLL_H_
|
||||
|
||||
#include <ase/types.h>
|
||||
#include <ase/macros.h>
|
||||
|
||||
/****t* ase.cmn.sll/ase_sll_walk_t
|
||||
* NAME
|
||||
* ase_sll_walk_t - define return values for ase_sll_walker_t
|
||||
*
|
||||
* SEE ALSO
|
||||
* ase_sll_walk, ase_sll_walker_t
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
enum ase_sll_walk_t
|
||||
{
|
||||
ASE_SLL_WALK_STOP = 0,
|
||||
ASE_SLL_WALK_FORWARD = 1
|
||||
};
|
||||
/******/
|
||||
|
||||
typedef struct ase_sll_t ase_sll_t;
|
||||
typedef struct ase_sll_node_t ase_sll_node_t;
|
||||
typedef enum ase_sll_walk_t ase_sll_walk_t;
|
||||
|
||||
/****b* ase.cmn.sll/ase_sll_copier_t
|
||||
* NAME
|
||||
* ase_sll_copier_t - define a node contruction callback
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_sll_copier_t defines a callback function for node construction.
|
||||
* A node is contructed when a user adds data to a list. The user can
|
||||
* define how the data to add can be maintained in the list. A singly
|
||||
* linked list not specified with any copiers stores the data pointer and
|
||||
* the data length into a node. A special copier ASE_SLL_COPIER_INLINE copies
|
||||
* the contents of the data a user provided into the node. You can use the
|
||||
* ase_sll_setcopier() function to change the copier.
|
||||
*
|
||||
* A copier should return the pointer to the copied data. If it fails to copy
|
||||
* data, it may return ASE_NULL. You need to set a proper freeer to free up
|
||||
* memory allocated for copy.
|
||||
*
|
||||
* SEE ALSO
|
||||
* ase_sll_setcopier, ase_sll_getcopier, ASE_SLL_COPIER
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
typedef void* (*ase_sll_copier_t) (
|
||||
ase_sll_t* sll /* a map */,
|
||||
void* dptr /* the pointer to data to copy */,
|
||||
ase_size_t dlen /* the length of data to copy */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****b* ase.cmn.sll/ase_sll_freeer_t
|
||||
* NAME
|
||||
* ase_sll_freeer_t - define a node destruction callback
|
||||
* SYNOPSIS
|
||||
*/
|
||||
typedef void (*ase_sll_freeer_t) (
|
||||
ase_sll_t* sll /* a map */,
|
||||
void* dptr /* the pointer to data to free */,
|
||||
ase_size_t dlen /* the length of data to free */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****t* ase.cmn.sll/ase_sll_comper_t
|
||||
* NAME
|
||||
* ase_sll_comper_t - define a data comparator
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_sll_comper_t type defines a key comparator that is called when
|
||||
* the list needs to compare data. A singly linked list is created with a
|
||||
* default comparator that performs bitwise comparison.
|
||||
*
|
||||
* The comparator should return 0 if the data are the same and a non-zero
|
||||
* integer otherwise.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
typedef int (*ase_sll_comper_t) (
|
||||
ase_sll_t* sll /* a singly linked list */,
|
||||
const void* dptr1 /* a data pointer */,
|
||||
ase_size_t dlen1 /* a data length */,
|
||||
const void* dptr2 /* a data pointer */,
|
||||
ase_size_t dlen2 /* a data length */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****b* ase.cmn.sll/ase_sll_walker_t
|
||||
* NAME
|
||||
* ase_sll_walker_t - define a list traversal callback for each node
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_sll_walk() calls a callback function of the type ase_sll_walker_t
|
||||
* for each node until it returns ASE_SLL_WALK_STOP. The walker should return
|
||||
* ASE_SLL_WALK_FORWARD to let ase_sll_walk() continue visiting the next node.
|
||||
* The third parameter to ase_sll_walk() is passed to the walker as the third
|
||||
* parameter.
|
||||
*
|
||||
* SEE ALSO
|
||||
* ase_sll_walk, ase_sll_walk_t
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
typedef ase_sll_walk_t (*ase_sll_walker_t) (
|
||||
ase_sll_t* sll /* a map */,
|
||||
ase_sll_node_t* node /* a visited node */,
|
||||
void* arg /* user-defined data */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****s* ase.cmn.sll/ase_sll_t
|
||||
* NAME
|
||||
* ase_sll_t - define a singly linked list
|
||||
*
|
||||
* DESCRPTION
|
||||
* The ase_sll_t type defines a singly lnked list.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
struct ase_sll_t
|
||||
{
|
||||
ase_mmgr_t* mmgr; /* memory manager */
|
||||
|
||||
ase_sll_copier_t copier; /* data copier */
|
||||
ase_sll_freeer_t freeer; /* data freeer */
|
||||
ase_sll_comper_t comper; /* data comparator */
|
||||
ase_byte_t scale; /* scale factor */
|
||||
|
||||
ase_size_t size; /* the number of nodes */
|
||||
ase_sll_node_t* head; /* the head node */
|
||||
ase_sll_node_t* tail; /* the tail node */
|
||||
};
|
||||
/******/
|
||||
|
||||
/****s* ase.cmn.sll/ase_sll_node_t
|
||||
* NAME
|
||||
* ase_sll_node_t - define a list node
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_sll_node_t type defines a list node containing a data pointer and
|
||||
* and data length.
|
||||
*
|
||||
* SEE ALSO
|
||||
* ASE_SLL_DPTR, ASE_SLL_DLEN, ASE_SLL_NEXT
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
struct ase_sll_node_t
|
||||
{
|
||||
void* dptr; /* the pointer to data */
|
||||
ase_size_t dlen; /* the length of data */
|
||||
ase_sll_node_t* next; /* the pointer to the next node */
|
||||
};
|
||||
/******/
|
||||
|
||||
#define ASE_SLL_COPIER_SIMPLE ((ase_sll_copier_t)1)
|
||||
#define ASE_SLL_COPIER_INLINE ((ase_sll_copier_t)2)
|
||||
|
||||
#define ASE_SLL_MMGR(sll) ((sll)->mmgr)
|
||||
#define ASE_SLL_XTN(s) ((void*)(((ase_sll_t*)s) + 1))
|
||||
#define ASE_SLL_COPIER(sll) ((sll)->copier)
|
||||
#define ASE_SLL_FREEER(sll) ((sll)->freeer)
|
||||
#define ASE_SLL_COMPER(sll) ((sll)->comper)
|
||||
|
||||
#define ASE_SLL_HEAD(sll) ((sll)->head)
|
||||
#define ASE_SLL_TAIL(sll) ((sll)->tail)
|
||||
#define ASE_SLL_SIZE(sll) ((sll)->size)
|
||||
#define ASE_SLL_SCALE(sll) ((sll)->scale)
|
||||
|
||||
#define ASE_SLL_DPTR(node) ((node)->dptr)
|
||||
#define ASE_SLL_DLEN(node) ((node)->dlen)
|
||||
#define ASE_SLL_NEXT(node) ((node)->next)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_open
|
||||
* NAME
|
||||
* ase_sll_open - create a singly linked list with extension area
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_sll_open() function creates an empty singly linked list.
|
||||
* If the memory manager mmgr is ASE_NULL, the function gets the default
|
||||
* memory manager with ASE_MMGR_GETMMGR() and uses it if it is not ASE_NULL.
|
||||
* The extension area is allocated when the positive extension size extension
|
||||
* is specified. It calls the extension initialization function initializer
|
||||
* after initializing the main area. The extension initializer is passed
|
||||
* the pointer to the singly linked list created.
|
||||
*
|
||||
* RETURN
|
||||
* The ase_sll_open() function returns the pointer to a new singly linked
|
||||
* list on success and ASE_NULL on failure.
|
||||
*
|
||||
* NOTES
|
||||
* In the debug build, it fails an assertion if ASE_MMGR_GETMMGR() returns
|
||||
* ASE_NULL when ASE_NULL is passed as the first parameter. In the release
|
||||
* build, it returns ASE_NULL if such a thing happens.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_sll_t* ase_sll_open (
|
||||
ase_mmgr_t* mmgr /* memory manager */ ,
|
||||
ase_size_t ext /* size of extension area in bytes */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_close
|
||||
* NAME
|
||||
* ase_sll_close - destroy a singly linked list
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_sll_close() function destroys a singly linked list freeing up
|
||||
* the memory.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_sll_close (
|
||||
ase_sll_t* sll /* a singly linked list */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_init
|
||||
* NAME
|
||||
* ase_sll_init - initialize a singly linked list
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_sll_init() function initializes a singly linked list. The memory
|
||||
* should be allocated by a caller and be passed to it. The caller may declare
|
||||
* a static variable of the ase_sll_t type and pass its address. A memory
|
||||
* manager still needs to be passed for node manipulation later.
|
||||
*
|
||||
* RETURN
|
||||
* The ase_sll_init() function returns the first parameter on success and
|
||||
* ASE_NULL on failure.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_sll_t* ase_sll_init (
|
||||
ase_sll_t* sll /* an uninitialized singly linked list */,
|
||||
ase_mmgr_t* mmgr /* a memory manager */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_fini
|
||||
* NAME
|
||||
* ase_sll_init - deinitialize a singly linked list
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_sll_fini (
|
||||
ase_sll_t* sll /* a singly linked list */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_getxtn
|
||||
* NAME
|
||||
* ase_sll_getxtn - get the pointer to the extension
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_sll_getxtn() function returns the pointer to the extension.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void* ase_sll_getxtn (
|
||||
ase_sll_t* sll /* a singly linked list */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_getmmgr
|
||||
* NAME
|
||||
* ase_sll_getmmgr - get the memory manager
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_mmgr_t* ase_sll_getmmgr (
|
||||
ase_sll_t* sll /* a singly linked list */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_setmmgr
|
||||
* NAME
|
||||
* ase_sll_setmmgr - set the memory manager
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_sll_setmmgr (
|
||||
ase_sll_t* sll /* a singly linked list */,
|
||||
ase_mmgr_t* mmgr /* a memory manager */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_getsize
|
||||
* NAME
|
||||
* ase_sll_getsize - get the number of nodes
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_sll_getsize() function returns the number of the data nodes held
|
||||
* in a singly linked list.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_size_t ase_sll_getsize (
|
||||
ase_sll_t* sll /* a singly linked list */
|
||||
);
|
||||
/******/
|
||||
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_getscale
|
||||
* NAME
|
||||
* ase_sll_getscale - get the scale factor
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
int ase_sll_getscale (
|
||||
ase_sll_t* sll /* a singly linked list */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_setscale
|
||||
* NAME
|
||||
* ase_sll_setscale - set the scale factor
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_sll_setscale() function sets the scale factor of the data length.
|
||||
* A scale factor determines the actual length of data in bytes. A singly
|
||||
* linked list created with a scale factor of 1. The scale factor should be
|
||||
* larger than 0 and less than 256.
|
||||
*
|
||||
* NOTES
|
||||
* It is a bad idea to change the scale factor when a sll is not empty.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_sll_setscale (
|
||||
ase_sll_t* sll /* a singly linked list */,
|
||||
int scale /* a scale factor */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_getcopier
|
||||
* NAME
|
||||
* ase_sll_getfreeer - get the data copier
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_sll_copier_t ase_sll_getcopier (
|
||||
ase_sll_t* sll /* a singly linked list */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_setcopier
|
||||
* NAME
|
||||
* ase_sll_setcopier - set a data copier
|
||||
*
|
||||
* DESCRIPTION
|
||||
* A special copier ASE_SLL_COPIER_INLINE is provided. This copier enables
|
||||
* you to copy the data inline to the internal node. No freeer is invoked
|
||||
* when the node is freeed.
|
||||
*
|
||||
* You may set the copier to ASE_NULL to perform no special operation
|
||||
* when the data pointer is rememebered.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_sll_setcopier (
|
||||
ase_sll_t* sll /* a singly linked list */,
|
||||
ase_sll_copier_t copier /* a data copier */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_getfreeer
|
||||
* NAME
|
||||
* ase_sll_getfreeer - get the data freeer
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_sll_freeer_t ase_sll_getfreeer (
|
||||
ase_sll_t* sll /* a singly linked list */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_setfreeer
|
||||
* NAME
|
||||
* ase_sll_setfreeer - set a data freeer
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The freeer is called when a node containing the element is destroyed.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_sll_setfreeer (
|
||||
ase_sll_t* sll /* a singly linked list */,
|
||||
ase_sll_freeer_t freeer /* a data freeer */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_getcomper
|
||||
* NAME
|
||||
* ase_sll_getcomper - get the data comparator
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_sll_comper_t ase_sll_getcomper (
|
||||
ase_sll_t* sll /* a singly linked list */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_setcomper
|
||||
* NAME
|
||||
* ase_sll_setcomper - set the data comparator
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_sll_setcomper (
|
||||
ase_sll_t* sll /* a singly linked list */,
|
||||
ase_sll_comper_t comper /* a comparator */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_gethead
|
||||
* NAME
|
||||
* ase_sll_gethead - get the head node
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_sll_node_t* ase_sll_gethead (
|
||||
ase_sll_t* sll /* a singly linked list */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_gettail
|
||||
* NAME
|
||||
* ase_sll_gettail - get the tail node
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_sll_node_t* ase_sll_gettail (
|
||||
ase_sll_t* sll /* a singly linked list */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_search
|
||||
* NAME
|
||||
* ase_sll_search - find a node
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_sll_search() function traverses a list to find a node containing
|
||||
* the same value as the the data pointer and length. The traversal begins
|
||||
* from the next node of the positional node. If the positional node is
|
||||
* ASE_NULL, the traversal begins from the head node.
|
||||
*
|
||||
* RETURN
|
||||
* The pointer to the node found. Otherwise, ASE_NULL.
|
||||
*
|
||||
* NOTES
|
||||
* No reverse search is provided because a reverse traversal can not be
|
||||
* achieved efficiently.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_sll_node_t* ase_sll_search (
|
||||
ase_sll_t* sll /* a singly linked list */,
|
||||
ase_sll_node_t* pos /* a positional node */,
|
||||
const void* dptr /* a data pointer */,
|
||||
ase_size_t dlen /* a data length */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_insert
|
||||
* NAME
|
||||
* ase_sll_insert - insert data to a new node
|
||||
*
|
||||
* DESCRIPTION
|
||||
* There is performance penalty unless the positional node is neither
|
||||
* the head node nor ASE_NULL. You should consider a different data
|
||||
* structure such as a doubly linked list if you need to insert data
|
||||
* into a random position.
|
||||
*
|
||||
* RETURN
|
||||
* The pointer to a new node on success and ASE_NULL on failure:w
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_sll_node_t* ase_sll_insert (
|
||||
ase_sll_t* sll /* a singly linked list */,
|
||||
ase_sll_node_t* pos /* a node before which a new node is inserted */,
|
||||
void* dptr /* the pointer to the data */,
|
||||
ase_size_t dlen /* the length of the data */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_delete
|
||||
* NAME
|
||||
* ase_sll_delete - delete a node
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_sll_delete() function deletes a node.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_sll_delete (
|
||||
ase_sll_t* sll /* a singly linked list */,
|
||||
ase_sll_node_t* pos /* a node to delete */
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_clear
|
||||
* NAME
|
||||
* ase_sll_clear - delete all nodes
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_sll_clear() function empties a singly linked list by deletinng
|
||||
* all the nodes.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_sll_clear (
|
||||
ase_sll_t* sll /* a singly linked list */
|
||||
);
|
||||
/******/
|
||||
|
||||
ase_sll_node_t* ase_sll_pushhead (
|
||||
ase_sll_t* sll /* a singly linked list */,
|
||||
void* dptr,
|
||||
ase_size_t dlen
|
||||
);
|
||||
|
||||
ase_sll_node_t* ase_sll_pushtail (
|
||||
ase_sll_t* sll /* a singly linked list */,
|
||||
void* dptr,
|
||||
ase_size_t dlen
|
||||
);
|
||||
|
||||
|
||||
void ase_sll_pophead (
|
||||
ase_sll_t* sll
|
||||
);
|
||||
|
||||
void ase_sll_poptail (
|
||||
ase_sll_t* sll
|
||||
);
|
||||
|
||||
/****f* ase.cmn.sll/ase_sll_walk
|
||||
* NAME
|
||||
* ase_sll_walk - traverse s singly linked list
|
||||
*
|
||||
* DESCRIPTION
|
||||
* A singly linked list allows uni-directional in-order traversal.
|
||||
* The ase_sll_walk() function traverses a singly linkked list from its
|
||||
* head node down to its tail node as long as the walker function returns
|
||||
* ASE_SLL_WALK_FORWARD. A walker can return ASE_SLL_WALK_STOP to cause
|
||||
* immediate stop of traversal.
|
||||
*
|
||||
* For each node, the walker function is called and it is passed three
|
||||
* parameters: the singly linked list, the visiting node, and the
|
||||
* user-defined data passed as the third parameter in a call to the
|
||||
* ase_sll_walk() function.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_sll_walk (
|
||||
ase_sll_t* sll /* a singly linked list */,
|
||||
ase_sll_walker_t walker /* a user-defined walker function */,
|
||||
void* arg /* the pointer to user-defined data */
|
||||
);
|
||||
/******/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
476
qse/include/ase/cmn/str.h
Normal file
476
qse/include/ase/cmn/str.h
Normal file
@ -0,0 +1,476 @@
|
||||
/*
|
||||
* $Id: str.h 496 2008-12-15 09:56:48Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_CMN_STR_H_
|
||||
#define _ASE_CMN_STR_H_
|
||||
|
||||
#include <ase/types.h>
|
||||
#include <ase/macros.h>
|
||||
|
||||
/****o* ase.cmn.str/string
|
||||
* DESCRIPTION
|
||||
* <ase/cmn/str.h> defines various functions, types, macros to manipulate
|
||||
* strings.
|
||||
*
|
||||
* The ase_cstr_t type and the ase_xstr_t defined in ase/types.h helps you
|
||||
* dealing with a string pointer and length.
|
||||
*
|
||||
* #include <ase/cmn/str.h>
|
||||
*
|
||||
* EXAMPLES
|
||||
* void f (void)
|
||||
* {
|
||||
* }
|
||||
******
|
||||
*/
|
||||
|
||||
|
||||
#define ASE_STR_LEN(s) ((s)->len)
|
||||
#define ASE_STR_PTR(s) ((s)->ptr)
|
||||
#define ASE_STR_CAPA(s) ((s)->capa)
|
||||
#define ASE_STR_CHAR(s,idx) ((s)->ptr[idx])
|
||||
|
||||
#define ASE_STR_MMGR(s) ((s)->mmgr)
|
||||
#define ASE_STR_XTN(s) ((void*)(((ase_str_t*)s) + 1))
|
||||
#define ASE_STR_SIZER(s) ((s)->sizer)
|
||||
|
||||
typedef struct ase_str_t ase_str_t;
|
||||
typedef ase_size_t (*ase_str_sizer_t) (ase_str_t* data, ase_size_t hint);
|
||||
|
||||
struct ase_str_t
|
||||
{
|
||||
ase_mmgr_t* mmgr;
|
||||
ase_str_sizer_t sizer;
|
||||
|
||||
ase_char_t* ptr;
|
||||
ase_size_t len;
|
||||
ase_size_t capa;
|
||||
};
|
||||
|
||||
/* int ase_chartonum (ase_char_t c, int base) */
|
||||
#define ASE_CHARTONUM(c,base) \
|
||||
((c>=ASE_T('0') && c<=ASE_T('9'))? ((c-ASE_T('0')<base)? (c-ASE_T('0')): base): \
|
||||
(c>=ASE_T('A') && c<=ASE_T('Z'))? ((c-ASE_T('A')+10<base)? (c-ASE_T('A')+10): base): \
|
||||
(c>=ASE_T('a') && c<=ASE_T('z'))? ((c-ASE_T('a')+10<base)? (c-ASE_T('a')+10): base): base)
|
||||
|
||||
/* ase_strtonum (const ase_char_t* nptr, ase_char_t** endptr, int base) */
|
||||
#define ASE_STRTONUM(value,nptr,endptr,base) \
|
||||
{ \
|
||||
int __ston_f = 0, __ston_v; \
|
||||
const ase_char_t* __ston_ptr = nptr; \
|
||||
for (;;) { \
|
||||
ase_char_t __ston_c = *__ston_ptr; \
|
||||
if (__ston_c == ASE_T(' ') || \
|
||||
__ston_c == ASE_T('\t')) { __ston_ptr++; continue; } \
|
||||
if (__ston_c == ASE_T('-')) { __ston_f++; __ston_ptr++; } \
|
||||
if (__ston_c == ASE_T('+')) { __ston_ptr++; } \
|
||||
break; \
|
||||
} \
|
||||
for (value = 0; (__ston_v = ASE_CHARTONUM(*__ston_ptr, base)) < base; __ston_ptr++) { \
|
||||
value = value * base + __ston_v; \
|
||||
} \
|
||||
if (endptr != ASE_NULL) *((const ase_char_t**)endptr) = __ston_ptr; \
|
||||
if (__ston_f > 0) value *= -1; \
|
||||
}
|
||||
|
||||
/* ase_strxtonum (const ase_char_t* nptr, ase_size_t len, ase_char_char** endptr, int base) */
|
||||
#define ASE_STRXTONUM(value,nptr,len,endptr,base) \
|
||||
{ \
|
||||
int __ston_f = 0, __ston_v; \
|
||||
const ase_char_t* __ston_ptr = nptr; \
|
||||
const ase_char_t* __ston_end = __ston_ptr + len; \
|
||||
value = 0; \
|
||||
while (__ston_ptr < __ston_end) { \
|
||||
ase_char_t __ston_c = *__ston_ptr; \
|
||||
if (__ston_c == ASE_T(' ') || __ston_c == ASE_T('\t')) { \
|
||||
__ston_ptr++; continue; \
|
||||
} \
|
||||
if (__ston_c == ASE_T('-')) { __ston_f++; __ston_ptr++; } \
|
||||
if (__ston_c == ASE_T('+')) { __ston_ptr++; } \
|
||||
break; \
|
||||
} \
|
||||
for (value = 0; __ston_ptr < __ston_end && \
|
||||
(__ston_v = ASE_CHARTONUM(*__ston_ptr, base)) != base; __ston_ptr++) { \
|
||||
value = value * base + __ston_v; \
|
||||
} \
|
||||
if (endptr != ASE_NULL) *((const ase_char_t**)endptr) = __ston_ptr; \
|
||||
if (__ston_f > 0) value *= -1; \
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* basic string functions
|
||||
*/
|
||||
ase_size_t ase_strlen (const ase_char_t* str);
|
||||
ase_size_t ase_strbytes (const ase_char_t* str);
|
||||
|
||||
ase_size_t ase_strcpy (
|
||||
ase_char_t* buf, const ase_char_t* str);
|
||||
ase_size_t ase_strxcpy (
|
||||
ase_char_t* buf, ase_size_t bsz, const ase_char_t* str);
|
||||
ase_size_t ase_strncpy (
|
||||
ase_char_t* buf, const ase_char_t* str, ase_size_t len);
|
||||
ase_size_t ase_strxncpy (
|
||||
ase_char_t* buf, ase_size_t bsz, const ase_char_t* str, ase_size_t len);
|
||||
|
||||
ase_size_t ase_strxcat (
|
||||
ase_char_t* buf, ase_size_t bsz, const ase_char_t* str);
|
||||
ase_size_t ase_strxncat (
|
||||
ase_char_t* buf, ase_size_t bsz, const ase_char_t* str, ase_size_t len);
|
||||
|
||||
int ase_strcmp (const ase_char_t* s1, const ase_char_t* s2);
|
||||
int ase_strxcmp (const ase_char_t* s1, ase_size_t len1, const ase_char_t* s2);
|
||||
int ase_strxncmp (
|
||||
const ase_char_t* s1, ase_size_t len1,
|
||||
const ase_char_t* s2, ase_size_t len2);
|
||||
|
||||
int ase_strcasecmp (
|
||||
const ase_char_t* s1, const ase_char_t* s2, ase_ccls_t* ccls);
|
||||
|
||||
/****f* ase.cmn.str/ase_strxncasecmp
|
||||
* NAME
|
||||
* ase_strxncasecmp - compare strings ignoring case
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_strxncasecmp() function compares characters at the same position
|
||||
* in each string after converting them to the same case temporarily.
|
||||
* It accepts two strings and a character class handler. A string is
|
||||
* represented by its beginning pointer and length. You can write your own
|
||||
* character class handler or use ASE_CCLS_GETDFL() to get the default
|
||||
* character class handler.
|
||||
*
|
||||
* For two strings to be equal, they need to have the same length and all
|
||||
* characters in the first string should be equal to their counterpart in the
|
||||
* second string.
|
||||
*
|
||||
* RETURN
|
||||
* The ase_strxncasecmp() returns 0 if two strings are equal, a positive
|
||||
* number if the first string is larger, -1 if the second string is larger.
|
||||
*
|
||||
* EXAMPLES
|
||||
* ase_strxncasecmp (ASE_T("foo"), 3, ASE_T("FoO"), 3, ASE_CCLS_GETDFL());
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
int ase_strxncasecmp (
|
||||
const ase_char_t* s1 /* the pointer to the first string */,
|
||||
ase_size_t len1 /* the length of the first string */,
|
||||
const ase_char_t* s2 /* the pointer to the second string */,
|
||||
ase_size_t len2 /* the length of the second string */,
|
||||
ase_ccls_t* ccls /* character class handler */
|
||||
);
|
||||
/******/
|
||||
|
||||
ase_char_t* ase_strdup (const ase_char_t* str, ase_mmgr_t* mmgr);
|
||||
ase_char_t* ase_strxdup (
|
||||
const ase_char_t* str, ase_size_t len, ase_mmgr_t* mmgr);
|
||||
ase_char_t* ase_strxdup2 (
|
||||
const ase_char_t* str1, ase_size_t len1,
|
||||
const ase_char_t* str2, ase_size_t len2, ase_mmgr_t* mmgr);
|
||||
|
||||
ase_char_t* ase_strstr (const ase_char_t* str, const ase_char_t* sub);
|
||||
ase_char_t* ase_strxstr (
|
||||
const ase_char_t* str, ase_size_t size, const ase_char_t* sub);
|
||||
ase_char_t* ase_strxnstr (
|
||||
const ase_char_t* str, ase_size_t strsz,
|
||||
const ase_char_t* sub, ase_size_t subsz);
|
||||
|
||||
ase_char_t* ase_strchr (const ase_char_t* str, ase_cint_t c);
|
||||
ase_char_t* ase_strxchr (const ase_char_t* str, ase_size_t len, ase_cint_t c);
|
||||
ase_char_t* ase_strrchr (const ase_char_t* str, ase_cint_t c);
|
||||
ase_char_t* ase_strxrchr (const ase_char_t* str, ase_size_t len, ase_cint_t c);
|
||||
|
||||
/* Checks if a string begins with a substring */
|
||||
ase_char_t* ase_strbeg (const ase_char_t* str, const ase_char_t* sub);
|
||||
ase_char_t* ase_strxbeg (
|
||||
const ase_char_t* str, ase_size_t len, const ase_char_t* sub);
|
||||
ase_char_t* ase_strnbeg (
|
||||
const ase_char_t* str, const ase_char_t* sub, ase_size_t len);
|
||||
ase_char_t* ase_strxnbeg (
|
||||
const ase_char_t* str, ase_size_t len1,
|
||||
const ase_char_t* sub, ase_size_t len2);
|
||||
|
||||
/* Checks if a string ends with a substring */
|
||||
ase_char_t* ase_strend (const ase_char_t* str, const ase_char_t* sub);
|
||||
ase_char_t* ase_strxend (
|
||||
const ase_char_t* str, ase_size_t len, const ase_char_t* sub);
|
||||
ase_char_t* ase_strnend (
|
||||
const ase_char_t* str, const ase_char_t* sub, ase_size_t len);
|
||||
ase_char_t* ase_strxnend (
|
||||
const ase_char_t* str, ase_size_t len1,
|
||||
const ase_char_t* sub, ase_size_t len2);
|
||||
|
||||
/*
|
||||
* string conversion
|
||||
*/
|
||||
int ase_strtoi (const ase_char_t* str);
|
||||
long ase_strtol (const ase_char_t* str);
|
||||
unsigned int ase_strtoui (const ase_char_t* str);
|
||||
unsigned long ase_strtoul (const ase_char_t* str);
|
||||
|
||||
int ase_strxtoi (const ase_char_t* str, ase_size_t len);
|
||||
long ase_strxtol (const ase_char_t* str, ase_size_t len);
|
||||
unsigned int ase_strxtoui (const ase_char_t* str, ase_size_t len);
|
||||
unsigned long ase_strxtoul (const ase_char_t* str, ase_size_t len);
|
||||
|
||||
ase_int_t ase_strtoint (const ase_char_t* str);
|
||||
ase_long_t ase_strtolong (const ase_char_t* str);
|
||||
ase_uint_t ase_strtouint (const ase_char_t* str);
|
||||
ase_ulong_t ase_strtoulong (const ase_char_t* str);
|
||||
|
||||
ase_int_t ase_strxtoint (const ase_char_t* str, ase_size_t len);
|
||||
ase_long_t ase_strxtolong (const ase_char_t* str, ase_size_t len);
|
||||
ase_uint_t ase_strxtouint (const ase_char_t* str, ase_size_t len);
|
||||
ase_ulong_t ase_strxtoulong (const ase_char_t* str, ase_size_t len);
|
||||
|
||||
ase_str_t* ase_str_open (
|
||||
ase_mmgr_t* mmgr,
|
||||
ase_size_t ext,
|
||||
ase_size_t capa
|
||||
);
|
||||
|
||||
void ase_str_close (
|
||||
ase_str_t* str
|
||||
);
|
||||
|
||||
/*
|
||||
* If capa is 0, it doesn't allocate the buffer in advance.
|
||||
*/
|
||||
ase_str_t* ase_str_init (
|
||||
ase_str_t* str,
|
||||
ase_mmgr_t* mmgr,
|
||||
ase_size_t capa
|
||||
);
|
||||
|
||||
void ase_str_fini (
|
||||
ase_str_t* str
|
||||
);
|
||||
|
||||
/****f* ase.cmn.str/ase_str_yield
|
||||
* NAME
|
||||
* ase_str_yield - yield the buffer
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_str_yield() function assigns the buffer to an variable of the
|
||||
* ase_xstr_t type and recreate a new buffer of the new_capa capacity.
|
||||
* The function fails if it fails to allocate a new buffer.
|
||||
*
|
||||
* RETURN
|
||||
* The ase_str_yield() function returns 0 on success, and -1 on failure.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
int ase_str_yield (
|
||||
ase_str_t* str /* a dynamic string */,
|
||||
ase_xstr_t* buf /* the pointer to a ase_xstr_t variable */,
|
||||
int new_capa /* new capacity in number of characters */
|
||||
);
|
||||
/******/
|
||||
|
||||
void* ase_str_getxtn (
|
||||
ase_str_t* str
|
||||
);
|
||||
|
||||
ase_mmgr_t* ase_str_getmmgr (
|
||||
ase_str_t* str
|
||||
);
|
||||
|
||||
void ase_str_setmmgr (
|
||||
ase_str_t* str,
|
||||
ase_mmgr_t* mmgr
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME: get the sizer
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* The ase_str_getsizer() function returns the sizer specified.
|
||||
*
|
||||
* RETURNS: a sizer function set or ASE_NULL if no sizer is set.
|
||||
*/
|
||||
ase_str_sizer_t ase_str_getsizer (
|
||||
ase_str_t* str /* a dynamic string */
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME: specify a sizer
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* The ase_str_setsizer() function specify a new sizer for a dynamic string.
|
||||
* With no sizer specified, the dynamic string doubles the current buffer
|
||||
* when it needs to increase its size. The sizer function is passed a dynamic
|
||||
* string and the minimum capacity required to hold data after resizing.
|
||||
* The string is truncated if the sizer function returns a smaller number
|
||||
* than the hint passed.
|
||||
*/
|
||||
void ase_str_setsizer (
|
||||
ase_str_t* str /* a dynamic string */,
|
||||
ase_str_sizer_t sizer /* a sizer function */
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME: get capacity
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* The ase_str_getcapa() function returns the current capacity.
|
||||
* You may use ASE_STR_CAPA(str) macro for performance sake.
|
||||
*
|
||||
* RETURNS: the current capacity in number of characters.
|
||||
*/
|
||||
ase_size_t ase_str_getcapa (
|
||||
ase_str_t* str /* a dynamic string */
|
||||
);
|
||||
|
||||
/*
|
||||
* NAME: set new capacity
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* The ase_str_setcapa() function set new capacity. If the new capacity
|
||||
* is smaller than the old, the overflowing characters are removed from
|
||||
* from the buffer.
|
||||
*
|
||||
* RETURNS: -1 on failure, a new capacity on success
|
||||
*/
|
||||
ase_size_t ase_str_setcapa (
|
||||
ase_str_t* str /* a dynamic string */,
|
||||
ase_size_t capa /* a new capacity */
|
||||
);
|
||||
|
||||
void ase_str_clear (
|
||||
ase_str_t* str
|
||||
);
|
||||
|
||||
void ase_str_swap (
|
||||
ase_str_t* str,
|
||||
ase_str_t* str2
|
||||
);
|
||||
|
||||
ase_size_t ase_str_cpy (
|
||||
ase_str_t* str,
|
||||
const ase_char_t* s
|
||||
);
|
||||
|
||||
ase_size_t ase_str_ncpy (
|
||||
ase_str_t* str,
|
||||
const ase_char_t* s,
|
||||
ase_size_t len
|
||||
);
|
||||
|
||||
ase_size_t ase_str_cat (
|
||||
ase_str_t* str,
|
||||
const ase_char_t* s
|
||||
);
|
||||
|
||||
ase_size_t ase_str_ncat (
|
||||
ase_str_t* str,
|
||||
const ase_char_t* s,
|
||||
ase_size_t len
|
||||
);
|
||||
|
||||
ase_size_t ase_str_ccat (
|
||||
ase_str_t* str,
|
||||
ase_char_t c
|
||||
);
|
||||
|
||||
ase_size_t ase_str_nccat (
|
||||
ase_str_t* str,
|
||||
ase_char_t c,
|
||||
ase_size_t len
|
||||
);
|
||||
|
||||
|
||||
ase_size_t ase_mbstowcs (
|
||||
const ase_mchar_t* mbs,
|
||||
ase_wchar_t* wcs,
|
||||
ase_size_t* wcslen
|
||||
);
|
||||
|
||||
/****f* ase.cmn.str/ase_mbsntowcsn
|
||||
* NAME
|
||||
* ase_mbsntowcsn - convert a multibyte string to a wide character string
|
||||
*
|
||||
* RETURN
|
||||
* The ase_mbstowcs() function returns the number of bytes handled.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_size_t ase_mbsntowcsn (
|
||||
const ase_mchar_t* mbs,
|
||||
ase_size_t mbslen,
|
||||
ase_wchar_t* wcs,
|
||||
ase_size_t* wcslen
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.str/ase_wcstombs
|
||||
* NAME
|
||||
* ase_wcstombs - convert a wide character string to a multibyte string.
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_wcstombs() function converts a null-terminated wide character
|
||||
* string to a multibyte string and stores it into the buffer pointed to
|
||||
* by mbs. The pointer to a variable holding the buffer length should be
|
||||
* passed to the function as the third parameter. After conversion, it holds
|
||||
* the length of the multibyte string excluding the terminating-null.
|
||||
* It may not null-terminate the resulting multibyte string if the buffer
|
||||
* is not large enough.
|
||||
*
|
||||
* RETURN
|
||||
* The ase_wcstombs() function returns the number of wide characters handled.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_size_t ase_wcstombs (
|
||||
const ase_wchar_t* wcs,
|
||||
ase_mchar_t* mbs,
|
||||
ase_size_t* mbslen
|
||||
);
|
||||
|
||||
/****f* ase.cmn.str/ase_wcsntombsn
|
||||
* NAME
|
||||
* ase_wcstombs - convert a wide character string to a multibyte string
|
||||
*
|
||||
* RETURN
|
||||
* The ase_wcstombs() function returns the number of wide characters handled.
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_size_t ase_wcsntombsn (
|
||||
const ase_wchar_t* wcs,
|
||||
ase_size_t wcslen,
|
||||
ase_mchar_t* mbs,
|
||||
ase_size_t* mbslen
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn.str/ase_wcstombs_strict
|
||||
* NAME
|
||||
* ase_wcstombs_strict - convert a wide character string to a multibyte string.
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The ase_wcstombs_strict() function performs the same as the ase_wcsmbs()
|
||||
* function except that it returns an error if it can't fully convert the
|
||||
* input string and/or the buffer is not large enough.
|
||||
*
|
||||
* RETURN
|
||||
* The ase_wcstombs_strict() function returns 0 on success and -1 on failure.
|
||||
* SYNOPSIS
|
||||
*/
|
||||
int ase_wcstombs_strict (
|
||||
const ase_wchar_t* wcs,
|
||||
ase_mchar_t* mbs,
|
||||
ase_size_t mbslen
|
||||
);
|
||||
/******/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
134
qse/include/ase/cmn/time.h
Normal file
134
qse/include/ase/cmn/time.h
Normal file
@ -0,0 +1,134 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef _ASE_CMN_TIME_H_
|
||||
#define _ASE_CMN_TIME_H_
|
||||
|
||||
#include <ase/types.h>
|
||||
#include <ase/macros.h>
|
||||
|
||||
#define ASE_EPOCH_YEAR ((ase_ntime_t)1970)
|
||||
#define ASE_EPOCH_MON ((ase_ntime_t)1)
|
||||
#define ASE_EPOCH_DAY ((ase_ntime_t)1)
|
||||
#define ASE_EPOCH_WDAY ((ase_ntime_t)4)
|
||||
|
||||
#define ASE_DAY_IN_WEEK ((ase_ntime_t)7)
|
||||
#define ASE_MON_IN_YEAR ((ase_ntime_t)12)
|
||||
#define ASE_HOUR_IN_DAY ((ase_ntime_t)24)
|
||||
#define ASE_MIN_IN_HOUR ((ase_ntime_t)60)
|
||||
#define ASE_MIN_IN_DAY (ASE_MIN_IN_HOUR * ASE_HOUR_IN_DAY)
|
||||
#define ASE_SEC_IN_MIN ((ase_ntime_t)60)
|
||||
#define ASE_SEC_IN_HOUR (ASE_SEC_IN_MIN * ASE_MIN_IN_HOUR)
|
||||
#define ASE_SEC_IN_DAY (ASE_SEC_IN_MIN * ASE_MIN_IN_DAY)
|
||||
#define ASE_MSEC_IN_SEC ((ase_ntime_t)1000)
|
||||
#define ASE_MSEC_IN_MIN (ASE_MSEC_IN_SEC * ASE_SEC_IN_MIN)
|
||||
#define ASE_MSEC_IN_HOUR (ASE_MSEC_IN_SEC * ASE_SEC_IN_HOUR)
|
||||
#define ASE_MSEC_IN_DAY (ASE_MSEC_IN_SEC * ASE_SEC_IN_DAY)
|
||||
|
||||
#define ASE_USEC_IN_MSEC ((ase_ntime_t)1000)
|
||||
#define ASE_NSEC_IN_USEC ((ase_ntime_t)1000)
|
||||
#define ASE_USEC_IN_SEC ((ase_ntime_t)ASE_USEC_IN_MSEC * ASE_MSEC_IN_SEC)
|
||||
|
||||
#define ASE_IS_LEAPYEAR(year) (!((year)%4) && (((year)%100) || !((year)%400)))
|
||||
#define ASE_DAY_IN_YEAR(year) (ASE_IS_LEAPYEAR(year)? 366: 365)
|
||||
|
||||
/* number of milliseconds since the Epoch (00:00:00 UTC, Jan 1, 1970) */
|
||||
typedef ase_long_t ase_ntime_t;
|
||||
typedef struct ase_btime_t ase_btime_t;
|
||||
|
||||
struct ase_btime_t
|
||||
{
|
||||
int sec; /* 0-61 */
|
||||
int min; /* 0-59 */
|
||||
int hour; /* 0-23 */
|
||||
int mday; /* 1-31 */
|
||||
int mon; /* 0(jan)-11(dec) */
|
||||
int year; /* the number of years since 1900 */
|
||||
int wday; /* 0(sun)-6(sat) */
|
||||
int yday; /* 0(jan 1) to 365 */
|
||||
int isdst;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/****f* ase.cmn/ase_gettime
|
||||
* NAME
|
||||
* ase_gettime - get the current time
|
||||
*
|
||||
* SYNPOSIS
|
||||
*/
|
||||
int ase_gettime (
|
||||
ase_ntime_t* nt
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn/ase_settime
|
||||
* NAME
|
||||
* ase_settime - set the current time
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
int ase_settime (
|
||||
ase_ntime_t nt
|
||||
);
|
||||
/******/
|
||||
|
||||
|
||||
/****f* ase.cmn/ase_gmtime
|
||||
* NAME
|
||||
* ase_gmtime - convert numeric time to broken-down time
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
void ase_gmtime (
|
||||
ase_ntime_t nt,
|
||||
ase_btime_t* bt
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn/ase_localtime
|
||||
* NAME
|
||||
* ase_localtime - convert numeric time to broken-down time
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
int ase_localtime (
|
||||
ase_ntime_t nt,
|
||||
ase_btime_t* bt
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn/ase_mktime
|
||||
* NAME
|
||||
* ase_mktime - convert broken-down time to numeric time
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
int ase_mktime (
|
||||
const ase_btime_t* bt,
|
||||
ase_ntime_t* nt
|
||||
);
|
||||
/******/
|
||||
|
||||
/****f* ase.cmn/ase_strftime
|
||||
* NAME
|
||||
* ase_strftime - format time
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
ase_size_t ase_strftime (
|
||||
ase_char_t* buf,
|
||||
ase_size_t size,
|
||||
const ase_char_t* fmt,
|
||||
ase_btime_t* bt
|
||||
);
|
||||
/******/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
299
qse/include/ase/cmn/tio.h
Normal file
299
qse/include/ase/cmn/tio.h
Normal file
@ -0,0 +1,299 @@
|
||||
/*
|
||||
* $Id: tio.h,v 1.19 2006/01/01 13:50:24 bacon Exp $
|
||||
*/
|
||||
|
||||
#ifndef _ASE_CMN_TIO_H_
|
||||
#define _ASE_CMN_TIO_H_
|
||||
|
||||
#include <ase/types.h>
|
||||
#include <ase/macros.h>
|
||||
#include <ase/cmn/str.h>
|
||||
|
||||
enum
|
||||
{
|
||||
ASE_TIO_ENOERR = 0,
|
||||
ASE_TIO_ENOMEM, /* out of memory */
|
||||
ASE_TIO_ENOSPC, /* no more space */
|
||||
ASE_TIO_EILSEQ, /* illegal sequence */
|
||||
ASE_TIO_EICSEQ, /* incomplete sequence */
|
||||
ASE_TIO_EILCHR, /* illegal character */
|
||||
ASE_TIO_ENOINF, /* no input function attached */
|
||||
ASE_TIO_EINPUT, /* input function returned an error */
|
||||
ASE_TIO_EINPOP, /* input function failed to open */
|
||||
ASE_TIO_EINPCL, /* input function failed to close */
|
||||
ASE_TIO_ENOUTF, /* no output function attached */
|
||||
ASE_TIO_EOUTPT, /* output function returned an error */
|
||||
ASE_TIO_EOUTOP, /* output function failed to open */
|
||||
ASE_TIO_EOUTCL /* output function failed to close */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
/* the size of input buffer should be at least equal to or greater
|
||||
* than the maximum sequence length of the ase_mchar_t string.
|
||||
* (i.e. 6 for utf8)
|
||||
*/
|
||||
ASE_TIO_MAX_INBUF_LEN = 4096,
|
||||
ASE_TIO_MAX_OUTBUF_LEN = 4096
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
ASE_TIO_IO_OPEN,
|
||||
ASE_TIO_IO_CLOSE,
|
||||
ASE_TIO_IO_DATA
|
||||
};
|
||||
|
||||
|
||||
#define ASE_TIO_MMGR(tio) ((tio)->mmgr)
|
||||
#define ASE_TIO_XTN(s) ((void*)(((ase_tio_t*)s) + 1))
|
||||
#define ASE_TIO_ERRNUM(tio) ((tio)->errnum)
|
||||
|
||||
/*
|
||||
* TYPE: ase_tio_t
|
||||
* Defines the tio type
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* <ase_tio_t> defines a generic type for text-based IO. When ase_char_t is
|
||||
* ase_mchar_t, it handles any byte streams. When ase_char_t is ase_wchar_t,
|
||||
* it handles utf-8 byte streams.
|
||||
*/
|
||||
typedef struct ase_tio_t ase_tio_t;
|
||||
|
||||
/*
|
||||
* TYPE: ase_tio_io_t
|
||||
* Defines a user-defines IO handler
|
||||
*/
|
||||
typedef ase_ssize_t (*ase_tio_io_t) (
|
||||
int cmd, void* arg, void* data, ase_size_t size);
|
||||
|
||||
struct ase_tio_t
|
||||
{
|
||||
ase_mmgr_t* mmgr;
|
||||
int errnum;
|
||||
|
||||
/* io functions */
|
||||
ase_tio_io_t input_func;
|
||||
ase_tio_io_t output_func;
|
||||
void* input_arg;
|
||||
void* output_arg;
|
||||
|
||||
/* for housekeeping */
|
||||
int input_status;
|
||||
ase_size_t inbuf_curp;
|
||||
ase_size_t inbuf_len;
|
||||
ase_size_t outbuf_len;
|
||||
|
||||
ase_mchar_t inbuf[ASE_TIO_MAX_INBUF_LEN];
|
||||
ase_mchar_t outbuf[ASE_TIO_MAX_OUTBUF_LEN];
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* FUNCTION: ase_tio_open
|
||||
*/
|
||||
ase_tio_t* ase_tio_open (
|
||||
ase_mmgr_t* mmgr,
|
||||
ase_size_t ext
|
||||
);
|
||||
|
||||
/*
|
||||
* FUNCTION: ase_tio_close
|
||||
*/
|
||||
int ase_tio_close (
|
||||
ase_tio_t* tio
|
||||
);
|
||||
|
||||
ase_tio_t* ase_tio_init (
|
||||
ase_tio_t* tip,
|
||||
ase_mmgr_t* mmgr
|
||||
);
|
||||
|
||||
int ase_tio_fini (
|
||||
ase_tio_t* tio
|
||||
);
|
||||
|
||||
void* ase_tio_getxtn (
|
||||
ase_tio_t* tio
|
||||
);
|
||||
|
||||
ase_mmgr_t* ase_tio_getmmgr (
|
||||
ase_tio_t* tio
|
||||
);
|
||||
|
||||
void ase_tio_setmmgr (
|
||||
ase_tio_t* tio,
|
||||
ase_mmgr_t* mmgr
|
||||
);
|
||||
|
||||
/*
|
||||
* FUNCTION: ase_tio_geterrnum
|
||||
* Returns an error code
|
||||
*
|
||||
* PARAMETERS:
|
||||
* grep - a grep object
|
||||
*
|
||||
* RETURNS:
|
||||
* Error code set by the last tio function called
|
||||
*/
|
||||
int ase_tio_geterrnum (ase_tio_t* tio);
|
||||
|
||||
/*
|
||||
* FUNCTION: ase_tio_geterrstr
|
||||
* Translates an error code to a string
|
||||
*
|
||||
* PARAMETERS:
|
||||
* tio - a tio object
|
||||
*
|
||||
* RETURNS:
|
||||
* A pointer to a constant string describing the last error occurred
|
||||
*/
|
||||
const ase_char_t* ase_tio_geterrstr (ase_tio_t* tio);
|
||||
|
||||
/*
|
||||
* FUNCTION: ase_tio_attachin
|
||||
* Attaches an input handler function
|
||||
*
|
||||
* PARAMETERS:
|
||||
* tio - a tio object
|
||||
* input - input handler function
|
||||
* arg - user data to be passed to the input handler
|
||||
*
|
||||
* RETURNS:
|
||||
* 0 on success, -1 on failure
|
||||
*/
|
||||
int ase_tio_attachin (
|
||||
ase_tio_t* tio,
|
||||
ase_tio_io_t input,
|
||||
void* arg
|
||||
);
|
||||
|
||||
/*
|
||||
* FUNCTION: ase_tio_detachin
|
||||
* Detaches an input handler function
|
||||
*
|
||||
* PARAMETERS:
|
||||
* tio - a tio object
|
||||
*
|
||||
* RETURNS:
|
||||
* 0 on success, -1 on failure
|
||||
*/
|
||||
int ase_tio_detachin (
|
||||
ase_tio_t* tio
|
||||
);
|
||||
|
||||
/*
|
||||
* FUNCTION: ase_tio_attachout
|
||||
* Attaches an output handler function
|
||||
*
|
||||
* PARAMETERS:
|
||||
* tio - a tio object
|
||||
* output - output handler function
|
||||
* arg - user data to be passed to the output handler
|
||||
*
|
||||
* RETURNS:
|
||||
* 0 on success, -1 on failure
|
||||
*/
|
||||
int ase_tio_attachout (
|
||||
ase_tio_t* tio,
|
||||
ase_tio_io_t output,
|
||||
void* arg
|
||||
);
|
||||
|
||||
/*
|
||||
* FUNCTION: ase_tio_detachout
|
||||
* Detaches an output handler function
|
||||
*
|
||||
* PARAMETERS:
|
||||
* tio - a tio object
|
||||
*
|
||||
* RETURNS:
|
||||
* 0 on success, -1 on failure
|
||||
*/
|
||||
int ase_tio_detachout (
|
||||
ase_tio_t* tio
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* FUNCTION: ase_tio_flush
|
||||
* Flushes the output buffer
|
||||
*
|
||||
* PARAMETERS:
|
||||
* tio - a tio object
|
||||
*
|
||||
* RETURNS:
|
||||
* Number of bytes written on success, -1 on failure
|
||||
*/
|
||||
ase_ssize_t ase_tio_flush (ase_tio_t* tio);
|
||||
|
||||
/*
|
||||
* FUNCTION: ase_tio_purge
|
||||
* Erases all input and output buffered
|
||||
*
|
||||
* PARAMETERS:
|
||||
* tio - a tio object
|
||||
*
|
||||
*/
|
||||
void ase_tio_purge (ase_tio_t* tio);
|
||||
|
||||
/*
|
||||
* FUNCTION: ase_tio_getc
|
||||
* Reads a single character
|
||||
*/
|
||||
ase_ssize_t ase_tio_getc (ase_tio_t* tio, ase_char_t* c);
|
||||
|
||||
/*
|
||||
* FUNCTION: ase_tio_gets
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* <ase_tio_gets> inserts a terminating null if there is a room
|
||||
*/
|
||||
ase_ssize_t ase_tio_gets (ase_tio_t* tio, ase_char_t* buf, ase_size_t size);
|
||||
|
||||
/*
|
||||
* FUNCTION: ase_tio_getsx
|
||||
*
|
||||
* DESCRIPTION:
|
||||
* <ase_tio_getsx> doesn't insert a terminating null character
|
||||
*/
|
||||
ase_ssize_t ase_tio_getsx (ase_tio_t* tio, ase_char_t* buf, ase_size_t size);
|
||||
|
||||
/*
|
||||
* FUNCTION: ase_tio_getstr
|
||||
*/
|
||||
ase_ssize_t ase_tio_getstr (ase_tio_t* tio, ase_str_t* buf);
|
||||
|
||||
/*
|
||||
* FUNCTION: ase_tio_putc
|
||||
*/
|
||||
ase_ssize_t ase_tio_putc (ase_tio_t* tio, ase_char_t c);
|
||||
|
||||
/*
|
||||
* FUNCTION: ase_tio_puts
|
||||
*/
|
||||
ase_ssize_t ase_tio_puts (ase_tio_t* tio, const ase_char_t* str);
|
||||
|
||||
/*
|
||||
* FUNCTION: ase_tio_putsx
|
||||
*/
|
||||
ase_ssize_t ase_tio_putsx (ase_tio_t* tio, const ase_char_t* str, ase_size_t size);
|
||||
|
||||
/*
|
||||
* FUNCTION: ase_tio_putsn
|
||||
*/
|
||||
ase_ssize_t ase_tio_putsn (ase_tio_t* tio, ...);
|
||||
|
||||
/*
|
||||
* FUNCTION: ase_tio_putsxn
|
||||
*/
|
||||
ase_ssize_t ase_tio_putsxn (ase_tio_t* tio, ...);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
64
qse/include/ase/conf_msw.h
Normal file
64
qse/include/ase/conf_msw.h
Normal file
@ -0,0 +1,64 @@
|
||||
/*
|
||||
* $Id: conf_msw.h 225 2008-06-26 06:48:38Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
/*
|
||||
Macro Meaning
|
||||
_WIN64 A 64-bit platform.
|
||||
_WIN32 A 32-bit platform. This value is also defined by the 64-bit
|
||||
compiler for backward compatibility.
|
||||
_WIN16 A 16-bit platform
|
||||
|
||||
The following macros are specific to the architecture.
|
||||
|
||||
Macro Meaning
|
||||
_M_IA64 Intel Itanium Processor Family
|
||||
_M_IX86 x86 platform
|
||||
_M_X64 x64 platform
|
||||
*/
|
||||
|
||||
#define ASE_ENDIAN_LITTLE
|
||||
|
||||
#define ASE_SIZEOF_CHAR 1
|
||||
#define ASE_SIZEOF_SHORT 2
|
||||
#define ASE_SIZEOF_INT 4
|
||||
|
||||
/*#ifdef _WIN64
|
||||
#define ASE_SIZEOF_LONG 8
|
||||
#else*/
|
||||
#define ASE_SIZEOF_LONG 4
|
||||
/*#endif*/
|
||||
|
||||
#if defined(__POCC__) || defined(__DMC__)
|
||||
/* pelles c with no microsoft extension */
|
||||
#define ASE_SIZEOF_LONG_LONG 8
|
||||
|
||||
#define ASE_SIZEOF___INT8 0
|
||||
#define ASE_SIZEOF___INT16 0
|
||||
#define ASE_SIZEOF___INT32 0
|
||||
#define ASE_SIZEOF___INT64 0
|
||||
#define ASE_SIZEOF___INT96 0
|
||||
#define ASE_SIZEOF___INT128 0
|
||||
#else
|
||||
#define ASE_SIZEOF_LONG_LONG 0
|
||||
|
||||
#define ASE_SIZEOF___INT8 1
|
||||
#define ASE_SIZEOF___INT16 2
|
||||
#define ASE_SIZEOF___INT32 4
|
||||
#define ASE_SIZEOF___INT64 8
|
||||
#define ASE_SIZEOF___INT96 0
|
||||
#define ASE_SIZEOF___INT128 0
|
||||
#endif
|
||||
|
||||
#ifdef _WIN64
|
||||
#define ASE_SIZEOF_VOID_P 8
|
||||
#else
|
||||
#define ASE_SIZEOF_VOID_P 4
|
||||
#endif
|
||||
|
||||
#define ASE_SIZEOF_FLOAT 4
|
||||
#define ASE_SIZEOF_DOUBLE 8
|
||||
#define ASE_SIZEOF_LONG_DOUBLE 16
|
||||
#define ASE_SIZEOF_WCHAR_T 2
|
90
qse/include/ase/conf_vms.h
Normal file
90
qse/include/ase/conf_vms.h
Normal file
@ -0,0 +1,90 @@
|
||||
/*
|
||||
* $Id: conf_vms.h 225 2008-06-26 06:48:38Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
/* all of vax, alpha, ia64 are in the little endian. */
|
||||
#define ASE_ENDIAN_LITTLE
|
||||
|
||||
/*
|
||||
* Refer to the chapter 3 of the following URL for the data sizes.
|
||||
* http://h71000.www7.hp.com/commercial/c/docs/6180profile.html
|
||||
*/
|
||||
|
||||
#define ASE_SIZEOF_CHAR 1
|
||||
#define ASE_SIZEOF_SHORT 2
|
||||
#define ASE_SIZEOF_INT 4
|
||||
#define ASE_SIZEOF_LONG 4
|
||||
|
||||
#if defined(vax) || defined(__vax)
|
||||
#define ASE_SIZEOF_LONG_LONG 0
|
||||
#elif defined(alpha) || defined(__alpha)
|
||||
#define ASE_SIZEOF_LONG_LONG 8
|
||||
#elif defined(ia64) || defined(__ia64)
|
||||
#define ASE_SIZEOF_LONG_LONG 8
|
||||
#else
|
||||
#define ASE_SIZEOF_LONG_LONG 0
|
||||
#endif
|
||||
|
||||
#define ASE_SIZEOF___INT8 1
|
||||
#define ASE_SIZEOF___INT16 2
|
||||
#define ASE_SIZEOF___INT32 4
|
||||
|
||||
#if defined(vax) || defined(__vax)
|
||||
#define ASE_SIZEOF___INT64 0
|
||||
#elif defined(alpha) || defined(__alpha)
|
||||
#define ASE_SIZEOF___INT64 8
|
||||
#elif defined(ia64) || defined(__ia64)
|
||||
#define ASE_SIZEOF___INT64 8
|
||||
#else
|
||||
#define ASE_SIZEOF___INT64 0
|
||||
#endif
|
||||
|
||||
#define ASE_SIZEOF___INT96 0
|
||||
#define ASE_SIZEOF___INT128 0
|
||||
|
||||
#if defined(vax) || defined(__vax)
|
||||
#define ASE_SIZEOF_VOID_P 4
|
||||
#elif defined(alpha) || defined(__alpha)
|
||||
#if __INITIAL_POINTER_SIZE==64
|
||||
#pragma pointer_size 64
|
||||
#define ASE_SIZEOF_VOID_P 8
|
||||
#elif __INITIAL_POINTER_SIZE==32
|
||||
#pragma pointer_size 32
|
||||
#define ASE_SIZEOF_VOID_P 4
|
||||
#elif __INITIAL_POINTER_SIZE==0
|
||||
#define ASE_SIZEOF_VOID_P 4
|
||||
#else
|
||||
#error "unsupported initial pointer size"
|
||||
#endif
|
||||
#elif defined(ia64) || defined(__ia64)
|
||||
#if __INITIAL_POINTER_SIZE==64
|
||||
#pragma pointer_size 64
|
||||
#define ASE_SIZEOF_VOID_P 8
|
||||
#elif __INITIAL_POINTER_SIZE==32
|
||||
#pragma pointer_size 32
|
||||
#define ASE_SIZEOF_VOID_P 4
|
||||
#elif __INITIAL_POINTER_SIZE==0
|
||||
#define ASE_SIZEOF_VOID_P 4
|
||||
#else
|
||||
#error "unsupported initial pointer size"
|
||||
#endif
|
||||
#else
|
||||
#error "unsupported architecture"
|
||||
#endif
|
||||
|
||||
#define ASE_SIZEOF_FLOAT 4
|
||||
#define ASE_SIZEOF_DOUBLE 8
|
||||
|
||||
#if defined(vax) || defined(__vax)
|
||||
#define ASE_SIZEOF_LONG_DOUBLE 8
|
||||
#elif defined(alpha) || defined(__alpha)
|
||||
#define ASE_SIZEOF_LONG_DOUBLE 16
|
||||
#elif defined(ia64) || defined(__ia64)
|
||||
#define ASE_SIZEOF_LONG_DOUBLE 16
|
||||
#else
|
||||
#define ASE_SIZEOF_LONG_DOUBLE 0
|
||||
#endif
|
||||
|
||||
#define ASE_SIZEOF_WCHAR_T 4
|
310
qse/include/ase/config.h.in
Normal file
310
qse/include/ase/config.h.in
Normal file
@ -0,0 +1,310 @@
|
||||
/* include/ase/config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* author's email address */
|
||||
#undef ASE_AUTHOR
|
||||
|
||||
/* char is mchar */
|
||||
#undef ASE_CHAR_IS_MCHAR
|
||||
|
||||
/* char is wchar */
|
||||
#undef ASE_CHAR_IS_WCHAR
|
||||
|
||||
/* Big Endian */
|
||||
#undef ASE_ENDIAN_BIG
|
||||
|
||||
/* Little Endian */
|
||||
#undef ASE_ENDIAN_LITTLE
|
||||
|
||||
/* Unknown Endian */
|
||||
#undef ASE_ENDIAN_UNKNOWN
|
||||
|
||||
/* sizeof(char) */
|
||||
#undef ASE_SIZEOF_CHAR
|
||||
|
||||
/* sizeof(double) */
|
||||
#undef ASE_SIZEOF_DOUBLE
|
||||
|
||||
/* sizeof(float) */
|
||||
#undef ASE_SIZEOF_FLOAT
|
||||
|
||||
/* sizeof(int) */
|
||||
#undef ASE_SIZEOF_INT
|
||||
|
||||
/* sizeof(long) */
|
||||
#undef ASE_SIZEOF_LONG
|
||||
|
||||
/* sizeof(long double) */
|
||||
#undef ASE_SIZEOF_LONG_DOUBLE
|
||||
|
||||
/* sizeof(long long) */
|
||||
#undef ASE_SIZEOF_LONG_LONG
|
||||
|
||||
/* sizeof(short) */
|
||||
#undef ASE_SIZEOF_SHORT
|
||||
|
||||
/* sizeof(void*) */
|
||||
#undef ASE_SIZEOF_VOID_P
|
||||
|
||||
/* sizeof(wchar_t) */
|
||||
#undef ASE_SIZEOF_WCHAR_T
|
||||
|
||||
/* sizeof(__int128) */
|
||||
#undef ASE_SIZEOF___INT128
|
||||
|
||||
/* sizeof(__int16) */
|
||||
#undef ASE_SIZEOF___INT16
|
||||
|
||||
/* sizeof(__int32) */
|
||||
#undef ASE_SIZEOF___INT32
|
||||
|
||||
/* sizeof(__int64) */
|
||||
#undef ASE_SIZEOF___INT64
|
||||
|
||||
/* sizeof(__int8) */
|
||||
#undef ASE_SIZEOF___INT8
|
||||
|
||||
/* use the syscall() function */
|
||||
#undef ASE_USE_SYSCALL
|
||||
|
||||
/* package version */
|
||||
#undef ASE_VERSION
|
||||
|
||||
/* major version number */
|
||||
#undef ASE_VERSION_MAJOR
|
||||
|
||||
/* minor version number */
|
||||
#undef ASE_VERSION_MINOR
|
||||
|
||||
/* patch level */
|
||||
#undef ASE_VERSION_PATCH
|
||||
|
||||
/* Define to 1 if you have the `atan' function. */
|
||||
#undef HAVE_ATAN
|
||||
|
||||
/* Define to 1 if you have the `atan2' function. */
|
||||
#undef HAVE_ATAN2
|
||||
|
||||
/* Define to 1 if you have the `atan2f' function. */
|
||||
#undef HAVE_ATAN2F
|
||||
|
||||
/* Define to 1 if you have the `atan2l' function. */
|
||||
#undef HAVE_ATAN2L
|
||||
|
||||
/* Define to 1 if you have the `atanf' function. */
|
||||
#undef HAVE_ATANF
|
||||
|
||||
/* Define to 1 if you have the `atanl' function. */
|
||||
#undef HAVE_ATANL
|
||||
|
||||
/* Define to 1 if you have the `cos' function. */
|
||||
#undef HAVE_COS
|
||||
|
||||
/* Define to 1 if you have the `cosf' function. */
|
||||
#undef HAVE_COSF
|
||||
|
||||
/* Define to 1 if you have the `cosl' function. */
|
||||
#undef HAVE_COSL
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the `exp' function. */
|
||||
#undef HAVE_EXP
|
||||
|
||||
/* Define to 1 if you have the `expf' function. */
|
||||
#undef HAVE_EXPF
|
||||
|
||||
/* Define to 1 if you have the `expl' function. */
|
||||
#undef HAVE_EXPL
|
||||
|
||||
/* Define to 1 if you have the `fstat64' function. */
|
||||
#undef HAVE_FSTAT64
|
||||
|
||||
/* Define to 1 if you have the `ftruncate64' function. */
|
||||
#undef HAVE_FTRUNCATE64
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the `log' function. */
|
||||
#undef HAVE_LOG
|
||||
|
||||
/* Define to 1 if you have the `logf' function. */
|
||||
#undef HAVE_LOGF
|
||||
|
||||
/* Define to 1 if you have the `logl' function. */
|
||||
#undef HAVE_LOGL
|
||||
|
||||
/* Define to 1 if you have the `lseek64' function. */
|
||||
#undef HAVE_LSEEK64
|
||||
|
||||
/* Define to 1 if you have the `mbrlen' function. */
|
||||
#undef HAVE_MBRLEN
|
||||
|
||||
/* Define to 1 if you have the `mbrtowc' function. */
|
||||
#undef HAVE_MBRTOWC
|
||||
|
||||
/* Define to 1 if you have the `mbsnrtowcs' function. */
|
||||
#undef HAVE_MBSNRTOWCS
|
||||
|
||||
/* Define to 1 if you have the `mbsrtowcs' function. */
|
||||
#undef HAVE_MBSRTOWCS
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the `pow' function. */
|
||||
#undef HAVE_POW
|
||||
|
||||
/* Define to 1 if you have the `powf' function. */
|
||||
#undef HAVE_POWF
|
||||
|
||||
/* Define to 1 if you have the `powl' function. */
|
||||
#undef HAVE_POWL
|
||||
|
||||
/* Define to 1 if you have the `sin' function. */
|
||||
#undef HAVE_SIN
|
||||
|
||||
/* Define to 1 if you have the `sinf' function. */
|
||||
#undef HAVE_SINF
|
||||
|
||||
/* Define to 1 if you have the `sinl' function. */
|
||||
#undef HAVE_SINL
|
||||
|
||||
/* Define to 1 if you have the `sqrt' function. */
|
||||
#undef HAVE_SQRT
|
||||
|
||||
/* Define to 1 if you have the `sqrtf' function. */
|
||||
#undef HAVE_SQRTF
|
||||
|
||||
/* Define to 1 if you have the `sqrtl' function. */
|
||||
#undef HAVE_SQRTL
|
||||
|
||||
/* Define to 1 if you have the `stat64' function. */
|
||||
#undef HAVE_STAT64
|
||||
|
||||
/* Define to 1 if you have the <stddef.h> header file. */
|
||||
#undef HAVE_STDDEF_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/syscall.h> header file. */
|
||||
#undef HAVE_SYS_SYSCALL_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the `tan' function. */
|
||||
#undef HAVE_TAN
|
||||
|
||||
/* Define to 1 if you have the `tanf' function. */
|
||||
#undef HAVE_TANF
|
||||
|
||||
/* Define to 1 if you have the `tanl' function. */
|
||||
#undef HAVE_TANL
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if you have the `uselocale' function. */
|
||||
#undef HAVE_USELOCALE
|
||||
|
||||
/* Define to 1 if you have the <wchar.h> header file. */
|
||||
#undef HAVE_WCHAR_H
|
||||
|
||||
/* wchar_t is available in stddef.h */
|
||||
#undef HAVE_WCHAR_T_IN_STDDEF_H
|
||||
|
||||
/* Define to 1 if you have the `wcrtomb' function. */
|
||||
#undef HAVE_WCRTOMB
|
||||
|
||||
/* Define to 1 if you have the `wcsnrtombs' function. */
|
||||
#undef HAVE_WCSNRTOMBS
|
||||
|
||||
/* Define to 1 if you have the `wcsrtombs' function. */
|
||||
#undef HAVE_WCSRTOMBS
|
||||
|
||||
/* Define to 1 if you have the <wctype.h> header file. */
|
||||
#undef HAVE_WCTYPE_H
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* The size of `char', as computed by sizeof. */
|
||||
#undef SIZEOF_CHAR
|
||||
|
||||
/* The size of `double', as computed by sizeof. */
|
||||
#undef SIZEOF_DOUBLE
|
||||
|
||||
/* The size of `float', as computed by sizeof. */
|
||||
#undef SIZEOF_FLOAT
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#undef SIZEOF_INT
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#undef SIZEOF_LONG
|
||||
|
||||
/* The size of `long double', as computed by sizeof. */
|
||||
#undef SIZEOF_LONG_DOUBLE
|
||||
|
||||
/* The size of `long long', as computed by sizeof. */
|
||||
#undef SIZEOF_LONG_LONG
|
||||
|
||||
/* The size of `short', as computed by sizeof. */
|
||||
#undef SIZEOF_SHORT
|
||||
|
||||
/* The size of `void *', as computed by sizeof. */
|
||||
#undef SIZEOF_VOID_P
|
||||
|
||||
/* The size of `wchar_t', as computed by sizeof. */
|
||||
#undef SIZEOF_WCHAR_T
|
||||
|
||||
/* The size of `__int128', as computed by sizeof. */
|
||||
#undef SIZEOF___INT128
|
||||
|
||||
/* The size of `__int16', as computed by sizeof. */
|
||||
#undef SIZEOF___INT16
|
||||
|
||||
/* The size of `__int32', as computed by sizeof. */
|
||||
#undef SIZEOF___INT32
|
||||
|
||||
/* The size of `__int64', as computed by sizeof. */
|
||||
#undef SIZEOF___INT64
|
||||
|
||||
/* The size of `__int8', as computed by sizeof. */
|
||||
#undef SIZEOF___INT8
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
134
qse/include/ase/lsp/lsp.h
Normal file
134
qse/include/ase/lsp/lsp.h
Normal file
@ -0,0 +1,134 @@
|
||||
/*
|
||||
* $Id: lsp.h 183 2008-06-03 08:18:55Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_LSP_LSP_H_
|
||||
#define _ASE_LSP_LSP_H_
|
||||
|
||||
#include <ase/types.h>
|
||||
#include <ase/macros.h>
|
||||
|
||||
typedef struct ase_lsp_t ase_lsp_t;
|
||||
typedef struct ase_lsp_obj_t ase_lsp_obj_t;
|
||||
typedef struct ase_lsp_prmfns_t ase_lsp_prmfns_t;
|
||||
|
||||
typedef ase_ssize_t (*ase_lsp_io_t) (
|
||||
int cmd, void* arg, ase_char_t* data, ase_size_t count);
|
||||
|
||||
typedef ase_real_t (*ase_lsp_pow_t) (
|
||||
void* data, ase_real_t x, ase_real_t y);
|
||||
typedef int (*ase_lsp_sprintf_t) (
|
||||
void* data, ase_char_t* buf, ase_size_t size,
|
||||
const ase_char_t* fmt, ...);
|
||||
typedef void (*ase_lsp_dprintf_t) (void* data, const ase_char_t* fmt, ...);
|
||||
|
||||
struct ase_lsp_prmfns_t
|
||||
{
|
||||
ase_mmgr_t mmgr;
|
||||
ase_ccls_t ccls;
|
||||
|
||||
/* utilities */
|
||||
struct
|
||||
{
|
||||
ase_lsp_sprintf_t sprintf;
|
||||
ase_lsp_dprintf_t dprintf;
|
||||
void* data;
|
||||
} misc;
|
||||
};
|
||||
|
||||
/* io function commands */
|
||||
enum
|
||||
{
|
||||
ASE_LSP_IO_OPEN = 0,
|
||||
ASE_LSP_IO_CLOSE = 1,
|
||||
ASE_LSP_IO_READ = 2,
|
||||
ASE_LSP_IO_WRITE = 3
|
||||
};
|
||||
|
||||
/* option code */
|
||||
enum
|
||||
{
|
||||
ASE_LSP_UNDEFSYMBOL = (1 << 0)
|
||||
};
|
||||
|
||||
/* error code */
|
||||
enum
|
||||
{
|
||||
ASE_LSP_ENOERR,
|
||||
ASE_LSP_ENOMEM,
|
||||
|
||||
ASE_LSP_EEXIT,
|
||||
ASE_LSP_EEND,
|
||||
ASE_LSP_EENDSTR,
|
||||
ASE_LSP_ENOINP,
|
||||
ASE_LSP_EINPUT,
|
||||
ASE_LSP_ENOOUTP,
|
||||
ASE_LSP_EOUTPUT,
|
||||
|
||||
ASE_LSP_ESYNTAX,
|
||||
ASE_LSP_ERPAREN,
|
||||
ASE_LSP_EARGBAD,
|
||||
ASE_LSP_EARGFEW,
|
||||
ASE_LSP_EARGMANY,
|
||||
ASE_LSP_EUNDEFFN,
|
||||
ASE_LSP_EBADFN,
|
||||
ASE_LSP_EDUPFML,
|
||||
ASE_LSP_EBADSYM,
|
||||
ASE_LSP_EUNDEFSYM,
|
||||
ASE_LSP_EEMPBDY,
|
||||
ASE_LSP_EVALBAD,
|
||||
ASE_LSP_EDIVBY0
|
||||
};
|
||||
|
||||
typedef ase_lsp_obj_t* (*ase_lsp_prim_t) (ase_lsp_t* lsp, ase_lsp_obj_t* obj);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
ase_lsp_t* ase_lsp_open (
|
||||
const ase_lsp_prmfns_t* prmfns,
|
||||
ase_size_t mem_ubound, ase_size_t mem_ubound_inc);
|
||||
|
||||
void ase_lsp_close (ase_lsp_t* lsp);
|
||||
|
||||
/**
|
||||
* @function ase_lsp_setassocdata
|
||||
* @brief ssociats the user-specified data with an interpreter
|
||||
*/
|
||||
void ase_lsp_setassocdata (ase_lsp_t* lsp, void* data);
|
||||
/**
|
||||
* @function ase_lsp_getassocdata
|
||||
* @brief returns the user-specified data associated with an interpreter
|
||||
*/
|
||||
void* ase_lsp_getassocdata (ase_lsp_t* lsp);
|
||||
|
||||
void ase_lsp_geterror (
|
||||
ase_lsp_t* lsp, int* errnum, const ase_char_t** errmsg);
|
||||
|
||||
void ase_lsp_seterror (
|
||||
ase_lsp_t* lsp, int errnum,
|
||||
const ase_char_t** errarg, ase_size_t argcnt);
|
||||
|
||||
int ase_lsp_attinput (ase_lsp_t* lsp, ase_lsp_io_t input, void* arg);
|
||||
int ase_lsp_detinput (ase_lsp_t* lsp);
|
||||
|
||||
int ase_lsp_attoutput (ase_lsp_t* lsp, ase_lsp_io_t output, void* arg);
|
||||
int ase_lsp_detoutput (ase_lsp_t* lsp);
|
||||
|
||||
ase_lsp_obj_t* ase_lsp_read (ase_lsp_t* lsp);
|
||||
ase_lsp_obj_t* ase_lsp_eval (ase_lsp_t* lsp, ase_lsp_obj_t* obj);
|
||||
int ase_lsp_print (ase_lsp_t* lsp, const ase_lsp_obj_t* obj);
|
||||
|
||||
int ase_lsp_addprim (
|
||||
ase_lsp_t* lsp, const ase_char_t* name, ase_size_t name_len,
|
||||
ase_lsp_prim_t prim, ase_size_t min_args, ase_size_t max_args);
|
||||
int ase_lsp_removeprim (ase_lsp_t* lsp, const ase_char_t* name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
5
qse/include/ase/lsp/makefile.am
Normal file
5
qse/include/ase/lsp/makefile.am
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
pkginclude_HEADERS = lsp.h
|
||||
pkgincludedir= $(includedir)/ase/lsp
|
||||
|
||||
CLEANFILES = *dist
|
415
qse/include/ase/lsp/makefile.in
Normal file
415
qse/include/ase/lsp/makefile.in
Normal file
@ -0,0 +1,415 @@
|
||||
# makefile.in generated by automake 1.10.1 from makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = include/ase/lsp
|
||||
DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/makefile.am \
|
||||
$(srcdir)/makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/include/ase/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(pkgincludedir)"
|
||||
pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER)
|
||||
HEADERS = $(pkginclude_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
pkgincludedir = $(includedir)/ase/lsp
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BUILD_CJ = @BUILD_CJ@
|
||||
BUILD_JNI = @BUILD_JNI@
|
||||
BUILD_MODE = @BUILD_MODE@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CFLAGS_JNI = @CFLAGS_JNI@
|
||||
CJ = @CJ@
|
||||
CJFLAGS = @CJFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GREP = @GREP@
|
||||
HAVE_CXX = @HAVE_CXX@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
JAR = @JAR@
|
||||
JAR_PATH = @JAR_PATH@
|
||||
JAVAC = @JAVAC@
|
||||
JAVAC_PATH = @JAVAC_PATH@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBM = @LIBM@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
RM = @RM@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
pkginclude_HEADERS = lsp.h
|
||||
CLEANFILES = *dist
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/makefile.in: $(srcdir)/makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/ase/lsp/makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign include/ase/lsp/makefile
|
||||
.PRECIOUS: makefile
|
||||
makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-pkgincludeHEADERS: $(pkginclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)"
|
||||
@list='$(pkginclude_HEADERS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \
|
||||
$(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-pkgincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkginclude_HEADERS)'; for p in $$list; do \
|
||||
f=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: makefile $(HEADERS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(pkgincludedir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f makefile
|
||||
distclean-am: clean-am distclean-generic distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-pkgincludeHEADERS
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-pkgincludeHEADERS
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool ctags distclean distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-pkgincludeHEADERS install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-pkgincludeHEADERS
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
171
qse/include/ase/macros.h
Normal file
171
qse/include/ase/macros.h
Normal file
@ -0,0 +1,171 @@
|
||||
/*
|
||||
* $Id: macros.h 455 2008-11-26 09:05:00Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_MACROS_H_
|
||||
#define _ASE_MACROS_H_
|
||||
|
||||
#include <ase/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
/*#define ASE_NULL ((ase_uint_t)0)*/
|
||||
#define ASE_NULL (0)
|
||||
#else
|
||||
#define ASE_NULL ((void*)0)
|
||||
#endif
|
||||
|
||||
/****d* ase/ASE_TRUE,ASE_FALSE
|
||||
* NAME
|
||||
* ASE_TRUE - represent a boolean true
|
||||
* ASE_FALSE - represent a boolean false
|
||||
******
|
||||
*/
|
||||
#define ASE_TRUE (0 == 0)
|
||||
#define ASE_FALSE (0 != 0)
|
||||
|
||||
|
||||
/****d* ase/ASE_ALIVE,ASE_ZOMBIE,ASE_DEAD
|
||||
* NAME
|
||||
* ASE_ALIVE - represent a living state
|
||||
* ASE_ZOMBIE - represent a zombie state
|
||||
* ASE_DEAD - represent a dead state
|
||||
******
|
||||
*/
|
||||
#define ASE_ALIVE 1
|
||||
#define ASE_ZOMBIE 0
|
||||
#define ASE_DEAD -1
|
||||
|
||||
|
||||
#define AES_MCHAR_EOF ((ase_mcint_t)-1)
|
||||
#define AES_WCHAR_EOF ((ase_wcint_t)-1)
|
||||
#define ASE_CHAR_EOF ((ase_cint_t)-1)
|
||||
|
||||
#define ASE_SIZEOF(n) (sizeof(n))
|
||||
#define ASE_COUNTOF(n) (sizeof(n)/sizeof(n[0]))
|
||||
#define ASE_OFFSETOF(type,member) ((ase_size_t)&((type*)0)->member)
|
||||
|
||||
#define ASE_TYPE_IS_SIGNED(type) (((type)0) > ((type)-1))
|
||||
#define ASE_TYPE_IS_UNSIGNED(type) (((type)0) < ((type)-1))
|
||||
|
||||
#define ASE_TYPE_SIGNED_MAX(type) \
|
||||
((type)~((type)1 << (ASE_SIZEOF(type) * 8 - 1)))
|
||||
#define ASE_TYPE_UNSIGNED_MAX(type) ((type)(~(type)0))
|
||||
|
||||
#define ASE_TYPE_SIGNED_MIN(type) \
|
||||
((type)((type)1 << (ASE_SIZEOF(type) * 8 - 1)))
|
||||
#define ASE_TYPE_UNSIGNED_MIN(type) ((type)0)
|
||||
|
||||
#define ASE_TYPE_MAX(type) \
|
||||
((ASE_TYPE_IS_SIGNED(type)? ASE_TYPE_SIGNED_MAX(type): ASE_TYPE_UNSIGNED_MAX(type)))
|
||||
#define ASE_TYPE_MIN(type) \
|
||||
((ASE_TYPE_IS_SIGNED(type)? ASE_TYPE_SIGNED_MIN(type): ASE_TYPE_UNSIGNED_MIN(type)))
|
||||
|
||||
#define ASE_IS_POWOF2(x) (((x) & ((x) - 1)) == 0)
|
||||
|
||||
#define ASE_SWAP(x,y,original_type,casting_type) \
|
||||
do { \
|
||||
x = (original_type)((casting_type)(x) ^ (casting_type)(y)); \
|
||||
y = (original_type)((casting_type)(y) ^ (casting_type)(x)); \
|
||||
x = (original_type)((casting_type)(x) ^ (casting_type)(y)); \
|
||||
} while (0)
|
||||
|
||||
#define ASE_ABS(x) ((x) < 0? -(x): (x))
|
||||
|
||||
#define ASE_LOOP_CONTINUE(id) goto __loop_ ## id ## _begin__;
|
||||
#define ASE_LOOP_BREAK(id) goto __loop_ ## id ## _end__;
|
||||
#define ASE_LOOP_BEGIN(id) __loop_ ## id ## _begin__: {
|
||||
#define ASE_LOOP_END(id) ASE_LOOP_CONTINUE(id) } __loop_ ## id ## _end__:;
|
||||
|
||||
#define ASE_REPEAT(n,blk) \
|
||||
do { \
|
||||
ase_size_t __ase_repeat_x1__ = (ase_size_t)(n); \
|
||||
ase_size_t __ase_repeat_x2__ = __ase_repeat_x1__ >> 4; \
|
||||
__ase_repeat_x1__ &= 15; \
|
||||
while (__ase_repeat_x1__-- > 0) { blk; } \
|
||||
while (__ase_repeat_x2__-- > 0) { \
|
||||
blk; blk; blk; blk; blk; blk; blk; blk; \
|
||||
blk; blk; blk; blk; blk; blk; blk; blk; \
|
||||
} \
|
||||
} while (0);
|
||||
|
||||
/* number of characters to number of bytes */
|
||||
#define ASE_NCTONB(x) ((x)*sizeof(ase_char_t))
|
||||
/* number of bytes to number of characters */
|
||||
#define ASE_NBTONC(x) ((x)/sizeof(ase_char_t))
|
||||
|
||||
#define ASE_MQ_I(val) #val
|
||||
#define ASE_MQ(val) ASE_MQ_I(val)
|
||||
#define ASE_MC(ch) ((ase_mchar_t)ch)
|
||||
#define ASE_MS(str) ((const ase_mchar_t*)str)
|
||||
#define ASE_MT(txt) (txt)
|
||||
|
||||
#define ASE_WQ_I(val) (L ## #val)
|
||||
#define ASE_WQ(val) ASE_WQ_I(val)
|
||||
#define ASE_WC(ch) ((ase_wchar_t)L ## ch)
|
||||
#define ASE_WS(str) ((const ase_wchar_t*)L ## str)
|
||||
#define ASE_WT(txt) (L ## txt)
|
||||
|
||||
#if defined(ASE_CHAR_IS_MCHAR)
|
||||
#define ASE_Q(val) ASE_MQ(val)
|
||||
#define ASE_C(ch) ASE_MC(ch)
|
||||
#define ASE_S(str) ASE_MS(str)
|
||||
#define ASE_T(txt) ASE_MT(txt)
|
||||
#else
|
||||
#define ASE_Q(val) ASE_WQ(val)
|
||||
#define ASE_C(ch) ASE_WC(ch)
|
||||
#define ASE_S(str) ASE_WS(str)
|
||||
#define ASE_T(txt) ASE_WT(txt)
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#define ASE_BEGIN_PACKED_STRUCT(x) struct x {
|
||||
#define ASE_END_PACKED_STRUCT() } __attribute__((packed));
|
||||
#else
|
||||
#define ASE_BEGIN_PACKED_STRUCT(x) struct x {
|
||||
#define ASE_END_PACKED_STRUCT() };
|
||||
#endif
|
||||
|
||||
#ifdef NDEBUG
|
||||
#define ASE_ASSERT(expr) ((void)0)
|
||||
#define ASE_ASSERTX(expr,desc) ((void)0)
|
||||
#else
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void ase_assert_failed (
|
||||
const ase_char_t* expr, const ase_char_t* desc,
|
||||
const ase_char_t* file, ase_size_t line);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#define ASE_ASSERT(expr) (void)((expr) || \
|
||||
(ase_assert_failed (ASE_T(#expr), ASE_NULL, ASE_T(__FILE__), __LINE__), 0))
|
||||
#define ASE_ASSERTX(expr,desc) (void)((expr) || \
|
||||
(ase_assert_failed (ASE_T(#expr), ASE_T(desc), ASE_T(__FILE__), __LINE__), 0))
|
||||
#endif
|
||||
|
||||
/****d* ase/ASE_FNS
|
||||
* NAME
|
||||
* ASE_FNS - define an ASE function name space
|
||||
* DESCRIPTION
|
||||
* The ASE_FNS macro enables you to simulate a function name space for the
|
||||
* types designed properly.
|
||||
* EXAMPLE
|
||||
* ASE_FNS (awk, AWK);
|
||||
* ase_awk_t* awk = AWK.open (....);
|
||||
* AWK.close (awk);
|
||||
******
|
||||
*/
|
||||
#define ASE_NS(type,name) struct ase_ns_##type##_t name = ase_ns_##type##_d
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define ASE_BEGIN_NAMESPACE(x) namespace x {
|
||||
#define ASE_END_NAMESPACE(x) }
|
||||
#define ASE_BEGIN_NAMESPACE2(x,y) namespace x { namespace y {
|
||||
#define ASE_END_NAMESPACE2(y,x) }}
|
||||
#endif
|
||||
|
||||
#endif
|
17
qse/include/ase/makefile.am
Normal file
17
qse/include/ase/makefile.am
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
# EXTRA_DIST = README
|
||||
SUBDIRS = cmn awk lsp tgp utl
|
||||
|
||||
pkginclude_HEADERS = config.h.in conf_msw.h conf_vms.h types.h macros.h pack1.h unpack.h
|
||||
|
||||
pkgincludedir= $(includedir)/ase
|
||||
|
||||
CLEANFILES = *dist
|
||||
|
||||
install-data-hook:
|
||||
@"$(GREP)" -E "#define[ ]+ASE_" "$(srcdir)/config.h" > "$(pkgincludedir)/config.h"
|
||||
@"$(RM)" -f "$(pkgincludedir)/config.h.in"
|
||||
@"$(SED)" 's|/\*#define ASE_HAVE_CONFIG_H\*/|#define ASE_HAVE_CONFIG_H|' "$(srcdir)/types.h" > "$(pkgincludedir)/types.h"
|
||||
|
||||
uninstall-hook:
|
||||
@"$(RM)" -f "$(pkgincludedir)/config.h"
|
563
qse/include/ase/makefile.in
Normal file
563
qse/include/ase/makefile.in
Normal file
@ -0,0 +1,563 @@
|
||||
# makefile.in generated by automake 1.10.1 from makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = include/ase
|
||||
DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/config.h.in \
|
||||
$(srcdir)/makefile.am $(srcdir)/makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-dvi-recursive install-exec-recursive \
|
||||
install-html-recursive install-info-recursive \
|
||||
install-pdf-recursive install-ps-recursive install-recursive \
|
||||
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||
ps-recursive uninstall-recursive
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(pkgincludedir)"
|
||||
pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER)
|
||||
HEADERS = $(pkginclude_HEADERS)
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
pkgincludedir = $(includedir)/ase
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BUILD_CJ = @BUILD_CJ@
|
||||
BUILD_JNI = @BUILD_JNI@
|
||||
BUILD_MODE = @BUILD_MODE@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CFLAGS_JNI = @CFLAGS_JNI@
|
||||
CJ = @CJ@
|
||||
CJFLAGS = @CJFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GREP = @GREP@
|
||||
HAVE_CXX = @HAVE_CXX@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
JAR = @JAR@
|
||||
JAR_PATH = @JAR_PATH@
|
||||
JAVAC = @JAVAC@
|
||||
JAVAC_PATH = @JAVAC_PATH@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBM = @LIBM@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
RM = @RM@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
|
||||
# EXTRA_DIST = README
|
||||
SUBDIRS = cmn awk lsp tgp utl
|
||||
pkginclude_HEADERS = config.h.in conf_msw.h conf_vms.h types.h macros.h pack1.h unpack.h
|
||||
CLEANFILES = *dist
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/makefile.in: $(srcdir)/makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/ase/makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign include/ase/makefile
|
||||
.PRECIOUS: makefile
|
||||
makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
config.h: stamp-h1
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h1; \
|
||||
$(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
|
||||
else :; fi
|
||||
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status include/ase/config.h
|
||||
$(srcdir)/config.h.in: $(am__configure_deps)
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-pkgincludeHEADERS: $(pkginclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)"
|
||||
@list='$(pkginclude_HEADERS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \
|
||||
$(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-pkgincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkginclude_HEADERS)'; for p in $$list; do \
|
||||
f=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
|
||||
done
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
$(RECURSIVE_CLEAN_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$top_distdir" \
|
||||
distdir="$$distdir/$$subdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: makefile $(HEADERS) config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(pkgincludedir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-pkgincludeHEADERS
|
||||
@$(NORMAL_INSTALL)
|
||||
$(MAKE) $(AM_MAKEFLAGS) install-data-hook
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-pkgincludeHEADERS
|
||||
@$(NORMAL_INSTALL)
|
||||
$(MAKE) $(AM_MAKEFLAGS) uninstall-hook
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
|
||||
install-data-am install-strip uninstall-am
|
||||
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am check check-am clean clean-generic clean-libtool \
|
||||
ctags ctags-recursive distclean distclean-generic \
|
||||
distclean-hdr distclean-libtool distclean-tags distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-data-hook install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-pkgincludeHEADERS \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs installdirs-am maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
|
||||
uninstall uninstall-am uninstall-hook \
|
||||
uninstall-pkgincludeHEADERS
|
||||
|
||||
|
||||
install-data-hook:
|
||||
@"$(GREP)" -E "#define[ ]+ASE_" "$(srcdir)/config.h" > "$(pkgincludedir)/config.h"
|
||||
@"$(RM)" -f "$(pkgincludedir)/config.h.in"
|
||||
@"$(SED)" 's|/\*#define ASE_HAVE_CONFIG_H\*/|#define ASE_HAVE_CONFIG_H|' "$(srcdir)/types.h" > "$(pkgincludedir)/types.h"
|
||||
|
||||
uninstall-hook:
|
||||
@"$(RM)" -f "$(pkgincludedir)/config.h"
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
17
qse/include/ase/pack1.h
Normal file
17
qse/include/ase/pack1.h
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* $Id: pack1.h 225 2008-06-26 06:48:38Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#pragma pack(1)
|
||||
#elif defined(__HP_aCC) || defined(__HP_cc)
|
||||
#pragma PACK 1
|
||||
#elif defined(_MSC_VER) || defined(__BORLANDC__)
|
||||
#pragma pack(push,1)
|
||||
#elif defined(__DECC)
|
||||
#pragma pack(push,1)
|
||||
#else
|
||||
#pragma pack(1)
|
||||
#endif
|
17
qse/include/ase/pack2.h
Normal file
17
qse/include/ase/pack2.h
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* $Id: pack2.h 225 2008-06-26 06:48:38Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#pragma pack(2)
|
||||
#elif defined(__HP_aCC) || defined(__HP_cc)
|
||||
#pragma PACK 2
|
||||
#elif defined(_MSC_VER) || defined(__BORLANDC__)
|
||||
#pragma pack(push,2)
|
||||
#elif defined(__DECC)
|
||||
#pragma pack(push,2)
|
||||
#else
|
||||
#pragma pack(2)
|
||||
#endif
|
5
qse/include/ase/tgp/makefile.am
Normal file
5
qse/include/ase/tgp/makefile.am
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
pkginclude_HEADERS = tgp.h
|
||||
pkgincludedir= $(includedir)/ase/tgp
|
||||
|
||||
CLEANFILES = *dist
|
415
qse/include/ase/tgp/makefile.in
Normal file
415
qse/include/ase/tgp/makefile.in
Normal file
@ -0,0 +1,415 @@
|
||||
# makefile.in generated by automake 1.10.1 from makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = include/ase/tgp
|
||||
DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/makefile.am \
|
||||
$(srcdir)/makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/include/ase/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(pkgincludedir)"
|
||||
pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER)
|
||||
HEADERS = $(pkginclude_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
pkgincludedir = $(includedir)/ase/tgp
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BUILD_CJ = @BUILD_CJ@
|
||||
BUILD_JNI = @BUILD_JNI@
|
||||
BUILD_MODE = @BUILD_MODE@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CFLAGS_JNI = @CFLAGS_JNI@
|
||||
CJ = @CJ@
|
||||
CJFLAGS = @CJFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GREP = @GREP@
|
||||
HAVE_CXX = @HAVE_CXX@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
JAR = @JAR@
|
||||
JAR_PATH = @JAR_PATH@
|
||||
JAVAC = @JAVAC@
|
||||
JAVAC_PATH = @JAVAC_PATH@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBM = @LIBM@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
RM = @RM@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
pkginclude_HEADERS = tgp.h
|
||||
CLEANFILES = *dist
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/makefile.in: $(srcdir)/makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/ase/tgp/makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign include/ase/tgp/makefile
|
||||
.PRECIOUS: makefile
|
||||
makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-pkgincludeHEADERS: $(pkginclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)"
|
||||
@list='$(pkginclude_HEADERS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \
|
||||
$(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-pkgincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkginclude_HEADERS)'; for p in $$list; do \
|
||||
f=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: makefile $(HEADERS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(pkgincludedir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f makefile
|
||||
distclean-am: clean-am distclean-generic distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-pkgincludeHEADERS
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-pkgincludeHEADERS
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool ctags distclean distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-pkgincludeHEADERS install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-pkgincludeHEADERS
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
40
qse/include/ase/tgp/tgp.h
Normal file
40
qse/include/ase/tgp/tgp.h
Normal file
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* $Id: tgp.h 235 2008-07-05 07:25:54Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_TGP_TGP_H_
|
||||
#define _ASE_TGP_TGP_H_
|
||||
|
||||
#include <ase/types.h>
|
||||
#include <ase/macros.h>
|
||||
|
||||
typedef struct ase_tgp_t ase_tgp_t;
|
||||
|
||||
enum ase_tgp_iocmd_t
|
||||
{
|
||||
ASE_TGP_IO_OPEN = 0,
|
||||
ASE_TGP_IO_CLOSE = 1,
|
||||
ASE_TGP_IO_READ = 2,
|
||||
ASE_TGP_IO_WRITE = 3
|
||||
};
|
||||
|
||||
typedef ase_ssize_t (*ase_tgp_io_t) (
|
||||
int cmd, void* arg, ase_char_t* data, ase_size_t count);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
ase_tgp_t* ase_tgp_open (ase_mmgr_t* mmgr);
|
||||
void ase_tgp_close (ase_tgp_t* tgp);
|
||||
|
||||
void ase_tgp_setassocdata (ase_tgp_t* tgp, void* data);
|
||||
void* ase_tgp_getassocdata (ase_tgp_t* tgp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
439
qse/include/ase/types.h
Normal file
439
qse/include/ase/types.h
Normal file
@ -0,0 +1,439 @@
|
||||
/*
|
||||
* $Id: types.h 476 2008-12-12 06:25:48Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_TYPES_H_
|
||||
#define _ASE_TYPES_H_
|
||||
|
||||
/****o* ase/basic types
|
||||
* DESCRIPTION
|
||||
* <ase/types.h> defines various common basic types. They are designed to be
|
||||
* cross-platform. These types are preferred over native data types in many
|
||||
* contexts.
|
||||
*
|
||||
* #include <ase/types.h>
|
||||
******
|
||||
*/
|
||||
|
||||
/* WARNING: NEVER CHANGE/DELETE THE FOLLOWING LINE */
|
||||
/*#define ASE_HAVE_CONFIG_H*/
|
||||
|
||||
#if defined(ASE_HAVE_CONFIG_H)
|
||||
#include <ase/config.h>
|
||||
#elif defined(_WIN32)
|
||||
#include <ase/conf_msw.h>
|
||||
#elif defined(vms) || defined(__vms)
|
||||
#include <ase/conf_vms.h>
|
||||
/*
|
||||
#elif defined(__unix__) || defined(__unix) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__SPU__)
|
||||
#if !defined(__unix__)
|
||||
#define __unix__
|
||||
#endif
|
||||
#if !defined(__unix)
|
||||
#define __unix
|
||||
#endif
|
||||
#include <ase/config.h>
|
||||
*/
|
||||
#else
|
||||
#error unsupported operating system
|
||||
#endif
|
||||
|
||||
/****t* ase/ase_bool_t
|
||||
* NAME
|
||||
* ase_bool_t - define a boolean type
|
||||
* DESCRIPTION
|
||||
* The ase_bool_t type defines a boolean type that can represent ASE_TRUE
|
||||
* and ASE_FALSE.
|
||||
******
|
||||
*/
|
||||
typedef int ase_bool_t;
|
||||
|
||||
/****t* ase/ase_tri_t
|
||||
* NAME
|
||||
* ase_tri_t - define a tri-state type
|
||||
* DESCRIPTION
|
||||
* The ase_tri_t type defines a tri-state type that can represent ASE_ALIVE,
|
||||
* ASE_ZOMBIE, and ASE_DEAD.
|
||||
******
|
||||
*/
|
||||
typedef int ase_tri_t;
|
||||
|
||||
/****t* ase/ase_int_t,ase_uint_t
|
||||
* NAME
|
||||
* ase_int_t - define a signed integer type as large as a pointer type
|
||||
* ase_uint_t - define an unsigned integer type as large as a pointer type
|
||||
******
|
||||
*/
|
||||
#if (defined(hpux) || defined(__hpux) || defined(__hpux__)) && (ASE_SIZEOF_VOID_P == ASE_SIZEOF_LONG)
|
||||
typedef long ase_int_t;
|
||||
typedef unsigned long ase_uint_t;
|
||||
#elif defined(__SPU__) && (ASE_SIZEOF_VOID_P == ASE_SIZEOF_LONG)
|
||||
typedef long ase_int_t;
|
||||
typedef unsigned long ase_uint_t;
|
||||
#elif ASE_SIZEOF_VOID_P == ASE_SIZEOF_INT
|
||||
typedef int ase_int_t;
|
||||
typedef unsigned int ase_uint_t;
|
||||
#elif ASE_SIZEOF_VOID_P == ASE_SIZEOF_LONG
|
||||
typedef long ase_int_t;
|
||||
typedef unsigned long ase_uint_t;
|
||||
#elif ASE_SIZEOF_VOID_P == ASE_SIZEOF_LONG_LONG
|
||||
typedef long long ase_int_t;
|
||||
typedef unsigned long long ase_uint_t;
|
||||
#elif ASE_SIZEOF_VOID_P == ASE_SIZEOF___INT32
|
||||
typedef __int32 ase_int_t;
|
||||
typedef unsigned __int32 ase_uint_t;
|
||||
#elif ASE_SIZEOF_VOID_P == ASE_SIZEOF___INT64
|
||||
typedef __int64 ase_int_t;
|
||||
typedef unsigned __int64 ase_uint_t;
|
||||
#else
|
||||
#error unsupported pointer size
|
||||
#endif
|
||||
|
||||
/****t* ase/ase_long_t,ase_ulong_t
|
||||
* NAME
|
||||
* ase_long_t - define the largest signed integer type supported
|
||||
* ase_ulong_t - define the largest unsigned integer type supported
|
||||
******
|
||||
*/
|
||||
#if ASE_SIZEOF_LONG_LONG > 0
|
||||
typedef long long ase_long_t;
|
||||
typedef unsigned long long ase_ulong_t;
|
||||
#elif ASE_SIZEOF___INT64 > 0
|
||||
typedef __int64 ase_long_t;
|
||||
typedef unsigned __int64 ase_ulong_t;
|
||||
#else
|
||||
typedef long ase_long_t;
|
||||
typedef unsigned long ase_ulong_t;
|
||||
#endif
|
||||
|
||||
/****t* ase/ase_int8_t,ase_uint8_t
|
||||
* NAME
|
||||
* ase_int8_t - define an 8-bit signed integer type
|
||||
* ase_uint8_t - define an 8-bit unsigned integer type
|
||||
******
|
||||
*/
|
||||
#if ASE_SIZEOF_CHAR == 1
|
||||
typedef char ase_int8_t;
|
||||
typedef unsigned char ase_uint8_t;
|
||||
#elif ASE_SIZEOF___INT8 == 1
|
||||
typedef __int8 ase_int8_t;
|
||||
typedef unsigned __int8 ase_uint8_t;
|
||||
#endif
|
||||
|
||||
/****t* ase/ase_int16_t,ase_uint16_t
|
||||
* NAME
|
||||
* ase_int16_t - define a 16-bit signed integer type
|
||||
* ase_uint16_t - define a 16-bit unsigned integer type
|
||||
******
|
||||
*/
|
||||
#if ASE_SIZEOF_SHORT == 2
|
||||
typedef short ase_int16_t;
|
||||
typedef unsigned short ase_uint16_t;
|
||||
#elif ASE_SIZEOF___INT16 == 2
|
||||
typedef __int16 ase_int16_t;
|
||||
typedef unsigned __int16 ase_uint16_t;
|
||||
#endif
|
||||
|
||||
/****t* ase/ase_int32_t,ase_uint32_t
|
||||
* NAME
|
||||
* ase_int32_t - define a 32-bit signed integer type
|
||||
* ase_uint32_t - define a 32-bit unsigned integer type
|
||||
******
|
||||
*/
|
||||
#if ASE_SIZEOF_INT == 4
|
||||
typedef int ase_int32_t;
|
||||
typedef unsigned int ase_uint32_t;
|
||||
#elif ASE_SIZEOF_LONG == 4
|
||||
typedef long ase_int32_t;
|
||||
typedef unsigned long ase_uint32_t;
|
||||
#elif ASE_SIZEOF___INT32 == 4
|
||||
typedef __int32 ase_int32_t;
|
||||
typedef unsigned __int32 ase_uint32_t;
|
||||
#endif
|
||||
|
||||
/****t* ase/ase_int64_t,ase_uint64_t
|
||||
* NAME
|
||||
* ase_int64_t - define a 64-bit signed integer type
|
||||
* ase_uint64_t - define a 64-bit unsigned integer type
|
||||
******
|
||||
*/
|
||||
#if ASE_SIZEOF_INT == 8
|
||||
#define ASE_HAVE_INT64_T
|
||||
#define ASE_HAVE_UINT64_T
|
||||
typedef int ase_int64_t;
|
||||
typedef unsigned int ase_uint64_t;
|
||||
#elif ASE_SIZEOF_LONG == 8
|
||||
#define ASE_HAVE_INT64_T
|
||||
#define ASE_HAVE_UINT64_T
|
||||
typedef long ase_int64_t;
|
||||
typedef unsigned long ase_uint64_t;
|
||||
#elif ASE_SIZEOF_LONG_LONG == 8
|
||||
#define ASE_HAVE_INT64_T
|
||||
#define ASE_HAVE_UINT64_T
|
||||
typedef long long ase_int64_t;
|
||||
typedef unsigned long long ase_uint64_t;
|
||||
#elif ASE_SIZEOF___INT64 == 8
|
||||
#define ASE_HAVE_INT64_T
|
||||
#define ASE_HAVE_UINT64_T
|
||||
typedef __int64 ase_int64_t;
|
||||
typedef unsigned __int64 ase_uint64_t;
|
||||
#endif
|
||||
|
||||
#if ASE_SIZEOF_INT == 16
|
||||
#define ASE_HAVE_INT128_T
|
||||
#define ASE_HAVE_UINT128_T
|
||||
typedef int ase_int128_t;
|
||||
typedef unsigned int ase_uint128_t;
|
||||
#elif ASE_SIZEOF_LONG == 16
|
||||
#define ASE_HAVE_INT128_T
|
||||
#define ASE_HAVE_UINT128_T
|
||||
typedef long ase_int128_t;
|
||||
typedef unsigned long ase_uint128_t;
|
||||
#elif ASE_SIZEOF_LONG_LONG == 16
|
||||
#define ASE_HAVE_INT128_T
|
||||
#define ASE_HAVE_UINT128_T
|
||||
typedef long long ase_int128_t;
|
||||
typedef unsigned long long ase_uint128_t;
|
||||
#elif ASE_SIZEOF___INT128 == 16
|
||||
#define ASE_HAVE_INT128_T
|
||||
#define ASE_HAVE_UINT128_T
|
||||
typedef __int128 ase_int128_t;
|
||||
typedef unsigned __int128 ase_uint128_t;
|
||||
#endif
|
||||
|
||||
/****t* ase/ase_byte_t
|
||||
* NAME
|
||||
* ase_word_t - define a byte type
|
||||
******
|
||||
*/
|
||||
typedef ase_uint8_t ase_byte_t;
|
||||
|
||||
/****t* ase/ase_size_t
|
||||
* NAME
|
||||
* ase_size_t - define an unsigned integer type that can hold a pointer value
|
||||
******
|
||||
*/
|
||||
#ifdef __SIZE_TYPE__
|
||||
typedef __SIZE_TYPE__ ase_size_t;
|
||||
#else
|
||||
typedef ase_uint_t ase_size_t;
|
||||
#endif
|
||||
|
||||
/****t* ase/ase_ssize_t
|
||||
* NAME
|
||||
* ase_ssize_t - define an signed integer type that can hold a pointer value
|
||||
******
|
||||
*/
|
||||
typedef ase_int_t ase_ssize_t;
|
||||
|
||||
/****t* ase/ase_word_t
|
||||
* NAME
|
||||
* ase_word_t - define an integer type identical to ase_uint_t
|
||||
******
|
||||
*/
|
||||
typedef ase_uint_t ase_word_t;
|
||||
|
||||
/* floating-point number */
|
||||
#if defined(__FreeBSD__)
|
||||
/* TODO: check if the support for long double is complete.
|
||||
* if so, use long double for ase_real_t */
|
||||
#define ASE_SIZEOF_REAL ASE_SIZEOF_DOUBLE
|
||||
typedef double ase_real_t;
|
||||
#elif ASE_SIZEOF_LONG_DOUBLE > ASE_SIZEOF_DOUBLE
|
||||
#define ASE_SIZEOF_REAL ASE_SIZEOF_LONG_DOUBLE
|
||||
typedef long double ase_real_t;
|
||||
#else
|
||||
#define ASE_SIZEOF_REAL ASE_SIZEOF_DOUBLE
|
||||
typedef double ase_real_t;
|
||||
#endif
|
||||
|
||||
/****t* ase/ase_mchar_t,ase_mcint_t
|
||||
* NAME
|
||||
* ase_mchar_t - define a multi-byte character
|
||||
* ase_mcint_t - define a type that can hold ase_mchar_t and ASE_MCHAR_EOF
|
||||
******
|
||||
*/
|
||||
typedef char ase_mchar_t;
|
||||
typedef int ase_mcint_t;
|
||||
|
||||
/****t* ase/ase_wchar_t,ase_wcint_t
|
||||
* NAME
|
||||
* ase_wchar_t - define a wide character
|
||||
* ase_wcint_t - define a type that can hold ase_wchar_t and ASE_WCHAR_EOF
|
||||
******
|
||||
*/
|
||||
#if defined(__cplusplus) && (!defined(_MSC_VER) || (defined(_MSC_VER)&&defined(_NATIVE_WCHAR_T_DEFINED)))
|
||||
/* C++ */
|
||||
|
||||
typedef wchar_t ase_wchar_t;
|
||||
typedef wchar_t ase_wcint_t;
|
||||
|
||||
/* all the way down from here for C */
|
||||
#elif defined(__WCHAR_TYPE__) && defined(__WINT_TYPE__)
|
||||
typedef __WCHAR_TYPE__ ase_wchar_t;
|
||||
typedef __WINT_TYPE__ ase_wcint_t;
|
||||
#elif (ASE_SIZEOF_WCHAR_T == 2) || (ASE_SIZEOF_WCHAR_T == 0)
|
||||
typedef unsigned short ase_wchar_t;
|
||||
typedef unsigned short ase_wcint_t;
|
||||
#elif (ASE_SIZEOF_WCHAR_T == 4)
|
||||
#if defined(vms) || defined(__vms)
|
||||
typedef unsigned int ase_wchar_t;
|
||||
typedef int ase_wcint_t;
|
||||
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
typedef int ase_wchar_t;
|
||||
typedef int ase_wcint_t;
|
||||
#elif (defined(sun) || defined(__sun) || defined(__linux))
|
||||
#if defined(_LP64)
|
||||
typedef int ase_wchar_t;
|
||||
typedef int ase_wcint_t;
|
||||
#else
|
||||
typedef long ase_wchar_t;
|
||||
typedef long ase_wcint_t;
|
||||
#endif
|
||||
#elif defined(__APPLE__) && defined(__MACH__)
|
||||
typedef int ase_wchar_t;
|
||||
typedef int ase_wcint_t;
|
||||
#elif defined(hpux) || defined(__hpux) || defined(__hpux__)
|
||||
#if defined(__HP_cc) || defined(__HP_aCC)
|
||||
typedef unsigned int ase_wchar_t;
|
||||
#else
|
||||
typedef int ase_wchar_t;
|
||||
#endif
|
||||
typedef int ase_wcint_t;
|
||||
#elif ASE_SIZEOF_LONG == 4
|
||||
typedef long ase_wchar_t;
|
||||
typedef long ase_wcint_t;
|
||||
#elif ASE_SIZEOF_INT == 4
|
||||
typedef int ase_wchar_t;
|
||||
typedef int ase_wcint_t;
|
||||
#else
|
||||
#error no supported data type for wchar_t
|
||||
#endif
|
||||
#else
|
||||
#error unsupported size of wchar_t
|
||||
#endif
|
||||
|
||||
/****t* ase/ase_char_t,ase_cint_t
|
||||
* NAME
|
||||
* ase_char_t - define a character
|
||||
* ase_cint_t - define a type that can hold ase_char_t and ASE_CHAR_EOF
|
||||
******
|
||||
*/
|
||||
#if defined(_WIN32) && (defined(UNICODE)||defined(_UNICODE))
|
||||
#define ASE_CHAR_IS_WCHAR
|
||||
typedef ase_wchar_t ase_char_t;
|
||||
typedef ase_wcint_t ase_cint_t;
|
||||
#else
|
||||
#if defined(ASE_CHAR_IS_MCHAR)
|
||||
typedef ase_mchar_t ase_char_t;
|
||||
typedef ase_mcint_t ase_cint_t;
|
||||
#elif defined(ASE_CHAR_IS_WCHAR)
|
||||
typedef ase_wchar_t ase_char_t;
|
||||
typedef ase_wcint_t ase_cint_t;
|
||||
#elif defined(_MBCS)
|
||||
#define ASE_CHAR_IS_MCHAR
|
||||
typedef ase_mchar_t ase_char_t;
|
||||
typedef ase_mcint_t ase_cint_t;
|
||||
#else
|
||||
#define ASE_CHAR_IS_WCHAR
|
||||
typedef ase_wchar_t ase_char_t;
|
||||
typedef ase_wcint_t ase_cint_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(ASE_CHAR_IS_WCHAR) && defined(_WIN32)
|
||||
#ifndef UNICODE
|
||||
#define UNICODE
|
||||
#endif
|
||||
#ifndef _UNICODE
|
||||
#define _UNICODE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef struct ase_xstr_t ase_xstr_t;
|
||||
typedef struct ase_cstr_t ase_cstr_t;
|
||||
typedef struct ase_mmgr_t ase_mmgr_t;
|
||||
typedef struct ase_ccls_t ase_ccls_t;
|
||||
|
||||
/****t* ase/ase_xstr_t
|
||||
* NAME
|
||||
* ase_xstr_t - combine a pointer and length
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
struct ase_xstr_t
|
||||
{
|
||||
ase_char_t* ptr; /* this is not a const pointer */
|
||||
ase_size_t len;
|
||||
};
|
||||
/******/
|
||||
|
||||
/****t* ase/ase_cstr_t
|
||||
* NAME
|
||||
* ase_cstr_t - combine a constant pointer and length
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
struct ase_cstr_t
|
||||
{
|
||||
const ase_char_t* ptr; /* this is a const pointer */
|
||||
ase_size_t len;
|
||||
};
|
||||
/******/
|
||||
|
||||
/****t* ase/ase_mmgr_t
|
||||
* NAME
|
||||
* ase_mmgr_t - define a memory manager
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
struct ase_mmgr_t
|
||||
{
|
||||
void* (*alloc) (void* data, ase_size_t n);
|
||||
void* (*realloc) (void* data, void* ptr, ase_size_t n);
|
||||
void (*free) (void* data, void* ptr);
|
||||
void* data;
|
||||
};
|
||||
/******/
|
||||
|
||||
/****t* ase/ase_ccls_type_t
|
||||
* NAME
|
||||
* ase_ccls_type_t - define types of character class
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
enum ase_ccls_type_t
|
||||
{
|
||||
ASE_CCLS_UPPER,
|
||||
ASE_CCLS_LOWER,
|
||||
ASE_CCLS_ALPHA,
|
||||
ASE_CCLS_DIGIT,
|
||||
ASE_CCLS_XDIGIT,
|
||||
ASE_CCLS_ALNUM,
|
||||
ASE_CCLS_SPACE,
|
||||
ASE_CCLS_PRINT,
|
||||
ASE_CCLS_GRAPH,
|
||||
ASE_CCLS_CNTRL,
|
||||
ASE_CCLS_PUNCT
|
||||
};
|
||||
/******/
|
||||
|
||||
typedef enum ase_ccls_type_t ase_ccls_type_t;
|
||||
|
||||
/****t* ase/ase_ccls_t
|
||||
* NAME
|
||||
* ase_mmgr_t - define a character class handler
|
||||
*
|
||||
* SYNOPSIS
|
||||
*/
|
||||
struct ase_ccls_t
|
||||
{
|
||||
ase_bool_t (*is) (void* data, ase_cint_t c, ase_ccls_type_t type);
|
||||
ase_cint_t (*to) (void* data, ase_cint_t c, ase_ccls_type_t type);
|
||||
void* data;
|
||||
};
|
||||
/******/
|
||||
|
||||
#endif
|
17
qse/include/ase/unpack.h
Normal file
17
qse/include/ase/unpack.h
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* $Id: unpack.h 225 2008-06-26 06:48:38Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#pragma pack()
|
||||
#elif defined(__HP_aCC) || defined(__HP_cc)
|
||||
#pragma PACK
|
||||
#elif defined(_MSC_VER) || defined(__BORLANDC__)
|
||||
#pragma pack(pop)
|
||||
#elif defined(__DECC)
|
||||
#pragma pack(pop)
|
||||
#else
|
||||
#pragma pack()
|
||||
#endif
|
66
qse/include/ase/utl/http.h
Normal file
66
qse/include/ase/utl/http.h
Normal file
@ -0,0 +1,66 @@
|
||||
/*
|
||||
* $Id: http.h 223 2008-06-26 06:44:41Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_UTL_HTTP_H_
|
||||
#define _ASE_UTL_HTTP_H_
|
||||
|
||||
#include <ase/types.h>
|
||||
#include <ase/macros.h>
|
||||
|
||||
/* returns the type of http method */
|
||||
typedef struct ase_http_req_t ase_http_req_t;
|
||||
typedef struct ase_http_hdr_t ase_http_hdr_t;
|
||||
|
||||
struct ase_http_req_t
|
||||
{
|
||||
ase_char_t* method;
|
||||
|
||||
struct
|
||||
{
|
||||
ase_char_t* ptr;
|
||||
ase_size_t len;
|
||||
} path;
|
||||
|
||||
struct
|
||||
{
|
||||
ase_char_t* ptr;
|
||||
ase_size_t len;
|
||||
} args;
|
||||
|
||||
struct
|
||||
{
|
||||
char major;
|
||||
char minor;
|
||||
} vers;
|
||||
};
|
||||
|
||||
struct ase_http_hdr_t
|
||||
{
|
||||
struct
|
||||
{
|
||||
ase_char_t* ptr;
|
||||
ase_size_t len;
|
||||
} name;
|
||||
|
||||
struct
|
||||
{
|
||||
ase_char_t* ptr;
|
||||
ase_size_t len;
|
||||
} value;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
ase_char_t* ase_parsehttpreq (ase_char_t* buf, ase_http_req_t* req);
|
||||
ase_char_t* ase_parsehttphdr (ase_char_t* buf, ase_http_hdr_t* hdr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
37
qse/include/ase/utl/main.h
Normal file
37
qse/include/ase/utl/main.h
Normal file
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* $Id: main.h 463 2008-12-09 06:52:03Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_UTL_MAIN_H_
|
||||
#define _ASE_UTL_MAIN_H_
|
||||
|
||||
#include <ase/types.h>
|
||||
#include <ase/macros.h>
|
||||
|
||||
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||
#if defined(ASE_CHAR_IS_MCHAR)
|
||||
#define ase_main main
|
||||
typedef ase_mchar_t ase_achar_t;
|
||||
#else
|
||||
#define ase_main wmain
|
||||
typedef ase_wchar_t ase_achar_t;
|
||||
#endif
|
||||
#else
|
||||
#define ase_main main
|
||||
typedef ase_mchar_t ase_achar_t;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int ase_runmain (int argc, ase_achar_t* argv[], int(*mf) (int,ase_char_t*[]));
|
||||
/* TODO - ase_runmain with env */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
6
qse/include/ase/utl/makefile.am
Normal file
6
qse/include/ase/utl/makefile.am
Normal file
@ -0,0 +1,6 @@
|
||||
|
||||
pkginclude_HEADERS = http.h main.h stdio.h
|
||||
|
||||
pkgincludedir= $(includedir)/ase/utl
|
||||
|
||||
CLEANFILES = *dist
|
415
qse/include/ase/utl/makefile.in
Normal file
415
qse/include/ase/utl/makefile.in
Normal file
@ -0,0 +1,415 @@
|
||||
# makefile.in generated by automake 1.10.1 from makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = include/ase/utl
|
||||
DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/makefile.am \
|
||||
$(srcdir)/makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/include/ase/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
|
||||
am__installdirs = "$(DESTDIR)$(pkgincludedir)"
|
||||
pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER)
|
||||
HEADERS = $(pkginclude_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
pkgincludedir = $(includedir)/ase/utl
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BUILD_CJ = @BUILD_CJ@
|
||||
BUILD_JNI = @BUILD_JNI@
|
||||
BUILD_MODE = @BUILD_MODE@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CFLAGS_JNI = @CFLAGS_JNI@
|
||||
CJ = @CJ@
|
||||
CJFLAGS = @CJFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GREP = @GREP@
|
||||
HAVE_CXX = @HAVE_CXX@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
JAR = @JAR@
|
||||
JAR_PATH = @JAR_PATH@
|
||||
JAVAC = @JAVAC@
|
||||
JAVAC_PATH = @JAVAC_PATH@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBM = @LIBM@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
RM = @RM@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
pkginclude_HEADERS = http.h main.h stdio.h
|
||||
CLEANFILES = *dist
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/makefile.in: $(srcdir)/makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/ase/utl/makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign include/ase/utl/makefile
|
||||
.PRECIOUS: makefile
|
||||
makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-pkgincludeHEADERS: $(pkginclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)"
|
||||
@list='$(pkginclude_HEADERS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
f=$(am__strip_dir) \
|
||||
echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \
|
||||
$(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \
|
||||
done
|
||||
|
||||
uninstall-pkgincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(pkginclude_HEADERS)'; for p in $$list; do \
|
||||
f=$(am__strip_dir) \
|
||||
echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: makefile $(HEADERS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(pkgincludedir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f makefile
|
||||
distclean-am: clean-am distclean-generic distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-pkgincludeHEADERS
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-pkgincludeHEADERS
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool ctags distclean distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-pkgincludeHEADERS install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-pkgincludeHEADERS
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
88
qse/include/ase/utl/stdio.h
Normal file
88
qse/include/ase/utl/stdio.h
Normal file
@ -0,0 +1,88 @@
|
||||
/*
|
||||
* $Id: stdio.h 419 2008-10-13 11:32:58Z baconevi $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
|
||||
#ifndef _ASE_UTL_STDIO_H_
|
||||
#define _ASE_UTL_STDIO_H_
|
||||
|
||||
#include <ase/types.h>
|
||||
#include <ase/macros.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <tchar.h>
|
||||
|
||||
#define ase_printf _tprintf
|
||||
#define ase_vprintf _vtprintf
|
||||
#define ase_fprintf _ftprintf
|
||||
#define ase_vfprintf _vftprintf
|
||||
|
||||
#define ase_fgets(x,y,s) _fgetts(x,y,s)
|
||||
#define ase_fgetc(x) _fgettc(x)
|
||||
#define ase_fputs(x,s) _fputts(x,s)
|
||||
#define ase_fputc(x,s) _fputtc(x,s)
|
||||
#elif defined(ASE_CHAR_IS_MCHAR)
|
||||
#define ase_fgets(x,y,s) fgets(x,y,s)
|
||||
#define ase_fgetc(x) fgetc(x)
|
||||
#define ase_fputs(x,s) fputs(x,s)
|
||||
#define ase_fputc(x,s) fputc(x,s)
|
||||
#else
|
||||
#define ase_fgets(x,y,s) fgetws(x,y,s)
|
||||
#define ase_fgetc(x) fgetwc(x)
|
||||
#define ase_fputs(x,s) fputws(x,s)
|
||||
#define ase_fputc(x,s) fputwc(x,s)
|
||||
#endif
|
||||
|
||||
#define ase_feof(s) feof(s)
|
||||
#define ase_ferror(s) ferror(s)
|
||||
#define ase_clearerr(s) clearerr(s)
|
||||
#define ase_fflush(s) fflush(s)
|
||||
#define ase_fclose(s) fclose(s)
|
||||
|
||||
#define ASE_FILE FILE
|
||||
#define ASE_STDIN stdin
|
||||
#define ASE_STDOUT stdout
|
||||
#define ASE_STDERR stderr
|
||||
|
||||
typedef int (*ase_getdelim_t) (const ase_char_t* ptr,ase_size_t len, void* arg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int ase_vsprintf (ase_char_t* buf, size_t size, const ase_char_t* fmt, va_list ap);
|
||||
int ase_sprintf (ase_char_t* buf, size_t size, const ase_char_t* fmt, ...);
|
||||
|
||||
#if !defined(_WIN32)
|
||||
int ase_vfprintf (ASE_FILE *stream, const ase_char_t* fmt, va_list ap);
|
||||
int ase_vprintf (const ase_char_t* fmt, va_list ap);
|
||||
int ase_fprintf (ASE_FILE* file, const ase_char_t* fmt, ...);
|
||||
int ase_printf (const ase_char_t* fmt, ...);
|
||||
#endif
|
||||
|
||||
int ase_dprintf (const ase_char_t* fmt, ...);
|
||||
ASE_FILE* ase_fopen (const ase_char_t* path, const ase_char_t* mode);
|
||||
ASE_FILE* ase_popen (const ase_char_t* cmd, const ase_char_t* mode);
|
||||
|
||||
/**
|
||||
* returns -2 on error, -1 on eof, length of data read on success
|
||||
*/
|
||||
ase_ssize_t ase_getline (ase_char_t **buf, ase_size_t *n, ASE_FILE *fp);
|
||||
/**
|
||||
* returns -3 on line breaker error, -2 on error, -1 on eof,
|
||||
* length of data read on success
|
||||
*/
|
||||
ase_ssize_t ase_getdelim (
|
||||
ase_char_t **buf, ase_size_t *n,
|
||||
ase_getdelim_t fn, void* fnarg, ASE_FILE *fp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
5
qse/include/makefile.am
Normal file
5
qse/include/makefile.am
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
AUTOMAKE_OPTIONS = no-dependencies
|
||||
|
||||
# EXTRA_DIST = README
|
||||
SUBDIRS = ase
|
500
qse/include/makefile.in
Normal file
500
qse/include/makefile.in
Normal file
@ -0,0 +1,500 @@
|
||||
# makefile.in generated by automake 1.10.1 from makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = include
|
||||
DIST_COMMON = $(srcdir)/makefile.am $(srcdir)/makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/include/ase/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
depcomp =
|
||||
am__depfiles_maybe =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-dvi-recursive install-exec-recursive \
|
||||
install-html-recursive install-info-recursive \
|
||||
install-pdf-recursive install-ps-recursive install-recursive \
|
||||
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||
ps-recursive uninstall-recursive
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BUILD_CJ = @BUILD_CJ@
|
||||
BUILD_JNI = @BUILD_JNI@
|
||||
BUILD_MODE = @BUILD_MODE@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CFLAGS_JNI = @CFLAGS_JNI@
|
||||
CJ = @CJ@
|
||||
CJFLAGS = @CJFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GREP = @GREP@
|
||||
HAVE_CXX = @HAVE_CXX@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
JAR = @JAR@
|
||||
JAR_PATH = @JAR_PATH@
|
||||
JAVAC = @JAVAC@
|
||||
JAVAC_PATH = @JAVAC_PATH@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBM = @LIBM@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
RM = @RM@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AUTOMAKE_OPTIONS = no-dependencies
|
||||
|
||||
# EXTRA_DIST = README
|
||||
SUBDIRS = ase
|
||||
all: all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/makefile.in: $(srcdir)/makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign include/makefile
|
||||
.PRECIOUS: makefile
|
||||
makefile: $(srcdir)/makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
$(RECURSIVE_CLEAN_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$top_distdir" \
|
||||
distdir="$$distdir/$$subdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: makefile
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f makefile
|
||||
distclean-am: clean-am distclean-generic distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
|
||||
install-strip
|
||||
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am check check-am clean clean-generic clean-libtool \
|
||||
ctags ctags-recursive distclean distclean-generic \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-dvi install-dvi-am install-exec \
|
||||
install-exec-am install-html install-html-am install-info \
|
||||
install-info-am install-man install-pdf install-pdf-am \
|
||||
install-ps install-ps-am install-strip installcheck \
|
||||
installcheck-am installdirs installdirs-am maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
|
||||
uninstall uninstall-am
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
Reference in New Issue
Block a user