diff options
author | neonloop | 2021-10-20 14:54:27 +0000 |
---|---|---|
committer | neonloop | 2021-10-20 14:54:27 +0000 |
commit | ea1947ffcc606d757357398b24e74a3f4ecefa07 (patch) | |
tree | 2031b8d4fc4c61063c710a7148378f57e662efbd /modules/libkey | |
download | bennugd-ea1947ffcc606d757357398b24e74a3f4ecefa07.tar.gz bennugd-ea1947ffcc606d757357398b24e74a3f4ecefa07.tar.bz2 bennugd-ea1947ffcc606d757357398b24e74a3f4ecefa07.zip |
Initial commit from steward-fu releasemain
Diffstat (limited to 'modules/libkey')
-rw-r--r-- | modules/libkey/Makefile | 609 | ||||
-rw-r--r-- | modules/libkey/Makefile.am | 15 | ||||
-rw-r--r-- | modules/libkey/Makefile.in | 609 | ||||
-rw-r--r-- | modules/libkey/libkey.c | 472 | ||||
-rw-r--r-- | modules/libkey/libkey.h | 68 | ||||
-rw-r--r-- | modules/libkey/libkey_exports.h | 191 |
6 files changed, 1964 insertions, 0 deletions
diff --git a/modules/libkey/Makefile b/modules/libkey/Makefile new file mode 100644 index 0000000..58d471c --- /dev/null +++ b/modules/libkey/Makefile @@ -0,0 +1,609 @@ +# Makefile.in generated by automake 1.12.1 from Makefile.am. +# libkey/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994-2012 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. + + + +#AUTOMAKE_OPTIONS = no-dependencies foreign + + +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/bennu +pkgincludedir = $(includedir)/bennu +pkglibdir = $(libdir)/bennu +pkglibexecdir = $(libexecdir)/bennu +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 = x86_64-pc-none +host_triplet = arm-unknown-linux-gnu +target_triplet = arm-unknown-linux-gnu +subdir = libkey +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/depcomp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.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.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +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)$(libdir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libkey_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libkey_la_OBJECTS = libkey_la-libkey.lo +libkey_la_OBJECTS = $(am_libkey_la_OBJECTS) +libkey_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libkey_la_CFLAGS) \ + $(CFLAGS) $(libkey_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libkey_la_SOURCES) +DIST_SOURCES = $(libkey_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /home/steward/Github/miyoo_src/bennugd/modules/missing --run aclocal-1.12 +AMTAR = $${TAR-tar} +AR = /opt/miyoo/usr/bin/arm-linux-ar +AS = as +AUTOCONF = ${SHELL} /home/steward/Github/miyoo_src/bennugd/modules/missing --run autoconf +AUTOHEADER = ${SHELL} /home/steward/Github/miyoo_src/bennugd/modules/missing --run autoheader +AUTOMAKE = ${SHELL} /home/steward/Github/miyoo_src/bennugd/modules/missing --run automake-1.12 +AWK = mawk +BGD_PATH = /home/steward/Github/miyoo_src/bennugd/modules/../core +CC = /opt/miyoo/usr/bin/arm-linux-gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -DTARGET_MIYOO -mcpu=arm926ej-s -mtune=arm926ej-s -O3 -DARM -D_ARM_ASSEM_ -I/opt/miyoo/arm-miyoo-linux-uclibcgnueabi/sysroot/usr/include/SDL -O2 -finline-functions -fno-strict-aliasing -Wall -DTARGET_LINUX -DUSE_LIBDES -DTARGET_MIYOO -mcpu=arm926ej-s -mtune=arm926ej-s -O3 -DARM -D_ARM_ASSEM_ -I/opt/miyoo/arm-miyoo-linux-uclibcgnueabi/sysroot/usr/include/SDL -I/home/steward/Github/miyoo_src/bennugd/modules/../3rdparty/des-4.04b +COMMON_CFLAGS = -Wall -DTARGET_LINUX -DUSE_LIBDES -DTARGET_MIYOO -mcpu=arm926ej-s -mtune=arm926ej-s -O3 -DARM -D_ARM_ASSEM_ -I/opt/miyoo/arm-miyoo-linux-uclibcgnueabi/sysroot/usr/include/SDL -I/home/steward/Github/miyoo_src/bennugd/modules/../3rdparty/des-4.04b +COMMON_LDFLAGS = -lc -ldl -D_REENTRANT -L/home/steward/Github/miyoo_src/bennugd/modules/../3rdparty/des-4.04b -ldes +CPP = /opt/miyoo/usr/bin/arm-linux-gcc -E +CPPFLAGS = +CYGPATH_W = echo +DEFS = -DPACKAGE_NAME=\"bennu\" -DPACKAGE_TARNAME=\"bennu\" -DPACKAGE_VERSION=\"1.0.0\" -DPACKAGE_STRING=\"bennu\ 1.0.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DPACKAGE=\"bennu\" -DVERSION=\"1.0.0\" -DHAVE_LIBM=1 +DEPDIR = .deps +DESLIBS = +DLLTOOL = false +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = +FGREP = /bin/grep -F +GREP = /bin/grep +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LD = /opt/miyoo/usr/bin/arm-linux-ld +LDFLAGS = -D_REENTRANT +LIBOBJS = +LIBS = -lm +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIPO = +LN_S = ln -s +LTLIBOBJS = +MAINT = # +MAKEINFO = ${SHELL} /home/steward/Github/miyoo_src/bennugd/modules/missing --run makeinfo +MANIFEST_TOOL = : +MKDIR_P = /bin/mkdir -p +NM = /opt/miyoo/bin//arm-linux-nm -B +NMEDIT = +OBJDUMP = arm-linux-objdump +OBJEXT = o +OTOOL = +OTOOL64 = +PACKAGE = bennu +PACKAGE_BUGREPORT = +PACKAGE_NAME = bennu +PACKAGE_STRING = bennu 1.0.0 +PACKAGE_TARNAME = bennu +PACKAGE_URL = +PACKAGE_VERSION = 1.0.0 +PATH_SEPARATOR = : +PKG_CONFIG = /usr/bin/pkg-config +PKG_CONFIG_LIBDIR = /opt/miyoo/arm-miyoo-linux-uclibcgnueabi/sysroot/usr/lib/pkgconfig +PKG_CONFIG_PATH = /opt/miyoo/arm-miyoo-linux-uclibcgnueabi/sysroot/usr/lib/pkgconfig +PNGLIBS = +PNG_CFLAGS = -I/usr/include/libpng16 +PNG_LIBS = -lpng16 -lz +RANLIB = /opt/miyoo/usr/bin/arm-linux-ranlib +SDL_CFLAGS = -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT +SDL_LIBS = -lSDL -lpthread +SDL_mixer_CFLAGS = -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT +SDL_mixer_LIBS = -lSDL_mixer -lSDL -lpthread +SED = /bin/sed +SET_MAKE = +SHELL = /bin/bash +STRIP = /opt/miyoo/usr/bin/arm-linux-strip +VERSION = 1.0.0 +WINDRES = +X11LIBS = -lX11 +ZLIBS = +ZLIB_CFLAGS = +ZLIB_LIBS = -lz +abs_builddir = /home/steward/Github/miyoo_src/bennugd/modules/libkey +abs_srcdir = /home/steward/Github/miyoo_src/bennugd/modules/libkey +abs_top_builddir = /home/steward/Github/miyoo_src/bennugd/modules +abs_top_srcdir = /home/steward/Github/miyoo_src/bennugd/modules +ac_ct_AR = +ac_ct_CC = +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = $${TAR-tar} chof - "$$tardir" +am__untar = $${TAR-tar} xf - +bindir = ${exec_prefix}/bin +build = x86_64-pc-none +build_alias = x86_64 +build_cpu = x86_64 +build_os = none +build_vendor = pc +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = arm-unknown-linux-gnu +host_alias = arm-linux +host_cpu = arm +host_os = linux-gnu +host_vendor = unknown +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /home/steward/Github/miyoo_src/bennugd/modules/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /opt/miyoo/usr +program_transform_name = s&^&arm-linux-& +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target = arm-unknown-linux-gnu +target_alias = arm-linux +target_cpu = arm +target_os = linux-gnu +target_vendor = unknown +top_build_prefix = ../ +top_builddir = .. +top_srcdir = .. +lib_LTLIBRARIES = libkey.la +libkey_la_SOURCES = libkey.c +libkey_la_CFLAGS = $(COMMON_CFLAGS) $(SDL_CFLAGS) -I$(BGD_PATH)/include +libkey_la_LDFLAGS = -s -module -no-undefined -avoid-version +libkey_la_LIBADD = $(COMMON_LDFLAGS) $(SDL_LIBS) -L$(BGD_PATH)/bgdrtm/src/.libs -lbgdrtm +CLEANFILES = libkey.la +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) --gnu libkey/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu libkey/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-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || 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)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_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}; \ + } +libkey.la: $(libkey_la_OBJECTS) $(libkey_la_DEPENDENCIES) $(EXTRA_libkey_la_DEPENDENCIES) + $(libkey_la_LINK) -rpath $(libdir) $(libkey_la_OBJECTS) $(libkey_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include ./$(DEPDIR)/libkey_la-libkey.Plo + +.c.o: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c $< + +.c.obj: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: + $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +# source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LTCOMPILE) -c -o $@ $< + +libkey_la-libkey.lo: libkey.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkey_la_CFLAGS) $(CFLAGS) -MT libkey_la-libkey.lo -MD -MP -MF $(DEPDIR)/libkey_la-libkey.Tpo -c -o libkey_la-libkey.lo `test -f 'libkey.c' || echo '$(srcdir)/'`libkey.c + $(am__mv) $(DEPDIR)/libkey_la-libkey.Tpo $(DEPDIR)/libkey_la-libkey.Plo +# source='libkey.c' object='libkey_la-libkey.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkey_la_CFLAGS) $(CFLAGS) -c -o libkey_la-libkey.lo `test -f 'libkey.c' || echo '$(srcdir)/'`libkey.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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 +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$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: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + 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)$(libdir)"; 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: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +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-libLTLIBRARIES clean-libtool \ + 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-libLTLIBRARIES + +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-libLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool cscopelist ctags 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-libLTLIBRARIES install-man install-pdf install-pdf-am \ + 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 uninstall uninstall-am uninstall-libLTLIBRARIES + + +# 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/modules/libkey/Makefile.am b/modules/libkey/Makefile.am new file mode 100644 index 0000000..01ee726 --- /dev/null +++ b/modules/libkey/Makefile.am @@ -0,0 +1,15 @@ +## Process this file with automake to produce Makefile.in + +#AUTOMAKE_OPTIONS = no-dependencies foreign + +lib_LTLIBRARIES = libkey.la + +libkey_la_SOURCES = libkey.c +libkey_la_CFLAGS = $(COMMON_CFLAGS) $(SDL_CFLAGS) -I$(BGD_PATH)/include +libkey_la_LDFLAGS = -s -module -no-undefined -avoid-version +libkey_la_LIBADD = $(COMMON_LDFLAGS) $(SDL_LIBS) -L$(BGD_PATH)/bgdrtm/src/.libs -lbgdrtm + +## Make sure these will be cleaned even when they're not built by +## default. +CLEANFILES = libkey.la + diff --git a/modules/libkey/Makefile.in b/modules/libkey/Makefile.in new file mode 100644 index 0000000..59d0758 --- /dev/null +++ b/modules/libkey/Makefile.in @@ -0,0 +1,609 @@ +# Makefile.in generated by automake 1.12.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 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@ + +#AUTOMAKE_OPTIONS = no-dependencies foreign + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +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@ +target_triplet = @target@ +subdir = libkey +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/depcomp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.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.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +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)$(libdir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +am__DEPENDENCIES_1 = +libkey_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am_libkey_la_OBJECTS = libkey_la-libkey.lo +libkey_la_OBJECTS = $(am_libkey_la_OBJECTS) +libkey_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libkey_la_CFLAGS) \ + $(CFLAGS) $(libkey_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libkey_la_SOURCES) +DIST_SOURCES = $(libkey_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BGD_PATH = @BGD_PATH@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +COMMON_CFLAGS = @COMMON_CFLAGS@ +COMMON_LDFLAGS = @COMMON_LDFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DESLIBS = @DESLIBS@ +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@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +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@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PNGLIBS = @PNGLIBS@ +PNG_CFLAGS = @PNG_CFLAGS@ +PNG_LIBS = @PNG_LIBS@ +RANLIB = @RANLIB@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_LIBS = @SDL_LIBS@ +SDL_mixer_CFLAGS = @SDL_mixer_CFLAGS@ +SDL_mixer_LIBS = @SDL_mixer_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +WINDRES = @WINDRES@ +X11LIBS = @X11LIBS@ +ZLIBS = @ZLIBS@ +ZLIB_CFLAGS = @ZLIB_CFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ +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_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@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +lib_LTLIBRARIES = libkey.la +libkey_la_SOURCES = libkey.c +libkey_la_CFLAGS = $(COMMON_CFLAGS) $(SDL_CFLAGS) -I$(BGD_PATH)/include +libkey_la_LDFLAGS = -s -module -no-undefined -avoid-version +libkey_la_LIBADD = $(COMMON_LDFLAGS) $(SDL_LIBS) -L$(BGD_PATH)/bgdrtm/src/.libs -lbgdrtm +CLEANFILES = libkey.la +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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) --gnu libkey/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu libkey/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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || 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)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_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}; \ + } +libkey.la: $(libkey_la_OBJECTS) $(libkey_la_DEPENDENCIES) $(EXTRA_libkey_la_DEPENDENCIES) + $(libkey_la_LINK) -rpath $(libdir) $(libkey_la_OBJECTS) $(libkey_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libkey_la-libkey.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +libkey_la-libkey.lo: libkey.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkey_la_CFLAGS) $(CFLAGS) -MT libkey_la-libkey.lo -MD -MP -MF $(DEPDIR)/libkey_la-libkey.Tpo -c -o libkey_la-libkey.lo `test -f 'libkey.c' || echo '$(srcdir)/'`libkey.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libkey_la-libkey.Tpo $(DEPDIR)/libkey_la-libkey.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libkey.c' object='libkey_la-libkey.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkey_la_CFLAGS) $(CFLAGS) -c -o libkey_la-libkey.lo `test -f 'libkey.c' || echo '$(srcdir)/'`libkey.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + 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 +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$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: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + 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)$(libdir)"; 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: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +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-libLTLIBRARIES clean-libtool \ + 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-libLTLIBRARIES + +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-libLTLIBRARIES + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool cscopelist ctags 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-libLTLIBRARIES install-man install-pdf install-pdf-am \ + 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 uninstall uninstall-am uninstall-libLTLIBRARIES + + +# 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/modules/libkey/libkey.c b/modules/libkey/libkey.c new file mode 100644 index 0000000..6b3ccde --- /dev/null +++ b/modules/libkey/libkey.c @@ -0,0 +1,472 @@ +/* + * Copyright © 2006-2016 SplinterGU (Fenix/Bennugd) + * Copyright © 2002-2006 Fenix Team (Fenix) + * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix) + * + * This file is part of Bennu - Game Development + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. + * + */ + +#include <stdio.h> +#include <stdlib.h> + +#include <SDL.h> + +#include "xctype.h" +#include "bgddl.h" +#include "dlvaracc.h" + +#define __LIBKEY +#include "libkey.h" + +/* ---------------------------------------------------------------------- */ + +#include "libkey_exports.h" + +/* ---------------------------------------------------------------------- */ + +typedef struct +{ + SDLKey sym; /* SDL virtual keysym */ + SDLMod mod; /* current key modifiers */ + HOTKEY_CALLBACK callback; +} hotkey ; + +static hotkey * hotkey_list = NULL ; +static int hotkey_allocated = 0 ; +static int hotkey_count = 0 ; + +/* ---------------------------------------------------------------------- */ + +/* Publicas */ +key_equiv key_table[127] ; /* Now we have a search table with equivs */ +unsigned char * keystate = NULL; /* Pointer to key states */ + +/* ---------------------------------------------------------------------- */ + +static int sdl_equiv[SDLK_LAST+1] ; + +static int equivs[] = +{ + SDLK_RCTRL, 1, + SDLK_1, 2, + SDLK_KP1, 2, + SDLK_2, 3, + SDLK_KP2, 3, + SDLK_3, 4, + SDLK_KP3, 4, + SDLK_4, 5, + SDLK_KP4, 5, + SDLK_5, 6, + SDLK_KP5, 6, + SDLK_6, 7, + SDLK_KP6, 7, + SDLK_7, 8, + SDLK_KP7, 8, + SDLK_8, 9, + SDLK_KP8, 9, + SDLK_9, 10, + SDLK_KP9, 10, + SDLK_0, 11, + SDLK_KP0, 11, + SDLK_MINUS, 12, + SDLK_EQUALS, 13, + SDLK_BACKSPACE, 14, + SDLK_TAB, 15, + SDLK_q, 16, + SDLK_w, 17, + SDLK_e, 18, + SDLK_r, 19, + SDLK_t, 20, + SDLK_y, 21, + SDLK_u, 22, + SDLK_i, 23, + SDLK_o, 24, + SDLK_p, 25, + SDLK_LEFTBRACKET, 26, + SDLK_RIGHTBRACKET, 27, + SDLK_RETURN, 28, + SDLK_KP_ENTER, 28, + SDLK_LCTRL, 29, + SDLK_RCTRL, 29, + SDLK_LCTRL, 96, + SDLK_RCTRL, 94, + SDLK_a, 30, + SDLK_s, 31, + SDLK_d, 32, + SDLK_f, 33, + SDLK_g, 34, + SDLK_h, 35, + SDLK_j, 36, + SDLK_k, 37, + SDLK_l, 38, + SDLK_SEMICOLON, 39, + SDLK_QUOTE, 40, + SDLK_BACKQUOTE, 41, + SDLK_LSHIFT, 42, + SDLK_BACKSLASH, 43, + SDLK_z, 44, + SDLK_x, 45, + SDLK_c, 46, + SDLK_v, 47, + SDLK_b, 48, + SDLK_n, 49, + SDLK_m, 50, + SDLK_COMMA, 51, + SDLK_PERIOD, 52, + SDLK_KP_PERIOD, 52, + SDLK_SLASH, 53, + SDLK_KP_DIVIDE, 53, + SDLK_RSHIFT, 54, + /* SDLK_PRINT, 55,*/ + SDLK_KP_MULTIPLY, 55, + SDLK_LALT, 56, + SDLK_RALT, 56, + SDLK_LALT, 95, + SDLK_RALT, 93, + SDLK_MODE, 93, + SDLK_MODE, 56, + SDLK_RMETA, 56, + SDLK_LMETA, 56, + SDLK_SPACE, 57, + SDLK_CAPSLOCK, 58, + SDLK_F1, 59, + SDLK_F2, 60, + SDLK_F3, 61, + SDLK_F4, 62, + SDLK_F5, 63, + SDLK_F6, 64, + SDLK_F7, 65, + SDLK_F8, 66, + SDLK_F9, 67, + SDLK_F10, 68, + SDLK_NUMLOCK, 69, + SDLK_SCROLLOCK, 70, + SDLK_HOME, 71, + SDLK_UP, 72, + SDLK_PAGEUP, 73, + SDLK_KP_MINUS, 74, + SDLK_LEFT, 75, + SDLK_RIGHT, 77, + SDLK_KP_PLUS, 78, + SDLK_END, 79, + SDLK_DOWN, 80, + SDLK_PAGEDOWN, 81, + SDLK_INSERT, 82, + SDLK_DELETE, 83, + SDLK_F11, 87, + SDLK_F12, 88, + SDLK_LESS, 89, + SDLK_PLUS, 90, + SDLK_GREATER, 91, + SDLK_QUESTION, 92, + SDLK_CARET, 93, + SDLK_SYSREQ, 55, + SDLK_PAUSE, 95, + SDLK_MENU, 97, + SDLK_LSUPER, 98, + SDLK_RSUPER, 99, + SDLK_COMPOSE, 99, + -1, -1 +} ; + +/* ---------------------------------------------------------------------- */ + +enum { + SHIFTSTATUS = 0, + ASCII, + SCANCODE +}; + +/* ---------------------------------------------------------------------- */ +/* Son las variables que se desea acceder. */ +/* El interprete completa esta estructura, si la variable existe. */ +/* (usada en tiempo de ejecucion) */ + +DLVARFIXUP __bgdexport( libkey, globals_fixup )[] = +{ + /* Nombre de variable global, puntero al dato, tamaño del elemento, cantidad de elementos */ + { "shift_status" , NULL, -1, -1 }, + { "ascii" , NULL, -1, -1 }, + { "scan_code" , NULL, -1, -1 }, + { NULL , NULL, -1, -1 } +}; + +/* ---------------------------------------------------------------------- */ + +static void add_key_equiv( int equiv, int keyconst ) +{ + key_equiv * curr = &key_table[keyconst] ; + + if ( curr->next != NULL ) while ( curr->next != NULL ) curr = curr->next ; + + if ( curr->sdlk_equiv != 0 ) + { + curr->next = malloc( sizeof( key_equiv ) ) ; + curr = curr->next ; + curr->next = NULL ; + } + + curr->sdlk_equiv = equiv ; +} + +/* ---------------------------------------------------------------------- */ + +void hotkey_add( int mod, int sym, HOTKEY_CALLBACK callback ) +{ + if ( hotkey_count >= hotkey_allocated ) + { + hotkey_allocated = hotkey_count + 5; + hotkey_list = realloc( hotkey_list, hotkey_allocated * sizeof( hotkey_list[0] ) ); + } + + if ( !hotkey_list ) + { + fprintf( stderr, "No memory for alloc hotkey\n" ); + exit( -1 ); + } + + hotkey_list [hotkey_count].mod = mod; + hotkey_list [hotkey_count].sym = sym; + hotkey_list [hotkey_count].callback = callback; + hotkey_count++; +} + +/* ---------------------------------------------------------------------- */ + +/* + * FUNCTION : process_key_events + * + * Process all pending SDL events, updating all global variables + * and handling debug key presses and cannot be changed + * + * PARAMS : + * None + * + * RETURN VALUE : + * None + */ + +static void process_key_events() +{ + SDL_Event e ; + SDLMod m ; + int k, asc ; + int pressed ; + key_equiv * curr ; + int keypress ; + static struct + { + int ascii ; + int scancode ; + } + keyring [64] ; + static int keyring_start = 0, keyring_tail = 0 ; + int ignore_key, n; + + /* Actualizar eventos */ + + keypress = 0 ; + m = SDL_GetModState() ; + + /* Procesa los eventos pendientes */ + /* Reset ascii and scancode if last key was released... */ + /* must check all the linked equivs */ + + pressed = 0 ; + if ( GLODWORD( libkey, SCANCODE ) ) + { + curr = &key_table[GLODWORD( libkey, SCANCODE )] ; + while ( curr != NULL && pressed == 0 ) + { + if ( keystate[curr->sdlk_equiv] ) pressed = 1 ; + curr = curr->next ; + } + } + + if ( !pressed ) + { + GLODWORD( libkey, ASCII ) = 0 ; + GLODWORD( libkey, SCANCODE ) = 0 ; + } + + while ( SDL_PeepEvents( &e, 1, SDL_GETEVENT, SDL_EVENTMASK(SDL_KEYDOWN)|SDL_EVENTMASK(SDL_KEYUP) ) > 0 ) + { + switch ( e.type ) + { + case SDL_KEYDOWN: + ignore_key = 0; + /* KeyDown HotKey */ + if ( hotkey_count ) + for ( n = 0; n < hotkey_count; n++ ) + { + if ((( hotkey_list[n].mod & e.key.keysym.mod ) == hotkey_list[n].mod ) && + ( !hotkey_list[n].sym || ( hotkey_list[n].sym == e.key.keysym.sym ) ) ) + { + ignore_key = hotkey_list[n].callback( e.key.keysym ); + } + } + /* KeyDown HotKey */ + + if ( ignore_key ) break ; + + /* Almacena la pulsación de la tecla */ + + k = sdl_equiv[e.key.keysym.sym]; + + m = e.key.keysym.mod ; + + if ( !keypress ) + { + GLODWORD( libkey, SCANCODE ) = k ; + if ( e.key.keysym.unicode ) + { + asc = win_to_dos[e.key.keysym.unicode & 0xFF] ; + + /* ascii mayusculas */ + if ( asc >= 'a' && asc <= 'z' && ( m & KMOD_LSHIFT || m & KMOD_RSHIFT || keystate[SDLK_CAPSLOCK] ) ) + asc -= 0x20 ; + } + else + { + asc = 0 ; /* NON PRINTABLE */ + } + + GLODWORD( libkey, ASCII ) = asc ; + keypress = 1 ; + } + else + { + keyring[keyring_tail].scancode = k ; + if ( e.key.keysym.unicode ) + { + asc = win_to_dos[e.key.keysym.unicode & 0x7F] ; + + /*ascii mayusculas */ + if ( asc >= 'a' && asc <= 'z' && ( m & KMOD_LSHIFT || m & KMOD_RSHIFT || keystate[SDLK_CAPSLOCK] ) ) + asc -= 0x20 ; + } + else + { + asc = 0 ; /* NON PRINTABLE */ + } + keyring[keyring_tail].ascii = asc ; + if ( ++keyring_tail == 64 ) keyring_tail = 0 ; + } + + break ; + + case SDL_KEYUP: + /* Do nothing, Bennu is key_up unsensitive */ + break ; + } + } + + if ( !keypress && keyring_start != keyring_tail ) + { + GLODWORD( libkey, ASCII ) = keyring[keyring_start].ascii ; + GLODWORD( libkey, SCANCODE ) = keyring[keyring_start].scancode ; + if ( ++keyring_start == 64 ) keyring_start = 0 ; + } + + /* Now actualized every frame... */ + GLODWORD( libkey, SHIFTSTATUS ) = + ( ( m & KMOD_RSHIFT ) ? STAT_RSHIFT : 0 ) | + ( ( m & KMOD_LSHIFT ) ? STAT_LSHIFT : 0 ) | + + ( ( m & KMOD_CTRL ) ? STAT_CTRL : 0 ) | + ( ( m & KMOD_ALT ) ? STAT_ALT : 0 ) | + + ( ( m & KMOD_RCTRL ) ? STAT_RCTRL : 0 ) | + ( ( m & KMOD_LCTRL ) ? STAT_LCTRL : 0 ) | + + ( ( m & KMOD_RALT ) ? STAT_RALT : 0 ) | + ( ( m & KMOD_LALT ) ? STAT_LALT : 0 ) | + + ( ( m & KMOD_NUM ) ? STAT_NUM : 0 ) | + ( ( m & KMOD_CAPS ) ? STAT_CAPS : 0 ) | + ( ( m & KMOD_SHIFT ) ? STAT_SHIFT : 0 ) ; +} + +/* ---------------------------------------------------------------------- */ + +/* Bigest priority first execute + Lowest priority last execute */ + +HOOK __bgdexport( libkey, handler_hooks )[] = +{ + { 4900, process_key_events }, + { 0, NULL } +} ; + +/* ---------------------------------------------------------------------- */ +/* Funciones de inicializacion del modulo/plugin */ + +void __bgdexport( libkey, module_initialize )() +{ + int * ptr = equivs ; + + if ( !SDL_WasInit( SDL_INIT_VIDEO ) ) SDL_InitSubSystem( SDL_INIT_VIDEO ); + + memset( sdl_equiv, 0, sizeof( sdl_equiv ) ); + memset( key_table, 0, sizeof( key_table ) ) ; + + while ( *ptr != -1 ) + { + sdl_equiv[*ptr] = ptr[1] ; + add_key_equiv( ptr[0], ptr[1] ) ; + ptr += 2 ; + } + + if ( !keystate ) keystate = SDL_GetKeyState( NULL ); + + SDL_EnableUNICODE( 1 ); +} + +/* ---------------------------------------------------------------------- */ + +void __bgdexport( libkey, module_finalize )() +{ + /* FREE used key_equivs... note base 127 equivs are static not allocated... */ + int i ; + key_equiv * aux ; + key_equiv * curr = key_table ; + + for ( i = 0;i < 127;i++ ) + { + if ( curr->next != NULL ) + { + curr = curr->next ; + while ( curr->next != NULL ) + { + aux = curr ; + curr = curr->next; + free( aux ) ; + } + free( curr ) ; + } + } + + if ( SDL_WasInit( SDL_INIT_VIDEO ) ) SDL_QuitSubSystem( SDL_INIT_VIDEO ); +} + +/* ---------------------------------------------------------------------- */ diff --git a/modules/libkey/libkey.h b/modules/libkey/libkey.h new file mode 100644 index 0000000..97b812d --- /dev/null +++ b/modules/libkey/libkey.h @@ -0,0 +1,68 @@ +/* + * Copyright © 2006-2013 SplinterGU (Fenix/Bennugd) + * Copyright © 2002-2006 Fenix Team (Fenix) + * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix) + * + * This file is part of Bennu - Game Development + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. + * + */ + +#ifndef __LIBKEY_H + #define __LIBKEY_H + + /* ---------------------------------------------------------------------- */ + + #define STAT_RSHIFT 0x0000001 + #define STAT_LSHIFT 0x0000002 + #define STAT_CTRL 0x0000004 + #define STAT_ALT 0x0000008 + #define STAT_RCTRL 0x0000010 + #define STAT_LCTRL 0x0000020 + #define STAT_RALT 0x0000040 + #define STAT_LALT 0x0000080 + #define STAT_NUM 0x0000100 + #define STAT_CAPS 0x0000200 + #define STAT_SHIFT 0x0000400 + + /* ---------------------------------------------------------------------- */ + + #ifndef __BGDC__ + + #include <SDL.h> + + typedef struct _keyequiv { + int sdlk_equiv ; + struct _keyequiv * next ; + } key_equiv ; + + typedef int (* HOTKEY_CALLBACK) (SDL_keysym); + + #ifndef __LIBKEY + extern DLLIMPORT void hotkey_add(int mod, int sym, HOTKEY_CALLBACK callback); + + extern DLLIMPORT key_equiv key_table[] ; /* Now we have a search table with equivs */ + extern DLLIMPORT unsigned char * keystate ; /* Pointer to key states */ + #endif + + #endif + +#endif diff --git a/modules/libkey/libkey_exports.h b/modules/libkey/libkey_exports.h new file mode 100644 index 0000000..0eadd15 --- /dev/null +++ b/modules/libkey/libkey_exports.h @@ -0,0 +1,191 @@ +/* + * Copyright © 2006-2013 SplinterGU (Fenix/Bennugd) + * Copyright © 2002-2006 Fenix Team (Fenix) + * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix) + * + * This file is part of Bennu - Game Development + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. + * + */ + +#ifndef __LIBKEY_EXPORTS +#define __LIBKEY_EXPORTS + +/* ----------------------------------------------------------------- */ + +#if defined(__BGDC__) || !defined(__STATIC__) + +/* ----------------------------------------------------------------- */ + +#include "bgddl.h" + +#include "libkey.h" + +/* ----------------------------------------------------------------- */ + +DLCONSTANT __bgdexport( libkey, constants_def )[] = +{ + { "_ESC", TYPE_DWORD, 1 }, + { "_1", TYPE_DWORD, 2 }, + { "_2", TYPE_DWORD, 3 }, + { "_3", TYPE_DWORD, 4 }, + { "_4", TYPE_DWORD, 5 }, + { "_5", TYPE_DWORD, 6 }, + { "_6", TYPE_DWORD, 7 }, + { "_7", TYPE_DWORD, 8 }, + { "_8", TYPE_DWORD, 9 }, + { "_9", TYPE_DWORD, 10 }, + { "_0", TYPE_DWORD, 11 }, + { "_MINUS", TYPE_DWORD, 12 }, + { "_PLUS", TYPE_DWORD, 13 }, + { "_BACKSPACE", TYPE_DWORD, 14 }, + { "_TAB", TYPE_DWORD, 15 }, + { "_Q", TYPE_DWORD, 16 }, + { "_W", TYPE_DWORD, 17 }, + { "_E", TYPE_DWORD, 18 }, + { "_R", TYPE_DWORD, 19 }, + { "_T", TYPE_DWORD, 20 }, + { "_Y", TYPE_DWORD, 21 }, + { "_U", TYPE_DWORD, 22 }, + { "_I", TYPE_DWORD, 23 }, + { "_O", TYPE_DWORD, 24 }, + { "_P", TYPE_DWORD, 25 }, + { "_L_BRACKET", TYPE_DWORD, 26 }, + { "_R_BRACKET", TYPE_DWORD, 27 }, + { "_ENTER", TYPE_DWORD, 28 }, + { "_C_ENTER", TYPE_DWORD, 28 }, + { "_CONTROL", TYPE_DWORD, 29 }, + { "_A", TYPE_DWORD, 30 }, + { "_S", TYPE_DWORD, 31 }, + { "_D", TYPE_DWORD, 32 }, + { "_F", TYPE_DWORD, 33 }, + { "_G", TYPE_DWORD, 34 }, + { "_H", TYPE_DWORD, 35 }, + { "_J", TYPE_DWORD, 36 }, + { "_K", TYPE_DWORD, 37 }, + { "_L", TYPE_DWORD, 38 }, + { "_SEMICOLON", TYPE_DWORD, 39 }, + { "_APOSTROPHE", TYPE_DWORD, 40 }, + { "_WAVE", TYPE_DWORD, 41 }, + { "_L_SHIFT", TYPE_DWORD, 42 }, + { "_BACKSLASH", TYPE_DWORD, 43 }, + { "_Z", TYPE_DWORD, 44 }, + { "_X", TYPE_DWORD, 45 }, + { "_C", TYPE_DWORD, 46 }, + { "_V", TYPE_DWORD, 47 }, + { "_B", TYPE_DWORD, 48 }, + { "_N", TYPE_DWORD, 49 }, + { "_M", TYPE_DWORD, 50 }, + { "_COMMA", TYPE_DWORD, 51 }, + { "_POINT", TYPE_DWORD, 52 }, + { "_SLASH", TYPE_DWORD, 53 }, + { "_C_BACKSLASH", TYPE_DWORD, 53 }, + { "_R_SHIFT", TYPE_DWORD, 54 }, + { "_C_ASTERISK", TYPE_DWORD, 55 }, + { "_PRN_SCR", TYPE_DWORD, 55 }, + { "_ALT", TYPE_DWORD, 56 }, + { "_SPACE", TYPE_DWORD, 57 }, + { "_CAPS_LOCK", TYPE_DWORD, 58 }, + { "_F1", TYPE_DWORD, 59 }, + { "_F2", TYPE_DWORD, 60 }, + { "_F3", TYPE_DWORD, 61 }, + { "_F4", TYPE_DWORD, 62 }, + { "_F5", TYPE_DWORD, 63 }, + { "_F6", TYPE_DWORD, 64 }, + { "_F7", TYPE_DWORD, 65 }, + { "_F8", TYPE_DWORD, 66 }, + { "_F9", TYPE_DWORD, 67 }, + { "_F10", TYPE_DWORD, 68 }, + { "_NUM_LOCK", TYPE_DWORD, 69 }, + { "_SCROLL_LOCK", TYPE_DWORD, 70 }, + { "_HOME", TYPE_DWORD, 71 }, + { "_C_HOME", TYPE_DWORD, 71 }, + { "_UP", TYPE_DWORD, 72 }, + { "_C_UP", TYPE_DWORD, 72 }, + { "_PGUP", TYPE_DWORD, 73 }, + { "_C_PGUP", TYPE_DWORD, 73 }, + { "_C_MINUS", TYPE_DWORD, 74 }, + { "_LEFT", TYPE_DWORD, 75 }, + { "_C_LEFT", TYPE_DWORD, 75 }, + { "_C_CENTER", TYPE_DWORD, 76 }, + { "_RIGHT", TYPE_DWORD, 77 }, + { "_C_RIGHT", TYPE_DWORD, 77 }, + { "_C_PLUS", TYPE_DWORD, 78 }, + { "_END", TYPE_DWORD, 79 }, + { "_C_END", TYPE_DWORD, 79 }, + { "_DOWN", TYPE_DWORD, 80 }, + { "_C_DOWN", TYPE_DWORD, 80 }, + { "_PGDN", TYPE_DWORD, 81 }, + { "_C_PGDN", TYPE_DWORD, 81 }, + { "_INS", TYPE_DWORD, 82 }, + { "_C_INS", TYPE_DWORD, 82 }, + { "_DEL", TYPE_DWORD, 83 }, + { "_C_DEL", TYPE_DWORD, 83 }, + { "_F11", TYPE_DWORD, 87 }, + { "_F12", TYPE_DWORD, 88 }, + { "_LESS", TYPE_DWORD, 89 }, + { "_EQUALS", TYPE_DWORD, 90 }, + { "_GREATER", TYPE_DWORD, 91 }, + { "_ASTERISK", TYPE_DWORD, 92 }, + { "_R_ALT", TYPE_DWORD, 93 }, + { "_R_CONTROL", TYPE_DWORD, 94 }, + { "_L_ALT", TYPE_DWORD, 95 }, + { "_L_CONTROL", TYPE_DWORD, 96 }, + { "_MENU", TYPE_DWORD, 97 }, + { "_L_WINDOWS", TYPE_DWORD, 98 }, + { "_R_WINDOWS", TYPE_DWORD, 99 }, + + { "STAT_RSHIFT", TYPE_DWORD, STAT_RSHIFT }, + { "STAT_LSHIFT", TYPE_DWORD, STAT_LSHIFT }, + { "STAT_CTRL", TYPE_DWORD, STAT_CTRL }, + { "STAT_ALT", TYPE_DWORD, STAT_ALT }, + { "STAT_RCTRL", TYPE_DWORD, STAT_RCTRL }, + { "STAT_LCTRL", TYPE_DWORD, STAT_LCTRL }, + { "STAT_RALT", TYPE_DWORD, STAT_RALT }, + { "STAT_LALT", TYPE_DWORD, STAT_LALT }, + { "STAT_NUM", TYPE_DWORD, STAT_NUM }, + { "STAT_CAPS", TYPE_DWORD, STAT_CAPS }, + { "STAT_SHIFT", TYPE_DWORD, STAT_SHIFT }, + + { NULL , 0 , 0 } +} ; + +/* ----------------------------------------------------------------- */ +/* Definicion de variables globales (usada en tiempo de compilacion) */ + +char * __bgdexport( libkey, globals_def ) = + "shift_status;\n" + "ascii;\n" + "scan_code;\n"; + +#endif + +/* ----------------------------------------------------------------- */ + +char * __bgdexport( libkey, modules_dependency )[] = +{ + "libsdlhandler", + NULL +}; + +/* ----------------------------------------------------------------- */ + +#endif |