gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r3693 - / bugGSF bugGSF/m4 bugGSF/src bugGSF/src/include


From: grothoff
Subject: [GNUnet-SVN] r3693 - / bugGSF bugGSF/m4 bugGSF/src bugGSF/src/include
Date: Fri, 10 Nov 2006 20:26:24 -0800 (PST)

Author: grothoff
Date: 2006-11-10 20:26:20 -0800 (Fri, 10 Nov 2006)
New Revision: 3693

Added:
   bugGSF/
   bugGSF/Makefile.am
   bugGSF/bootstrap
   bugGSF/configure.ac
   bugGSF/m4/
   bugGSF/m4/Makefile.am
   bugGSF/m4/abi-gsf.m4
   bugGSF/src/
   bugGSF/src/Makefile.am
   bugGSF/src/bugGSF.c
   bugGSF/src/include/
   bugGSF/src/include/Makefile.am
   bugGSF/src/include/platform.h
   bugGSF/src/test_binary.c
Log:
start

Added: bugGSF/Makefile.am
===================================================================
--- bugGSF/Makefile.am  2006-11-11 03:46:08 UTC (rev 3692)
+++ bugGSF/Makefile.am  2006-11-11 04:26:20 UTC (rev 3693)
@@ -0,0 +1,2 @@
+SUBDIRS  = m4 libltdl src . 
+ACLOCAL_AMFLAGS = -I m4

Added: bugGSF/bootstrap
===================================================================
--- bugGSF/bootstrap    2006-11-11 03:46:08 UTC (rev 3692)
+++ bugGSF/bootstrap    2006-11-11 04:26:20 UTC (rev 3693)
@@ -0,0 +1,6 @@
+#!/bin/sh
+export WANT_AUTOMAKE="1.8"
+cd libltdl
+autoreconf -f -i
+cd ..
+autoreconf -f -i


Property changes on: bugGSF/bootstrap
___________________________________________________________________
Name: svn:executable
   + *

Added: bugGSF/configure.ac
===================================================================
--- bugGSF/configure.ac 2006-11-11 03:46:08 UTC (rev 3692)
+++ bugGSF/configure.ac 2006-11-11 04:26:20 UTC (rev 3693)
@@ -0,0 +1,130 @@
+# Process this file with autoconf to produce a configure script.
+AC_PREREQ(2.57)
+AC_INIT([bugGSF], [0.0.0], address@hidden)
+AC_REVISION($Revision: 1.67 $)
+AM_INIT_AUTOMAKE([bugGSF], [0.0.0])
+AM_CONFIG_HEADER(src/include/config.h)
+
+AH_TOP([#define _GNU_SOURCE  1])
+
+# Checks for programs.
+AC_CANONICAL_HOST
+
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_CXX
+
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+AC_DISABLE_STATIC
+
+case "$host_os" in
+linux*)
+     AC_DEFINE(LINUX,1,[This is a Linux system])
+     AC_DEFINE_UNQUOTED(LINUX,1,[This is a LINUX system])
+     AM_CONDITIONAL(HAVE_GNU_LD, true)    
+     AM_CONDITIONAL(SOMEBSD, false)
+     XTRA_CPPLIBS=-lstdc++
+     LIBEXT=.so
+     ;;
+freebsd*)
+     AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
+     AC_CHECK_LIB(c_r, pthread_create)
+     AM_CONDITIONAL(HAVE_GNU_LD, true)
+     AM_CONDITIONAL(SOMEBSD, true)
+     LIBEXT=.so
+     ;;
+openbsd*)
+     AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
+     AC_CHECK_LIB(c_r, pthread_create)
+     AM_CONDITIONAL(HAVE_GNU_LD, true)
+     AM_CONDITIONAL(SOMEBSD, true)
+     LIBEXT=.so
+     ;;
+netbsd*)
+     AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
+     AC_CHECK_LIB(c_r, pthread_create)
+     AM_CONDITIONAL(HAVE_GNU_LD, true)
+     AM_CONDITIONAL(SOMEBSD, true)
+     LIBEXT=.so
+     ;;
+*solaris*)
+     AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system])
+     AC_CHECK_LIB(resolv, res_init)
+     XTRA_CPPLIBS=-lstdc++
+     AM_CONDITIONAL(HAVE_GNU_LD, false)
+     AM_CONDITIONAL(SOMEBSD, false)
+     CFLAGS="-D_POSIX_PTHREAD_SEMANTICS $CFLAGS"
+     LIBEXT=.so
+     ;;
+darwin*)
+     AC_DEFINE_UNQUOTED(DARWIN,1,[This is a Darwin system])
+     AM_CONDITIONAL(HAVE_GNU_LD, false)
+     AM_CONDITIONAL(SOMEBSD, false)
+     LIBEXT=.dylib
+     ;;
+cygwin*)
+     AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a CYGWIN system])
+     LDFLAGS="$LDFLAGS -no-undefined"
+     AM_CONDITIONAL(SOMEBSD, false)
+     AM_CONDITIONAL(HAVE_GNU_LD, false)
+     LIBEXT=.dll
+     ;;
+mingw*)
+     AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system])
+     AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
+     AC_CHECK_LIB(intl, gettext)
+     AC_CHECK_LIB(ws2_32, _head_libws2_32_a,,[AC_MSG_ERROR([libextractor 
requires Winsock2])])
+     AC_CHECK_LIB(plibc, plibc_init,,[AC_MSG_ERROR([libextractor requires 
PlibC])])
+     LDFLAGS="$LDFLAGS -no-undefined -Wl,--export-all-symbols"
+     AM_CONDITIONAL(HAVE_GNU_LD, true)
+     AM_CONDITIONAL(SOMEBSD, false)
+     LIBEXT=.dll
+     ;;
+*)
+     AC_MSG_RESULT(Unrecognised OS $host_os)
+     AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
+     AC_MSG_RESULT(otheros)
+     AM_CONDITIONAL(HAVE_GNU_LD, false)
+     AM_CONDITIONAL(SOMEBSD, false)
+     LIBEXT=.so
+     ;;
+esac
+
+AC_LIBTOOL_DLOPEN
+AC_LIBLTDL_INSTALLABLE
+AC_SUBST(LTDLINCL)
+AC_SUBST(LIBLTDL)
+AM_PROG_LIBTOOL
+AC_LIB_LTDL
+AC_CONFIG_SUBDIRS(libltdl)
+
+AM_ICONV
+
+AC_CHECK_LIB(dl, dlopen)
+AC_LIB_PROG_LD_GNU
+
+# check for glib >= 2.0.0
+AC_MSG_CHECKING(for glib)
+AM_PATH_GLIB_2_0(2.0.0,
+                without_glib=false,
+                 without_glib=true)
+ABI_GSF
+
+AC_SUBST(CPPFLAGS)
+AC_SUBST(LDFLAGS)
+AC_SUBST(XTRA_CPPLIBS)
+AC_SUBST(LIBEXT)
+
+AC_CONFIG_FILES([Makefile m4/Makefile 
+src/Makefile
+src/include/Makefile
+])
+
+AC_OUTPUT
+
+if test "x$have_gsf" != "xtrue"
+then
+ AC_MSG_ERROR([ERROR: libgsf not found])
+fi

Added: bugGSF/m4/Makefile.am
===================================================================
--- bugGSF/m4/Makefile.am       2006-11-11 03:46:08 UTC (rev 3692)
+++ bugGSF/m4/Makefile.am       2006-11-11 04:26:20 UTC (rev 3693)
@@ -0,0 +1,3 @@
+EXTRA_DIST = \
+ abi-gsf.m4 
+

Added: bugGSF/m4/abi-gsf.m4
===================================================================
--- bugGSF/m4/abi-gsf.m4        2006-11-11 03:46:08 UTC (rev 3692)
+++ bugGSF/m4/abi-gsf.m4        2006-11-11 04:26:20 UTC (rev 3693)
@@ -0,0 +1,81 @@
+# start: abi/ac-helpers/abi-gsf.m4
+# 
+# Copyright (C) 2005 Christian Neumair
+# 
+# This file is free software; you may copy and/or distribute it with
+# or without modifications, as long as this notice is preserved.
+# This software 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.
+#
+# The above license applies to THIS FILE ONLY, the GNUnet code
+# itself may be copied and distributed under the terms of the GNU
+# GPL, see COPYING for more details
+#
+# Usage: ABI_GSF
+
+# Check for gsf
+
+AC_DEFUN([ABI_GSF], [
+
+test_gsf=true
+have_gsf=false
+
+test_gsf_gnome=true
+have_gsf_gnome=false
+
+AC_ARG_ENABLE(gsf,[  --disable-gsf Turn off gsf], [
+       if test "x$enableval" = "xno"; then
+               test_gsf=false
+       fi
+])
+
+AC_ARG_ENABLE(gsf-gnome,[  --disable-gnome Turn off gsf-gnome], [
+       if test "x$enableval" = "xno"; then
+               test_gsf_gnome=false
+       fi
+])
+
+if test "x$test_gsf" = "xtrue" ; then
+       PKG_CHECK_MODULES(GSF,[libgsf-1 >= 1.10], [
+               have_gsf=true
+               GSF_CFLAGS="$GSF_CFLAGS -DHAVE_GSF"
+       ],
+       [
+               have_gsf=false
+       ])
+fi
+
+if test "x$have_gsf" = "xtrue" -a "x$test_gsf_gnome" = "xtrue" ; then
+       PKG_CHECK_MODULES(GSF_GNOME, [libgsf-gnome-1 >= 1.10], [
+               have_gsf_gnome=true
+               GSF_GNOME_CFLAGS="$GSF_GNOME_CFLAGS -DHAVE_GSF_GNOME"
+       ],
+       [
+               have_gsf_gnome=false
+       ])
+fi
+
+AC_SUBST(GSF_CFLAGS)
+AC_SUBST(GSF_LIBS)
+
+AC_SUBST(GSF_GNOME_CFLAGS)
+AC_SUBST(GSF_GNOME_LIBS)
+
+AM_CONDITIONAL(WITH_GSF, test "x$have_gsf" = "xtrue")
+AM_CONDITIONAL(WITH_GSF_GNOME, test "x$have_gsf_gnome" = "xtrue")
+
+if test "x$have_gsf_gnome" = "xtrue" ; then
+       abi_gsf_message="yes, with GNOME support"
+        AC_DEFINE(HAVE_GSF, 1, [Have gsf])
+else if test "x$have_gsf" = "xtrue" ; then
+       abi_gsf_message="yes, without GNOME support"
+        AC_DEFINE(HAVE_GSF, 1, [Have gsf])
+else
+       abi_gsf_message="no"
+        AC_DEFINE(HAVE_GSF, 0, [Have gsf])
+fi
+fi
+
+])

Added: bugGSF/src/Makefile.am
===================================================================
--- bugGSF/src/Makefile.am      2006-11-11 03:46:08 UTC (rev 3692)
+++ bugGSF/src/Makefile.am      2006-11-11 04:26:20 UTC (rev 3693)
@@ -0,0 +1,31 @@
+SUBDIRS = include .
+
+INCLUDES = -I$(top_srcdir)/src/include
+
+# install plugins under:
+plugindir = $(libdir)/bugGSF
+
+PLUGINFLAGS = -avoid-version -module -no-undefined
+
+plugin_LTLIBRARIES = libbugGSF.la
+
+libbugGSF_la_SOURCES = \
+  bugGSF.c
+libbugGSF_la_LDFLAGS = \
+  $(PLUGINFLAGS) 
+libbugGSF_la_CFLAGS = \
+  $(GSF_CFLAGS) 
+libbugGSF_la_LIBADD = \
+  $(LIBADD) $(GSF_LIBS) 
+
+
+check_PROGRAMS = \
+  test_binary
+
+TESTS = $(check_PROGRAMS)
+
+test_binary_SOURCES = \
+  test_binary.c
+test_binary_LDADD = \
+  @GTK_LIBS@
+

Added: bugGSF/src/bugGSF.c
===================================================================
--- bugGSF/src/bugGSF.c 2006-11-11 03:46:08 UTC (rev 3692)
+++ bugGSF/src/bugGSF.c 2006-11-11 04:26:20 UTC (rev 3693)
@@ -0,0 +1,56 @@
+/*
+     This file is part of bugGSF.
+     (C) 2006 Christian Grothoff
+
+     bugGSF 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, or (at your
+     option) any later version.
+
+     bugGSF 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 bugGSF; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+#include "platform.h"
+
+#include <glib-object.h>
+#include <gsf/gsf-utils.h>
+#include <gsf/gsf-input-memory.h>
+#include <gsf/gsf-infile.h>
+#include <gsf/gsf-infile-msole.h>
+#include <gsf/gsf-msole-utils.h>
+
+/* using libgobject, needs init! */
+void __attribute__ ((constructor)) bugGSF_init(void) {
+ g_type_init();
+}
+
+void
+bugGSF_main() {
+  GsfInput * input;
+  GsfInfile * infile;
+  GError * err = NULL;
+  char data[1024];
+
+  input = gsf_input_memory_new(data,                          
+                              (gsf_off_t) 1024,
+                              FALSE);
+  if (input == NULL)
+    return;
+  infile = gsf_infile_msole_new(input, &err);
+  if (infile == NULL) {
+    g_object_unref(G_OBJECT(input));
+    return;
+  }
+  g_object_unref(G_OBJECT(infile));
+  g_object_unref(G_OBJECT(input));
+}
+
+/* end of bugGSF */


Property changes on: bugGSF/src/bugGSF.c
___________________________________________________________________
Name: svn:eol-style
   + native

Added: bugGSF/src/include/Makefile.am
===================================================================
--- bugGSF/src/include/Makefile.am      2006-11-11 03:46:08 UTC (rev 3692)
+++ bugGSF/src/include/Makefile.am      2006-11-11 04:26:20 UTC (rev 3693)
@@ -0,0 +1,3 @@
+SUBDIRS  = . 
+EXTRA_DIST = \
+  platform.h 

Added: bugGSF/src/include/platform.h
===================================================================
--- bugGSF/src/include/platform.h       2006-11-11 03:46:08 UTC (rev 3692)
+++ bugGSF/src/include/platform.h       2006-11-11 04:26:20 UTC (rev 3693)
@@ -0,0 +1,67 @@
+/*
+     This file is part of GNUnet.
+     (C) 2001, 2002, 2003, 2004, 2005 Christian Grothoff (and other 
contributing authors)
+
+     libextractor 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, or (at your
+     option) any later version.
+
+     libextractor 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 libextractor; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file include/platform.h
+ * @brief plaform specifics
+ *
+ * @author Nils Durner
+ */
+
+#ifndef PLATFORM_H
+#define PLATFORM_H
+
+#include "config.h"
+#include "gettext.h"
+#define _(a) dgettext(PACKAGE, a)
+
+#include "plibc.h"
+
+#include <string.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <time.h>
+#include <utime.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <limits.h>
+#include <stddef.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#ifndef MINGW
+ #include <sys/socket.h>
+ #include <sys/mman.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+#else
+ #include <winsock2.h>
+#endif
+#include <locale.h>
+#include <iconv.h>
+#include <langinfo.h>
+
+#ifdef OSX
+ #define socklen_t unsigned int
+#endif
+
+#endif


Property changes on: bugGSF/src/include/platform.h
___________________________________________________________________
Name: svn:eol-style
   + native

Added: bugGSF/src/test_binary.c
===================================================================
--- bugGSF/src/test_binary.c    2006-11-11 03:46:08 UTC (rev 3692)
+++ bugGSF/src/test_binary.c    2006-11-11 04:26:20 UTC (rev 3693)
@@ -0,0 +1,144 @@
+/*
+     This file is part of bugGSF.
+     (C) 2006 Christian Grothoff
+
+     bugGSF 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, or (at your
+     option) any later version.
+
+     bugGSF 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 bugGSF; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+ */
+
+#include "platform.h"
+
+#if HAVE_LTDL_H
+#include <ltdl.h>
+#else
+#include <../../libltdl/ltdl.h>
+#endif
+
+static void *getSymbolWithPrefix(void *lib_handle,
+                                 const char *lib_name,
+                                 const char *sym_name)
+{
+  size_t name_size
+    = strlen(lib_name)
+    + strlen(sym_name)
+    + 1 /* for the zero delim. */
+    + 1 /* for the optional '_' prefix */;
+  char *name=malloc(name_size),*first_error;
+  void *symbol=NULL;
+
+  snprintf(name,
+          name_size,
+          "_%s%s",
+          lib_name,
+          sym_name);
+
+  symbol=lt_dlsym(lib_handle,name+1 /* skip the '_' */);
+  if (symbol==NULL) {
+    first_error=strdup(lt_dlerror());
+    symbol=lt_dlsym(lib_handle,name /* now try with the '_' */);
+#if DEBUG
+    fprintf(stderr,
+           _("Resolving symbol `%s' in library `%s' failed, "
+             "so I tried `%s', but that failed also.  Errors are: "
+             "`%s' and `%s'.\n"),
+             name+1,
+             lib_name,
+             name,
+             first_error,
+             lt_dlerror());
+#endif
+    free(first_error);
+  }
+  free(name);
+  return symbol;
+ }
+
+/**
+ * Load a dynamic library.
+ * @return 1 on success, -1 on error
+ */
+static int
+loadLibrary (const char *name,
+            void **libHandle,
+            ExtractMethod * method)
+{
+  *libHandle = lt_dlopenext (name);
+  if (*libHandle == NULL)
+    {
+#if DEBUG
+      fprintf (stderr,
+              _("Loading `%s' plugin failed: %s\n"),
+              name,
+              lt_dlerror ());
+#endif
+      return -1;
+    }
+
+  *method = (ExtractMethod) getSymbolWithPrefix (*libHandle, name, "_extract");
+  if (*method == NULL) {
+    lt_dlclose (*libHandle);
+    return -1;
+  }
+  return 1;
+}
+
+/**
+ * Remove a library for keyword extraction.
+ * @param prev the current list of libraries
+ * @param library the name of the library to remove
+ * @return the reduced list, unchanged if the library was not loaded
+ */
+EXTRACTOR_ExtractorList *
+EXTRACTOR_removeLibrary(EXTRACTOR_ExtractorList * prev,
+                       const char *library)
+{
+  EXTRACTOR_ExtractorList *pos;
+  EXTRACTOR_ExtractorList *first;
+  pos = prev;
+  first = prev;
+  while ((pos != NULL) && (0 != strcmp (pos->libname, library)))
+    {
+      prev = pos;
+      pos = pos->next;
+    }
+  if (pos != NULL)
+    {
+      /* found, close library */
+      if (first == pos)
+       first = pos->next;
+      else
+       prev->next = pos->next;
+      /* found */
+      free (pos->libname);
+      if( pos->options )
+       free (pos->options);
+      if( pos->libraryHandle )
+       lt_dlclose (pos->libraryHandle);
+      free (pos);
+    }
+#if DEBUG
+  else
+    fprintf(stderr,
+           _("Unloading plugin `%s' failed!\n"),
+           library);
+#endif
+  return first;
+}
+
+
+int main(int argc,
+        char * argv[]) {
+  return 0;
+}


Property changes on: bugGSF/src/test_binary.c
___________________________________________________________________
Name: svn:eol-style
   + native





reply via email to

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