diff --git a/stix/Makefile.am b/stix/Makefile.am index d66adab..741a38f 100644 --- a/stix/Makefile.am +++ b/stix/Makefile.am @@ -3,7 +3,7 @@ ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = -SUBDIRS = libltdl lib +SUBDIRS = libltdl mod lib DIST_SUBDIRS = $(SUBDIRS) distclean-local: diff --git a/stix/Makefile.in b/stix/Makefile.in index 4ad101f..42bb666 100644 --- a/stix/Makefile.in +++ b/stix/Makefile.in @@ -359,7 +359,7 @@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTION = foreign ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = -SUBDIRS = libltdl lib +SUBDIRS = libltdl mod lib DIST_SUBDIRS = $(SUBDIRS) all: all-recursive diff --git a/stix/configure b/stix/configure index 716a70f..b55adef 100755 --- a/stix/configure +++ b/stix/configure @@ -19930,7 +19930,7 @@ STIX_PROJECT_AUTHOR="${PACKAGE_BUGREPORT}" STIX_PROJECT_URL="${PACKAGE_URL}" -ac_config_files="$ac_config_files Makefile lib/Makefile" +ac_config_files="$ac_config_files Makefile lib/Makefile mod/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -21084,6 +21084,7 @@ do "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; + "mod/Makefile") CONFIG_FILES="$CONFIG_FILES mod/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff --git a/stix/configure.ac b/stix/configure.ac index e20ca92..4373813 100644 --- a/stix/configure.ac +++ b/stix/configure.ac @@ -427,6 +427,7 @@ AC_SUBST(STIX_PROJECT_URL, "${PACKAGE_URL}") AC_CONFIG_FILES([ Makefile lib/Makefile + mod/Makefile ]) AC_OUTPUT diff --git a/stix/kernel/Apex.st b/stix/kernel/Apex.st index a9babee..2c8f906 100644 --- a/stix/kernel/Apex.st +++ b/stix/kernel/Apex.st @@ -66,6 +66,8 @@ #method(#class) new: anInteger { | x | +## TODO: check if the class is a fixed class. +## if so, raise an exception. x := self basicNew: anInteger. x initialize. "TODO: assess if it's good to call 'initialize' from new." ^x. @@ -175,6 +177,11 @@ ## TODO: add = and ~= for equality check. + + ## ------------------------------------------------------- + ## COMMON QUERIES + ## ------------------------------------------------------- + #method isNil { "^self == nil." @@ -201,6 +208,16 @@ ^true. } + #method isError + { + ^false + } + + #method(#class) isError + { + ^false + } + ## ------------------------------------------------------- ## ------------------------------------------------------- @@ -287,6 +304,7 @@ { self class cannotInstantiate } + } #class Object(Apex) diff --git a/stix/kernel/Class.st b/stix/kernel/Class.st index 4b51a32..a342bef 100644 --- a/stix/kernel/Class.st +++ b/stix/kernel/Class.st @@ -1,4 +1,7 @@ - +## +## the Class object should be a variable-pointer object because +## it needs to accomodate class instance variables. +## #class(#pointer) Class(Apex) { #dcl spec selfspec superclass subclasses name instvars classvars classinstvars pooldics instmthdic classmthdic. diff --git a/stix/kernel/Stdio.st b/stix/kernel/Stdio.st new file mode 100644 index 0000000..2d019b7 --- /dev/null +++ b/stix/kernel/Stdio.st @@ -0,0 +1,40 @@ +#class(#word) Stdio(Object) +{ + #method(#class) new: size + { + ##self prohibited + ##raise exception. prohibited... + ^nil. + } + + #method(#class) new + { + ##self prohibited + ##raise exception. prohibited... + ^nil. + } + + #method(#class) open: name for: mode + { + ^(super new: 1) open: name for: mode + } + + #method open: name for: mode + { + + } + + #method close + { + + } + + #method xxx + { + self basicSize dump. + } +} + +#class(#word) Stdio2 (Stdio) +{ +} diff --git a/stix/kernel/Stix.st b/stix/kernel/Stix.st index 3acce5a..247b7c0 100644 --- a/stix/kernel/Stix.st +++ b/stix/kernel/Stix.st @@ -11,6 +11,11 @@ "accept an arbitary object instead of a string. the object can be sent displayString for string conversion" } + + #method isError + { + ^true + } } #class Magnitude(Object) @@ -379,4 +384,5 @@ f isNil ifTrue: [ self error: 'No such function' ]. ######################################################################################### +#include 'Stdio.st'. #include 'Console.st'. diff --git a/stix/kernel/test-014.st b/stix/kernel/test-014.st index 6d0b8bf..21f641c 100644 --- a/stix/kernel/test-014.st +++ b/stix/kernel/test-014.st @@ -122,6 +122,11 @@ System logNl:(-820186817651640487320479808367534510238779540102526006236474836166734016865205999870833760242352512045225158774173869894826877890589130978987229877889333678492731896878236182891224254464936050871086340438798130266913122427332418216677813151305680453358955006355665628938266331979307689540884269372365762883678113227136498054422414501840232090872158915536978847443767922315217311444711397048331496139248250188991402851129033493732164230227458717486395514436574417275149404197774547389507462779807727615 * 765507696474864454832447821143032209556194237429024272487376513755618415740858933212778176226195677908876814855895611901838419364549855580388081219363378099926549770419687104031809304167273647479680584409544921582452247598843590335565958941218635089801691339265287920342381909847353843571491984747541378691432905678660731517460920201717549951480681654501180257614183394160869490681730637245109396396631700176391975994387097927483353281545628136320635813474136122790139443917922910896873631927820545774) asString. System logNl: S'\0\0\0END OF MAIN\0AB\0\0\0C\0\0\0'. + + + v1 := Stdio open: '/tmp/1.txt' for: 'w+'. + v1 xxx. + v1 close. } } diff --git a/stix/lib/Makefile.am b/stix/lib/Makefile.am index b6081d0..9a6489d 100644 --- a/stix/lib/Makefile.am +++ b/stix/lib/Makefile.am @@ -74,29 +74,6 @@ if ENABLE_STATIC_MODULE # mod-dir.c mod-dir.h \ #libstix_la_LIBADD += -else -################################################## -# DYNAMIC MODULES -################################################## - -CPPFLAGS_MOD_COMMON = $(CPPFLAGS_LIB_COMMON) -LDFLAGS_MOD_COMMON = $(LDFLAGS_LIB_COMMON) -LIBADD_MOD_COMMON = -lstix - -pkgmodexecdir = $(libdir) - -pkgmodexec_LTLIBRARIES = libstix-snd.la libstix-con.la - -libstix_snd_la_SOURCES = mod-snd.c mod-snd.h -libstix_snd_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON) -libstix_snd_la_LDFLAGS = $(LDFLAGS_MOD_COMMON) -libstix_snd_la_LIBADD = $(LIBADD_MOD_COMMON) - -libstix_con_la_SOURCES = mod-con.c mod-con.h -libstix_con_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON) -libstix_con_la_LDFLAGS = $(LDFLAGS_MOD_COMMON) -libstix_con_la_LIBADD = $(LIBADD_MOD_COMMON) -ltermcap - endif diff --git a/stix/lib/Makefile.in b/stix/lib/Makefile.in index a6cc669..c92749d 100644 --- a/stix/lib/Makefile.in +++ b/stix/lib/Makefile.in @@ -128,39 +128,10 @@ am__uninstall_files_from_dir = { \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -am__installdirs = "$(DESTDIR)$(pkglibdir)" \ - "$(DESTDIR)$(pkgmodexecdir)" "$(DESTDIR)$(bindir)" \ +am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(pkgincludedir)" -LTLIBRARIES = $(pkglib_LTLIBRARIES) $(pkgmodexec_LTLIBRARIES) +LTLIBRARIES = $(pkglib_LTLIBRARIES) am__DEPENDENCIES_1 = -@ENABLE_STATIC_MODULE_FALSE@libstix_con_la_DEPENDENCIES = \ -@ENABLE_STATIC_MODULE_FALSE@ $(am__DEPENDENCIES_1) -am__libstix_con_la_SOURCES_DIST = mod-con.c mod-con.h -@ENABLE_STATIC_MODULE_FALSE@am_libstix_con_la_OBJECTS = \ -@ENABLE_STATIC_MODULE_FALSE@ libstix_con_la-mod-con.lo -libstix_con_la_OBJECTS = $(am_libstix_con_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -libstix_con_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(AM_CFLAGS) $(CFLAGS) $(libstix_con_la_LDFLAGS) $(LDFLAGS) -o \ - $@ -@ENABLE_STATIC_MODULE_FALSE@am_libstix_con_la_rpath = -rpath \ -@ENABLE_STATIC_MODULE_FALSE@ $(pkgmodexecdir) -@ENABLE_STATIC_MODULE_FALSE@libstix_snd_la_DEPENDENCIES = \ -@ENABLE_STATIC_MODULE_FALSE@ $(am__DEPENDENCIES_1) -am__libstix_snd_la_SOURCES_DIST = mod-snd.c mod-snd.h -@ENABLE_STATIC_MODULE_FALSE@am_libstix_snd_la_OBJECTS = \ -@ENABLE_STATIC_MODULE_FALSE@ libstix_snd_la-mod-snd.lo -libstix_snd_la_OBJECTS = $(am_libstix_snd_la_OBJECTS) -libstix_snd_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ - $(AM_CFLAGS) $(CFLAGS) $(libstix_snd_la_LDFLAGS) $(LDFLAGS) -o \ - $@ -@ENABLE_STATIC_MODULE_FALSE@am_libstix_snd_la_rpath = -rpath \ -@ENABLE_STATIC_MODULE_FALSE@ $(pkgmodexecdir) am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) libstix_la_DEPENDENCIES = $(am__DEPENDENCIES_2) am_libstix_la_OBJECTS = libstix_la-bigint.lo libstix_la-comp.lo \ @@ -170,6 +141,10 @@ am_libstix_la_OBJECTS = libstix_la-bigint.lo libstix_la-comp.lo \ libstix_la-proc.lo libstix_la-rbt.lo libstix_la-stix.lo \ libstix_la-sym.lo libstix_la-utf8.lo libstix_la-utl.lo libstix_la_OBJECTS = $(am_libstix_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = libstix_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libstix_la_LDFLAGS) $(LDFLAGS) -o $@ @@ -214,11 +189,8 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libstix_con_la_SOURCES) $(libstix_snd_la_SOURCES) \ - $(libstix_la_SOURCES) $(stix_SOURCES) -DIST_SOURCES = $(am__libstix_con_la_SOURCES_DIST) \ - $(am__libstix_snd_la_SOURCES_DIST) $(libstix_la_SOURCES) \ - $(stix_SOURCES) +SOURCES = $(libstix_la_SOURCES) $(stix_SOURCES) +DIST_SOURCES = $(libstix_la_SOURCES) $(stix_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -458,30 +430,6 @@ stix_SOURCES = main.c stix_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) stix_LDFLAGS = $(LDFLAGS_LIB_COMMON) stix_LDADD = $(LIBADD_LIB_COMMON) -lstix #-ldyncall_s - -################################################## -# STATIC MODULES BUILT INTO MAIN LIBRARY -################################################## -#libstix_la_SOURCES += \ -# mod-dir.c mod-dir.h \ -#libstix_la_LIBADD += - -################################################## -# DYNAMIC MODULES -################################################## -@ENABLE_STATIC_MODULE_FALSE@CPPFLAGS_MOD_COMMON = $(CPPFLAGS_LIB_COMMON) -@ENABLE_STATIC_MODULE_FALSE@LDFLAGS_MOD_COMMON = $(LDFLAGS_LIB_COMMON) -@ENABLE_STATIC_MODULE_FALSE@LIBADD_MOD_COMMON = -lstix -@ENABLE_STATIC_MODULE_FALSE@pkgmodexecdir = $(libdir) -@ENABLE_STATIC_MODULE_FALSE@pkgmodexec_LTLIBRARIES = libstix-snd.la libstix-con.la -@ENABLE_STATIC_MODULE_FALSE@libstix_snd_la_SOURCES = mod-snd.c mod-snd.h -@ENABLE_STATIC_MODULE_FALSE@libstix_snd_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON) -@ENABLE_STATIC_MODULE_FALSE@libstix_snd_la_LDFLAGS = $(LDFLAGS_MOD_COMMON) -@ENABLE_STATIC_MODULE_FALSE@libstix_snd_la_LIBADD = $(LIBADD_MOD_COMMON) -@ENABLE_STATIC_MODULE_FALSE@libstix_con_la_SOURCES = mod-con.c mod-con.h -@ENABLE_STATIC_MODULE_FALSE@libstix_con_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON) -@ENABLE_STATIC_MODULE_FALSE@libstix_con_la_LDFLAGS = $(LDFLAGS_MOD_COMMON) -@ENABLE_STATIC_MODULE_FALSE@libstix_con_la_LIBADD = $(LIBADD_MOD_COMMON) -ltermcap all: stix-cfg.h $(MAKE) $(AM_MAKEFLAGS) all-am @@ -568,47 +516,6 @@ clean-pkglibLTLIBRARIES: rm -f $${locs}; \ } -install-pkgmodexecLTLIBRARIES: $(pkgmodexec_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(pkgmodexec_LTLIBRARIES)'; test -n "$(pkgmodexecdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(pkgmodexecdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(pkgmodexecdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkgmodexecdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkgmodexecdir)"; \ - } - -uninstall-pkgmodexecLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(pkgmodexec_LTLIBRARIES)'; test -n "$(pkgmodexecdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkgmodexecdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkgmodexecdir)/$$f"; \ - done - -clean-pkgmodexecLTLIBRARIES: - -test -z "$(pkgmodexec_LTLIBRARIES)" || rm -f $(pkgmodexec_LTLIBRARIES) - @list='$(pkgmodexec_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -libstix-con.la: $(libstix_con_la_OBJECTS) $(libstix_con_la_DEPENDENCIES) $(EXTRA_libstix_con_la_DEPENDENCIES) - $(AM_V_CCLD)$(libstix_con_la_LINK) $(am_libstix_con_la_rpath) $(libstix_con_la_OBJECTS) $(libstix_con_la_LIBADD) $(LIBS) - -libstix-snd.la: $(libstix_snd_la_OBJECTS) $(libstix_snd_la_DEPENDENCIES) $(EXTRA_libstix_snd_la_DEPENDENCIES) - $(AM_V_CCLD)$(libstix_snd_la_LINK) $(am_libstix_snd_la_rpath) $(libstix_snd_la_OBJECTS) $(libstix_snd_la_LIBADD) $(LIBS) - libstix.la: $(libstix_la_OBJECTS) $(libstix_la_DEPENDENCIES) $(EXTRA_libstix_la_DEPENDENCIES) $(AM_V_CCLD)$(libstix_la_LINK) -rpath $(pkglibdir) $(libstix_la_OBJECTS) $(libstix_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @@ -671,7 +578,6 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstix_con_la-mod-con.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstix_la-bigint.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstix_la-comp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstix_la-debug.Plo@am__quote@ @@ -689,7 +595,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstix_la-sym.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstix_la-utf8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstix_la-utl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstix_snd_la-mod-snd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stix-main.Po@am__quote@ .c.o: @@ -716,20 +621,6 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< -libstix_con_la-mod-con.lo: mod-con.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstix_con_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstix_con_la-mod-con.lo -MD -MP -MF $(DEPDIR)/libstix_con_la-mod-con.Tpo -c -o libstix_con_la-mod-con.lo `test -f 'mod-con.c' || echo '$(srcdir)/'`mod-con.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstix_con_la-mod-con.Tpo $(DEPDIR)/libstix_con_la-mod-con.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mod-con.c' object='libstix_con_la-mod-con.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstix_con_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstix_con_la-mod-con.lo `test -f 'mod-con.c' || echo '$(srcdir)/'`mod-con.c - -libstix_snd_la-mod-snd.lo: mod-snd.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstix_snd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstix_snd_la-mod-snd.lo -MD -MP -MF $(DEPDIR)/libstix_snd_la-mod-snd.Tpo -c -o libstix_snd_la-mod-snd.lo `test -f 'mod-snd.c' || echo '$(srcdir)/'`mod-snd.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstix_snd_la-mod-snd.Tpo $(DEPDIR)/libstix_snd_la-mod-snd.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mod-snd.c' object='libstix_snd_la-mod-snd.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstix_snd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstix_snd_la-mod-snd.lo `test -f 'mod-snd.c' || echo '$(srcdir)/'`mod-snd.c - libstix_la-bigint.lo: bigint.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstix_la-bigint.lo -MD -MP -MF $(DEPDIR)/libstix_la-bigint.Tpo -c -o libstix_la-bigint.lo `test -f 'bigint.c' || echo '$(srcdir)/'`bigint.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstix_la-bigint.Tpo $(DEPDIR)/libstix_la-bigint.Plo @@ -976,7 +867,7 @@ check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) stix-cfg.h installdirs: - for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(pkgmodexecdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgincludedir)"; do \ + for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -1012,8 +903,7 @@ maintainer-clean-generic: clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ - clean-pkglibLTLIBRARIES clean-pkgmodexecLTLIBRARIES \ - mostlyclean-am + clean-pkglibLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -1040,8 +930,7 @@ install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-binPROGRAMS install-pkglibLTLIBRARIES \ - install-pkgmodexecLTLIBRARIES +install-exec-am: install-binPROGRAMS install-pkglibLTLIBRARIES install-html: install-html-am @@ -1082,32 +971,37 @@ ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-pkgincludeHEADERS \ - uninstall-pkglibLTLIBRARIES uninstall-pkgmodexecLTLIBRARIES + uninstall-pkglibLTLIBRARIES @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: all install-am install-data-am install-strip uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool \ - clean-pkglibLTLIBRARIES clean-pkgmodexecLTLIBRARIES \ - cscopelist-am ctags ctags-am distclean distclean-compile \ - distclean-generic distclean-hdr distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-binPROGRAMS 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-pkglibLTLIBRARIES install-pkgmodexecLTLIBRARIES \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-hook uninstall-pkgincludeHEADERS \ - uninstall-pkglibLTLIBRARIES uninstall-pkgmodexecLTLIBRARIES + clean-pkglibLTLIBRARIES cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + 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-pkglibLTLIBRARIES install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-hook \ + uninstall-pkgincludeHEADERS uninstall-pkglibLTLIBRARIES +################################################## +# STATIC MODULES BUILT INTO MAIN LIBRARY +################################################## +#libstix_la_SOURCES += \ +# mod-dir.c mod-dir.h \ +#libstix_la_LIBADD += + install-data-hook: @echo "#ifndef _STIX_CFG_H_" > "$(DESTDIR)$(pkgincludedir)/stix-cfg.h" @echo "#define _STIX_CFG_H_" >> "$(DESTDIR)$(pkgincludedir)/stix-cfg.h" diff --git a/stix/lib/comp.c b/stix/lib/comp.c index 0ea9abd..537be60 100644 --- a/stix/lib/comp.c +++ b/stix/lib/comp.c @@ -2477,6 +2477,20 @@ static int compile_class_level_variables (stix_t* stix) { var_info_t var; +/* +TODO: check variability conflict. +if it's a indexed class, check if the superclass is fixed or index. +if super is fixed and self is fixed or variable-pointer, no restriction. +if super is fixed and self is variable-nonpointer, no instance varaible in the super side and in the self side. +if super is variable-pointer, self must be a variable-pointer. can't be fixed either +if super is variable-nonpointer, self must be a variable-nonpointer of the same type. can't be fixed either +if super is variable-nonpointer, no instance variable is allowed. + if (stix->c->cls.flags & CLASS_INDEXED) + { + set_syntax_error (stix, STIX_SYNERR_VARNAMEDUP, TOKEN_LOC(stix), TOKEN_NAME(stix)); + return -1; + } +*/ if (find_class_level_variable(stix, STIX_NULL, TOKEN_NAME(stix), &var) >= 0 || stix_lookupdic (stix, stix->sysdic, TOKEN_NAME(stix)) || /* conflicts with a top global name */ stix_lookupdic (stix, stix->c->cls.ns_oop, TOKEN_NAME(stix))) /* conflicts with a global name in the class'es name space */ diff --git a/stix/lib/mod-snd.h b/stix/lib/mod-snd.h deleted file mode 100644 index 6f06e4b..0000000 --- a/stix/lib/mod-snd.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * $Id$ - * - Copyright (c) 2006-2016 Chung, Hyung-Hwan. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _STIX_LIB_MOD_SND_H_ -#define _STIX_LIB_MOD_SND_H_ - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - -STIX_EXPORT int stix_prim_mod_snd (stix_t* stix, stix_prim_mod_t* mod); - -#if defined(__cplusplus) -} -#endif - -#endif - diff --git a/stix/lib/obj.c b/stix/lib/obj.c index 63f11b4..df12c30 100644 --- a/stix/lib/obj.c +++ b/stix/lib/obj.c @@ -189,9 +189,14 @@ static STIX_INLINE int decode_spec (stix_t* stix, stix_oop_t _class, stix_oow_t if (indexed_type == STIX_OBJ_TYPE_OOP) { - if (named_instvar > STIX_MAX_NAMED_INSTVARS || - vlen > STIX_MAX_INDEXED_INSTVARS(named_instvar)) + if (named_instvar > STIX_MAX_NAMED_INSTVARS) { + STIX_DEBUG3 (stix, "Too many named instance variables for a variable-pointer class %O - %zu/%zu\n", _class, named_instvar, (stix_oow_t)STIX_MAX_NAMED_INSTVARS); + return -1; + } + if (vlen > STIX_MAX_INDEXED_INSTVARS(named_instvar)) + { + STIX_DEBUG3 (stix, "Too many unnamed instance variables for a variable-pointer class %O - %zu/%zu\n", _class, vlen, (stix_oow_t)STIX_MAX_INDEXED_INSTVARS(named_instvar)); return -1; } @@ -200,8 +205,16 @@ static STIX_INLINE int decode_spec (stix_t* stix, stix_oop_t _class, stix_oow_t else { /* a non-pointer indexed class can't have named instance variables */ - if (named_instvar > 0) return -1; - if (vlen > STIX_OBJ_SIZE_MAX) return -1; + if (named_instvar > 0) + { + STIX_DEBUG1 (stix, "Named instance variables in a variable-nonpointer class %O\n", _class); + return -1; + } + if (vlen > STIX_OBJ_SIZE_MAX) + { + STIX_DEBUG3 (stix, "Too many unnamed instance variables for a variable-nonpointer class %O - %zu/%zu\n", _class, vlen, (stix_oow_t)STIX_OBJ_SIZE_MAX); + return -1; + } } } else @@ -209,9 +222,19 @@ static STIX_INLINE int decode_spec (stix_t* stix, stix_oop_t _class, stix_oow_t /* named instance variables only. treat it as if it is an * indexable class with no variable data */ indexed_type = STIX_OBJ_TYPE_OOP; - vlen = 0; /* vlen is not used */ - if (named_instvar > STIX_MAX_NAMED_INSTVARS) return -1; + if (vlen > 0) + { + STIX_DEBUG2 (stix, "Unamed instance variables for a fixed class %O - %zu\n", _class, vlen); + return -1; + } + /*vlen = 0;*/ /* vlen is not used */ + + if (named_instvar > STIX_MAX_NAMED_INSTVARS) + { + STIX_DEBUG3 (stix, "Too many named instance variables for a fixed class %O - %zu/%zu\n", _class, named_instvar, (stix_oow_t)STIX_MAX_NAMED_INSTVARS); + return -1; + } STIX_ASSERT (named_instvar <= STIX_OBJ_SIZE_MAX); } diff --git a/stix/lib/stix-prv.h b/stix/lib/stix-prv.h index 0f3c321..196a5f6 100644 --- a/stix/lib/stix-prv.h +++ b/stix/lib/stix-prv.h @@ -1085,91 +1085,6 @@ stix_oop_process_t stix_makeproc ( stix_t* stix ); -/* ========================================================================= */ -/* utf8.c */ -/* ========================================================================= */ -stix_oow_t stix_uctoutf8 ( - stix_uch_t uc, - stix_bch_t* utf8, - stix_oow_t size -); - -stix_oow_t stix_utf8touc ( - const stix_bch_t* utf8, - stix_oow_t size, - stix_uch_t* uc -); - -/** - * The stix_ucstoutf8() function converts a unicode character string \a ucs - * to a UTF8 string and writes it into the buffer pointed to by \a bcs, but - * not more than \a bcslen bytes including the terminating null. - * - * Upon return, \a bcslen is modified to the actual number of bytes written to - * \a bcs excluding the terminating null; \a ucslen is modified to the number of - * wide characters converted. - * - * You may pass #STIX_NULL for \a bcs to dry-run conversion or to get the - * required buffer size for conversion. -2 is never returned in this case. - * - * \return - * - 0 on full conversion, - * - -1 on no or partial conversion for an illegal character encountered, - * - -2 on no or partial conversion for a small buffer. - * - * \code - * const stix_uch_t ucs[] = { 'H', 'e', 'l', 'l', 'o' }; - * stix_bch_t bcs[10]; - * stix_oow_t ucslen = 5; - * stix_oow_t bcslen = STIX_COUNTOF(bcs); - * n = stix_ucstoutf8 (ucs, &ucslen, bcs, &bcslen); - * if (n <= -1) - * { - * // conversion error - * } - * \endcode - */ -int stix_ucstoutf8 ( - const stix_uch_t* ucs, - stix_oow_t* ucslen, - stix_bch_t* bcs, - stix_oow_t* bcslen -); - -/** - * The stix_utf8toucs() function converts a UTF8 string to a uncide string. - * - * It never returns -2 if \a ucs is #STIX_NULL. - * - * \code - * const stix_bch_t* bcs = "test string"; - * stix_uch_t ucs[100]; - * stix_oow_t ucslen = STIX_COUNTOF(buf), n; - * stix_oow_t bcslen = 11; - * int n; - * n = stix_utf8toucs (bcs, &bcslen, ucs, &ucslen); - * if (n <= -1) { invalid/incomplenete sequence or buffer to small } - * \endcode - * - * For a null-terminated string, you can specify ~(stix_oow_t)0 in - * \a bcslen. The destination buffer \a ucs also must be large enough to - * store a terminating null. Otherwise, -2 is returned. - * - * The resulting \a ucslen can still be greater than 0 even if the return - * value is negative. The value indiates the number of characters converted - * before the error has occurred. - * - * \return 0 on success. - * -1 if \a bcs contains an illegal character. - * -2 if the wide-character string buffer is too small. - * -3 if \a bcs is not a complete sequence. - */ -int stix_utf8toucs ( - const stix_bch_t* bcs, - stix_oow_t* bcslen, - stix_uch_t* ucs, - stix_oow_t* ucslen -); /* ========================================================================= */ /* bigint.c */ diff --git a/stix/lib/stix-utl.h b/stix/lib/stix-utl.h index 625b440..29309d1 100644 --- a/stix/lib/stix-utl.h +++ b/stix/lib/stix-utl.h @@ -57,12 +57,12 @@ extern "C" { /* ========================================================================= */ /* utl.c */ /* ========================================================================= */ -stix_oow_t stix_hashbytes ( +STIX_EXPORT stix_oow_t stix_hashbytes ( const stix_oob_t* ptr, stix_oow_t len ); -stix_oow_t stix_hashuchars ( +STIX_EXPORT stix_oow_t stix_hashuchars ( const stix_uch_t* ptr, stix_oow_t len ); @@ -70,84 +70,171 @@ stix_oow_t stix_hashuchars ( #define stix_hashbchars(ptr,len) stix_hashbytes(ptr,len) -int stix_equalchars ( +STIX_EXPORT int stix_equalchars ( const stix_uch_t* str1, const stix_uch_t* str2, stix_oow_t len ); -int stix_compucstr ( +STIX_EXPORT int stix_compucstr ( const stix_uch_t* str1, const stix_uch_t* str2 ); -int stix_compbcstr ( +STIX_EXPORT int stix_compbcstr ( const stix_bch_t* str1, const stix_bch_t* str2 ); -int stix_compucbcstr ( +STIX_EXPORT int stix_compucbcstr ( const stix_uch_t* str1, const stix_bch_t* str2 ); -int stix_compucxbcstr ( +STIX_EXPORT int stix_compucxbcstr ( const stix_uch_t* str1, stix_oow_t len, const stix_bch_t* str2 ); -void stix_copyuchars ( +STIX_EXPORT void stix_copyuchars ( stix_uch_t* dst, const stix_uch_t* src, stix_oow_t len ); -void stix_copybchars ( +STIX_EXPORT void stix_copybchars ( stix_bch_t* dst, const stix_bch_t* src, stix_oow_t len ); -void stix_copybchtouchars ( +STIX_EXPORT void stix_copybchtouchars ( stix_uch_t* dst, const stix_bch_t* src, stix_oow_t len ); -stix_oow_t stix_copyucstr ( +STIX_EXPORT stix_oow_t stix_copyucstr ( stix_uch_t* dst, stix_oow_t len, const stix_uch_t* src ); -stix_oow_t stix_copybcstr ( +STIX_EXPORT stix_oow_t stix_copybcstr ( stix_bch_t* dst, stix_oow_t len, const stix_bch_t* src ); -stix_uch_t* stix_finduchar ( +STIX_EXPORT stix_uch_t* stix_finduchar ( const stix_uch_t* ptr, stix_oow_t len, stix_uch_t c ); -stix_bch_t* stix_findbchar ( +STIX_EXPORT stix_bch_t* stix_findbchar ( const stix_bch_t* ptr, stix_oow_t len, stix_bch_t c ); -stix_oow_t stix_countucstr ( +STIX_EXPORT stix_oow_t stix_countucstr ( const stix_uch_t* str ); -stix_oow_t stix_countbcstr ( +STIX_EXPORT stix_oow_t stix_countbcstr ( const stix_bch_t* str ); + +/* ========================================================================= */ +/* utf8.c */ +/* ========================================================================= */ +STIX_EXPORT stix_oow_t stix_uctoutf8 ( + stix_uch_t uc, + stix_bch_t* utf8, + stix_oow_t size +); + +STIX_EXPORT stix_oow_t stix_utf8touc ( + const stix_bch_t* utf8, + stix_oow_t size, + stix_uch_t* uc +); + +/** + * The stix_ucstoutf8() function converts a unicode character string \a ucs + * to a UTF8 string and writes it into the buffer pointed to by \a bcs, but + * not more than \a bcslen bytes including the terminating null. + * + * Upon return, \a bcslen is modified to the actual number of bytes written to + * \a bcs excluding the terminating null; \a ucslen is modified to the number of + * wide characters converted. + * + * You may pass #STIX_NULL for \a bcs to dry-run conversion or to get the + * required buffer size for conversion. -2 is never returned in this case. + * + * \return + * - 0 on full conversion, + * - -1 on no or partial conversion for an illegal character encountered, + * - -2 on no or partial conversion for a small buffer. + * + * \code + * const stix_uch_t ucs[] = { 'H', 'e', 'l', 'l', 'o' }; + * stix_bch_t bcs[10]; + * stix_oow_t ucslen = 5; + * stix_oow_t bcslen = STIX_COUNTOF(bcs); + * n = stix_ucstoutf8 (ucs, &ucslen, bcs, &bcslen); + * if (n <= -1) + * { + * // conversion error + * } + * \endcode + */ +STIX_EXPORT int stix_ucstoutf8 ( + const stix_uch_t* ucs, + stix_oow_t* ucslen, + stix_bch_t* bcs, + stix_oow_t* bcslen +); + +/** + * The stix_utf8toucs() function converts a UTF8 string to a uncide string. + * + * It never returns -2 if \a ucs is #STIX_NULL. + * + * \code + * const stix_bch_t* bcs = "test string"; + * stix_uch_t ucs[100]; + * stix_oow_t ucslen = STIX_COUNTOF(buf), n; + * stix_oow_t bcslen = 11; + * int n; + * n = stix_utf8toucs (bcs, &bcslen, ucs, &ucslen); + * if (n <= -1) { invalid/incomplenete sequence or buffer to small } + * \endcode + * + * For a null-terminated string, you can specify ~(stix_oow_t)0 in + * \a bcslen. The destination buffer \a ucs also must be large enough to + * store a terminating null. Otherwise, -2 is returned. + * + * The resulting \a ucslen can still be greater than 0 even if the return + * value is negative. The value indiates the number of characters converted + * before the error has occurred. + * + * \return 0 on success. + * -1 if \a bcs contains an illegal character. + * -2 if the wide-character string buffer is too small. + * -3 if \a bcs is not a complete sequence. + */ +STIX_EXPORT int stix_utf8toucs ( + const stix_bch_t* bcs, + stix_oow_t* bcslen, + stix_uch_t* ucs, + stix_oow_t* ucslen +); + #if defined(__cplusplus) } #endif diff --git a/stix/mod/Makefile.am b/stix/mod/Makefile.am new file mode 100644 index 0000000..dffc71e --- /dev/null +++ b/stix/mod/Makefile.am @@ -0,0 +1,66 @@ +AUTOMAKE_OPTIONS = nostdinc + +CPPFLAGS_ALL_COMMON = \ + -I$(abs_builddir) \ + -I$(abs_srcdir) \ + -I$(abs_srcdir)/../lib \ + -I$(includedir) + +LDFLAGS_ALL_COMMON = -L$(abs_builddir) -L$(libdir) + +################################################## +# MAIN LIBRARY +################################################## + +CPPFLAGS_LIB_COMMON = $(CPPFLAGS_ALL_COMMON) $(LTDLINCL) +LDFLAGS_LIB_COMMON = $(LDFLAGS_ALL_COMMON) -version-info 1:0:0 -no-undefined +LIBADD_LIB_COMMON = $(LIBM) $(LIBLTDL) + +if WIN32 +# you must adjust the value of DEFAULT_MODPOSTFIX according +# to the first number in -version-info above +CPPFLAGS_LIB_COMMON += -DSTIX_DEFAULT_MODPREFIX=\"libstix-\" -DSTIX_DEFAULT_MODPOSTFIX=\"-1\" +else +CPPFLAGS_LIB_COMMON += -DSTIX_DEFAULT_MODPREFIX=\"$(libdir)/libstix-\" -DSTIX_DEFAULT_MODPOSTFIX=\"\" +endif + +if ENABLE_STATIC_MODULE + +################################################## +# STATIC MODULES BUILT INTO MAIN LIBRARY +################################################## +#libstix_la_SOURCES += mod-dir.c mod-dir.h \ +#libstix_la_LIBADD += + +else + +################################################## +# DYNAMIC MODULES +################################################## + +CPPFLAGS_MOD_COMMON = $(CPPFLAGS_LIB_COMMON) +LDFLAGS_MOD_COMMON = $(LDFLAGS_LIB_COMMON) +LIBADD_MOD_COMMON = -lstix + +pkgmodexecdir = $(libdir) + +pkgmodexec_LTLIBRARIES = libstix-stdio.la libstix-sound.la libstix-console.la + +libstix_stdio_la_SOURCES = stdio.c +libstix_stdio_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON) +libstix_stdio_la_LDFLAGS = $(LDFLAGS_MOD_COMMON) +libstix_stdio_la_LIBADD = $(LIBADD_MOD_COMMON) + +libstix_sound_la_SOURCES = sound.c sound.h +libstix_sound_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON) +libstix_sound_la_LDFLAGS = $(LDFLAGS_MOD_COMMON) +libstix_sound_la_LIBADD = $(LIBADD_MOD_COMMON) + +libstix_console_la_SOURCES = console.c console.h +libstix_console_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON) +libstix_console_la_LDFLAGS = $(LDFLAGS_MOD_COMMON) +libstix_console_la_LIBADD = $(LIBADD_MOD_COMMON) -ltermcap + +endif + + diff --git a/stix/mod/Makefile.in b/stix/mod/Makefile.in new file mode 100644 index 0000000..d059134 --- /dev/null +++ b/stix/mod/Makefile.in @@ -0,0 +1,788 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 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@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@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@ + +# you must adjust the value of DEFAULT_MODPOSTFIX according +# to the first number in -version-info above +@WIN32_TRUE@am__append_1 = -DSTIX_DEFAULT_MODPREFIX=\"libstix-\" -DSTIX_DEFAULT_MODPOSTFIX=\"-1\" +@WIN32_FALSE@am__append_2 = -DSTIX_DEFAULT_MODPREFIX=\"$(libdir)/libstix-\" -DSTIX_DEFAULT_MODPOSTFIX=\"\" +subdir = mod +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/ac/depcomp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/argz.m4 \ + $(top_srcdir)/m4/ax_cxx_namespace.m4 \ + $(top_srcdir)/m4/ax_numval.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/lib/stix-cfg.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +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 = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(pkgmodexecdir)" +LTLIBRARIES = $(pkgmodexec_LTLIBRARIES) +am__DEPENDENCIES_1 = +@ENABLE_STATIC_MODULE_FALSE@libstix_console_la_DEPENDENCIES = \ +@ENABLE_STATIC_MODULE_FALSE@ $(am__DEPENDENCIES_1) +am__libstix_console_la_SOURCES_DIST = console.c console.h +@ENABLE_STATIC_MODULE_FALSE@am_libstix_console_la_OBJECTS = \ +@ENABLE_STATIC_MODULE_FALSE@ libstix_console_la-console.lo +libstix_console_la_OBJECTS = $(am_libstix_console_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libstix_console_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libstix_console_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@ENABLE_STATIC_MODULE_FALSE@am_libstix_console_la_rpath = -rpath \ +@ENABLE_STATIC_MODULE_FALSE@ $(pkgmodexecdir) +@ENABLE_STATIC_MODULE_FALSE@libstix_sound_la_DEPENDENCIES = \ +@ENABLE_STATIC_MODULE_FALSE@ $(am__DEPENDENCIES_1) +am__libstix_sound_la_SOURCES_DIST = sound.c sound.h +@ENABLE_STATIC_MODULE_FALSE@am_libstix_sound_la_OBJECTS = \ +@ENABLE_STATIC_MODULE_FALSE@ libstix_sound_la-sound.lo +libstix_sound_la_OBJECTS = $(am_libstix_sound_la_OBJECTS) +libstix_sound_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libstix_sound_la_LDFLAGS) $(LDFLAGS) \ + -o $@ +@ENABLE_STATIC_MODULE_FALSE@am_libstix_sound_la_rpath = -rpath \ +@ENABLE_STATIC_MODULE_FALSE@ $(pkgmodexecdir) +@ENABLE_STATIC_MODULE_FALSE@libstix_stdio_la_DEPENDENCIES = \ +@ENABLE_STATIC_MODULE_FALSE@ $(am__DEPENDENCIES_1) +am__libstix_stdio_la_SOURCES_DIST = stdio.c +@ENABLE_STATIC_MODULE_FALSE@am_libstix_stdio_la_OBJECTS = \ +@ENABLE_STATIC_MODULE_FALSE@ libstix_stdio_la-stdio.lo +libstix_stdio_la_OBJECTS = $(am_libstix_stdio_la_OBJECTS) +libstix_stdio_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libstix_stdio_la_LDFLAGS) $(LDFLAGS) \ + -o $@ +@ENABLE_STATIC_MODULE_FALSE@am_libstix_stdio_la_rpath = -rpath \ +@ENABLE_STATIC_MODULE_FALSE@ $(pkgmodexecdir) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = +depcomp = $(SHELL) $(top_srcdir)/ac/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libstix_console_la_SOURCES) $(libstix_sound_la_SOURCES) \ + $(libstix_stdio_la_SOURCES) +DIST_SOURCES = $(am__libstix_console_la_SOURCES_DIST) \ + $(am__libstix_sound_la_SOURCES_DIST) \ + $(am__libstix_stdio_la_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +ARGZ_H = @ARGZ_H@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILD_MODE = @BUILD_MODE@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +HAVE_CXX = @HAVE_CXX@ +INCLTDL = @INCLTDL@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBADD_DL = @LIBADD_DL@ +LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ +LIBADD_DLOPEN = @LIBADD_DLOPEN@ +LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ +LIBLTDL = @LIBLTDL@ +LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTDLDEPS = @LTDLDEPS@ +LTDLINCL = @LTDLINCL@ +LTDLOPEN = @LTDLOPEN@ +LTLIBOBJS = @LTLIBOBJS@ +LT_CONFIG_H = @LT_CONFIG_H@ +LT_DLLOADERS = @LT_DLLOADERS@ +LT_DLPREOPEN = @LT_DLPREOPEN@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ +PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ +PACKAGE_VERSION_PATCH = @PACKAGE_VERSION_PATCH@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +QUADMATH_LIBS = @QUADMATH_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STIX_PROJECT_AUTHOR = @STIX_PROJECT_AUTHOR@ +STIX_PROJECT_URL = @STIX_PROJECT_URL@ +STIX_SIZEOF_CHAR = @STIX_SIZEOF_CHAR@ +STIX_SIZEOF_DOUBLE = @STIX_SIZEOF_DOUBLE@ +STIX_SIZEOF_FLOAT = @STIX_SIZEOF_FLOAT@ +STIX_SIZEOF_INT = @STIX_SIZEOF_INT@ +STIX_SIZEOF_LONG = @STIX_SIZEOF_LONG@ +STIX_SIZEOF_LONG_DOUBLE = @STIX_SIZEOF_LONG_DOUBLE@ +STIX_SIZEOF_LONG_LONG = @STIX_SIZEOF_LONG_LONG@ +STIX_SIZEOF_OFF64_T = @STIX_SIZEOF_OFF64_T@ +STIX_SIZEOF_OFF_T = @STIX_SIZEOF_OFF_T@ +STIX_SIZEOF_SHORT = @STIX_SIZEOF_SHORT@ +STIX_SIZEOF_VOID_P = @STIX_SIZEOF_VOID_P@ +STIX_SIZEOF_WCHAR_T = @STIX_SIZEOF_WCHAR_T@ +STRIP = @STRIP@ +UNICOWS_LIBS = @UNICOWS_LIBS@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +ltdl_LIBOBJS = @ltdl_LIBOBJS@ +ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ +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@ +subdirs = @subdirs@ +sys_symbol_underscore = @sys_symbol_underscore@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = nostdinc +CPPFLAGS_ALL_COMMON = \ + -I$(abs_builddir) \ + -I$(abs_srcdir) \ + -I$(abs_srcdir)/../lib \ + -I$(includedir) + +LDFLAGS_ALL_COMMON = -L$(abs_builddir) -L$(libdir) + +################################################## +# MAIN LIBRARY +################################################## +CPPFLAGS_LIB_COMMON = $(CPPFLAGS_ALL_COMMON) $(LTDLINCL) \ + $(am__append_1) $(am__append_2) +LDFLAGS_LIB_COMMON = $(LDFLAGS_ALL_COMMON) -version-info 1:0:0 -no-undefined +LIBADD_LIB_COMMON = $(LIBM) $(LIBLTDL) + +################################################## +# STATIC MODULES BUILT INTO MAIN LIBRARY +################################################## +#libstix_la_SOURCES += mod-dir.c mod-dir.h \ +#libstix_la_LIBADD += + +################################################## +# DYNAMIC MODULES +################################################## +@ENABLE_STATIC_MODULE_FALSE@CPPFLAGS_MOD_COMMON = $(CPPFLAGS_LIB_COMMON) +@ENABLE_STATIC_MODULE_FALSE@LDFLAGS_MOD_COMMON = $(LDFLAGS_LIB_COMMON) +@ENABLE_STATIC_MODULE_FALSE@LIBADD_MOD_COMMON = -lstix +@ENABLE_STATIC_MODULE_FALSE@pkgmodexecdir = $(libdir) +@ENABLE_STATIC_MODULE_FALSE@pkgmodexec_LTLIBRARIES = libstix-stdio.la libstix-sound.la libstix-console.la +@ENABLE_STATIC_MODULE_FALSE@libstix_stdio_la_SOURCES = stdio.c +@ENABLE_STATIC_MODULE_FALSE@libstix_stdio_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON) +@ENABLE_STATIC_MODULE_FALSE@libstix_stdio_la_LDFLAGS = $(LDFLAGS_MOD_COMMON) +@ENABLE_STATIC_MODULE_FALSE@libstix_stdio_la_LIBADD = $(LIBADD_MOD_COMMON) +@ENABLE_STATIC_MODULE_FALSE@libstix_sound_la_SOURCES = sound.c sound.h +@ENABLE_STATIC_MODULE_FALSE@libstix_sound_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON) +@ENABLE_STATIC_MODULE_FALSE@libstix_sound_la_LDFLAGS = $(LDFLAGS_MOD_COMMON) +@ENABLE_STATIC_MODULE_FALSE@libstix_sound_la_LIBADD = $(LIBADD_MOD_COMMON) +@ENABLE_STATIC_MODULE_FALSE@libstix_console_la_SOURCES = console.c console.h +@ENABLE_STATIC_MODULE_FALSE@libstix_console_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON) +@ENABLE_STATIC_MODULE_FALSE@libstix_console_la_LDFLAGS = $(LDFLAGS_MOD_COMMON) +@ENABLE_STATIC_MODULE_FALSE@libstix_console_la_LIBADD = $(LIBADD_MOD_COMMON) -ltermcap +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(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 ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign mod/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign mod/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 +$(am__aclocal_m4_deps): + +install-pkgmodexecLTLIBRARIES: $(pkgmodexec_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(pkgmodexec_LTLIBRARIES)'; test -n "$(pkgmodexecdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgmodexecdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgmodexecdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkgmodexecdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkgmodexecdir)"; \ + } + +uninstall-pkgmodexecLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkgmodexec_LTLIBRARIES)'; test -n "$(pkgmodexecdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkgmodexecdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkgmodexecdir)/$$f"; \ + done + +clean-pkgmodexecLTLIBRARIES: + -test -z "$(pkgmodexec_LTLIBRARIES)" || rm -f $(pkgmodexec_LTLIBRARIES) + @list='$(pkgmodexec_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libstix-console.la: $(libstix_console_la_OBJECTS) $(libstix_console_la_DEPENDENCIES) $(EXTRA_libstix_console_la_DEPENDENCIES) + $(AM_V_CCLD)$(libstix_console_la_LINK) $(am_libstix_console_la_rpath) $(libstix_console_la_OBJECTS) $(libstix_console_la_LIBADD) $(LIBS) + +libstix-sound.la: $(libstix_sound_la_OBJECTS) $(libstix_sound_la_DEPENDENCIES) $(EXTRA_libstix_sound_la_DEPENDENCIES) + $(AM_V_CCLD)$(libstix_sound_la_LINK) $(am_libstix_sound_la_rpath) $(libstix_sound_la_OBJECTS) $(libstix_sound_la_LIBADD) $(LIBS) + +libstix-stdio.la: $(libstix_stdio_la_OBJECTS) $(libstix_stdio_la_DEPENDENCIES) $(EXTRA_libstix_stdio_la_DEPENDENCIES) + $(AM_V_CCLD)$(libstix_stdio_la_LINK) $(am_libstix_stdio_la_rpath) $(libstix_stdio_la_OBJECTS) $(libstix_stdio_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstix_console_la-console.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstix_sound_la-sound.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstix_stdio_la-stdio.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +libstix_console_la-console.lo: console.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstix_console_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstix_console_la-console.lo -MD -MP -MF $(DEPDIR)/libstix_console_la-console.Tpo -c -o libstix_console_la-console.lo `test -f 'console.c' || echo '$(srcdir)/'`console.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstix_console_la-console.Tpo $(DEPDIR)/libstix_console_la-console.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='console.c' object='libstix_console_la-console.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstix_console_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstix_console_la-console.lo `test -f 'console.c' || echo '$(srcdir)/'`console.c + +libstix_sound_la-sound.lo: sound.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstix_sound_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstix_sound_la-sound.lo -MD -MP -MF $(DEPDIR)/libstix_sound_la-sound.Tpo -c -o libstix_sound_la-sound.lo `test -f 'sound.c' || echo '$(srcdir)/'`sound.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstix_sound_la-sound.Tpo $(DEPDIR)/libstix_sound_la-sound.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sound.c' object='libstix_sound_la-sound.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstix_sound_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstix_sound_la-sound.lo `test -f 'sound.c' || echo '$(srcdir)/'`sound.c + +libstix_stdio_la-stdio.lo: stdio.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstix_stdio_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libstix_stdio_la-stdio.lo -MD -MP -MF $(DEPDIR)/libstix_stdio_la-stdio.Tpo -c -o libstix_stdio_la-stdio.lo `test -f 'stdio.c' || echo '$(srcdir)/'`stdio.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstix_stdio_la-stdio.Tpo $(DEPDIR)/libstix_stdio_la-stdio.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stdio.c' object='libstix_stdio_la-stdio.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstix_stdio_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libstix_stdio_la-stdio.lo `test -f 'stdio.c' || echo '$(srcdir)/'`stdio.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +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 "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$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 $(LTLIBRARIES) +installdirs: + for dir in "$(DESTDIR)$(pkgmodexecdir)"; 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: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-pkgmodexecLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-pkgmodexecLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-pkgmodexecLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkgmodexecLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile 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-pkgmodexecLTLIBRARIES install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-pkgmodexecLTLIBRARIES + + +# 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: diff --git a/stix/lib/mod-con.c b/stix/mod/console.c similarity index 97% rename from stix/lib/mod-con.c rename to stix/mod/console.c index 3dbd6f0..6b0c8da 100644 --- a/stix/lib/mod-con.c +++ b/stix/mod/console.c @@ -25,11 +25,9 @@ */ -#include "mod-con.h" +#include "console.h" #include -#include "stix-prv.h" /* TODO: remove this header after refactoring it */ - #include #include @@ -299,7 +297,7 @@ static void unload (stix_t* stix, stix_prim_mod_t* mod) } -int stix_prim_mod_con (stix_t* stix, stix_prim_mod_t* mod) +int stix_prim_mod_console (stix_t* stix, stix_prim_mod_t* mod) { mod->query = query; mod->unload = unload; diff --git a/stix/lib/mod-snd.c b/stix/mod/sound.c similarity index 97% rename from stix/lib/mod-snd.c rename to stix/mod/sound.c index 4e53a8d..62ff0ea 100644 --- a/stix/lib/mod-snd.c +++ b/stix/mod/sound.c @@ -25,7 +25,7 @@ */ -#include "mod-snd.h" +#include "sound.h" #include /* ------------------------------------------------------------------------ */ @@ -93,7 +93,7 @@ static void unload (stix_t* stix, stix_prim_mod_t* mod) } -int stix_prim_mod_snd (stix_t* stix, stix_prim_mod_t* mod) +int stix_prim_mod_sound (stix_t* stix, stix_prim_mod_t* mod) { mod->query = query; mod->unload = unload; diff --git a/stix/mod/stdio.c b/stix/mod/stdio.c new file mode 100644 index 0000000..ac2ba34 --- /dev/null +++ b/stix/mod/stdio.c @@ -0,0 +1,198 @@ +/* + * $Id$ + * + Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#include +#include + +#include +#include + +static int prim_open (stix_t* stix, stix_ooi_t nargs) +{ + stix_oop_word_t rcv; + stix_oop_char_t name; + stix_oop_char_t mode; + FILE* fp; + +#if defined(STIX_OOCH_IS_UCH) + stix_oow_t ucslen, bcslen; + stix_bch_t namebuf[PATH_MAX]; + stix_bch_t modebuf[32]; /* TODO: dynamic-sized conversion?? */ +#endif + + rcv = (stix_oop_word_t)STIX_STACK_GETRCV(stix, nargs); + name = (stix_oop_char_t)STIX_STACK_GETARG(stix, nargs, 0); + mode = (stix_oop_char_t)STIX_STACK_GETARG(stix, nargs, 1); + +#if defined(STIX_OOCH_IS_UCH) +/* TODO: error check on string conversion */ + ucslen = STIX_OBJ_GET_SIZE(name); + bcslen = STIX_COUNTOF(namebuf) - 1; + stix_ucstoutf8 (name->slot, &ucslen, namebuf, &bcslen); + namebuf[bcslen] = '\0'; + + ucslen = STIX_OBJ_GET_SIZE(mode); + bcslen = STIX_COUNTOF(modebuf) - 1; + stix_ucstoutf8 (mode->slot, &ucslen, modebuf, &bcslen); + modebuf[bcslen] = '\0'; + +STIX_DEBUG2 (stix, "opening %s for %s\n", namebuf, modebuf); + fp = fopen (namebuf, modebuf); +#else + fp = fopen (name->slot, mode->slot); +#endif + if (!fp) + { + return -1; /* TODO: return success with an object instead... */ + } + + rcv->slot[0] = (stix_oow_t)fp; + STIX_STACK_SETRETTORCV (stix, nargs); + return 1; +} + +static int prim_close (stix_t* stix, stix_ooi_t nargs) +{ + stix_oop_word_t rcv; + + rcv = (stix_oop_word_t)STIX_STACK_GETRCV(stix, nargs); + if (rcv->slot[0]) + { + fclose ((FILE*)rcv->slot[0]); + rcv->slot[0] = 0; + } + + STIX_STACK_SETRETTORCV (stix, nargs); + return 1; +} + +static int prim_write (stix_t* stix, stix_ooi_t nargs) +{ + /* return how many bytes have been written.. */ + + STIX_STACK_SETRETTORCV (stix, nargs); + return 1; +} + +/* ------------------------------------------------------------------------ */ + +typedef struct fnctab_t fnctab_t; +struct fnctab_t +{ + const stix_bch_t* name; + stix_prim_impl_t handler; +}; + +static fnctab_t fnctab[] = +{ + { "close", prim_close }, + { "open", prim_open }, + { "write", prim_write } +}; + +/* ------------------------------------------------------------------------ */ + +static stix_prim_impl_t query (stix_t* stix, stix_prim_mod_t* mod, const stix_ooch_t* name) +{ + int left, right, mid, n; + + left = 0; right = STIX_COUNTOF(fnctab) - 1; + + while (left <= right) + { + mid = (left + right) / 2; + + n = stix_compoocbcstr (name, fnctab[mid].name); + if (n < 0) right = mid - 1; + else if (n > 0) left = mid + 1; + else + { + return fnctab[mid].handler; + } + } + + stix->errnum = STIX_ENOENT; + return STIX_NULL; +} + +#if 0 +/* TOOD: concept of a argument_check fucntion? + * check if receiver is a certain object? + * check if receiver is at a certain size? + * etc... + */ +static int sanity_check (stix_t* stix) +{ +} +#endif + +static void unload (stix_t* stix, stix_prim_mod_t* mod) +{ + /* TODO: close all open handle?? */ +} + + +int stix_prim_mod_stdio (stix_t* stix, stix_prim_mod_t* mod) +{ + mod->query = query; + mod->unload = unload; + mod->ctx = STIX_NULL; + +#if 0 + +#include 'Stix.st'. +#import 'Console'. + + c = stix_findclass (stix, "Console"); + if (!c) c = stix_makeclass (stix, "Console", "x y"); <- provides an API to create a simple class + + stix_addmethod (stix, c, "open", prim_open); + stix_addmethod (stix, c, "close:", prim_close); + stix_addmethod (stix, c, "setCursorTo:", prim_setcursor); + stix_addmethod (stix, c, "clear", prim_clear ); + stix_addmethod (stix, c, "write", prim_write ); + + + + +/* GRAMMER ENHANCEMENT */ +fun abc (a, b, c) <----- this style, register C style method +{ +} + +fun abc: a with: b c: c <----- smalltalk style +{ +} + +abc->def (a, b, c) <------- use -> as an c style method indicator +abc abc: a with: b c: c + +#endif + + return 0; +} +