guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, master, updated. release_1-9-8-113-g55


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-8-113-g5595bd7
Date: Tue, 16 Mar 2010 23:54:28 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=5595bd76414e50834b293ead7fd67a54fe56c563

The branch, master has been updated
       via  5595bd76414e50834b293ead7fd67a54fe56c563 (commit)
       via  d12f974b4389f11a2f5fe47f6ca786514cb3bbc9 (commit)
       via  dd1464bf38c5e2dc71652b62f63e4bcf93179a14 (commit)
       via  3023e7b0c90081f0060cb78a4a534ed7cd77c9bf (commit)
       via  087aa6aa312a8d0af51fa9b2f7bfc1332ad97338 (commit)
      from  b0abbaa74a036242a8d727432c82ee95a6bf5a8b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5595bd76414e50834b293ead7fd67a54fe56c563
Author: Ludovic Courtès <address@hidden>
Date:   Wed Mar 17 00:52:52 2010 +0100

    Remove obsolete test directory.
    
    * test-suite/tests/c-api: Remove.

commit d12f974b4389f11a2f5fe47f6ca786514cb3bbc9
Author: Ludovic Courtès <address@hidden>
Date:   Wed Mar 17 00:51:22 2010 +0100

    Change `dynamic-link' to return a global handle when the argument is 
omitted.
    
    * libguile/dynl.c (sysdep_dynl_link): Handle FNAME == NULL.
      (scm_dynamic_link): Make argument optional.  Adjust body accordingly.
    
    * test-suite/standalone/test-ffi (global, strerror, strlen): New
      bindings.
      Add test for these bindings.
    
    * doc/ref/api-modules.texi (Low level dynamic linking): Update
      description of `dynamic-link'.

commit dd1464bf38c5e2dc71652b62f63e4bcf93179a14
Author: Ludovic Courtès <address@hidden>
Date:   Wed Mar 17 00:45:57 2010 +0100

    Provide `int', `long', `size_t', etc. in `(system foreign)'.
    
    * libguile/foreign.c (sym_int, sym_long, sym_unsigned_int,
      sym_unsigned_long, sym_size_t): New variables.
      (scm_init_foreign): Define them at the Scheme level.
    
    * module/system/foreign.scm (int, unsigned-int, long,
      unsigned-long, size_t): New exported bindings.

commit 3023e7b0c90081f0060cb78a4a534ed7cd77c9bf
Author: Ludovic Courtès <address@hidden>
Date:   Wed Mar 17 00:06:13 2010 +0100

    Fix doc string of `dynamic-pointer'.
    
    * libguile/dynl.c (scm_dynamic_pointer): Fix doc string.  Reformat body.

commit 087aa6aa312a8d0af51fa9b2f7bfc1332ad97338
Author: Ludovic Courtès <address@hidden>
Date:   Tue Mar 16 23:51:21 2010 +0100

    Use GC-managed pointerless memory in the FFI.
    
    * libguile/foreign.c (scm_make_foreign_function): Use
      `scm_gc_malloc_pointerless ()' when allocating memory for CIF.
      (pack): Likewise for the `FFI_TYPE_STRUCT' case.

-----------------------------------------------------------------------

Summary of changes:
 doc/ref/api-modules.texi         |    9 ++-
 libguile/dynl.c                  |   70 +++++++++++++++-------
 libguile/foreign.c               |   69 ++++++++++++++++++++--
 module/system/foreign.scm        |    1 +
 test-suite/standalone/test-ffi   |   25 ++++++++
 test-suite/tests/c-api/Makefile  |   16 -----
 test-suite/tests/c-api/README    |   11 ----
 test-suite/tests/c-api/strings.c |   74 -----------------------
 test-suite/tests/c-api/testlib.c |  121 --------------------------------------
 test-suite/tests/c-api/testlib.h |   28 ---------
 10 files changed, 143 insertions(+), 281 deletions(-)
 delete mode 100644 test-suite/tests/c-api/Makefile
 delete mode 100644 test-suite/tests/c-api/README
 delete mode 100644 test-suite/tests/c-api/strings.c
 delete mode 100644 test-suite/tests/c-api/testlib.c
 delete mode 100644 test-suite/tests/c-api/testlib.h

diff --git a/doc/ref/api-modules.texi b/doc/ref/api-modules.texi
index a717386..aa6eaa3 100644
--- a/doc/ref/api-modules.texi
+++ b/doc/ref/api-modules.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Guile Reference Manual.
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007, 
2008, 2009
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007, 
2008, 2009, 2010
 @c   Free Software Foundation, Inc.
 @c See the file guile.texi for copying conditions.
 
@@ -1029,7 +1029,7 @@ When using the low level procedures to do your dynamic 
linking, you have
 complete control over which library is loaded when and what gets done
 with it.
 
address@hidden {Scheme Procedure} dynamic-link library
address@hidden {Scheme Procedure} dynamic-link [library]
 @deffnx {C Function} scm_dynamic_link (library)
 Find the shared library denoted by @var{library} (a string) and link it
 into the running Guile application.  When everything works out, return a
@@ -1040,6 +1040,11 @@ dependent.
 Normally, @var{library} is just the name of some shared library file
 that will be searched for in the places where shared libraries usually
 reside, such as in @file{/usr/lib} and @file{/usr/local/lib}.
+
+When @var{library} is omitted, a @dfn{global symbol handle} is returned.  This
+handle provides access to the symbols available to the program at run-time,
+including those exported by the program itself and the shared libraries already
+loaded.
 @end deffn
 
 @deffn {Scheme Procedure} dynamic-object? obj
diff --git a/libguile/dynl.c b/libguile/dynl.c
index 0175c33..a204e93 100644
--- a/libguile/dynl.c
+++ b/libguile/dynl.c
@@ -77,16 +77,23 @@ static void *
 sysdep_dynl_link (const char *fname, const char *subr)
 {
   lt_dlhandle handle;
-  handle = lt_dlopenext (fname);
+
+  if (fname != NULL)
+    handle = lt_dlopenext (fname);
+  else
+    /* Return a handle for the program as a whole.  */
+    handle = lt_dlopen (NULL);
+
   if (NULL == handle)
     {
       SCM fn;
       SCM msg;
 
-      fn = scm_from_locale_string (fname);
+      fn = fname != NULL ? scm_from_locale_string (fname) : SCM_BOOL_F;
       msg = scm_from_locale_string (lt_dlerror ());
       scm_misc_error (subr, "file: ~S, message: ~S", scm_list_2 (fn, msg));
     }
+
   return (void *) handle;
 }
 
@@ -155,7 +162,7 @@ dynl_obj_print (SCM exp, SCM port, scm_print_state *pstate)
 }
 
 
-SCM_DEFINE (scm_dynamic_link, "dynamic-link", 1, 0, 0, 
+SCM_DEFINE (scm_dynamic_link, "dynamic-link", 0, 1, 0,
             (SCM filename),
            "Find the shared object (shared library) denoted by\n"
            "@var{filename} and link it into the running Guile\n"
@@ -165,18 +172,33 @@ SCM_DEFINE (scm_dynamic_link, "dynamic-link", 1, 0, 0,
            "Searching for object files is system dependent.  Normally,\n"
            "if @var{filename} does have an explicit directory it will\n"
            "be searched for in locations\n"
-           "such as @file{/usr/lib} and @file{/usr/local/lib}.")
+           "such as @file{/usr/lib} and @file{/usr/local/lib}.\n\n"
+           "When @var{filename} is omitted, a @dfn{global symbol handle} is\n"
+           "returned.  This handle provides access to the symbols\n"
+           "available to the program at run-time, including those exported\n"
+           "by the program itself and the shared libraries already loaded.\n")
 #define FUNC_NAME s_scm_dynamic_link
 {
   void *handle;
   char *file;
 
   scm_dynwind_begin (0);
-  file = scm_to_locale_string (filename);
-  scm_dynwind_free (file);
+
+  if (SCM_UNBNDP (filename))
+    file = NULL;
+  else
+    {
+      file = scm_to_locale_string (filename);
+      scm_dynwind_free (file);
+    }
+
   handle = sysdep_dynl_link (file, FUNC_NAME);
   scm_dynwind_end ();
-  SCM_RETURN_NEWSMOB2 (scm_tc16_dynamic_obj, SCM_UNPACK (filename), handle);
+
+  SCM_RETURN_NEWSMOB2 (scm_tc16_dynamic_obj,
+                      SCM_UNBNDP (filename)
+                      ? SCM_UNPACK (SCM_BOOL_F) : SCM_UNPACK (filename),
+                      handle);
 }
 #undef FUNC_NAME
 
@@ -220,8 +242,8 @@ SCM_DEFINE (scm_dynamic_pointer, "dynamic-pointer", 3, 1, 0,
            "shared object referred to by @var{dobj}.  The handle\n"
            "aliases a C value, and is declared to be of type\n"
             "@var{type}. Valid types are defined in the\n"
-            "@code{(system vm ffi)} module.\n\n"
-            "This facility works by asking the operating system for\n"
+            "@code{(system foreign)} module.\n\n"
+            "This facility works by asking the dynamic linker for\n"
             "the address of a symbol, then assuming that it aliases a\n"
             "value of a given type. Obviously, the user must be very\n"
             "careful to ensure that the value actually is of the\n"
@@ -237,22 +259,24 @@ SCM_DEFINE (scm_dynamic_pointer, "dynamic-pointer", 3, 1, 
0,
 
   SCM_VALIDATE_STRING (1, name);
   t = scm_to_unsigned_integer (type, 0, SCM_FOREIGN_TYPE_LAST);
-  /*fixme* GC-problem */
   SCM_VALIDATE_SMOB (SCM_ARG3, dobj, dynamic_obj);
-  if (DYNL_HANDLE (dobj) == NULL) {
+
+  if (DYNL_HANDLE (dobj) == NULL)
     SCM_MISC_ERROR ("Already unlinked: ~S", dobj);
-  } else {
-    char *chars;
-
-    scm_dynwind_begin (0);
-    chars = scm_to_locale_string (name);
-    scm_dynwind_free (chars);
-    val = sysdep_dynl_value (chars, DYNL_HANDLE (dobj), FUNC_NAME);
-    scm_dynwind_end ();
-    return scm_take_foreign_pointer (t, val,
-                                     SCM_UNBNDP (len) ? 0 : scm_to_size_t 
(len),
-                                     NULL);
-  }
+  else
+    {
+      char *chars;
+
+      scm_dynwind_begin (0);
+      chars = scm_to_locale_string (name);
+      scm_dynwind_free (chars);
+      val = sysdep_dynl_value (chars, DYNL_HANDLE (dobj), FUNC_NAME);
+      scm_dynwind_end ();
+
+      return scm_take_foreign_pointer (t, val,
+                                      SCM_UNBNDP (len) ? 0 : scm_to_size_t 
(len),
+                                      NULL);
+    }
 }
 #undef FUNC_NAME
 
diff --git a/libguile/foreign.c b/libguile/foreign.c
index 00de06f..b462ee9 100644
--- a/libguile/foreign.c
+++ b/libguile/foreign.c
@@ -42,6 +42,11 @@ SCM_SYMBOL (sym_uint32, "uint32");
 SCM_SYMBOL (sym_int32, "int32");
 SCM_SYMBOL (sym_uint64, "uint64");
 SCM_SYMBOL (sym_int64, "int64");
+SCM_SYMBOL (sym_int, "int");
+SCM_SYMBOL (sym_long, "long");
+SCM_SYMBOL (sym_unsigned_int, "unsigned-int");
+SCM_SYMBOL (sym_unsigned_long, "unsigned-long");
+SCM_SYMBOL (sym_size_t, "size_t");
 
 /* that's for pointers, you know. */
 SCM_SYMBOL (sym_asterisk, "*");
@@ -656,10 +661,12 @@ SCM_DEFINE (scm_make_foreign_function, 
"make-foreign-function", 3, 0, 0,
      one for the return val */
   cif_len = (ROUND_UP (cif_len, alignof(ffi_type))
              + (nargs + n_struct_elts + 1)*sizeof(ffi_type));
-  
-  mem = scm_malloc (cif_len);
-  scm_cif = scm_take_foreign_pointer (SCM_FOREIGN_TYPE_VOID, mem, cif_len, 
free);
-  cif = (ffi_cif*)mem;
+
+  mem = scm_gc_malloc_pointerless (cif_len, "foreign");
+  scm_cif = scm_take_foreign_pointer (SCM_FOREIGN_TYPE_VOID, mem,
+                                     cif_len, NULL);
+  cif = (ffi_cif *) mem;
+
   /* reuse cif_len to walk through the mem */
   cif_len = ROUND_UP (sizeof (ffi_cif), alignof(void*));
   type_ptrs = (ffi_type**)(mem + cif_len);
@@ -910,10 +917,10 @@ pack (ffi_type *type, void *loc)
       return scm_from_int64 (*(scm_t_int64*)loc);
     case FFI_TYPE_STRUCT:
       {
-        void *mem = scm_malloc (type->size);
+        void *mem = scm_gc_malloc_pointerless (type->size, "foreign");
         memcpy (mem, loc, type->size);
         return scm_take_foreign_pointer (SCM_FOREIGN_TYPE_VOID,
-                                         mem, type->size, free);
+                                         mem, type->size, NULL);
       }
     case FFI_TYPE_POINTER:
       return scm_take_foreign_pointer (SCM_FOREIGN_TYPE_VOID,
@@ -982,6 +989,56 @@ scm_init_foreign (void)
   scm_define (sym_int32, scm_from_uint8 (SCM_FOREIGN_TYPE_INT32));
   scm_define (sym_uint64, scm_from_uint8 (SCM_FOREIGN_TYPE_UINT64));
   scm_define (sym_int64, scm_from_uint8 (SCM_FOREIGN_TYPE_INT64));
+
+  scm_define (sym_int,
+#if SIZEOF_INT == 8
+             scm_from_uint8 (SCM_FOREIGN_TYPE_INT64)
+#elif SIZEOF_INT == 4
+             scm_from_uint8 (SCM_FOREIGN_TYPE_INT32)
+#else
+# error unsupported sizeof (int)
+#endif
+             );
+
+  scm_define (sym_unsigned_int,
+#if SIZEOF_UNSIGNED_INT == 8
+             scm_from_uint8 (SCM_FOREIGN_TYPE_UINT64)
+#elif SIZEOF_UNSIGNED_INT == 4
+             scm_from_uint8 (SCM_FOREIGN_TYPE_UINT32)
+#else
+# error unsupported sizeof (unsigned int)
+#endif
+             );
+
+  scm_define (sym_long,
+#if SIZEOF_LONG == 8
+             scm_from_uint8 (SCM_FOREIGN_TYPE_INT64)
+#elif SIZEOF_LONG == 4
+             scm_from_uint8 (SCM_FOREIGN_TYPE_INT32)
+#else
+# error unsupported sizeof (long)
+#endif
+             );
+
+  scm_define (sym_unsigned_long,
+#if SIZEOF_UNSIGNED_LONG == 8
+             scm_from_uint8 (SCM_FOREIGN_TYPE_UINT64)
+#elif SIZEOF_UNSIGNED_LONG == 4
+             scm_from_uint8 (SCM_FOREIGN_TYPE_UINT32)
+#else
+# error unsupported sizeof (unsigned long)
+#endif
+             );
+
+  scm_define (sym_size_t,
+#if SIZEOF_SIZE_T == 8
+             scm_from_uint8 (SCM_FOREIGN_TYPE_UINT64)
+#elif SIZEOF_SIZE_T == 4
+             scm_from_uint8 (SCM_FOREIGN_TYPE_UINT32)
+#else
+# error unsupported sizeof (size_t)
+#endif
+             );
 }
 
 void
diff --git a/module/system/foreign.scm b/module/system/foreign.scm
index 73c11fe..7966dd9 100644
--- a/module/system/foreign.scm
+++ b/module/system/foreign.scm
@@ -20,6 +20,7 @@
   #:use-module (rnrs bytevector)
   #:export (void
             float double
+            int unsigned-int long unsigned-long size_t
             int8 uint8
             uint16 int16
             uint32 int32
diff --git a/test-suite/standalone/test-ffi b/test-suite/standalone/test-ffi
index 5487625..19c1c15 100755
--- a/test-suite/standalone/test-ffi
+++ b/test-suite/standalone/test-ffi
@@ -168,6 +168,31 @@ exec guile -q -s "$0" "$@"
               '(0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0))
       (error "unexpected dest")))
 
+
+;;;
+;;; Global symbols.
+;;;
+
+(use-modules ((rnrs bytevector) #:select (utf8->string)))
+
+(if (defined? 'setlocale)
+    (setlocale LC_ALL "C"))
+
+(define global (dynamic-link))
+
+(define strerror
+  (make-foreign-function '* (dynamic-func "strerror" global)
+                         (list int)))
+
+(define strlen
+  (make-foreign-function size_t (dynamic-func "strlen" global)
+                         (list '*)))
+
+(let* ((ptr (strerror ENOENT))
+       (len (strlen ptr))
+       (bv  (foreign->bytevector ptr 'u8 0 len))
+       (str (utf8->string bv)))
+  (test #t (not (not (string-contains str "file")))))
 
 ;; Local Variables:
 ;; mode: scheme
diff --git a/test-suite/tests/c-api/Makefile b/test-suite/tests/c-api/Makefile
deleted file mode 100644
index 44488af..0000000
--- a/test-suite/tests/c-api/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-CC = gcc
-CFLAGS = -g `guile-config compile`
-
-all: strings
-
-strings: strings.o testlib.o
-       ${CC} ${CFLAGS} ${LDFLAGS} -o strings strings.o testlib.o \
-               `guile-config link`
-
-strings.o: strings.c testlib.h
-testlib.o: testlib.c testlib.h
-
-
-clean:
-       rm -f strings
-       rm -f *.o
diff --git a/test-suite/tests/c-api/README b/test-suite/tests/c-api/README
deleted file mode 100644
index da13fde..0000000
--- a/test-suite/tests/c-api/README
+++ /dev/null
@@ -1,11 +0,0 @@
-[NOTE: this code is no longer used -- for now these tests are in the
- standalone directory.  What'll happen longer-term is uncertain...]
-
-
-This directory contains tests for Guile's C API.  At the moment, the
-test suite doesn't have any way to run these automatically --- we need
-to 1) figure out how to run the compiler, and 2) figure out how to
-integrate results from C tests into the test suite statistics.
-
-Nonetheless, it's better to have this code accumulating here than
-someplace else where nobody can find it.
diff --git a/test-suite/tests/c-api/strings.c b/test-suite/tests/c-api/strings.c
deleted file mode 100644
index 68eb83e..0000000
--- a/test-suite/tests/c-api/strings.c
+++ /dev/null
@@ -1,74 +0,0 @@
-
-/* NOTE: this code was never being run.  The same tests have been
-   migrated to standalone/test-gh.c */
-
-/* strings.c --- test the Guile C API's string handling functions
-   Jim Blandy <address@hidden> --- August 1999  */
-
-#include <guile/gh.h>
-
-#include "testlib.h"
-
-static int
-string_equal (SCM str, char *lit)
-{
-  int len = strlen (lit);
-  
-  return (SCM_LENGTH (str) == len
-         && ! memcmp (SCM_ROCHARS (str), lit, len));
-}
-
-void
-test_gh_set_substr ()
-{
-  test_context_t cx = test_enter_context ("gh_set_substr");
-  SCM string;
-
-  string = gh_str02scm ("Free, darnit!");
-  test_pass_if ("make a string", gh_string_p (string));
-
-  gh_set_substr ("dammit", string, 6, 6);
-  test_pass_if ("gh_set_substr from literal",
-               string_equal (string, "Free, dammit!"));
-  
-  /* Make sure that we can use the string itself as a source.
-
-     I guess this behavior isn't really visible, since the GH API
-     doesn't provide any direct access to the string contents.  But I
-     think it should, eventually.  You can't write efficient string
-     code if you have to copy the string just to look at it.  */
-
-  /* Copy a substring to an overlapping region to its right.  */
-  gh_set_substr (SCM_CHARS (string), string, 4, 6);
-  test_pass_if ("gh_set_substr shifting right",
-               string_equal (string, "FreeFree, it!"));
-  
-  string = gh_str02scm ("Free, darnit!");
-  test_pass_if ("make another string", gh_string_p (string));
-
-  /* Copy a substring to an overlapping region to its left.  */
-  gh_set_substr (SCM_CHARS (string) + 6, string, 2, 6);
-  test_pass_if ("gh_set_substr shifting right",
-               string_equal (string, "Frdarnitrnit!"));
-
-  test_restore_context (cx);
-}
-
-void 
-main_prog (int argc, char *argv[])
-{
-  test_context_t strings = test_enter_context ("strings.c");
-
-  test_gh_set_substr ();
-
-  test_restore_context (strings);
-
-  exit (test_summarize ());
-}
-
-int 
-main (int argc, char *argv[])
-{
-  gh_enter (argc, argv, main_prog);
-  return 0;
-}
diff --git a/test-suite/tests/c-api/testlib.c b/test-suite/tests/c-api/testlib.c
deleted file mode 100644
index 21fff24..0000000
--- a/test-suite/tests/c-api/testlib.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/* testlib.c --- reporting test results
-   Jim Blandy <address@hidden> --- August 1999 */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "testlib.h"
-
-
-
-/* Dying.  */
-
-static void
-fatal (char *message)
-{
-  fprintf (stderr, "%s\n", message);
-  exit (1);
-}
-
-
-/* Contexts.  */
-
-/* If it gets deeper than this, that's probably an error, right?  */
-#define MAX_NESTING 10
-
-int depth = 0;
-char *context_name_stack[MAX_NESTING];
-int marker;
-int context_marker_stack[MAX_NESTING];
-
-test_context_t
-test_enter_context (char *name)
-{
-  if (depth >= MAX_NESTING)
-    fatal ("test contexts nested too deeply");
-
-  /* Generate a unique marker value for this context.  */
-  marker++;
-
-  context_name_stack[depth] = name;
-  context_marker_stack[depth] = marker;
-
-  depth++;
-
-  return marker;
-}
-
-void
-test_restore_context (test_context_t context)
-{
-  if (depth <= 0)
-    fatal ("attempt to leave outermost context");
-
-  depth--;
-
-  /* Make sure that we're exiting the same context we last entered.  */
-  if (context_marker_stack[depth] != context)
-    fatal ("contexts not nested properly");
-}
-
-
-/* Reporting results.  */
-
-int count_passes, count_fails;
-
-static void
-print_test_name (char *name)
-{
-  int i;
-
-  for (i = 0; i < depth; i++)
-    printf ("%s: ", context_name_stack[i]);
-
-  printf ("%s", name);
-}
-
-static void
-print_result (char *result, char *name)
-{
-  printf ("%s: ", result);
-  print_test_name (name);
-  putchar ('\n');
-}
-
-void
-test_pass (char *name)
-{
-  print_result ("PASS", name);
-  count_passes++;
-}
-
-void
-test_fail (char *name)
-{
-  print_result ("FAIL", name);
-  count_fails++;
-}
-
-void
-test_pass_if (char *name, int condition)
-{
-  (condition ? test_pass : test_fail) (name);
-}
-
-
-/* Printing a summary.  */
-
-/* Print a summary of the reported test results.  Return zero if
-   no failures occurred, one otherwise.  */
-
-int
-test_summarize ()
-{
-  putchar ('\n');
-
-  printf ("passes:      %d\n", count_passes);
-  printf ("failures:    %d\n", count_fails);
-  printf ("total tests: %d\n", count_passes + count_fails);
-
-  return (count_fails != 0);
-}
diff --git a/test-suite/tests/c-api/testlib.h b/test-suite/tests/c-api/testlib.h
deleted file mode 100644
index 3adaf7f..0000000
--- a/test-suite/tests/c-api/testlib.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* testlib.h --- reporting test results
-   Jim Blandy <address@hidden> --- August 1999 */
-
-#ifndef TESTLIB_H
-#define TESTLIB_H
-
-extern void test_pass (char *name);
-extern void test_fail (char *name);
-extern void test_pass_if (char *name, int condition);
-
-/* We need a way to keep track of what groups of tests we're currently
-   within.  A call to test_enter_context assures that future tests
-   will be reported with a name prefixed by NAME, until we call
-   test_restore_context with the value it returned.
-
-   Calls to test_enter_context and test_restore_context should be
-   properly nested; passing the context around allows them to detect
-   mismatches.
-
-   It is the caller's responsibility to free NAME after exiting the
-   context.  (This is trivial if you're passing string literals to
-   test_enter_context.)  */
-
-typedef int test_context_t;
-extern test_context_t test_enter_context (char *name);
-extern void test_restore_context (test_context_t context);
-
-#endif /* TESTLIB_H */


hooks/post-receive
-- 
GNU Guile




reply via email to

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