You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(58) |
Sep
(79) |
Oct
(41) |
Nov
(80) |
Dec
(23) |
---|
From: <sg...@us...> - 2003-11-17 18:24:40
|
Update of /cvsroot/libfunutil/libfunutil/toc/tests In directory sc8-pr-cvs1:/tmp/cvs-serv32589/toc/tests Added Files: libltdl.sh Log Message: egg --- NEW FILE: libltdl.sh --- # toc_run_description = looking for libdl/libltdl # toc_begin_help = # Looks for libltdl or libdl (preferring the former) # Sets the following config vars: # # HAVE_LIBLTDL = 0 or 1 # HAVE_LIBDL = 0 or 1 # LDADD_LIBDL = -ldl or empty # LDADD_LIBLTDL = -lltdl or empty # # = toc_end_help # Many thanks to Roger Leigh for introducing me to ltdl! toc_add_config HAVE_LIBLTDL=0 toc_add_config HAVE_LIBDL=0 toc_add_config LDADD_LIBDL= toc_add_config LDADD_LIBLTDL= err=1 toc_run_failok gcc_build_and_run toc/tests/c/check_for_ltdlopen_and_friends.c -export-dynamic -lltdl && { err=0 toc_add_config HAVE_LIBLTDL=1 toc_add_config LDADD_LIBLTDL=-lltdl } toc_run_failok gcc_build_and_run toc/tests/c/check_for_dlopen_and_friends.c -export-dynamic -ldl && { err=0 toc_add_config HAVE_LIBDL=1 toc_add_config LDADD_LIBDL=-ldl } return $err |
From: <sg...@us...> - 2003-11-17 18:24:35
|
Update of /cvsroot/libfunutil/libfunutil/toc/tests/c In directory sc8-pr-cvs1:/tmp/cvs-serv32669/toc/tests/c Added Files: check_for_ltdlopen_and_friends.c Log Message: egg --- NEW FILE: check_for_ltdlopen_and_friends.c --- /** Quick check for lt_dlopen(), lt_dlclose() and lt_dlsym(). toc usage: toc_run_fail path/to/this/file -lltdl -export-dynamic */ #include <ltdl.h> #include <stdlib.h> void foo_function() {} int main() { typedef void (*func)(); void * soh = 0; lt_dlinit(); soh = lt_dlopen( 0 ); // , RTLD_NOW | RTLD_GLOBAL ); if( ! soh ) { printf( "could not open main app: %s\n", lt_dlerror() ); return 1; } void * sym = (func) lt_dlsym( soh, "foo_function" ); if( 0 == sym ) { printf( "could not find test symbol: %s\n", lt_dlerror() ); return 2; } return 0; } |
From: <sg...@us...> - 2003-11-17 18:24:21
|
Update of /cvsroot/libfunutil/libfunutil/toc/make In directory sc8-pr-cvs1:/tmp/cvs-serv32544/toc/make Added Files: DOXYGEN.make NAMESPACE.make Log Message: egg --- NEW FILE: DOXYGEN.make --- #!/do/not/make # a (big) snippet to build API docs using doxygen # Much of this process was written by Rusty Ballinger. # # Edit the file Doxyfile template, Doxyfile.at, using # @at-token@ conventions. # # Define: # DOXYGEN_PREDEF = predfined C vars # DOXYGEN_ATPARSE_ARGS = list of args to pass to the @at-parser@ # Some globally-defined vars are pre-set. # In particular you may want to add: # DOXYGEN_INPUT="index.txt $(top_includesdir)/yourincludes)" # DOXYGEN_FILTER=/path/to/filter (may be left blank) # Useful sometimes for perl/sed'ing, e.g., C macros in API docs. # # Sample: # INCLUDES_DIRS = $(addprefix $(top_includesdir)/,lib1 otherlib) # # DOXYGEN_PREDEF = \ # HAVE_CONFIG_H=1 # # DOXYGEN_ATPARSE_ARGS = \ # DOXYGEN_INPUT="index.txt $(INCLUDES_DIRS)" # # Of course your Doxyfile.at must have the appropriate @tokens@ in it, # but the one shipped with this file is already set up for you. ifeq (,$(DOXYGEN_BIN)) $(error The variable DOXYGEN_BIN must be set before including this file.) endif DOXYFILE = Doxyfile doxygen_outdir = ./doxygen DOXYGEN_IN = Doxyfile.at DIST_FILES += $(DOXYGEN_IN) index.txt doxygen_install_dirname = doxygen-$(PACKAGE_NAME)-$(PACKAGE_VERSION) docs: doxygen clean: clean-doxygen install: install-doxygen DOXYGEN_ATPARSE_ARGS += \ top_srcdir=${top_srcdir} \ top_libdir=${top_libdir} \ top_includesdir=${top_includesdir} \ PERL="$(PERL)" \ PACKAGE_NAME=$(PACKAGE_NAME) \ PACKAGE_VERSION=$(PACKAGE_VERSION)\ PREDEFINED="$(DOXYGEN_PREDEF)" \ DOXYGEN_FILTER=$(DOXYGEN_FILTER) DOXYGEN_MAKE = $(toc_makesdir)/DOXYGEN.make CLEAN_FILES += $(DOXYGEN_FILTER) atparser = $(top_srcdir)/toc/bin/atsign_parse $(top_srcdir)/configure: $(DOXYFILE): $(DOXYGEN_FILTER) $(DOXYGEN_IN) Makefile $(top_srcdir)/configure @echo "Creating $@."; \ $(call toc_atparse_file,$(DOXYGEN_IN),$@, \ $(DOXYGEN_ATPARSE_ARGS) \ ) CLEAN_FILES += $(DOXYFILE) INSTALL_DEST_DOXYGEN = $(INSTALL_DOCS_DEST) DISTCLEAN_FILES += $(DOXYFILE) doxygen: clean-doxygen $(DOXYFILE) $(DOXYGEN_BIN) @echo Output is in $(doxygen_outdir) and ./latex. clean-doxygen: -rm -fr $(doxygen_outdir) latex install-doxygen: doxygen @echo "Installing docs to $(INSTALL_DOCS_DEST)/$(doxygen_install_dirname)" @test -d $(INSTALL_DEST_DOXYGEN) || mkdir -p $(INSTALL_DEST_DOXYGEN); \ cp -r $(doxygen_outdir) $(INSTALL_DOCS_DEST)/$(doxygen_install_dirname) # all: docs --- NEW FILE: NAMESPACE.make --- #!/do/not/make # # A snippet to help filter source code files to replace a namespace. # Usage: # define: # NAMESPACE = mynamespace # NAMESPACE_TOKEN = token to replace when filtering. e.g. MY_NAMESPACE # NAMESPACE_PREFIX = filename prefix for pre-filtered files. Defaults to ns. # NAMESPACE_FILTERED_FILES = list containing XXX which should be filtered from # $(NAMESPACE_PREFIX)XXX. # then include this file. NAMESPACE_PREFIX ?= ns. NAMESPACE_TOKEN ?= NAMESPACE ifeq (,$(NAMESPACE)) $(error You must set the variable NAMESPACE before including this file.) endif NAMESPACE_MAKE = $(toc_makesdir)/NAMESPACE.make NAMESPACE_TMPFILE = .toc.NAMESPACE.tmp $(NAMESPACE_FILTERED_FILES): %: $(NAMESPACE_PREFIX)% Makefile $(top_srcdir)/toc.$(PACKAGE_NAME).make $(NAMESPACE_MAKE) @nsf=$<; \ echo -n "namespace $(NAMESPACE): $$nsf --> $@ ... "; \ sed -e 's,$(NAMESPACE_TOKEN),$(NAMESPACE),g' < $$nsf > $(NAMESPACE_TMPFILE); \ cmp -s $(NAMESPACE_TMPFILE) $@ && rm $(NAMESPACE_TMPFILE); \ test -f $(NAMESPACE_TMPFILE) && { mv $(NAMESPACE_TMPFILE) $@; echo " updated"; } || echo " up to date"; |
From: <sg...@us...> - 2003-10-18 02:05:48
|
Update of /cvsroot/libfunutil/libfunutil/lib/s11n In directory sc8-pr-cvs1:/tmp/cvs-serv20054 Modified Files: Makefile Serializable.h Log Message: WTF? Fixed some link-related weirdness Index: Makefile =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile 14 Oct 2003 03:38:14 -0000 1.3 +++ Makefile 17 Oct 2003 09:08:02 -0000 1.4 @@ -40,9 +40,9 @@ top_srcdir_absolute = $(shell cd $(top_srcdir) && pwd) # CPPFLAGS += -DDLLLOADER_DEFAULT_PATH=\".:$(top_srcdir_absolute)/lib/s11n:$(prefix)/lib\" -OBJECTS = $(patsubst %.cpp,%.o,$(SOURCES)) -PARSER_OBJECTS = $(addprefix parsers/,flex_lexers.o funtxt.flex.o funxml.flex.o select_lexer.flex.o simplexml.flex.o) - +PARSER_OBJECTS = $(addprefix parsers/,compact.flex.o flex_lexers.o \ + funtxt.flex.o funxml.flex.o hex.flex.o paren.flex.o \ + select_lexer.flex.o simplexml.flex.o) INSTALL_PACKAGE_HEADERS_DEST = $(prefix)/include/s11n INSTALL_PACKAGE_HEADERS = $(HEADERS) @@ -72,8 +72,8 @@ # build, requiring a sub-make (after building SUBDIRS) to get the # proper values here: OBJECTS_TOOLBOX = $(wildcard $(top_libdir)/toolbox/*.o) -OBJECTS_S11N = $(wildcard *.o parsers/*.o) -OBJECTS = $(OBJECTS_TOOLBOX) $(OBJECTS_S11N) +OBJECTS_S11N = $(patsubst %.cpp,%.o,$(SOURCES)) $(PARSER_OBJECTS) +# OBJECTS = $(OBJECTS_TOOLBOX) $(OBJECTS_S11N) ############################## static libs STATIC_LIBS = libs11n @@ -91,7 +91,7 @@ -all: symlink-headers subdir-parsers $(OBJECTS) +all: symlink-headers subdir-parsers @${MAKE} --no-print-directory STATIC_LIBS SHARED_LIBS $(ENM_NAMESFILE) # sub-make needed to get .o files which didn't exist when build started :/ Index: Serializable.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/Serializable.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Serializable.h 14 Oct 2003 20:42:30 -0000 1.2 +++ Serializable.h 17 Oct 2003 09:08:02 -0000 1.3 @@ -6,9 +6,9 @@ #ifndef SERIALIZABLE_H_INCLUDED #define SERIALIZABLE_H_INCLUDED #include <string> - +#include <s11n/s11n_node.h> // note: gcc 3.3pre doesn't need this, gcc 3.3.1 does namespace s11n { - class s11n_node; // forward decl +// class s11n_node; // forward decl /** Serializable plays several roles: @@ -98,6 +98,7 @@ #include <s11n/serializable_adapter.h> + SERIALIZABLE_ADAPTER(s11n::Serializable,s7e,d9e); // this is the // only sane place to put this, i think? |
Update of /cvsroot/libfunutil/libfunutil/client/s11nconvert In directory sc8-pr-cvs1:/tmp/cvs-serv20021 Modified Files: AltSerializable.cpp AltSerializable.h BarClass.cpp BarClass.h FooClass.cpp FooClass.h Makefile main.cpp Log Message: ??? Index: AltSerializable.cpp =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/AltSerializable.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AltSerializable.cpp 14 Oct 2003 03:26:54 -0000 1.1 +++ AltSerializable.cpp 17 Oct 2003 09:07:35 -0000 1.2 @@ -2,6 +2,7 @@ #include <toolbox/debuggering_macros.h> // COUT/CERR #include <toolbox/ClassLoader.h> // COUT/CERR #include <toolbox/SimpleCLParser.h> // COUT/CERR +#include <s11n/serializable_adapter.h> #define VERBOSE if (toolbox::SimpleCLParser::args().get_bool( "v", false ) ) CERR Index: AltSerializable.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/AltSerializable.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AltSerializable.h 14 Oct 2003 03:26:54 -0000 1.1 +++ AltSerializable.h 17 Oct 2003 09:07:36 -0000 1.2 @@ -33,6 +33,7 @@ }; } // namespace alts11n:: + /** This creates the required serializable_adapter<AltSerializable> specializations to map the AltSerializable API to Index: BarClass.cpp =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/BarClass.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- BarClass.cpp 14 Oct 2003 03:26:54 -0000 1.1 +++ BarClass.cpp 17 Oct 2003 09:07:36 -0000 1.2 @@ -1,10 +1,7 @@ #include <s11n/s11n-macros.h> // COUT/CERR -#include <s11n/serializable_adapter.h> -#include <s11n/Serializable.h> #include "BarClass.h" -SERIALIZABLE_REGISTER(s11n::Serializable,BarClass); using namespace s11n; using namespace std; Index: BarClass.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/BarClass.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- BarClass.h 14 Oct 2003 03:26:54 -0000 1.1 +++ BarClass.h 17 Oct 2003 09:07:36 -0000 1.2 @@ -3,8 +3,10 @@ using namespace s11n; using namespace std; +// #include <s11n/serializable_adapter.h> +#include <s11n/Serializable.h> -struct BarClass: public Serializable +struct BarClass: public s11n::Serializable { std::string name; int magic_number; @@ -13,3 +15,5 @@ virtual bool s7e( s11n::s11n_node & ser ) const; virtual bool d9e( const s11n::s11n_node & node ); }; + +SERIALIZABLE_REGISTER(s11n::Serializable,BarClass); Index: FooClass.cpp =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/FooClass.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- FooClass.cpp 14 Oct 2003 03:26:54 -0000 1.1 +++ FooClass.cpp 17 Oct 2003 09:07:36 -0000 1.2 @@ -9,8 +9,6 @@ using namespace s11n; using namespace std; -SERIALIZABLE_REGISTER(s11n::Serializable,foo::FooClass); - namespace foo { using namespace s11n; using namespace std; Index: FooClass.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/FooClass.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- FooClass.h 14 Oct 2003 03:26:54 -0000 1.1 +++ FooClass.h 17 Oct 2003 09:07:36 -0000 1.2 @@ -1,21 +1,24 @@ #ifndef FOO_H_INCLUDED -#define FOO_H_INCLUDED +#define FOO_H_INCLUDED 1 -#include <s11n/S11n.h> #include <s11n/s11n_io.h> +#include <s11n/Serializable.h> namespace foo { -struct FooClass:public s11n::Serializable -{ - std::string name; - FooClass( ); - virtual ~ FooClass( ); - virtual bool s7e( s11n::s11n_node & ser ) const; - virtual bool d9e( const s11n::s11n_node & ser ); + struct FooClass : public s11n::Serializable + { + std::string name; + FooClass( ); + virtual ~ FooClass( ); + virtual bool s7e( s11n::s11n_node & ser ) const; + virtual bool d9e( const s11n::s11n_node & ser ); -// private: -// void bogosity(){} -// int incompatibility; -}; + // private: + // void bogosity(){} + // int incompatibility; + }; }; // namespace foo + +SERIALIZABLE_REGISTER(s11n::Serializable,foo::FooClass); + #endif // FOO_H_INCLUDED Index: Makefile =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile 14 Oct 2003 20:38:41 -0000 1.1 +++ Makefile 17 Oct 2003 09:07:36 -0000 1.2 @@ -30,13 +30,7 @@ endif main_cpp_CPPFLAGS = -DSERIALIZABLE_TYPE=$(SERIALIZABLE_TYPE) -DSERIALIZABLE_TYPE_STRING=\"$(SERIALIZABLE_TYPE)\" main2_cpp_CPPFLAGS = -DSERIALIZABLE_TYPE=alts11n::AltSerializable -DSERIALIZABLE_TYPE_STRING=\"alts11n::AltSerializable\" -ifeq (elib,$(PACKAGE_NAME)) - s11nconvert_bin_LDADD += $(ELIB_LDADD) -else - BIN_PROGRAMS_LDADD += $(S11N_CLIENT_LDADD) -# alts11nconvert_bin_LDADD += $(S11N_CLIENT_LDADD) -endif - +BIN_PROGRAMS_LDADD += $(S11N_CLIENT_LDADD) include $(toc_makesdir)/BIN_PROGRAMS.make INSTALL_BINS = $(BIN_PROGRAMS) Index: main.cpp =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/s11nconvert/main.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- main.cpp 14 Oct 2003 03:26:54 -0000 1.1 +++ main.cpp 17 Oct 2003 09:07:36 -0000 1.2 @@ -26,11 +26,15 @@ #include <toolbox/class_name.h> #include <toolbox/Instantiator.h> -#include <s11n/S11n.h> #include <s11n/s11n_io.h> #include <s11n/serializer_loader.h> #include <s11n/node_loader.h> + #include <s11n/Serializable.h> +// #include <s11n/serializable_adapter.h> +// SERIALIZABLE_ADAPTER(s11n::Serializable,s7e,d9e); + + // #include <s11n/include_from_main.h> #if HAVE_CONFIG_H @@ -54,6 +58,7 @@ #ifndef SERIALIZABLE_TYPE_STRING # define SERIALIZABLE_TYPE_STRING "s11n::Serializable" #endif + #include "AltSerializable.h" |
From: <sg...@us...> - 2003-10-17 09:23:15
|
Update of /cvsroot/libfunutil/libfunutil/tests In directory sc8-pr-cvs1:/tmp/cvs-serv21278 Modified Files: Makefile Log Message: removed s11n tests - these are currently obsolete Index: Makefile =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/tests/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile 27 Sep 2003 22:40:15 -0000 1.3 +++ Makefile 17 Oct 2003 09:18:47 -0000 1.4 @@ -1,8 +1,8 @@ SUBDIRS = funUtil include toc.make -ifeq (1,$(configure_enable_s11n)) -SUBDIRS += s11n -endif +#ifeq (1,$(configure_enable_s11n)) +#SUBDIRS += s11n +#endif all: subdirs |
From: <sg...@us...> - 2003-10-15 10:00:13
|
Update of /cvsroot/libfunutil/libfunutil/toc/tests In directory sc8-pr-cvs1:/tmp/cvs-serv23364 Modified Files: readline.sh Log Message: i never thought i'd be writing config tests to accomodate diffs between different suse releases... Index: readline.sh =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/toc/tests/readline.sh,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- readline.sh 27 Sep 2003 22:34:03 -0000 1.9 +++ readline.sh 15 Oct 2003 09:59:34 -0000 1.10 @@ -33,11 +33,18 @@ } configure_with_libreadline=${configure_with_libreadline-0} -libname=libreadline.a + libpath=/usr/lib:/usr/local/lib:${prefix}/lib:/lib -toc_find_failok $libname $libpath || { - echo "Couldn't find $libname in path [${libpath}]" - return 1 +do=0 +for L in libreadline.a libreadline.so.4; do + toc_find_failok $L "$libpath" && { + do=1 + break + } +done +test x$do = x0 && { + echo "libreadline library file not found." + return 0 } lib=${TOC_FIND_RESULT} |
From: <sg...@us...> - 2003-10-14 20:42:36
|
Update of /cvsroot/libfunutil/libfunutil/lib/s11n/parsers In directory sc8-pr-cvs1:/tmp/cvs-serv24817/lib/s11n/parsers Modified Files: funtxt.flex.at Log Message: a few minor changes/fixes from the main tree. Index: funtxt.flex.at =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/parsers/funtxt.flex.at,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- funtxt.flex.at 14 Oct 2003 03:38:14 -0000 1.2 +++ funtxt.flex.at 14 Oct 2003 20:42:30 -0000 1.3 @@ -78,7 +78,6 @@ #include <toolbox/ClassLoader.h> #include <toolbox/Instantiator.h> #include <toolbox/KeyValueParser.h> -#include <s11n/S11n.h> // s11n_node and friends. #include <s11n/node_builder.h> |
Update of /cvsroot/libfunutil/libfunutil/lib/s11n In directory sc8-pr-cvs1:/tmp/cvs-serv24817/lib/s11n Modified Files: S11n.h Serializable.cpp Serializable.h node_builder.cpp node_builder.h s11n_node.h serializable_adapter.h Log Message: a few minor changes/fixes from the main tree. Index: S11n.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/S11n.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- S11n.h 14 Oct 2003 03:38:14 -0000 1.3 +++ S11n.h 14 Oct 2003 20:42:30 -0000 1.4 @@ -4,9 +4,10 @@ #ifndef S11N_H_INCLUDED #define S11N_H_INCLUDED 1 -#include <s11n/s11n_node.h> -#include <s11n/Serializable.h> -#include <s11n/serializable_adapter.h> +// please don't use this header - it's being phased out. +// #include <s11n/s11n_node.h> +// #include <s11n/Serializable.h> +// #include <s11n/serializable_adapter.h> /** The s11n serialization (s11n) framework is an object serialization framework modelled heavily off work by Rusty Ballinger Index: Serializable.cpp =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/Serializable.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Serializable.cpp 14 Oct 2003 03:07:15 -0000 1.1 +++ Serializable.cpp 14 Oct 2003 20:42:30 -0000 1.2 @@ -1,8 +1,10 @@ -#include "Serializable.h" #include <s11n/s11n-macros.h> // CERR #include <s11n/s11n_node.h> -#include <s11n/serializable_adapter.h> +// #include <s11n/serializable_adapter.h> +#include "Serializable.h" + +#include <s11n/s11n_node.h> // make the library aware of Serializable as a serializable type: Index: Serializable.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/Serializable.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Serializable.h 14 Oct 2003 03:07:15 -0000 1.1 +++ Serializable.h 14 Oct 2003 20:42:30 -0000 1.2 @@ -7,10 +7,8 @@ #define SERIALIZABLE_H_INCLUDED #include <string> -#include <s11n/s11n_node.h> - namespace s11n { - + class s11n_node; // forward decl /** Serializable plays several roles: @@ -100,7 +98,7 @@ #include <s11n/serializable_adapter.h> -SERIALIZABLE_ADAPTER(s11n::Serializable,s7e,d9e); // this is the only sane place to put this, i think? - +SERIALIZABLE_ADAPTER(s11n::Serializable,s7e,d9e); // this is the +// only sane place to put this, i think? #endif // SERIALIZABLE_H_INCLUDED Index: node_builder.cpp =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/node_builder.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- node_builder.cpp 14 Oct 2003 03:07:15 -0000 1.1 +++ node_builder.cpp 14 Oct 2003 20:42:30 -0000 1.2 @@ -8,8 +8,12 @@ #include <s11n/s11n-macros.h> // CERR macro #include <toolbox/PointerList.h> #include <toolbox/ClassLoader.h> -#include <s11n/S11n.h> + +#include <s11n/serializable_adapter.h> +#include <s11n/Serializable.h> #include <s11n/node_builder.h> + +#include <s11n/s11n_node.h> #define LEXER_LOUD 0 Index: node_builder.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/node_builder.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- node_builder.h 14 Oct 2003 03:07:15 -0000 1.1 +++ node_builder.h 14 Oct 2003 20:42:30 -0000 1.2 @@ -10,13 +10,11 @@ #include <cassert> #include <toolbox/PointerList.h> -#include <toolbox/ClassLoader.h> -#include <s11n/s11n_node.h> namespace s11n { - + class s11n_node; // forward decl /** node_builder is a helper class for building trees from Index: s11n_node.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/s11n_node.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- s11n_node.h 14 Oct 2003 03:07:15 -0000 1.1 +++ s11n_node.h 14 Oct 2003 20:42:30 -0000 1.2 @@ -250,7 +250,7 @@ return tgt; } - if ( ! serializable_adapter<SerializableType>::proxy_deserialize( *tgt, *this ) ) + if ( ! serializable_adapter<SerializableType>::deserialize( *tgt, *this ) ) { NODEDEBUG << "tgt->deserialize() failed. Deleting tgt. impl_class="<< classname << ", nodename=" << this->name() << std::endl; delete( tgt ); @@ -276,7 +276,7 @@ // std::string classname = Adapter::impl_class(); // node->impl_class( Adapter::impl_class() ); NODEDEBUG << "serialize(" << nodename << " , " <<std::hex << &ser << ") typeid=["<<typeid(ser).name()<<"] impl_class="<<node->impl_class() << std::endl; - if ( !Adapter::proxy_serialize( ser, *node ) ) + if ( !Adapter::serialize( ser, *node ) ) { NODEDEBUG << "serialize(" << nodename << " , " <<std::hex << &ser << ") failed!" << std::endl; delete( node ); @@ -302,7 +302,7 @@ bool serialize( const SerializableType & ser ) { typedef serializable_adapter<SerializableType> Adapter; - return Adapter::proxy_serialize( ser, *this ); + return Adapter::serialize( ser, *this ); } @@ -516,7 +516,7 @@ ch = ( *it ); node = new s11n_node(); node->name( nodename ); - if ( ! Adapter::proxy_serialize( *ch, *node ) ) + if ( ! Adapter::serialize( *ch, *node ) ) { delete( node ); worked = false; @@ -546,7 +546,7 @@ bool deserialize( SerializableType & tgt ) const { NODEDEBUG << "bool deserialize<T>()" << std::endl; - return serializable_adapter<SerializableType>::proxy_deserialize( tgt, *this ); + return serializable_adapter<SerializableType>::deserialize( tgt, *this ); } /** Index: serializable_adapter.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/s11n/serializable_adapter.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- serializable_adapter.h 14 Oct 2003 03:07:15 -0000 1.1 +++ serializable_adapter.h 14 Oct 2003 20:42:30 -0000 1.2 @@ -10,8 +10,8 @@ #include <toolbox/ClassLoader.h> #include <toolbox/class_name.h> - -// funny how this code can compile without any other s11n code, via +// #include <s11n/s11n_node.h> +// funny how this class can compile without any other s11n code, via // the magic of templates. @@ -22,58 +22,8 @@ class s11n_node; } -namespace { // anonymous ns, important for linking reasons - - template <typename T, typename X> struct serializable_adapter; // forward decl - /** - This class exists solely for experimental classloading reasons! - */ - struct base_serializable_adapter - { - base_serializable_adapter(){} - virtual ~base_serializable_adapter(){} - - virtual const char * impl_class() const { return "base_serializable_adapter::impl_class() needs to be overridden by a specialization"; }; - -// template <class serializable_type,class node_type> -// bool serialize( const serializable_type & ser, node_type & node ) -// { -// return false; -// } -// template <class serializable_type,class node_type> -// bool deserialize( serializable_type & ser, const node_type & node ) -// { -// return false; -// } - - template <class serializable_type,class node_type> - static bool proxy_serialize( const serializable_type & ser, node_type & node ) - { - return toolbox::context_singleton< - serializable_adapter<serializable_type,node_type> , - serializable_type - >::instance().serialize( ser, node ); - } - - template <class serializable_type,class node_type> - static bool proxy_deserialize( serializable_type & ser, const node_type & node ) - { - return toolbox::context_singleton< - serializable_adapter<serializable_type,node_type> , - serializable_type - >::instance().deserialize( ser, node ); - } - - template <class serializable_type,class node_type> - static const char * proxy_impl_class() - { - return toolbox::context_singleton< - serializable_adapter<serializable_type,node_type> , - serializable_type - >::instance().impl_class( ser, node ); - } +namespace { - }; /** This class acts as a proxy between concrete @@ -114,7 +64,7 @@ setting an s11n_node's impl_class() during serialization. */ template <class SerializableType,class NodeType = s11n::s11n_node> - class serializable_adapter : public base_serializable_adapter + class serializable_adapter { public: typedef serializable_adapter<SerializableType,NodeType> ThisType; @@ -122,9 +72,6 @@ typedef SerializableType serializable_type; typedef SerializableType impl_type; - serializable_adapter(){} - virtual ~serializable_adapter(){}; - #define NOT_SPECIALIZED(func) CERR << ":? got non-specialized "<<# func<<"()! You must specialize serializable_adaptor<T> for type "<<typeid(ser).name()<< std::endl; assert(0); /** Returns the class name for x. @@ -134,33 +81,38 @@ template signature, but this is the only way i've found to ensure the class name. */ - virtual const char * impl_class() const + static std::string class_name() { - NOT_SPECIALIZED(impl_class); + NOT_SPECIALIZED(class_name); return typeid(ser).name(); + /* aaarrgggg!! why does this always return the serializable_type classname in specializations??? + classloader_registerer<serializable_type,impl_type>::class_name(); */ } - bool serialize( const serializable_type & ser, node_type & node ) + static bool serialize( const serializable_type & ser, node_type & node ) { NOT_SPECIALIZED(serialize); - node.impl_class( impl_class() ); + node.impl_class( class_name() ); return ser.serialize( node ); } - bool deserialize( serializable_type & ser, const node_type & node ) + static bool deserialize( serializable_type & ser, const node_type & node ) { NOT_SPECIALIZED(deserialize); return ser.serialize( node ); } + protected: + serializable_adapter(){} + ~serializable_adapter(){}; // unimpl. + private: static std::string m_implclass; }; // basic_serializable_adaptor /** Quasi-bogus specialization to accomodate usage of, e.g., - container::value_type as a SerializableType parameter in - container-related de/ser methods. + container::value_type as a SerializableType parameter. */ template <class SerializableType,class NodeType> class serializable_adapter<SerializableType *,NodeType> : public serializable_adapter <SerializableType,NodeType>{}; @@ -186,24 +138,23 @@ */ #define SERIALIZABLE_ADAPTER(SerInterface,SerializE,DeserializE) \ CLASSLOADER_REGISTER(SerInterface,SerInterface); \ - CLASSLOADER_REGISTER(base_serializable_adapter,serializable_adapter<SerInterface>); \ CLASS_NAME(SerInterface); \ namespace { \ typedef s11n::s11n_node node_type;\ - template <> struct serializable_adapter<SerInterface,node_type> : public base_serializable_adapter { \ + template <> struct serializable_adapter<SerInterface,node_type> { \ typedef SerInterface serializable_type; \ typedef SerInterface impl_type; \ typedef serializable_adapter<SerInterface,node_type> this_t; \ explicit serializable_adapter(){}; \ ~serializable_adapter(){}; \ - virtual const char * impl_class() const \ + static std::string class_name() \ { return # SerInterface; }\ - bool serialize( const serializable_type & ser, node_type &node ) \ + static bool serialize( const serializable_type & ser, node_type &node ) \ { \ - node.impl_class( impl_class() ); \ + node.impl_class( class_name() ); \ return ser.SerializE( node ); \ } \ - bool deserialize( serializable_type & ser, const node_type & node ) \ + static bool deserialize( serializable_type & ser, const node_type & node ) \ { return ser.DeserializE( node ); } \ }; \ } @@ -246,7 +197,6 @@ #define SERIALIZABLE_REGISTER(SerInterface,SerImpl) \ CLASS_NAME(SerImpl); \ - CLASSLOADER_REGISTER(base_serializable_adapter,serializable_adapter<SerImpl>); \ CLASSLOADER_REGISTER(SerInterface,SerImpl); \ CLASSLOADER_REGISTER(SerImpl,SerImpl); \ namespace { \ @@ -258,15 +208,15 @@ typedef serializable_adapter<impl_type,node_type> this_t; \ explicit serializable_adapter(){}; \ ~serializable_adapter(){}; \ - virtual const char * impl_class() const \ + static std::string class_name() \ { return # SerImpl; }\ - bool serialize( const serializable_type & ser, node_type &node ) \ + static bool serialize( const serializable_type & ser, node_type &node ) \ { \ bool b = parent_t::serialize( ser, node ); \ - node.impl_class( impl_class() ); \ + node.impl_class( class_name() ); \ return b; \ } \ - bool deserialize( serializable_type & ser, const node_type & node ) \ + static bool deserialize( serializable_type & ser, const node_type & node ) \ { return parent_t::deserialize( ser, node ); } \ }; \ template<> struct serializable_adapter<SerImpl *,node_type> : public serializable_adapter<SerImpl,node_type> {};\ |
From: <sg...@us...> - 2003-10-14 20:42:00
|
Update of /cvsroot/libfunutil/libfunutil/lib In directory sc8-pr-cvs1:/tmp/cvs-serv24684/lib Modified Files: Makefile Log Message: doh - corrected subdirs assignment. Index: Makefile =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile 14 Oct 2003 04:35:06 -0000 1.6 +++ Makefile 14 Oct 2003 20:41:56 -0000 1.7 @@ -5,7 +5,7 @@ SUBDIRS += toolbox s11n endif -SUBDIRS = funUtil +SUBDIRS += funUtil all: subdirs |
From: <sg...@us...> - 2003-10-14 20:38:45
|
Update of /cvsroot/libfunutil/libfunutil/client/s11nconvert In directory sc8-pr-cvs1:/tmp/cvs-serv24206/client/s11nconvert Added Files: Makefile Log Message: egg --- NEW FILE: Makefile --- include toc.make # CPPFLAGS += -DCLASSLOADER_DEBUG=1 DIST_FILES += $(wildcard in.* *.cpp *.h) BIN_PROGRAMS = s11nconvert # alts11nconvert s11nconvert_bin_OBJECTS = main.o AltSerializable.o alts11nconvert_bin_OBJECTS = main2.o AltSerializable.o main2.cpp: main.cpp cp $< $@ main2.o: Makefile CLEAN_FILES += main2.* main.o: Makefile tip: FORCE @echo -e "tip: build with\n\tALTS11N=classname ${MAKE}\nto set the default Serializable implementation used (e.g.) by the -d option.";\ echo "The current Serializable type is $(SERIALIZABLE_TYPE)." SERIALIZABLE_TYPE = s11n::Serializable ifeq (1,${ALTS11N}) SERIALIZABLE_TYPE = alts11n::AltSerializable else ifneq (,${ALTS11N}) SERIALIZABLE_TYPE = ${ALTS11N} endif endif main_cpp_CPPFLAGS = -DSERIALIZABLE_TYPE=$(SERIALIZABLE_TYPE) -DSERIALIZABLE_TYPE_STRING=\"$(SERIALIZABLE_TYPE)\" main2_cpp_CPPFLAGS = -DSERIALIZABLE_TYPE=alts11n::AltSerializable -DSERIALIZABLE_TYPE_STRING=\"alts11n::AltSerializable\" ifeq (elib,$(PACKAGE_NAME)) s11nconvert_bin_LDADD += $(ELIB_LDADD) else BIN_PROGRAMS_LDADD += $(S11N_CLIENT_LDADD) # alts11nconvert_bin_LDADD += $(S11N_CLIENT_LDADD) endif include $(toc_makesdir)/BIN_PROGRAMS.make INSTALL_BINS = $(BIN_PROGRAMS) %.o: Makefile SHARED_LIBS = BigSO AltSerializable FooClass BarClass SHARED_LIBS_LDADD = $(L_S11N) # FooClass BarClass LoadableSubclass FooClass_so_OBJECTS = FooClass.o BarClass_so_OBJECTS = BarClass.o # LoadableSubclass_so_OBJECTS = LoadableSubclass.o BigSO_so_OBJECTS = BarClass.o FooClass.o CLEAN_FILES += FooClass.so BarClass.so include $(toc_makesdir)/SHARED_LIBS.make link-bigso: BigSO.so for i in FooClass BarClass; do ln -fs $< $$i.so; done INSTALL_LIBEXECS = # reset the list auto-generated by SHARED_LIBS. %.so: $(S11N_LIB_SO) s11nconvert: $(S11N_LIB_SO) #FooClass.so: # ln -s BigSO.so $@ #BarClass.so: # ln -s BigSO.so $@ install-BINS: strip-bins all: BIN_PROGRAMS SHARED_LIBS tip link-bigso alt: clean ALTS11N=1 ${MAKE} |
From: <sg...@us...> - 2003-10-14 20:38:17
|
Update of /cvsroot/libfunutil/libfunutil/lib/s11n/parsers In directory sc8-pr-cvs1:/tmp/cvs-serv24164/lib/s11n/parsers Removed Files: common_flex_definitions.in Log Message: should not have been here. --- common_flex_definitions.in DELETED --- |
From: <sg...@us...> - 2003-10-14 20:37:55
|
Update of /cvsroot/libfunutil/libfunutil/lib/s11n/parsers In directory sc8-pr-cvs1:/tmp/cvs-serv24075/lib/s11n/parsers Added Files: common_flex_definitions.at compact.flex.at hex.flex.at paren.flex.at Log Message: egg. apparently forgot them last night. --- NEW FILE: common_flex_definitions.at --- SPACE ([ \t]) NONSPACE ([^ \t]) WORD ([_[:alnum:]]+) WORDS (({WORD}{SPACE}){2,}) START_OF_LINE ^({SPACE}*) DIGIT ([0-9]) INTEGER ({DIGIT}+) DOUBLE_QUOTED_STRING ([\"]([^\"]|(\\\"))+[\"]) SINGLE_QUOTED_STRING ([\'][^\']*[\']) QUOTED_STRING ({SINGLE_QUOTED_STRING}|{DOUBLE_QUOTED_STRING}) // QUOTED_STRING: doesn't yet handle escaped quotes-in-quotes. Need to use //# separate states for that, i think. NUMBER_type1 ([-+]?{DIGIT}+\.?([eE][-+]?{DIGIT}+)?) NUMBER_type2 ([-+]?{DIGIT}*\.{DIGIT}+([eE][-+]?{DIGIT}+)?) NUMBER ({NUMBER_type1}|{NUMBER_type2}) CLASSNAME (({WORD}\:\:)+)?{WORD} ALMOST_A_WORD [\._a-zA-Z0-9]+ VARNAME ([a-zA-Z_][_a-zA-Z0-9]*) VARNAME_LENIENT ([a-zA-Z_][\.\-_a-zA-Z0-9]*|{CLASSNAME}) HEX_DIGIT ([a-fA-F0-9]) RGB_COLOR (#{HEX_DIGIT}{6}) SEMICOLON ({SPACE}*;+{SPACE}*) // ESCAPED_MULTILINE ((.*\$)/[^(\\\n)]*) // ESCAPED_MULTILINE ([.]+([^\\]\n$)) // {ESCAPED_MULTILINE}| // PROPERTY_TYPES ({ESCAPED_MULTILINE}) //UNTIL_SEMICOLON .+\;{SPACE}*$ //PROPERTY_VALUE ({NUMBER}|{ALMOST_A_WORD}|{QUOTED_STRING}|{WORD_WITH_PUNCTUATION}|{RGB_COLOR}) // WORD_WITH_PUNCTUATION [#.\!\?\-_a-zA-Z0-9]+ //UNTIL_EOL ([.\n]+[^\\]$) UNTIL_SEMICOLON (.+;) //ESCAPED_LINES ((.+([\\]\n))+[^\\]\n) PROPERTY_DECL_RULES ({QUOTED_STRING}|{ALMOST_A_WORD}|{WORDS}|{RGB_COLOR}) PROP_DECL_EQUALS (({WORD}|{NUMBER}){SPACE}*={SPACE}*) PROP_DECL_SPACE (({WORD}|{NUMBER}){SPACE}+) PROPERTY_DECLS ({PROP_DECL_EQUALS}|{PROP_DECL_SPACE}) PROPERTY_DEFINITION ({PROPERTY_DECLS}{PROPERTY_DECL_RULES}) // \<[^/][^\>]+\> { add_token( elib::efstring( "opening ",YYText() ) ); } // \<\/[^\>]+\> { add_token( elib::efstring( "closing ",YYText() ) ); } --- NEW FILE: compact.flex.at --- %option c++ %{ // // LICENSE: Public Domain // Author: stephan - sg...@us... // #define YY_SKIP_YYWRAP 1 int yywrap() { return 1; } // #include <stdio.h> #include <cassert> #include <iostream> #include <string> #include <deque> #include <s11n/s11n-macros.h> // COUT/CERR #define PCERR CERR << "compact.flex error:" // #include <toolbox/string_util.h> // trim_string() // #include <toolbox/PropertyStore.h> // #include <toolbox/ClassLoader.h> // #include <toolbox/Instantiator.h> // #include <toolbox/KeyValueParser.h> #include <s11n/node_builder.h> #include <s11n/flex_lexers.h> #include <toolbox/string_util.h> // hex2int() using std::cin; using std::cerr; using std::cout; using std::endl; /** Basic grammar spec: {NODE_OPEN}{NAME_SIZE}{NODE_NAME}<class_name_size>{CLASSNAME} ({PROP_OPEN}<key_size><key><value_size><value>)* (sub-nodes)* {NODE_CLOSE} See the lex source for the meanings of the {TOKENS} named above. */ namespace { unsigned long node_depth = 0; unsigned int loops = 0; std::string word; std::string propname; std::string propval; std::string nodename; std::string nodeclass; bool in_prop; unsigned int decval = 0; unsigned int lcv = 0; s11n::node_builder * serbuilder = 0; } namespace s11n { FlexLexer * CompactTreeBuilder::lexer() { FlexLexer * fp = 0; fp = this->FlexTreeBuilder::lexer(); if( fp ) return fp; // else first-time setup: this->reset(); return this->FlexTreeBuilder::lexer(); } void CompactTreeBuilder::reset() { this->FlexTreeBuilder::reset(); FlexLexer * foo = new compactFlexLexer(); this->FlexTreeBuilder::lexer( foo ); serbuilder = this->builder(); node_depth = 0; } } // namespace s11n namespace { char inchar; } #define READWORD(SZ) word = ""; \ for( int i = 0; i < SZ; i++ )\ {\ inchar = yyinput(); \ if( 0 == inchar ) {word=""; PCERR << "Reached EOF during READWORD!" << endl; return 0;} \ word += inchar; \ };\ decval = toolbox::hex2int(word) // if( 0 == decval ) { PCERR << "Error reading word of size " << SZ<<". Maybe reached end of input?" << endl; return 0; } %} HEX_DIGIT ([a-fA-F0-9]) WORD4 ({HEX_DIGIT}{4}) // maintenance note: these hex codes must be kept in sync with those from HexSerializer's enum NODE_OPEN f1 NODE_CLOSE f0 PROP_OPEN e1 COOKIE 51191001 DATA_END 51191000 %% {COOKIE} {;} {DATA_END} { return 0; } [ \t\n] {;} {NODE_OPEN} { //COUT << "Opening node." << std::endl; READWORD(2); // read node name size nodename = ""; loops = decval; for( lcv = 0; lcv < loops; lcv++ ) { //READWORD(2); //cout << "["<<word<<"/"<<decval<<"]"; nodename += yyinput(); // (unsigned char) decval; } //cout<< endl; READWORD(2); // get class name size nodeclass = ""; loops = decval; for( lcv = 0; lcv < loops; lcv++ ) { // read class name nodeclass += (unsigned char) yyinput(); // decval; } //COUT << "nodename=["<<nodename<<"]"<<"["<<nodeclass<<"]"<<endl; if( ! serbuilder->open_node( nodeclass, nodename ) ) { PCERR<< "open_node("<<nodeclass<<","<<nodename<<") failed." << endl; return 0; } nodename = nodeclass = ""; } {NODE_CLOSE} { //COUT << "Closing node." << std::endl; serbuilder->close_node(); if( 0 == serbuilder->node_depth() ) { // stop once we close the first top-level node. return 0; } continue; } {PROP_OPEN} { //COUTL( "Opening property" ); propname = ""; READWORD(2); // prop name size loops = decval; for( lcv = 0; lcv < loops; lcv++ ) { // read property name propname += (unsigned char) yyinput(); // decval; } READWORD(8); // get value size propval = ""; loops = decval; for( lcv = 0; lcv < loops; lcv++ ) { // read property's value propval += (unsigned char) yyinput(); // decval; } serbuilder->add_property( propname, propval ); propval = propname = ""; } [.] { PCERR << "unexpected token: " << YYText() <<std::endl; return 0; } %% #if COMPACT_DO_MAIN #include <s11n/s11n_io.h> // HexSerializer // #include <s11n/FlexShell.h> // #include <s11n/ELib.h> using namespace s11n; int main( int argc, char ** argv ) { s11n::CompactTreeBuilder bob; FlexLexer * lexer = bob.lexer(); // FlexLexer * lexer = new compactFlexLexer(); while( 0 != (lexer->yylex() ) ); if( bob.root_node() ) { s11n::ParenSerializer ser; ser.serialize( *(bob.root_node()), std::cout ); // s11n::CompactSerializer compact; // compact.serialize( *(bob.root_node()), std::cout ); } return 0; } #endif --- NEW FILE: hex.flex.at --- %option c++ %{ // // LICENSE: Public Domain // Author: stephan - sg...@us... // #define YY_SKIP_YYWRAP 1 int yywrap() { return 1; } // #include <stdio.h> #include <cassert> #include <iostream> #include <string> #include <deque> #include <s11n/s11n-macros.h> // COUT/CERR #define PCERR CERR << "hex.flex error:" // #include <toolbox/string_util.h> // trim_string() // #include <toolbox/PropertyStore.h> // #include <toolbox/ClassLoader.h> // #include <toolbox/Instantiator.h> // #include <toolbox/KeyValueParser.h> #include <s11n/node_builder.h> #include <s11n/flex_lexers.h> #include <toolbox/string_util.h> // hex2int() using std::cin; using std::cerr; using std::cout; using std::endl; /** Basic grammar spec for the "hexed" serialization format: {NODE_OPEN}{NAME_SIZE}{NODE_NAME}<class_name_size>{CLASSNAME} ({PROP_OPEN}<key_size><key><value_size><value>)* (sub-nodes)* {NODE_CLOSE} See the lex source for the meanings of the {TOKENS} named above. */ namespace { unsigned long node_depth = 0; unsigned int loops = 0; std::string word; std::string propname; std::string propval; std::string nodename; std::string nodeclass; bool in_prop; unsigned int decval = 0; unsigned int lcv = 0; s11n::node_builder * serbuilder = 0; } namespace s11n { FlexLexer * HexTreeBuilder::lexer() { FlexLexer * fp = 0; fp = this->FlexTreeBuilder::lexer(); if( fp ) return fp; // else first-time setup: this->reset(); return this->FlexTreeBuilder::lexer(); } void HexTreeBuilder::reset() { this->FlexTreeBuilder::reset(); FlexLexer * foo = new hexFlexLexer(); this->FlexTreeBuilder::lexer( foo ); serbuilder = this->builder(); node_depth = 0; } } // namespace s11n namespace { char inchar; } #define READWORD(SZ) word = ""; \ for( int i = 0; i < SZ; i++ )\ {\ inchar = yyinput(); \ if( 0 == inchar ) {word=""; return 0;} \ word += inchar; \ };\ decval = toolbox::hex2int(word);\ if( 0 == decval ) { PCERR << "Error reading word (size="<<SZ<<"). Maybe reached end of input?" << endl; return 0; } %} HEX_DIGIT ([a-fA-F0-9]) WORD2 {HEX_DIGIT}{2} // maintenance note: these hex codes must be kept in sync with those from HexSerializer's enum NODE_OPEN 11 NODE_CLOSE 10 PROP_OPEN 21 COOKIE 51190001 DATA_END 51190000 %% \n {;} {COOKIE} {;} {DATA_END} { return 0; } {NODE_OPEN} { //COUT << "Opening node." << std::endl; READWORD(2); // read node name size nodename = ""; loops = decval; for( lcv = 0; lcv < loops; lcv++ ) { // read node name READWORD(2); // read next char of node name. nodename += (unsigned char) decval; } //cout<< endl; READWORD(2); // get class name size nodeclass = ""; loops = decval; for( lcv = 0; lcv < loops; lcv++ ) { // read class name READWORD(2); // get next char nodeclass += (unsigned char) decval; } if( ! serbuilder->open_node( nodeclass, nodename ) ) { PCERR<< "open_node("<<nodeclass<<","<<nodename<<") failed." << endl; return 0; } } {NODE_CLOSE} { //COUT << "Closing node." << std::endl; serbuilder->close_node(); if( 0 == serbuilder->node_depth() ) { // stop once we close the first top-level node. return 0; } } {PROP_OPEN} { //COUTL( "Opening property" ); READWORD(2); // prop name size //COUT << "name size=" <<word << " dec="<<decval<<std::endl; propname = ""; loops = decval; for( lcv = 0; lcv < loops; lcv++ ) { // read property naem READWORD(2); // next char propname += (unsigned char) decval; } READWORD(8); // get value size propval = ""; loops = decval; for( lcv = 0; lcv < loops; lcv++ ) { // read property's value READWORD(2); // next char propval += (unsigned char) decval; } serbuilder->add_property( propname, propval ); } {WORD2}|[.] { PCERR<< "unexpected token: " << YYText()<<std::endl; return 0; } %% #if HEX_DO_MAIN #include <s11n/s11n_io.h> // HexSerializer // #include <s11n/FlexShell.h> // #include <s11n/ELib.h> using namespace s11n; int main( int argc, char ** argv ) { s11n::HexTreeBuilder bob; FlexLexer * lexer = bob.lexer(); // FlexLexer * lexer = new hexFlexLexer(); while( 0 != (lexer->yylex() ) ); if( bob.root_node() ) { s11n::ParenSerializer ser; ser.serialize( *(bob.root_node()), std::cout ); } return 0; } #endif --- NEW FILE: paren.flex.at --- %option c++ %{ /** LICENSE: Public Domain Author: stephan - sg...@us... This lexer reads in a lisp-like (but not lisp) grammar for the s11n framework. It's output partner is s11n::ParenSerializer. Sample: nodename=(ImplClassName (propery_name property value) (prop2 value of \) prop2) another_node=(ns::ClassName) ) nodename represents an s11n_node::name() ImplClassName represents the object's impl_class() value. Note that closing parens in your data must be backslash-escaped. This parser arguably strips all non-paired backslashes, so any actual backslashes must also be escaped (C-style). The ParensSerializer takes this into account and escapes it's serialized data. */ #define YY_SKIP_YYWRAP 1 int yywrap() { return 1; } // #include <stdio.h> #include <cassert> #include <iostream> #include <string> #include <deque> #include <s11n/s11n-macros.h> // COUT/CERR #define PCERR CERR << "paren.flex error:" #include <toolbox/string_util.h> // trim_string() // #include <toolbox/PropertyStore.h> // #include <toolbox/ClassLoader.h> // #include <toolbox/Instantiator.h> // #include <toolbox/KeyValueParser.h> #include <s11n/node_builder.h> #include <s11n/flex_lexers.h> using std::cin; using std::cerr; using std::cout; using std::endl; namespace { unsigned long node_depth = 0; std::string tmpstr; std::string nodename; std::string nodeclass; bool in_prop; s11n::node_builder * serbuilder = 0; } namespace s11n { FlexLexer * ParenTreeBuilder::lexer() { FlexLexer * fp = 0; fp = this->FlexTreeBuilder::lexer(); if( fp ) return fp; // else first-time setup: this->reset(); return this->FlexTreeBuilder::lexer(); } void ParenTreeBuilder::reset() { this->FlexTreeBuilder::reset(); FlexLexer * foo = new parenFlexLexer(); this->FlexTreeBuilder::lexer( foo ); serbuilder = this->builder(); node_depth = 0; } } // namespace s11n /***** *****/ %} @COMMON_DEFINITIONS@ %x OPEN_CLASS %x IN_PROPERTY OPENER \( CLOSER \) NODENAME {VARNAME} PROPERTY {VARNAME} %% {SPACE}*[#;].*$ {;} // comment lines "(*" { // (* comment blocks *) // Code mostly taken from the flex info pages. int c; while((c = yyinput()) != 0) { if(c == '*') { c = yyinput(); if( 0 == c ) { PCERR << "hit EOF in a (*comment block*)." << std::endl; return 0; } if( ')' == c ) break; //??? else unput(c); } } return 1; } {OPENER}{SPACE}* { BEGIN IN_PROPERTY; } <IN_PROPERTY>({VARNAME}|{NUMBER})({SPACE})* { // key name of property std::string propname = YYText(); // strip leading/trailing spaces from the property name: static const std::string avoid = " \t\n"; std::string::size_type tail = propname.find_last_not_of( avoid ); propname = propname.substr( propname.find_first_not_of( avoid ), (std::string::npos == tail) ? tail : (tail + 1) ); //COUT << "property ["<<propname<<"] = "; // Now we consider all data until a non-escaped closing brace // to be the value of the property... std::string propval = ""; unsigned char c = yyinput(); bool escaped = false; while( 0 != c ) { if( (!escaped) && '\\' == c ) { // next char will be considered escaped, and this slash is stripped. escaped = true; c = yyinput(); if( ')' != c ) propval += '\\'; // ^^^^ put back the slash. We only want to strip escapes from closing parens. continue; } if ( !escaped && ')' == c ) { // Look for a non-escaped paren to close // us. Ideally we would count the // opened/closed "data parens", but this would // quickly get complicated and would breaking // with certain data sets. break; } escaped = false; propval += c; c = yyinput(); //COUT << "["<<c<<"]"<<endl; } if( 0 == c ) { PCERR << "Reached EOF while reading value for property '"<<propname<<"'. This shouldn't happen." << std::endl; return 0; } //std::cout << "["<<propval<<"]"<<std::endl; serbuilder->add_property( propname, propval ); BEGIN 0; } {NODENAME}={OPENER} { tmpstr = YYText(); nodename = tmpstr.substr( 0, tmpstr.find( "=" ) ); //COUT << "node name="<<nodename<<std::endl; BEGIN OPEN_CLASS; } <OPEN_CLASS>{SPACE}+ {;} <OPEN_CLASS>{CLOSER} { // special case: empty node: nodename=() --node_depth; //COUT << "ignoring empty node " << nodename << std::endl; BEGIN 0; } <OPEN_CLASS>[{SPACE}\n]+ {;} <OPEN_CLASS>{CLASSNAME} { nodeclass = std::string(YYText()); if( nodeclass.empty() ) { PCERR << "nodes may not have empty names!" <<std::endl; return 0; } //COUT << "opening '"<<nodename<<"', class=" << nodeclass << std::endl; ++node_depth; if( ! serbuilder->open_node( nodeclass, nodename ) ) { PCERR<< "open_node("<<nodeclass<<","<<nodename<<") failed." << endl; return 0; } BEGIN 0; } <OPEN_CLASS>[.\n] { PCERR << "did not find class name after '"<<nodename<<"=(" << std::endl; return 0; } {CLOSER} { //COUT << node_depth<< " Closing node" << std::endl; serbuilder->close_node(); --node_depth; if( 0 == serbuilder->node_depth() ) { // stop once we close the first top-level node. return 0; } } ^"(s11n::parens)" {;} // magic cookie ({SPACE})|\n {;} . {;} // [.]+ { PCERR << "Unexpected token: [" << YYText()<<"]"<<std::endl;} %% // ^{SPACE}*[#;].*$ {;} // comment lines // [#;][^{OPENER}]* {;} // comments trailing after node closures #if PAREN_DO_MAIN #include <s11n/s11n_io.h> // ParenSerializer int main( int argc, char ** argv ) { s11n::ParenTreeBuilder bob; FlexLexer * lexer = bob.lexer(); while( 0 != (lexer->yylex() ) ); if( bob.root_node() ) { s11n::ParenSerializer ser; ser.serialize( *(bob.root_node()), std::cout ); } return 0; } #endif |
From: <sg...@us...> - 2003-10-14 04:35:10
|
Update of /cvsroot/libfunutil/libfunutil/lib In directory sc8-pr-cvs1:/tmp/cvs-serv16878/lib Modified Files: Makefile Log Message: moved s11n/toolbox in front of funUtil because some funUtil code will be serializable and will need the headers symlinked. Index: Makefile =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile 14 Oct 2003 03:11:17 -0000 1.5 +++ Makefile 14 Oct 2003 04:35:06 -0000 1.6 @@ -1,11 +1,11 @@ include toc.make -SUBDIRS = funUtil - ifeq (1,$(configure_enable_s11n)) SUBDIRS += toolbox s11n endif + +SUBDIRS = funUtil all: subdirs |
From: <sg...@us...> - 2003-10-14 04:34:34
|
Update of /cvsroot/libfunutil/libfunutil/lib/funUtil In directory sc8-pr-cvs1:/tmp/cvs-serv16793/lib/funUtil Modified Files: libfunutil.qmake Log Message: added Fudgish.{cpp,h} Index: libfunutil.qmake =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/funUtil/libfunutil.qmake,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- libfunutil.qmake 23 Aug 2003 20:36:47 -0000 1.20 +++ libfunutil.qmake 14 Oct 2003 04:34:30 -0000 1.21 @@ -16,6 +16,7 @@ Describable.cpp \ Deserializer.cpp \ DieRoll.cpp \ + Fudgeish.cpp \ KeyValueParser.cpp \ Nameable.cpp \ OtherSimpleCLParser.cpp \ @@ -41,6 +42,7 @@ Describable.h \ Deserializer.h \ DieRoll.h \ + Fudgeish.h \ KeyValueParser.h \ LoadableClass.h \ Nameable.h \ |
From: <sg...@us...> - 2003-10-14 04:34:17
|
Update of /cvsroot/libfunutil/libfunutil/lib/funUtil In directory sc8-pr-cvs1:/tmp/cvs-serv16775/lib/funUtil Modified Files: Fudgeish.cpp Fudgeish.h Log Message: doh - changed namespace to fun. Index: Fudgeish.cpp =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/funUtil/Fudgeish.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Fudgeish.cpp 14 Oct 2003 04:26:10 -0000 1.1 +++ Fudgeish.cpp 14 Oct 2003 04:34:13 -0000 1.2 @@ -4,26 +4,24 @@ #if HAVE_CONFIG_H -#include "config.h" +# include "config.h" #endif #include "Fudgeish.h" -#if FUDGE_USE_ELIB -# include <elib/elib_globals.h> // elib::random() -# include <elib/e-macs.h> // COUT -# define ROLLDF (elib::random(0,3) - 1 ) -#else -# include <stdlib.h> -# include <iostream> -# define ROLLDF ( (::random() % 3) - 1 ) -# define COUT std::cout << __FILE__<<":"<<__LINE__<<": " -// and let's hope ::random() is seeded from somewhere! :) +#if FUDGE_USE_S11N +# include <toolbox/debuggering_macros.h> // COUT #endif +#include <stdlib.h> +#include <iostream> +#define ROLLDF ( (::random() % 3) - 1 ) +#define COUT std::cout << __FILE__<<":"<<__LINE__<<": " +// and let's hope ::random() is seeded from somewhere! :) -namespace fudge + +namespace fun { using namespace std; @@ -72,24 +70,21 @@ return name; } - std::ostream & operator<<( std::ostream & os, const fudge::Buff & ca ) + std::ostream & operator<<( std::ostream & os, const fun::Buff & ca ) { os << "[" << ca.name(); os << " x"<< ca.count(); os << "]"; os << "] Scale="<<ca.scale(); // os << " x"<< ca->count(); - if( ca.offensive() ) os <<" ODF="<<fudge::ratingName(ca.odf()); - if( ca.defensive() ) os <<" DDF="<<fudge::ratingName(ca.ddf()); - // << " Range(?)="<< fudge::ratingName(ca.range()); + if( ca.offensive() ) os <<" ODF="<<fun::ratingName(ca.odf()); + if( ca.defensive() ) os <<" DDF="<<fun::ratingName(ca.ddf()); + // << " Range(?)="<< fun::ratingName(ca.range()); return os; }; dF::dF( short whichside ) -#if FUDGE_USE_ELIB - : s11n::Serializable( "fudge::dF" ) -#endif { this->side( whichside ); }; @@ -131,19 +126,19 @@ } -#if FUDGE_USE_ELIB +#if FUDGE_USE_S11N bool - dF::serialize( s11n::S11nNode & node ) const + dF::s7e( s11n::S11nNode & node ) const { - if( ! this->Serializable::serialize( node ) ) return false; + if( ! this->Serializable::s7e( node ) ) return false; node.set( "side", (this->side() == 0 ? "0" : (this->side()<0 ? "-" : "+") ) ); return true; } bool - dF::deserialize( const s11n::S11nNode &node ) + dF::d9e( const s11n::S11nNode &node ) { - if( ! this->Serializable::deserialize( node ) ) return false; + if( ! this->Serializable::d9e( node ) ) return false; std::string s = node.get_string( "side" ); if ( "+" == s ) this->side( 1 ); else if ( "-" == s ) this->side( -1 ); @@ -151,13 +146,9 @@ // else don't touch it. return true; } -#endif // FUDGE_USE_ELIB +#endif // FUDGE_USE_S11N - DiceBag::DiceBag( int dicecount ) : -#if FUDGE_USE_ELIB - s11n::Serializable( "fudge::DiceBag" ), -#endif -m_lastroll(0) + DiceBag::DiceBag( int dicecount ) : m_lastroll(0) { this->diceCount( dicecount ); //this->m_dice.auto_delete( true ); @@ -175,11 +166,11 @@ return this->m_dice; } -#if FUDGE_USE_ELIB +#if FUDGE_USE_S11N bool - DiceBag::serialize( s11n::S11nNode & node ) const + DiceBag::s7e( s11n::S11nNode & node ) const { - if( ! this->Serializable::serialize( node ) ) return false; + if( ! this->Serializable::s7e( node ) ) return false; //node.serialize_children( "dice", this->dice() ); // i do this instead to keep the file size down. dF's // are INSANELY BLOATED when serialized: @@ -195,11 +186,11 @@ } bool - DiceBag::deserialize( const s11n::S11nNode &node ) + DiceBag::d9e( const s11n::S11nNode &node ) { - if( ! this->Serializable::deserialize( node ) ) return false; + if( ! this->Serializable::d9e( node ) ) return false; //node.deserialize_children( "dice", this->dice() ); - fudge::dF die; + fun::dF die; char c; this->m_lastroll = 0; std::string dice = node.get( "dice", "" ); @@ -212,7 +203,7 @@ } return true; } -#endif // FUDGE_USE_ELIB +#endif // FUDGE_USE_S11N // bool @@ -319,9 +310,6 @@ int MaxVeryHurt, int MaxIncap, int MaxNearDeath ) -#if FUDGE_USE_ELIB - : s11n::Serializable( "fudge::WoundTrack" ) -#endif { this->init(); m_boxes[NoEffect] = 0; @@ -332,11 +320,11 @@ m_boxes[NearDeath] = MaxNearDeath; } -#if FUDGE_USE_ELIB +#if FUDGE_USE_S11N bool - WoundTrack::serialize( s11n::S11nNode & node ) const + WoundTrack::s7e( s11n::S11nNode & node ) const { - if( ! this->Serializable::serialize( node ) ) return false; + if( ! this->Serializable::s7e( node ) ) return false; std::string wname; for( int i = NoEffect; i <= NearDeath; i++ ) @@ -351,9 +339,9 @@ } bool - WoundTrack::deserialize( const s11n::S11nNode &node ) + WoundTrack::d9e( const s11n::S11nNode &node ) { - if( ! this->Serializable::deserialize( node ) ) return false; + if( ! this->Serializable::d9e( node ) ) return false; std::string wname; for( int i = NoEffect; i <= NearDeath; i++ ) { @@ -365,7 +353,7 @@ this->m_migratewounds = node.get( "migrate_wounds", this->m_migratewounds ); return true; } -#endif // FUDGE_USE_ELIB +#endif // FUDGE_USE_S11N Index: Fudgeish.h =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/lib/funUtil/Fudgeish.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Fudgeish.h 14 Oct 2003 04:26:10 -0000 1.1 +++ Fudgeish.h 14 Oct 2003 04:34:13 -0000 1.2 @@ -7,34 +7,31 @@ #include <iostream> #include <string> -#ifndef FUDGE_USE_ELIB -#define FUDGE_USE_ELIB 0 -// Define FUDGE_USE_ELIB=1 only if you use elib (which is highly -// unlikely). (0==FUDGE_USE_ELIB) is completely untested, but should -// give you a start if you want to use this code outside of the safe -// confines of elib. +#ifndef FUDGE_USE_S11N +# define FUDGE_USE_S11N 0 #endif -#if FUDGE_USE_ELIB -# include <s11n/S11n.h> // serialization +#if FUDGE_USE_S11N // serialization +# include <s11n/Serializable.h> +# include <s11n/s11n_node.h> #endif -/** -License: Public Domain -Author: st...@wa... +// /** +// License: Public Domain +// Author: st...@wa... -namespace fudge contains objects representing some of the core -aspects of the Fudge roleplaying system. To use this code you will -need to replace the random number generator and maybe pull out -some other elib-specific code. +// namespace fudge contains objects representing some of the core +// aspects of the Fudge roleplaying system. To use this code you will +// need to replace the random number generator and maybe pull out +// some other elib-specific code. -Most (99.99%) of the naming and logic here were inspired by Fudge -(http://www.fudgerpg.com). Indeed, the code is for processing common -Fudge-style operations. +// Most (99.99%) of the naming and logic here were inspired by Fudge +// (http://www.fudgerpg.com). Indeed, the code is for processing common +// Fudge-style operations. -*/ +// */ -namespace fudge { +namespace fun { /** Rating lists the Fudge-standard levels used for rating @@ -127,7 +124,7 @@ dF represents a single "Fudge Die" (aka, dF). */ class dF -#if FUDGE_USE_ELIB +#if FUDGE_USE_S11N : public s11n::Serializable #endif { @@ -180,7 +177,7 @@ */ short roll(); -#if FUDGE_USE_ELIB +#if FUDGE_USE_S11N /** de/serialize(): implemented for the Serializable interface. @@ -213,7 +210,7 @@ number of dice. */ class DiceBag -#if FUDGE_USE_ELIB +#if FUDGE_USE_S11N : public s11n::Serializable #endif { @@ -289,7 +286,7 @@ list_type m_dice; int m_lastroll; -#if FUDGE_USE_ELIB +#if FUDGE_USE_S11N public: /** de/serialize(): implemented for the Serializable interface. @@ -306,7 +303,7 @@ boxes for any given wound severity. */ class WoundTrack -#if FUDGE_USE_ELIB +#if FUDGE_USE_S11N : public s11n::Serializable #endif { @@ -483,7 +480,7 @@ virtual int applyDamage( int dmg ); /** - Returns the fudge::Rating severity for dmg damage points. + Returns the fun::Rating severity for dmg damage points. Uses (rather unobjectively) the Fudge-default rules for translating damage points to hits. @@ -534,7 +531,7 @@ bool m_migratewounds; void init(); -#if FUDGE_USE_ELIB +#if FUDGE_USE_S11N public: /** de/serialize(): implemented for the Serializable interface. @@ -551,7 +548,7 @@ exact interpretation of a buff is client-dependent. */ class Buff -#if FUDGE_USE_ELIB +#if FUDGE_USE_S11N : public s11n::Serializable #endif { @@ -561,7 +558,7 @@ this->init(); }; - Buff( const std::string &n, int o, int d, int s=fudge::Scale_Human ) : m_odf(o),m_ddf(d),m_scale(s),m_range(0),m_count(1),m_ablative(false),m_flags(0),m_name(n) + Buff( const std::string &n, int o, int d, int s=fun::Scale_Human ) : m_odf(o),m_ddf(d),m_scale(s),m_range(0),m_count(1),m_ablative(false),m_flags(0),m_name(n) { this->init(); }; |
From: <sg...@us...> - 2003-10-14 03:43:55
|
Update of /cvsroot/libfunutil/libfunutil/toc/sbin In directory sc8-pr-cvs1:/tmp/cvs-serv10305/toc/sbin Modified Files: toc_core.sh Log Message: a couple pro-active quoting fixes. Index: toc_core.sh =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/toc/sbin/toc_core.sh,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- toc_core.sh 27 Sep 2003 22:34:03 -0000 1.27 +++ toc_core.sh 14 Oct 2003 03:43:52 -0000 1.28 @@ -621,11 +621,11 @@ # It returns !0 only if $TOC_ATSIGN_PARSER throws an error. # $1 = file containing properties to @-filter. # $2 = input template (e.g. toc_shared.make.at) - # $3 = output file (e.g. toc_shared.make). It only changed if + # $3 = output file (e.g. toc_shared.make). Is only changed if # needed, so it is dependency-safe. - local pfile=$1 - local tmpl=$2 - local ofile=$3 + local pfile="$1" + local tmpl="$2" + local ofile="$3" test -f "$pfile" || toc_die $? "toc_atfilter_file: \$1: file not found: $pfile" test -f "$tmpl" || toc_die $? "toc_atfilter_file: \$2: file not found: $tmpl" local tmpfile=$ofile.tmp.toc_atfilter_file |
From: <sg...@us...> - 2003-10-14 03:43:29
|
Update of /cvsroot/libfunutil/libfunutil In directory sc8-pr-cvs1:/tmp/cvs-serv10281 Modified Files: configure.libfunutil Log Message: added a missing toc_add_config. Index: configure.libfunutil =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/configure.libfunutil,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- configure.libfunutil 14 Oct 2003 03:11:17 -0000 1.20 +++ configure.libfunutil 14 Oct 2003 03:43:25 -0000 1.21 @@ -58,6 +58,7 @@ } configure_enable_s11n=${configure_enable_s11n-1} +toc_add_config configure_enable_s11n=${configure_enable_s11n} test x1 = "x${configure_enable_s11n}" && { source configure.s11n } |
From: <sg...@us...> - 2003-10-14 03:42:47
|
Update of /cvsroot/libfunutil/libfunutil In directory sc8-pr-cvs1:/tmp/cvs-serv10186 Modified Files: toc.libfunUtil.help Log Message: reversed --enable-s11n to --disable-s11n Index: toc.libfunUtil.help =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/toc.libfunUtil.help,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- toc.libfunUtil.help 27 Sep 2003 22:32:55 -0000 1.1 +++ toc.libfunUtil.help 14 Oct 2003 03:42:43 -0000 1.2 @@ -1,3 +1,5 @@ ---enable-s11n - Enables the highly-experimental s11n library (see lib/s11n and tests/s11n). +--disable-s11n + Disables the experimental s11n library (see lib/s11n and client/s11nconvert). + + |
From: <sg...@us...> - 2003-10-14 03:42:23
|
Update of /cvsroot/libfunutil/libfunutil/client In directory sc8-pr-cvs1:/tmp/cvs-serv10167/client Modified Files: Makefile Log Message: now conditionally builds s11nconvert. Index: Makefile =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/client/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile 14 Oct 2003 03:26:54 -0000 1.1 +++ Makefile 14 Oct 2003 03:42:20 -0000 1.2 @@ -1,5 +1,7 @@ include toc.make -SUBDIRS = s11nconvert +ifeq (1,$(configure_enable_s11n)) + SUBDIRS = s11nconvert +endif all: subdirs |
From: <sg...@us...> - 2003-10-14 03:37:48
|
Update of /cvsroot/libfunutil/libfunutil/lib/s11n In directory sc8-pr-cvs1:/tmp/cvs-serv9525/lib/s11n Added Files: FileLoader.cpp FileLoader.h Log Message: this object is of arguable utility. TODO: re-evaluate it's purpose in life. --- NEW FILE: FileLoader.cpp --- // // Author: stephan beal <sg...@us...> // License: Public Domain // #include <s11n/FileLoader.h> #include <s11n/flex_lexers.h> // FlexTreeBuilder #include <s11n/s11n-macros.h> // BROKEN() namespace s11n { s11n_node * FileLoader::loadNode( const std::string & key ) const { std::string path = this->PathFinder::find( key ); if( path.empty() ) return NULL; FlexTreeBuilder * bob = FlexTreeBuilder::loadBuilder( path ); if( ! bob ) return NULL; s11n_node * node = 0; if( bob->builder() ) { node = bob->root_node(); bob->builder()->autoDelete( false ); // we take control of node. } delete( bob ); return node; } } // namespace s11n --- NEW FILE: FileLoader.h --- // // Author: stephan beal <sg...@us...> // License: Public Domain // #ifndef S11NFILELOADER_H_INCLUDED #define S11NFILELOADER_H_INCLUDED 1 #include <string> #include <toolbox/PathFinder.h> #include <s11n/s11n_node.h> namespace s11n { /** A classloader for loading Serializable classes from files, plus a convenience class for loading files from arbitrary data types, without having to know the type nor if it is compressed or not. */ class FileLoader : public toolbox::PathFinder { public: typedef FileLoader ThisType; // typedef toolbox::DLLLoader ParentClass; // typedef ParentClass::value_type value_type; // typedef ParentClass::key_type key_type; FileLoader(){}; virtual ~ FileLoader(){}; /** First tries to load key via the ancestor's method(s), and returns that pointer if it works. Secondly it tries to find file key in this->path() and return a new value_type * if it can deserialize an object of that type from that file. The caller owns the returned pointer, which may be NULL. Note that the input file may be in any format internally supported by the library. */ template <typename SerializableType> SerializableType * load( const std::string & filename ) const { typedef SerializableType ST; s11n_node * node = FileLoader::loadNode( key ); if( node ) { ST * ch = 0; /** Grief!!!! gcc 3.3 refuses to compile this: ch = node->deserialize<ST>(); error is: parse error before `;' token but it allows the exact same code in some other contexts!!! A workaround is to qualify s11n_node's class, but that breaks polymorphism!!! deserialize() is a template func, so it can't be virtual, but that's beside the point! */ ch = node->s11n_node::deserialize<ST>(); delete( node ); } return ch; } /** Tries to load the root s11n_node from the input file. The caller owns the pointer. This is similar to load(), but the returned object is not deserialized (indeed, it is not Serializable). This function supports all current Serializer data formats, uncompressed or compressed (assuming the suitable decompressor is enabled in your library). */ s11n_node * loadNode( const std::string & ) const; }; // class FileLoader }; // namespace s11n #endif // S11NFILELOADER_H_INCLUDED |
From: <sg...@us...> - 2003-10-14 03:36:59
|
Update of /cvsroot/libfunutil/libfunutil/lib/s11n In directory sc8-pr-cvs1:/tmp/cvs-serv9364/lib/s11n Removed Files: gzstream.cpp gzstream.h Log Message: moved to ../toolbox --- gzstream.cpp DELETED --- --- gzstream.h DELETED --- |
From: <sg...@us...> - 2003-10-14 03:36:30
|
Update of /cvsroot/libfunutil/libfunutil/doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv9286/doc/api Modified Files: Makefile Doxyfile.in Log Message: s11n docs are now conditionally added to doxygen. Index: Makefile =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/doc/api/Makefile,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Makefile 14 Oct 2003 03:12:57 -0000 1.8 +++ Makefile 14 Oct 2003 03:36:25 -0000 1.9 @@ -20,11 +20,17 @@ clean-doxygen: -rm -fr latex +DOXYGEN_INCLUDE_PATHS = $(top_includesdir)/fun +ifeq (1,$(configure_enable_s11n)) + DOXYGEN_INCLUDE_PATHS += $(top_includesdir)/s11n $(top_includesdir)/toolbox +endif + atparser = $(top_srcdir)/toc/bin/atsign_parse $(DOXYFILE): Makefile $(DOXYFILE_IN) $(call toc_atparse_file,$(DOXYFILE_IN),$@, \ BT_PKG_NAME=$(PACKAGE_NAME) BT_PKG_VERSION=$(PACKAGE_VERSION) \ BT_PROG_PERL=$(PERL_BIN) \ top_includesdir="$(top_includesdir)" \ + INPUT_PATHS="$(DOXYGEN_INCLUDE_PATHS)" \ ) Index: Doxyfile.in =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/doc/api/Doxyfile.in,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Doxyfile.in 14 Oct 2003 03:12:24 -0000 1.6 +++ Doxyfile.in 14 Oct 2003 03:36:25 -0000 1.7 @@ -311,7 +311,7 @@ # Also, really we should feed doxygen the list of source files we actually # build (if we can get it from the makefiles) rather than having to exclude # the crap which isn't worth building, below. -INPUT = @top_includesdir@/fun @top_includesdir@/s11n @top_includesdir@/toolbox index.txt +INPUT = @INPUT_PATHS@ index.txt # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp |
From: <sg...@us...> - 2003-10-14 03:26:59
|
Update of /cvsroot/libfunutil/libfunutil/client In directory sc8-pr-cvs1:/tmp/cvs-serv7323/client Added Files: Makefile Log Message: egg --- NEW FILE: Makefile --- include toc.make SUBDIRS = s11nconvert all: subdirs |
From: <sg...@us...> - 2003-10-14 03:25:22
|
Update of /cvsroot/libfunutil/libfunutil/client/s11nconvert In directory sc8-pr-cvs1:/tmp/cvs-serv6914/client/s11nconvert Log Message: Directory /cvsroot/libfunutil/libfunutil/client/s11nconvert added to the repository |