dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/Xsharp XsharpSupport.c,NONE,1.1 .cvs


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/Xsharp XsharpSupport.c,NONE,1.1 .cvsignore,1.1,1.2 Makefile.am,1.1,1.2 Makefile.in,1.1,1.2
Date: Fri, 06 Jun 2003 21:01:54 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/Xsharp
In directory subversions:/tmp/cvs-serv23642/Xsharp

Modified Files:
        .cvsignore Makefile.am Makefile.in 
Added Files:
        XsharpSupport.c 
Log Message:


Add the shared library "libXsharpSupport.so" to provide C support
routines to Xsharp which cannot be easily implemented in C#.


--- NEW FILE ---
/*
 * XsharpSupport.c - C support code for Xsharp.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#if !defined(X_DISPLAY_MISSING) && HAVE_SELECT

#include <X11/Xlib.h>
#ifdef WIN32
        #include <X11/Xwinsock.h>
#endif
#if TIME_WITH_SYS_TIME
        #include <sys/time.h>
    #include <time.h>
#else
    #if HAVE_SYS_TIME_H
                #include <sys/time.h>
    #else
        #include <time.h>
    #endif
#endif
#if HAVE_SYS_TYPES_H
        #include <sys/types.h>
#endif
#if HAVE_SYS_SELECT_H
        #include <sys/select.h>
#endif
#if HAVE_UNISTD_H
        #include <unistd.h>
#endif

int XNextEventWithTimeout(Display *dpy, XEvent *event, int timeout)
{
        int fd = ConnectionNumber(dpy);
        fd_set readSet;
        struct timeval tv;
        int result;

        /* Initialize the read set */
        FD_ZERO(&readSet);
        FD_SET(fd, &readSet);

        /* Select on the display connection */
        if(timeout >= 0)
        {
                tv.tv_sec = timeout / 1000;
                tv.tv_usec = (timeout % 1000) * 1000;
                result = select(fd + 1, &readSet, (fd_set *)0, (fd_set *)0, 
&tv);
        }
        else
        {
                result = select(fd + 1, &readSet, (fd_set *)0, (fd_set *)0,
                                            (struct timeval *)0);
        }

        /* If there was activity on the connection, then read the event */
        if(result > 0)
        {
                XNextEvent(dpy, event);
        }

        /* Return the final result to the caller */
        return result;
}

#else /* X_DISPLAY_MISSING || !HAVE_SELECT */

int XNextEventWithTimeout(void *dpy, void *event, int timeout)
{
        return -1;
}

#endif /* X_DISPLAY_MISSING || !HAVE_SELECT */

Index: .cvsignore
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/Xsharp/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** .cvsignore  28 May 2003 04:17:53 -0000      1.1
--- .cvsignore  7 Jun 2003 01:01:51 -0000       1.2
***************
*** 2,5 ****
--- 2,6 ----
  Makefile.in
  .deps
+ .libs
  *.dll
  *.exe
***************
*** 7,9 ****
--- 8,12 ----
  *.iltmp
  *.xml
+ *.lo
+ *.la
  Xlib.cs

Index: Makefile.am
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/Xsharp/Makefile.am,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** Makefile.am 28 May 2003 04:17:53 -0000      1.1
--- Makefile.am 7 Jun 2003 01:01:52 -0000       1.2
***************
*** 2,5 ****
--- 2,13 ----
  .PHONY: Xsharp.dll
  
+ xsupportdir = $(libdir)/cscc/lib
+ xsupport_LTLIBRARIES = libXsharpSupport.la
+ 
+ libXsharpSupport_la_SOURCES = XsharpSupport.c
+ libXsharpSupport_la_LDFLAGS = $(X_LIBS) $(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS)
+ 
+ AM_CFLAGS = $(X_CFLAGS)
+ 
  all-local: Xsharp.dll
  

Index: Makefile.in
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/Xsharp/Makefile.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** Makefile.in 28 May 2003 04:17:53 -0000      1.1
--- Makefile.in 7 Jun 2003 01:01:52 -0000       1.2
***************
*** 58,61 ****
--- 58,64 ----
  PRE_UNINSTALL = :
  POST_UNINSTALL = :
+ host_alias = @host_alias@
+ host_triplet = @host@
+ AS = @AS@
  ASSEMBLY_LINKER = @ASSEMBLY_LINKER@
  AWK = @AWK@
***************
*** 68,81 ****
--- 71,88 ----
  CSHARP_PLUGIN = @CSHARP_PLUGIN@
  CYGPATH = @CYGPATH@
+ DLLTOOL = @DLLTOOL@
  EXEEXT = @EXEEXT@
  ILFIND = @ILFIND@
  ILRUN = @ILRUN@
+ LIBTOOL = @LIBTOOL@
  LN_S = @LN_S@
  MAINT = @MAINT@
  MAKEINFO = @MAKEINFO@
+ OBJDUMP = @OBJDUMP@
  OBJEXT = @OBJEXT@
  PACKAGE = @PACKAGE@
  PNET_PATH = @PNET_PATH@
  PROFILE_NAME = @PROFILE_NAME@
+ RANLIB = @RANLIB@
  RESGEN = @RESGEN@
  RESGEN_FLAGS = @RESGEN_FLAGS@
***************
*** 87,90 ****
--- 94,105 ----
  X_ulong = @X_ulong@
  
+ xsupportdir = $(libdir)/cscc/lib
+ xsupport_LTLIBRARIES = libXsharpSupport.la
+ 
+ libXsharpSupport_la_SOURCES = XsharpSupport.c
+ libXsharpSupport_la_LDFLAGS = $(X_LIBS) $(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS)
+ 
+ AM_CFLAGS = $(X_CFLAGS)
+ 
  CLEANFILES = Xsharp.dll
  DISTCLEANFILES = Xlib.cs
***************
*** 94,97 ****
--- 109,130 ----
  mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
  CONFIG_CLEAN_FILES =  Xlib.cs
+ LTLIBRARIES =  $(xsupport_LTLIBRARIES)
+ 
+ 
+ DEFS = @DEFS@ -I. -I$(srcdir) 
+ CPPFLAGS = @CPPFLAGS@
+ LDFLAGS = @LDFLAGS@
+ LIBS = @LIBS@
+ X_CFLAGS = @X_CFLAGS@
+ X_LIBS = @X_LIBS@
+ X_EXTRA_LIBS = @X_EXTRA_LIBS@
+ X_PRE_LIBS = @X_PRE_LIBS@
+ libXsharpSupport_la_LIBADD = 
+ libXsharpSupport_la_OBJECTS =  XsharpSupport.lo
+ CFLAGS = @CFLAGS@
+ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) 
$(CFLAGS)
+ LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) 
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+ CCLD = $(CC)
+ LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
  DATA =  $(pnetassemblies_DATA)
  
***************
*** 103,108 ****
--- 136,146 ----
  TAR = gtar
  GZIP_ENV = --best
+ DEP_FILES =  .deps/XsharpSupport.P
+ SOURCES = $(libXsharpSupport_la_SOURCES)
+ OBJECTS = $(libXsharpSupport_la_OBJECTS)
+ 
  all: all-redirect
  .SUFFIXES:
+ .SUFFIXES: .S .c .lo .o .obj .s
  $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am 
$(top_srcdir)/configure.in $(ACLOCAL_M4) 
        cd $(top_srcdir) && $(AUTOMAKE) --gnu Xsharp/Makefile
***************
*** 115,118 ****
--- 153,222 ----
        cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= 
$(SHELL) ./config.status
  
+ mostlyclean-xsupportLTLIBRARIES:
+ 
+ clean-xsupportLTLIBRARIES:
+       -test -z "$(xsupport_LTLIBRARIES)" || rm -f $(xsupport_LTLIBRARIES)
+ 
+ distclean-xsupportLTLIBRARIES:
+ 
+ maintainer-clean-xsupportLTLIBRARIES:
+ 
+ install-xsupportLTLIBRARIES: $(xsupport_LTLIBRARIES)
+       @$(NORMAL_INSTALL)
+       $(mkinstalldirs) $(DESTDIR)$(xsupportdir)
+       @list='$(xsupport_LTLIBRARIES)'; for p in $$list; do \
+         if test -f $$p; then \
+           echo "$(LIBTOOL)  --mode=install $(INSTALL) $$p 
$(DESTDIR)$(xsupportdir)/$$p"; \
+           $(LIBTOOL)  --mode=install $(INSTALL) $$p 
$(DESTDIR)$(xsupportdir)/$$p; \
+         else :; fi; \
+       done
+ 
+ uninstall-xsupportLTLIBRARIES:
+       @$(NORMAL_UNINSTALL)
+       list='$(xsupport_LTLIBRARIES)'; for p in $$list; do \
+         $(LIBTOOL)  --mode=uninstall rm -f $(DESTDIR)$(xsupportdir)/$$p; \
+       done
+ 
+ # FIXME: We should only use cygpath when building on Windows,
+ # and only if it is available.
+ .c.obj:
+       $(COMPILE) -c `cygpath -w $<`
+ 
+ .s.o:
+       $(COMPILE) -c $<
+ 
+ .S.o:
+       $(COMPILE) -c $<
+ 
+ mostlyclean-compile:
+       -rm -f *.o core *.core
+       -rm -f *.$(OBJEXT)
+ 
+ clean-compile:
+ 
+ distclean-compile:
+       -rm -f *.tab.c
+ 
+ maintainer-clean-compile:
+ 
+ .s.lo:
+       $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+ 
+ .S.lo:
+       $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+ 
+ mostlyclean-libtool:
+       -rm -f *.lo
+ 
+ clean-libtool:
+       -rm -rf .libs _libs
+ 
+ distclean-libtool:
+ 
+ maintainer-clean-libtool:
+ 
+ libXsharpSupport.la: $(libXsharpSupport_la_OBJECTS) 
$(libXsharpSupport_la_DEPENDENCIES)
+       $(LINK) -rpath $(xsupportdir) $(libXsharpSupport_la_LDFLAGS) 
$(libXsharpSupport_la_OBJECTS) $(libXsharpSupport_la_LIBADD) $(LIBS)
+ 
  install-pnetassembliesDATA: $(pnetassemblies_DATA)
        @$(NORMAL_INSTALL)
***************
*** 133,139 ****
          rm -f $(DESTDIR)$(pnetassembliesdir)/$$p; \
        done
  tags: TAGS
- TAGS:
  
  
  distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
--- 237,269 ----
          rm -f $(DESTDIR)$(pnetassembliesdir)/$$p; \
        done
+ 
  tags: TAGS
  
+ ID: $(HEADERS) $(SOURCES) $(LISP)
+       list='$(SOURCES) $(HEADERS)'; \
+       unique=`for i in $$list; do echo $$i; done | \
+         awk '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       here=`pwd` && cd $(srcdir) \
+         && mkid -f$$here/ID $$unique $(LISP)
+ 
+ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)'; \
+       unique=`for i in $$list; do echo $$i; done | \
+         awk '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+         || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags  $$unique $(LISP) -o 
$$here/TAGS)
+ 
+ mostlyclean-tags:
+ 
+ clean-tags:
+ 
+ distclean-tags:
+       -rm -f TAGS ID
+ 
+ maintainer-clean-tags:
  
  distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
***************
*** 157,160 ****
--- 287,322 ----
          fi; \
        done
+ 
+ DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
+ 
+ -include $(DEP_FILES)
+ 
+ mostlyclean-depend:
+ 
+ clean-depend:
+ 
+ distclean-depend:
+       -rm -rf .deps
+ 
+ maintainer-clean-depend:
+ 
+ %.o: %.c
+       @echo '$(COMPILE) -c $<'; \
+       $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+       @-cp .deps/$(*F).pp .deps/$(*F).P; \
+       tr ' ' '\012' < .deps/$(*F).pp \
+         | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+           >> .deps/$(*F).P; \
+       rm .deps/$(*F).pp
+ 
+ %.lo: %.c
+       @echo '$(LTCOMPILE) -c $<'; \
+       $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+       @-sed -e 's/^\([^:]*\)\.o[      ]*:/\1.lo \1.o :/' \
+         < .deps/$(*F).pp > .deps/$(*F).P; \
+       tr ' ' '\012' < .deps/$(*F).pp \
+         | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+           >> .deps/$(*F).P; \
+       rm -f .deps/$(*F).pp
  info-am:
  info: info-am
***************
*** 168,172 ****
  install-exec: install-exec-am
  
! install-data-am: install-pnetassembliesDATA
  install-data: install-data-am
  
--- 330,334 ----
  install-exec: install-exec-am
  
! install-data-am: install-xsupportLTLIBRARIES install-pnetassembliesDATA
  install-data: install-data-am
  
***************
*** 174,185 ****
        @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
  install: install-am
! uninstall-am: uninstall-pnetassembliesDATA
  uninstall: uninstall-am
! all-am: Makefile $(DATA) all-local
  all-redirect: all-am
  install-strip:
        $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
  installdirs:
!       $(mkinstalldirs)  $(DESTDIR)$(pnetassembliesdir)
  
  
--- 336,348 ----
        @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
  install: install-am
! uninstall-am: uninstall-xsupportLTLIBRARIES uninstall-pnetassembliesDATA
  uninstall: uninstall-am
! all-am: Makefile $(LTLIBRARIES) $(DATA) all-local
  all-redirect: all-am
  install-strip:
        $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
  installdirs:
!       $(mkinstalldirs)  $(DESTDIR)$(xsupportdir) \
!               $(DESTDIR)$(pnetassembliesdir)
  
  
***************
*** 195,211 ****
  
  maintainer-clean-generic:
! mostlyclean-am:  mostlyclean-generic
  
  mostlyclean: mostlyclean-am
  
! clean-am:  clean-generic mostlyclean-am
  
  clean: clean-am
  
! distclean-am:  distclean-generic clean-am
  
  distclean: distclean-am
  
! maintainer-clean-am:  maintainer-clean-generic distclean-am
        @echo "This command is intended for maintainers to use;"
        @echo "it deletes files that may require special tools to rebuild."
--- 358,383 ----
  
  maintainer-clean-generic:
! mostlyclean-am:  mostlyclean-xsupportLTLIBRARIES mostlyclean-compile \
!               mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
!               mostlyclean-generic
  
  mostlyclean: mostlyclean-am
  
! clean-am:  clean-xsupportLTLIBRARIES clean-compile clean-libtool \
!               clean-tags clean-depend clean-generic mostlyclean-am
  
  clean: clean-am
  
! distclean-am:  distclean-xsupportLTLIBRARIES distclean-compile \
!               distclean-libtool distclean-tags distclean-depend \
!               distclean-generic clean-am
!       -rm -f libtool
  
  distclean: distclean-am
  
! maintainer-clean-am:  maintainer-clean-xsupportLTLIBRARIES \
!               maintainer-clean-compile maintainer-clean-libtool \
!               maintainer-clean-tags maintainer-clean-depend \
!               maintainer-clean-generic distclean-am
        @echo "This command is intended for maintainers to use;"
        @echo "it deletes files that may require special tools to rebuild."
***************
*** 213,221 ****
  maintainer-clean: maintainer-clean-am
  
! .PHONY: uninstall-pnetassembliesDATA install-pnetassembliesDATA tags \
! distdir info-am info dvi-am dvi check check-am installcheck-am \
! installcheck install-exec-am install-exec install-data-am install-data \
! install-am install uninstall-am uninstall all-local all-redirect all-am \
! all installdirs mostlyclean-generic distclean-generic clean-generic \
  maintainer-clean-generic clean mostlyclean distclean maintainer-clean
  
--- 385,401 ----
  maintainer-clean: maintainer-clean-am
  
! .PHONY: mostlyclean-xsupportLTLIBRARIES distclean-xsupportLTLIBRARIES \
! clean-xsupportLTLIBRARIES maintainer-clean-xsupportLTLIBRARIES \
! uninstall-xsupportLTLIBRARIES install-xsupportLTLIBRARIES \
! mostlyclean-compile distclean-compile clean-compile \
! maintainer-clean-compile mostlyclean-libtool distclean-libtool \
! clean-libtool maintainer-clean-libtool uninstall-pnetassembliesDATA \
! install-pnetassembliesDATA tags mostlyclean-tags distclean-tags \
! clean-tags maintainer-clean-tags distdir mostlyclean-depend \
! distclean-depend clean-depend maintainer-clean-depend info-am info \
! dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
! install-exec install-data-am install-data install-am install \
! uninstall-am uninstall all-local all-redirect all-am all installdirs \
! mostlyclean-generic distclean-generic clean-generic \
  maintainer-clean-generic clean mostlyclean distclean maintainer-clean
  





reply via email to

[Prev in Thread] Current Thread [Next in Thread]