From 7fe60435bce6595a9c58a9bfd8244d74b5320e96 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Tue, 15 Jan 2013 08:46:13 +0100 Subject: Import DirectFB141_2k11R3_beta5 --- Source/FusionDale/examples/Makefile.am | 25 ++ Source/FusionDale/examples/Makefile.in | 534 +++++++++++++++++++++++++++++++ Source/FusionDale/examples/data_test.c | 91 ++++++ Source/FusionDale/examples/fd_client.c | 85 +++++ Source/FusionDale/examples/fd_proxy.c | 213 ++++++++++++ Source/FusionDale/examples/fdmaster.c | 53 +++ Source/FusionDale/examples/simple.c | 130 ++++++++ Source/FusionDale/examples/t2_receiver.c | 106 ++++++ Source/FusionDale/examples/t2_sender.c | 75 +++++ 9 files changed, 1312 insertions(+) create mode 100755 Source/FusionDale/examples/Makefile.am create mode 100755 Source/FusionDale/examples/Makefile.in create mode 100755 Source/FusionDale/examples/data_test.c create mode 100755 Source/FusionDale/examples/fd_client.c create mode 100755 Source/FusionDale/examples/fd_proxy.c create mode 100755 Source/FusionDale/examples/fdmaster.c create mode 100755 Source/FusionDale/examples/simple.c create mode 100755 Source/FusionDale/examples/t2_receiver.c create mode 100755 Source/FusionDale/examples/t2_sender.c (limited to 'Source/FusionDale/examples') diff --git a/Source/FusionDale/examples/Makefile.am b/Source/FusionDale/examples/Makefile.am new file mode 100755 index 0000000..025ffec --- /dev/null +++ b/Source/FusionDale/examples/Makefile.am @@ -0,0 +1,25 @@ +## Makefile.am for FusionDale/examples + +INCLUDES = -I$(top_srcdir)/include $(FUSION_CFLAGS) + +LIBADDS = \ + $(top_builddir)/src/libfusiondale.la \ + $(FUSION_LIBS) + +bin_PROGRAMS = fdmaster +noinst_PROGRAMS = simple t2_sender t2_receiver data_test + +fdmaster_SOURCES = fdmaster.c +fdmaster_LDADD = $(LIBADDS) + +simple_SOURCES = simple.c +simple_LDADD = $(LIBADDS) + +t2_sender_SOURCES = t2_sender.c +t2_sender_LDADD = $(LIBADDS) + +t2_receiver_SOURCES = t2_receiver.c +t2_receiver_LDADD = $(LIBADDS) + +data_test_SOURCES = data_test.c +data_test_LDADD = $(LIBADDS) diff --git a/Source/FusionDale/examples/Makefile.in b/Source/FusionDale/examples/Makefile.in new file mode 100755 index 0000000..4e1bc8c --- /dev/null +++ b/Source/FusionDale/examples/Makefile.in @@ -0,0 +1,534 @@ +# Makefile.in generated by automake 1.10.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = fdmaster$(EXEEXT) +noinst_PROGRAMS = simple$(EXEEXT) t2_sender$(EXEEXT) \ + t2_receiver$(EXEEXT) data_test$(EXEEXT) +subdir = examples +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) +am_data_test_OBJECTS = data_test.$(OBJEXT) +data_test_OBJECTS = $(am_data_test_OBJECTS) +am__DEPENDENCIES_1 = +am__DEPENDENCIES_2 = $(top_builddir)/src/libfusiondale.la \ + $(am__DEPENDENCIES_1) +data_test_DEPENDENCIES = $(am__DEPENDENCIES_2) +am_fdmaster_OBJECTS = fdmaster.$(OBJEXT) +fdmaster_OBJECTS = $(am_fdmaster_OBJECTS) +fdmaster_DEPENDENCIES = $(am__DEPENDENCIES_2) +am_simple_OBJECTS = simple.$(OBJEXT) +simple_OBJECTS = $(am_simple_OBJECTS) +simple_DEPENDENCIES = $(am__DEPENDENCIES_2) +am_t2_receiver_OBJECTS = t2_receiver.$(OBJEXT) +t2_receiver_OBJECTS = $(am_t2_receiver_OBJECTS) +t2_receiver_DEPENDENCIES = $(am__DEPENDENCIES_2) +am_t2_sender_OBJECTS = t2_sender.$(OBJEXT) +t2_sender_OBJECTS = $(am_t2_sender_OBJECTS) +t2_sender_DEPENDENCIES = $(am__DEPENDENCIES_2) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +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 = $(data_test_SOURCES) $(fdmaster_SOURCES) $(simple_SOURCES) \ + $(t2_receiver_SOURCES) $(t2_sender_SOURCES) +DIST_SOURCES = $(data_test_SOURCES) $(fdmaster_SOURCES) \ + $(simple_SOURCES) $(t2_receiver_SOURCES) $(t2_sender_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIR = @DATADIR@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FUSIONDALE_BINARY_AGE = @FUSIONDALE_BINARY_AGE@ +FUSIONDALE_INTERFACE_AGE = @FUSIONDALE_INTERFACE_AGE@ +FUSIONDALE_MAJOR_VERSION = @FUSIONDALE_MAJOR_VERSION@ +FUSIONDALE_MICRO_VERSION = @FUSIONDALE_MICRO_VERSION@ +FUSIONDALE_MINOR_VERSION = @FUSIONDALE_MINOR_VERSION@ +FUSIONDALE_VERSION = @FUSIONDALE_VERSION@ +FUSION_CFLAGS = @FUSION_CFLAGS@ +FUSION_LIBS = @FUSION_LIBS@ +GREP = @GREP@ +INCLUDEDIR = @INCLUDEDIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTERNALINCLUDEDIR = @INTERNALINCLUDEDIR@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_RELEASE = @LT_RELEASE@ +LT_REVISION = @LT_REVISION@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULEDIR = @MODULEDIR@ +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_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_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@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +INCLUDES = -I$(top_srcdir)/include $(FUSION_CFLAGS) +LIBADDS = \ + $(top_builddir)/src/libfusiondale.la \ + $(FUSION_LIBS) + +fdmaster_SOURCES = fdmaster.c +fdmaster_LDADD = $(LIBADDS) +simple_SOURCES = simple.c +simple_LDADD = $(LIBADDS) +t2_sender_SOURCES = t2_sender.c +t2_sender_LDADD = $(LIBADDS) +t2_receiver_SOURCES = t2_receiver.c +t2_receiver_LDADD = $(LIBADDS) +data_test_SOURCES = data_test.c +data_test_LDADD = $(LIBADDS) +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 examples/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu examples/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 +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +data_test$(EXEEXT): $(data_test_OBJECTS) $(data_test_DEPENDENCIES) + @rm -f data_test$(EXEEXT) + $(LINK) $(data_test_OBJECTS) $(data_test_LDADD) $(LIBS) +fdmaster$(EXEEXT): $(fdmaster_OBJECTS) $(fdmaster_DEPENDENCIES) + @rm -f fdmaster$(EXEEXT) + $(LINK) $(fdmaster_OBJECTS) $(fdmaster_LDADD) $(LIBS) +simple$(EXEEXT): $(simple_OBJECTS) $(simple_DEPENDENCIES) + @rm -f simple$(EXEEXT) + $(LINK) $(simple_OBJECTS) $(simple_LDADD) $(LIBS) +t2_receiver$(EXEEXT): $(t2_receiver_OBJECTS) $(t2_receiver_DEPENDENCIES) + @rm -f t2_receiver$(EXEEXT) + $(LINK) $(t2_receiver_OBJECTS) $(t2_receiver_LDADD) $(LIBS) +t2_sender$(EXEEXT): $(t2_sender_OBJECTS) $(t2_sender_DEPENDENCIES) + @rm -f t2_sender$(EXEEXT) + $(LINK) $(t2_sender_OBJECTS) $(t2_sender_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data_test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdmaster.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t2_receiver.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t2_sender.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(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@ mv -f $(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@ mv -f $(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 $@ $< + +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) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool \ + clean-noinstPROGRAMS 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 + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -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-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool clean-noinstPROGRAMS ctags \ + distclean distclean-compile distclean-generic \ + 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-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-binPROGRAMS + +# 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/Source/FusionDale/examples/data_test.c b/Source/FusionDale/examples/data_test.c new file mode 100755 index 0000000..e2e8059 --- /dev/null +++ b/Source/FusionDale/examples/data_test.c @@ -0,0 +1,91 @@ +/* + (c) Copyright 2006-2007 directfb.org + + All rights reserved. + + Written by Denis Oliver Kropp . + + This file is subject to the terms and conditions of the MIT License: + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +#include + + +#define CHECK(x) \ + do { \ + DirectResult ret = (x); \ + if (ret && ret != DR_BUSY) \ + FusionDaleErrorFatal(#x,ret); \ + } while (0) + + +static void +EventCallback( FDMessengerEventID event_id, + int param, + void *data, + int data_size, + void *context ) +{ + D_INFO( "EventCallback( %lu, %d, %p, %d, %p )\n", + event_id, param, data, data_size, context ); +} + +int +main( int argc, char *argv[] ) +{ + IFusionDale *dale; + IFusionDaleMessenger *messenger; + FDMessengerEventID event_id; + FDMessengerListenerID listener_id; + void *data; + + CHECK( FusionDaleInit( &argc, &argv ) ); + + CHECK( FusionDaleCreate( &dale ) ); + + CHECK( dale->CreateMessenger( dale, &messenger ) ); + + + CHECK( messenger->RegisterEvent( messenger, "Data Event", &event_id ) ); + + CHECK( messenger->RegisterListener( messenger, event_id, EventCallback, NULL, &listener_id ) ); + + + CHECK( messenger->AllocateData( messenger, 200, &data ) ); + + CHECK( messenger->SendEvent( messenger, event_id, 23, data, 200 ) ); + + + sleep(1); + + + CHECK( messenger->UnregisterEvent( messenger, event_id ) ); + + messenger->Release( messenger ); + dale->Release( dale ); + + return 0; +} diff --git a/Source/FusionDale/examples/fd_client.c b/Source/FusionDale/examples/fd_client.c new file mode 100755 index 0000000..df87d84 --- /dev/null +++ b/Source/FusionDale/examples/fd_client.c @@ -0,0 +1,85 @@ +/* + (c) Copyright 2006-2007 directfb.org + + All rights reserved. + + Written by Denis Oliver Kropp . + + This file is subject to the terms and conditions of the MIT License: + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include +#include + +#include +#include + +#include +#include + + +/**********************************************************************************************************************/ + +int +main( int argc, char *argv[] ) +{ + DirectResult ret; + IFusionDale *dale; + IComa *coma; + IComaComponent *component; + + ret = DirectFBInit( &argc, &argv ); + if (ret) + DirectFBErrorFatal( "DirectFBInit", ret ); + + ret = FusionDaleInit( &argc, &argv ); + if (ret) + FusionDaleErrorFatal( "FusionDaleInit", ret ); + + ret = FusionDaleCreate( &dale ); + if (ret) + FusionDaleErrorFatal( "FusionDaleCreate", ret ); + + ret = dale->EnterComa( dale, "TestComa", &coma ); + if (ret) + FusionDaleErrorFatal( "EnterComa", ret ); + + ret = coma->GetComponent( coma, "TestComponent", 100000, &component ); + if (ret) + FusionDaleErrorFatal( "GetComponent", ret ); + + + + ret = component->Call( component, 1, NULL, NULL ); + if (ret) + FusionDaleError( "Call", ret ); + + + component->Release( component ); + coma->Release( coma ); + dale->Release( dale ); + + return 0; +} + diff --git a/Source/FusionDale/examples/fd_proxy.c b/Source/FusionDale/examples/fd_proxy.c new file mode 100755 index 0000000..efdf728 --- /dev/null +++ b/Source/FusionDale/examples/fd_proxy.c @@ -0,0 +1,213 @@ +/* + (c) Copyright 2006-2007 directfb.org + + All rights reserved. + + Written by Denis Oliver Kropp . + + This file is subject to the terms and conditions of the MIT License: + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include +#include + +#include +#include + +#include +#include + + +static DFBResult server_run(); + +/**********************************************************************************************************************/ + +typedef struct { + IFusionDale *dale; + IComa *coma; + IComaComponent *component; +} Test; + +static void +Test_MethodFunc( void *ctx, + ComaMethodID method, + void *arg, + unsigned int magic ) +{ + Test *test = ctx; + IComaComponent *component = test->component; + + D_INFO( "%s( %lu, %p, %u\n", __func__, method, arg, magic ); + + component->Return( component, 0, magic ); +} + +/**********************************************************************************************************************/ + +int +main( int argc, char *argv[] ) +{ + DirectResult ret; + Test test; + + + ret = DirectFBInit( &argc, &argv ); + if (ret) + DirectFBErrorFatal( "DirectFBInit", ret ); + + ret = FusionDaleInit( &argc, &argv ); + if (ret) + FusionDaleErrorFatal( "FusionDaleInit", ret ); + + + pid_t pid; + + pid = fork(); + switch (pid) { + case -1: + D_PERROR( "Could not fork()!\n" ); + return -1; + + case 0: + server_run(); + return 0; + + default: + break; + } + + + ret = FusionDaleCreate( &test.dale ); + if (ret) + FusionDaleErrorFatal( "FusionDaleCreate", ret ); + + ret = test.dale->EnterComa( test.dale, "TestComa", &test.coma ); + if (ret) + FusionDaleErrorFatal( "EnterComa", ret ); + + ret = test.coma->CreateComponent( test.coma, "TestComponent", Test_MethodFunc, 0, &test, &test.component ); + if (ret) + FusionDaleErrorFatal( "CreateComponent", ret ); + + test.component->Activate( test.component ); + + pause(); + //server_run(); + + test.component->Release( test.component ); + test.coma->Release( test.coma ); + test.dale->Release( test.dale ); + + return 0; +} + +/**********************************************************************************************************************/ + +static DirectResult +ConstructDispatcher( VoodooServer *server, + VoodooManager *manager, + const char *name, + void *ctx, + VoodooInstanceID *ret_instance ) +{ + DirectResult ret; + DirectInterfaceFuncs *funcs; + void *interface; + VoodooInstanceID instance; + + D_ASSERT( server != NULL ); + D_ASSERT( manager != NULL ); + D_ASSERT( name != NULL ); + D_ASSERT( ret_instance != NULL ); + + ret = DirectGetInterface( &funcs, name, "Dispatcher", NULL, NULL ); + if (ret) + return ret; + + ret = funcs->Allocate( &interface ); + if (ret) + return ret; + + ret = funcs->Construct( interface, manager, &instance ); + if (ret) + return ret; + + *ret_instance = instance; + + return DFB_OK; +} + +/**********************************************************************************************************************/ + +static DFBResult +server_run() +{ + DFBResult ret; + VoodooPlayer *player = NULL; + VoodooServer *server = NULL; + + ret = voodoo_player_create( NULL, &player ); + if (ret) { + D_ERROR( "Voodoo/Proxy: Could not create the player (%s)!\n", DirectFBErrorString(ret) ); + goto out; + } + + ret = voodoo_server_create( &server ); + if (ret) { + D_ERROR( "Voodoo/Proxy: Could not create the server (%s)!\n", DirectFBErrorString(ret) ); + goto out; + } + + ret = voodoo_server_register( server, "IDirectFB", ConstructDispatcher, NULL ); + if (ret) { + D_ERROR( "Voodoo/Proxy: Could not register super interface 'IDirectFB'!\n" ); + goto out; + } + + ret = voodoo_server_register( server, "IDiVine", ConstructDispatcher, NULL ); + if (ret) { + D_ERROR( "Voodoo/Proxy: Could not register super interface 'IDiVine'!\n" ); + goto out; + } + + ret = voodoo_server_register( server, "IFusionDale", ConstructDispatcher, NULL ); + if (ret) { + D_ERROR( "Voodoo/Proxy: Could not register super interface 'IFusionDale'!\n" ); + goto out; + } + + ret = voodoo_server_run( server, true ); + if (ret) + D_ERROR( "Voodoo/Proxy: Server exiting with error (%s)!\n", DirectFBErrorString(ret) ); + +out: + if (server) + voodoo_server_destroy( server ); + + if (player) + voodoo_player_destroy( player ); + + return ret; +} + diff --git a/Source/FusionDale/examples/fdmaster.c b/Source/FusionDale/examples/fdmaster.c new file mode 100755 index 0000000..40553ef --- /dev/null +++ b/Source/FusionDale/examples/fdmaster.c @@ -0,0 +1,53 @@ +/* + (c) Copyright 2006-2007 directfb.org + + All rights reserved. + + Written by Denis Oliver Kropp . + + This file is subject to the terms and conditions of the MIT License: + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +int +main( int argc, char *argv[] ) +{ + DirectResult ret; + IFusionDale *dale; + + ret = FusionDaleInit( &argc, &argv ); + if (ret) + FusionDaleErrorFatal( "FusionDaleInit", ret ); + + ret = FusionDaleCreate( &dale ); + if (ret) + FusionDaleErrorFatal( "FusionDaleCreate", ret ); + + pause(); + + dale->Release( dale ); + + return 0; +} diff --git a/Source/FusionDale/examples/simple.c b/Source/FusionDale/examples/simple.c new file mode 100755 index 0000000..048ea0b --- /dev/null +++ b/Source/FusionDale/examples/simple.c @@ -0,0 +1,130 @@ +/* + (c) Copyright 2006-2007 directfb.org + + All rights reserved. + + Written by Denis Oliver Kropp . + + This file is subject to the terms and conditions of the MIT License: + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +#include + +static void +EventCallback( FDMessengerEventID event_id, + int param, + void *data, + int data_size, + void *context ) +{ + D_INFO( "EventCallback( %lu, %d, %p, %d, %p )\n", + event_id, param, data, data_size, context ); +} + +int +main( int argc, char *argv[] ) +{ + DirectResult ret; + IFusionDale *dale; + IFusionDaleMessenger *messenger; + FDMessengerEventID event_id1; + FDMessengerEventID event_id2; + FDMessengerListenerID listener_id1; + FDMessengerListenerID listener_id2; + + ret = FusionDaleInit( &argc, &argv ); + if (ret) + FusionDaleErrorFatal( "FusionDaleInit", ret ); + + ret = FusionDaleCreate( &dale ); + if (ret) + FusionDaleErrorFatal( "FusionDaleCreate", ret ); + + ret = dale->CreateMessenger( dale, &messenger ); + if (ret) + FusionDaleErrorFatal( "IFusionDale::CreateMessenger", ret ); + + + + ret = messenger->RegisterEvent( messenger, "Test Event", &event_id1 ); + if (ret) + FusionDaleErrorFatal( "IFusionDaleMessenger::RegisterEvent", ret ); + + ret = messenger->IsEventRegistered( messenger, "Test Event" ); + if (ret) + FusionDaleErrorFatal( "IFusionDaleMessenger::IsEventRegistered", ret ); + + + ret = messenger->RegisterEvent( messenger, "Test Event2", &event_id2 ); + if (ret) + FusionDaleError( "IFusionDaleMessenger::RegisterEvent", ret ); + + + ret = messenger->RegisterListener( messenger, event_id1, EventCallback, NULL, &listener_id1 ); + if (ret) + FusionDaleError( "IFusionDaleMessenger::RegisterListener", ret ); + + + ret = messenger->RegisterListener( messenger, event_id2, EventCallback, NULL, &listener_id2 ); + if (ret) + FusionDaleError( "IFusionDaleMessenger::RegisterListener", ret ); + + + ret = messenger->SendSimpleEvent( messenger, event_id1, 23 ); + if (ret) + FusionDaleErrorFatal( "IFusionDaleMessenger::UnregisterEvent", ret ); + +// sleep(1); + + ret = messenger->UnregisterListener( messenger, listener_id1 ); + if (ret) + FusionDaleErrorFatal( "IFusionDaleMessenger::UnregisterEvent", ret ); + + + ret = messenger->SendSimpleEvent( messenger, event_id1, 23 ); + if (ret) + FusionDaleErrorFatal( "IFusionDaleMessenger::UnregisterEvent", ret ); + +// sleep(1); + + ret = messenger->UnregisterEvent( messenger, event_id1 ); + if (ret) + FusionDaleErrorFatal( "IFusionDaleMessenger::UnregisterEvent", ret ); + + + sleep(2); + + + ret = messenger->UnregisterEvent( messenger, event_id2 ); + if (ret) + FusionDaleErrorFatal( "IFusionDaleMessenger::UnregisterEvent", ret ); + + + messenger->Release( messenger ); + dale->Release( dale ); + + return 0; +} diff --git a/Source/FusionDale/examples/t2_receiver.c b/Source/FusionDale/examples/t2_receiver.c new file mode 100755 index 0000000..b729d05 --- /dev/null +++ b/Source/FusionDale/examples/t2_receiver.c @@ -0,0 +1,106 @@ +/* + (c) Copyright 2006-2007 directfb.org + + All rights reserved. + + Written by Denis Oliver Kropp . + + This file is subject to the terms and conditions of the MIT License: + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include +#include + +#include +#include + +#include + + +#define CHECK(x) \ + do { \ + DirectResult ret = (x); \ + if (ret && ret != DR_BUSY) \ + FusionDaleErrorFatal(#x,ret); \ + } while (0) + + +static int first; +static int first_delay; +static int last; +static int count; + +static void +EventCallback( FDMessengerEventID event_id, + int param, + void *data, + int data_size, + void *context ) +{ +// D_INFO( "EventCallback( %lu, %d, %p, %d, %p )\n", + // event_id, param, data, data_size, context ); + + if (!first) { + first = param; + first_delay = direct_clock_get_millis() - first; + } + + last = param; + + count++; +} + +int +main( int argc, char *argv[] ) +{ + IFusionDale *dale; + IFusionDaleMessenger *messenger; + FDMessengerEventID event_id; + FDMessengerListenerID listener_id; + + CHECK( FusionDaleInit( &argc, &argv ) ); + + CHECK( FusionDaleCreate( &dale ) ); + + CHECK( dale->CreateMessenger( dale, &messenger ) ); + + CHECK( messenger->RegisterEvent( messenger, "T2 Event", &event_id ) ); + + + CHECK( messenger->RegisterListener( messenger, event_id, EventCallback, NULL, &listener_id ) ); + + printf( "\n" ); + + sleep( 10 ); + + printf( "%d ms between first and last of %d messages (%d.%03dk/sec)\n" + "%d ms latency (1st message)\n", last - first, count, + count / (last - first), count * 1000 / (last - first) % 1000, first_delay ); + + CHECK( messenger->UnregisterEvent( messenger, event_id ) ); + + + messenger->Release( messenger ); + dale->Release( dale ); + + return 0; +} diff --git a/Source/FusionDale/examples/t2_sender.c b/Source/FusionDale/examples/t2_sender.c new file mode 100755 index 0000000..54f1f34 --- /dev/null +++ b/Source/FusionDale/examples/t2_sender.c @@ -0,0 +1,75 @@ +/* + (c) Copyright 2006-2007 directfb.org + + All rights reserved. + + Written by Denis Oliver Kropp . + + This file is subject to the terms and conditions of the MIT License: + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, + publish, distribute, sublicense, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include +#include + +#include + + +#define CHECK(x) \ + do { \ + DirectResult ret = (x); \ + if (ret && ret != DR_BUSY) \ + FusionDaleErrorFatal(#x,ret); \ + } while (0) + + +int +main( int argc, char *argv[] ) +{ + int i; + IFusionDale *dale; + IFusionDaleMessenger *messenger; + FDMessengerEventID event_id; + + CHECK( FusionDaleInit( &argc, &argv ) ); + + CHECK( FusionDaleCreate( &dale ) ); + + CHECK( dale->GetMessenger( dale, &messenger ) ); + + CHECK( messenger->RegisterEvent( messenger, "T2 Event", &event_id ) ); + + + for (i=0; i<100000; i++) { + CHECK( messenger->SendSimpleEvent( messenger, event_id, direct_clock_get_millis() ) ); + } + + + CHECK( messenger->UnregisterEvent( messenger, event_id ) ); + + + messenger->Release( messenger ); + dale->Release( dale ); + + return 0; +} -- cgit