incubator-triplesoup-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leosim...@apache.org
Subject svn commit: r528519 [11/12] - in /incubator/triplesoup/donations/TRIPLES-2-libb: ./ docs/ docs/html/ docs/tmpl/ docs/xml/ redland-integration/ redland/ src/ test/ tests/ utils/
Date Fri, 13 Apr 2007 15:19:52 GMT
Added: incubator/triplesoup/donations/TRIPLES-2-libb/src/bjournaling.c
URL: http://svn.apache.org/viewvc/incubator/triplesoup/donations/TRIPLES-2-libb/src/bjournaling.c?view=auto&rev=528519
==============================================================================
--- incubator/triplesoup/donations/TRIPLES-2-libb/src/bjournaling.c (added)
+++ incubator/triplesoup/donations/TRIPLES-2-libb/src/bjournaling.c Fri Apr 13 08:19:45 2007
@@ -0,0 +1,308 @@
+/* (c) 2007 Satis Superque Merce B.V. All rights reserved.
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ */
+
+#include <b.h>
+#include <stdarg.h>
+
+static char b_journaling_io (b_t * data, b_io_t * io);
+static b_error_t b_journaling_recover_cache_empty (b_t * data, b_io_t * io,
+						   b_uint64 * done);
+static b_error_t b_journaling_recover_end_write (b_t * data, b_io_t * io,
+						 b_uint64 * done);
+static b_error_t b_journaling_recover_write (b_t * data, b_io_t * io,
+					     b_uint64 * done);
+
+/* Journaling procedure: */
+void
+b_journaling_new (b_t * data, b_io_t * io, b_journaling_type_t type, ...)
+{
+  va_list va;
+  b_uint64 pointer;
+  size_t size;
+  unsigned char *what;
+  char freed;
+  char cio;
+  b_string_t *str;
+
+  /* Witch filedescriptor? */
+  cio = b_journaling_io (data, io);
+
+  va_start (va, type);
+
+  /* Witch operation? */
+  switch (type)
+    {
+    case B_JOURNALING_CACHE_EMPTY:
+      /* No argument */
+
+      if (b_string_new (&str) != B_OK)
+	return;
+
+      b_string_add (str, (unsigned char *) &cio, sizeof (cio));
+      b_string_add (str, (unsigned char *) &type, sizeof (type));
+
+      b_io_write (data->journaling_io, str->string, str->size,
+		  data->max_cache);
+      b_string_destroy (str, NULL);
+      break;
+
+    case B_JOURNALING_END_WRITE:
+      /* 1th argument: the pointer */
+      if (!(pointer = va_arg (va, b_uint64)))
+	return;
+
+      if (b_string_new (&str) != B_OK)
+	return;
+
+      b_string_add (str, (unsigned char *) &cio, sizeof (cio));
+      b_string_add (str, (unsigned char *) &type, sizeof (type));
+      b_string_add (str, (unsigned char *) &pointer, sizeof (pointer));
+
+      b_io_write (data->journaling_io, str->string, str->size,
+		  data->max_cache);
+      b_string_destroy (str, NULL);
+      break;
+
+    case B_JOURNALING_WRITE:
+      /* 1th argument: the pointer */
+      if (!(pointer = va_arg (va, b_uint64)))
+	return;
+
+      /* 2nd argument: the size */
+      if (!(size = va_arg (va, size_t)))
+	return;
+
+      /* 3rd argument: what */
+      if (!(what = va_arg (va, void *)))
+	{
+	  freed = 1;
+
+	  if (!(what = malloc (size + 1)))
+	    return;
+
+	  if (b_io_read (io, what, size) <= 0)
+	    return;
+	}
+      else
+	freed = 0;
+
+      if (b_string_new (&str) != B_OK)
+	{
+	  if (freed)
+	    free (what);
+	  return;
+	}
+
+      b_string_add (str, (unsigned char *) &cio, sizeof (cio));
+      b_string_add (str, (unsigned char *) &type, sizeof (type));
+      b_string_add (str, (unsigned char *) &pointer, sizeof (pointer));
+      b_string_add (str, (unsigned char *) &size, sizeof (size));
+      b_string_add (str, (unsigned char *) what, size);
+
+      b_io_write (data->journaling_io, str->string, str->size,
+		  data->max_cache);
+      b_string_destroy (str, NULL);
+
+      if (freed)
+	free (what);
+      break;
+    }
+
+  va_end (va);
+}
+
+/* The destroing procedure removes the file: */
+void
+b_journaling_destroy (b_t * data)
+{
+  data->journaling_io->end_pointer = sizeof (b_uint64);
+  memcpy (data->journaling_io->data, &data->journaling_io->end_pointer,
+	  sizeof (data->journaling_io->end_pointer));
+}
+
+/* Witch io element? */
+static char
+b_journaling_io (b_t * data, b_io_t * io)
+{
+  if (data->uris_io == io)
+    return B_TYPE_URI;
+
+  if (data->properties_io == io)
+    return B_TYPE_PROPERTY;
+
+  if (data->literals_io == io)
+    return B_TYPE_LITERAL;
+
+  if (data->bnodes_io == io)
+    return B_TYPE_BNODE;
+
+  if (data->contexts_io == io)
+    return B_TYPE_CONTEXT;
+
+  if (data->datatypes_io == io)
+    return B_TYPE_DATATYPE;
+
+  return -1;
+}
+
+/* Recovering procedure: */
+b_error_t
+b_journaling_recover (b_t * data)
+{
+  b_uint64 done = 0;
+  char b;
+  b_io_t *io;
+
+  /* Until the file exists: */
+  while (b_io_read (data->journaling_io, &b, sizeof (char)) <= 0)
+    {
+      /* The first byte means the io element: */
+      switch (b)
+	{
+	case B_TYPE_URI:
+	  io = data->uris_io;
+	  break;
+
+	case B_TYPE_PROPERTY:
+	  io = data->properties_io;
+	  break;
+
+	case B_TYPE_LITERAL:
+	  io = data->literals_io;
+	  break;
+
+	case B_TYPE_BNODE:
+	  io = data->bnodes_io;
+	  break;
+
+	case B_TYPE_CONTEXT:
+	  io = data->contexts_io;
+	  break;
+
+	case B_TYPE_DATATYPE:
+	  io = data->datatypes_io;
+	  break;
+
+	case -1:
+	  io = data->triples_io;
+	  break;
+
+	default:
+	  /* Error in the file: */
+	  b_journaling_destroy (data);
+	  return B_OK;
+	}
+
+      /* The second byte means the operation: */
+      if (b_io_read (data->journaling_io, &b, sizeof (char)) <= 0)
+	{
+	  b_journaling_destroy (data);
+	  return B_OK;
+	}
+
+      switch (b)
+	{
+	case B_JOURNALING_CACHE_EMPTY:
+	  if (b_journaling_recover_cache_empty (data, io, &done) != B_OK)
+	    {
+	      b_journaling_destroy (data);
+	      return B_OK;
+	    }
+
+	  break;
+
+	case B_JOURNALING_END_WRITE:
+	  if (b_journaling_recover_end_write (data, io, &done) != B_OK)
+	    {
+	      b_journaling_destroy (data);
+	      return B_OK;
+	    }
+
+	  break;
+
+	case B_JOURNALING_WRITE:
+	  if (b_journaling_recover_write (data, io, &done) != B_OK)
+	    {
+	      b_journaling_destroy (data);
+	      return B_OK;
+	    }
+
+	  break;
+
+	default:
+	  /* Error in the file: */
+	  b_journaling_destroy (data);
+	  return B_OK;
+	}
+    }
+
+  b_journaling_destroy (data);
+  return B_OK;
+}
+
+/* If the crashed procedure was creating the empty element of a b-tree, I can
+ * reset the end_pointer: */
+static b_error_t
+b_journaling_recover_cache_empty (b_t * data, b_io_t * io, b_uint64 * done)
+{
+  io->end_pointer = sizeof (b_uint64);
+  memcpy (io->data, &io->end_pointer, sizeof (io->end_pointer));
+  return B_OK;
+}
+
+/* If the crashed procedure was writting something in the end of the file, I
+ * reset the end_pointer to the previous value: */
+static b_error_t
+b_journaling_recover_end_write (b_t * data, b_io_t * io, b_uint64 * done)
+{
+  b_uint64 pointer;
+
+  if (b_io_read (data->journaling_io, &pointer, sizeof (pointer)) <= 0)
+    return B_ERROR_POSIX;
+
+  io->end_pointer = pointer;
+  memcpy (io->data, &io->end_pointer, sizeof (io->end_pointer));
+
+  (*done) += sizeof (pointer);
+  return B_OK;
+}
+
+/* if the crashed procedure was writting in the middle of the file, I must
+ * write the previous value: */
+static b_error_t
+b_journaling_recover_write (b_t * data, b_io_t * io, b_uint64 * done)
+{
+  b_uint64 pointer;
+  size_t size;
+  unsigned char *what;
+
+  if (b_io_read (data->journaling_io, &pointer, sizeof (pointer)) <= 0)
+    return B_ERROR_POSIX;
+
+  if (b_io_read (data->journaling_io, &size, sizeof (size)) <= 0)
+    return B_ERROR_POSIX;
+
+  if (!(what = malloc (size)))
+    return B_ERROR_POSIX;
+
+  if (b_io_read (data->journaling_io, what, size) <= 0)
+    {
+      free (what);
+      return B_ERROR_POSIX;
+    }
+
+  b_io_seek (io, pointer, SEEK_SET);
+  b_io_write (io, what, size, data->max_cache);
+  free (what);
+
+  (*done) += size + sizeof (size) + sizeof (pointer);
+  return B_OK;
+}
+
+/* EOF */

Modified: incubator/triplesoup/donations/TRIPLES-2-libb/src/bnew.c
URL: http://svn.apache.org/viewvc/incubator/triplesoup/donations/TRIPLES-2-libb/src/bnew.c?view=diff&rev=528519&r1=528518&r2=528519
==============================================================================
--- incubator/triplesoup/donations/TRIPLES-2-libb/src/bnew.c (original)
+++ incubator/triplesoup/donations/TRIPLES-2-libb/src/bnew.c Fri Apr 13 08:19:45 2007
@@ -70,6 +70,33 @@
   B_NEW_FD (B_PATH_DATATYPES_DATA, datatypes_io);
   B_NEW_FD (B_PATH_TRIPLES_DATA, triples_io);
 
+  if (!
+      (file =
+       malloc (sizeof (char) *
+	       (strlen ((char *) path) + strlen (B_PATH_JOURNALING_DATA) +
+		1))))
+    {
+      b_destroy (*data);
+      return B_ERROR_MEMORY;
+    }
+
+  sprintf (file, "%s%s", path, B_PATH_JOURNALING_DATA);
+  error = b_io_new (&(*data)->journaling_io, (unsigned char *) file, n);
+  (*data)->journaling_file = (unsigned char *) file;
+
+  if (error != B_OK)
+    {
+      b_destroy (*data);
+      return error;
+    }
+
+  /* if it return a strange value, the DB is broken... */
+  if ((error = b_journaling_recover (*data)) != B_OK)
+    {
+      b_destroy (*data);
+      return error;
+    }
+
   if ((error = b_count_triple_cache (*data, &(*data)->triples_total)))
     {
       b_destroy (*data);

Modified: incubator/triplesoup/donations/TRIPLES-2-libb/src/bremove.c
URL: http://svn.apache.org/viewvc/incubator/triplesoup/donations/TRIPLES-2-libb/src/bremove.c?view=diff&rev=528519&r1=528518&r2=528519
==============================================================================
--- incubator/triplesoup/donations/TRIPLES-2-libb/src/bremove.c (original)
+++ incubator/triplesoup/donations/TRIPLES-2-libb/src/bremove.c Fri Apr 13 08:19:45 2007
@@ -52,9 +52,18 @@
   if (map.instances > 0)
     return B_OK;
 
+  b_journaling_new (data, io, B_JOURNALING_WRITE, cache->pointer,
+		    sizeof (b_map_t), &map);
+
   b_io_seek (io, map.parent, SEEK_SET);
   if (b_io_read (io, &parent, sizeof (b_map_t)) <= 0)
-    return B_ERROR_INTERNAL;
+    {
+      b_journaling_destroy (data);
+      return B_ERROR_INTERNAL;
+    }
+
+  b_journaling_new (data, io, B_JOURNALING_WRITE, map.parent,
+		    sizeof (b_map_t), &parent);
 
   /* 1 child or 0 children: */
   if (!map.left)
@@ -70,13 +79,22 @@
 
 	  b_io_seek (io, map.right, SEEK_SET);
 	  if (b_io_read (io, &other, sizeof (b_map_t)) <= 0)
-	    return B_ERROR_INTERNAL;
+	    {
+	      b_journaling_destroy (data);
+	      return B_ERROR_INTERNAL;
+	    }
+
+	  b_journaling_new (data, io, B_JOURNALING_WRITE, map.right,
+			    sizeof (b_map_t), &other);
 
 	  other.parent = map.parent;
 
 	  b_io_seek (io, map.right, SEEK_SET);
 	  if (b_io_write (io, &other, sizeof (b_map_t), data->max_cache) <= 0)
-	    return B_ERROR_INTERNAL;
+	    {
+	      b_journaling_destroy (data);
+	      return B_ERROR_INTERNAL;
+	    }
 	}
     }
 
@@ -93,13 +111,22 @@
 
 	  b_io_seek (io, map.left, SEEK_SET);
 	  if (b_io_read (io, &other, sizeof (b_map_t)) <= 0)
-	    return B_ERROR_INTERNAL;
+	    {
+	      b_journaling_destroy (data);
+	      return B_ERROR_INTERNAL;
+	    }
+
+	  b_journaling_new (data, io, B_JOURNALING_WRITE, map.left,
+			    sizeof (b_map_t), &other);
 
 	  other.parent = map.parent;
 
 	  b_io_seek (io, map.left, SEEK_SET);
 	  if (b_io_write (io, &other, sizeof (b_map_t), data->max_cache) <= 0)
-	    return B_ERROR_INTERNAL;
+	    {
+	      b_journaling_destroy (data);
+	      return B_ERROR_INTERNAL;
+	    }
 	}
     }
 
@@ -112,15 +139,24 @@
       /* I'm looking for the in-order successor: */
       pointer = b_io_seek (io, map.right, SEEK_SET);
       if (b_io_read (io, &other, sizeof (b_map_t)) <= 0)
-	return B_ERROR_INTERNAL;
+	{
+	  b_journaling_destroy (data);
+	  return B_ERROR_INTERNAL;
+	}
 
       while (other.left)
 	{
 	  pointer = b_io_seek (io, other.left, SEEK_SET);
 	  if (b_io_read (io, &other, sizeof (b_map_t)) <= 0)
-	    return B_ERROR_INTERNAL;
+	    {
+	      b_journaling_destroy (data);
+	      return B_ERROR_INTERNAL;
+	    }
 	}
 
+      b_journaling_new (data, io, B_JOURNALING_WRITE, pointer,
+			sizeof (b_map_t), &other);
+
       /* I change the parent link: */
       if (parent.left == cache->pointer)
 	parent.left = pointer;
@@ -135,7 +171,13 @@
 
 	  b_io_seek (io, other.parent, SEEK_SET);
 	  if (b_io_read (io, &other_p, sizeof (b_map_t)) <= 0)
-	    return B_ERROR_INTERNAL;
+	    {
+	      b_journaling_destroy (data);
+	      return B_ERROR_INTERNAL;
+	    }
+
+	  b_journaling_new (data, io, B_JOURNALING_WRITE, other.parent,
+			    sizeof (b_map_t), &other_p);
 
 	  if (other_p.left == pointer)
 	    other_p.left = other.right;
@@ -145,32 +187,53 @@
 	  b_io_seek (io, other.parent, SEEK_SET);
 	  if (b_io_write (io, &other_p, sizeof (b_map_t), data->max_cache) <=
 	      0)
-	    return B_ERROR_INTERNAL;
+	    {
+	      b_journaling_destroy (data);
+	      return B_ERROR_INTERNAL;
+	    }
 
 	  if (other.right)
 	    {
 	      b_io_seek (io, other.right, SEEK_SET);
 	      if (b_io_read (io, &other_r, sizeof (b_map_t)) <= 0)
-		return B_ERROR_INTERNAL;
+		{
+		  b_journaling_destroy (data);
+		  return B_ERROR_INTERNAL;
+		}
+
+	      b_journaling_new (data, io, B_JOURNALING_WRITE,
+				other.right, sizeof (b_map_t), &other_r);
 
 	      other_r.parent = other.parent;
 
 	      b_io_seek (io, other.right, SEEK_SET);
 	      if (b_io_write (io, &other_r, sizeof (b_map_t), data->max_cache)
 		  <= 0)
-		return B_ERROR_INTERNAL;
+		{
+		  b_journaling_destroy (data);
+		  return B_ERROR_INTERNAL;
+		}
 	    }
 
 	  b_io_seek (io, map.right, SEEK_SET);
 	  if (b_io_read (io, &other_r, sizeof (b_map_t)) <= 0)
-	    return B_ERROR_INTERNAL;
+	    {
+	      b_journaling_destroy (data);
+	      return B_ERROR_INTERNAL;
+	    }
+
+	  b_journaling_new (data, io, B_JOURNALING_WRITE, map.right,
+			    sizeof (b_map_t), &other_r);
 
 	  other_r.parent = pointer;
 
 	  b_io_seek (io, map.right, SEEK_SET);
 	  if (b_io_write (io, &other_r, sizeof (b_map_t), data->max_cache) <=
 	      0)
-	    return B_ERROR_INTERNAL;
+	    {
+	      b_journaling_destroy (data);
+	      return B_ERROR_INTERNAL;
+	    }
 
 	  other.right = map.right;
 	}
@@ -181,32 +244,51 @@
 
       b_io_seek (io, pointer, SEEK_SET);
       if (b_io_write (io, &other, sizeof (b_map_t), data->max_cache) <= 0)
-	return B_ERROR_INTERNAL;
+	{
+	  b_journaling_destroy (data);
+	  return B_ERROR_INTERNAL;
+	}
 
       /* The left child: */
       b_io_seek (io, map.left, SEEK_SET);
       if (b_io_read (io, &other, sizeof (b_map_t)) <= 0)
-	return B_ERROR_INTERNAL;
+	{
+	  b_journaling_destroy (data);
+	  return B_ERROR_INTERNAL;
+	}
+
+      b_journaling_new (data, io, B_JOURNALING_WRITE, map.left,
+			sizeof (b_map_t), &other);
 
       other.parent = pointer;
 
       b_io_seek (io, map.left, SEEK_SET);
       if (b_io_write (io, &other, sizeof (b_map_t), data->max_cache) <= 0)
-	return B_ERROR_INTERNAL;
+	{
+	  b_journaling_destroy (data);
+	  return B_ERROR_INTERNAL;
+	}
     }
 
   /* sync the parent: */
   b_io_seek (io, map.parent, SEEK_SET);
   if (b_io_write (io, &parent, sizeof (b_map_t), data->max_cache) <= 0)
-    return B_ERROR_INTERNAL;
+    {
+      b_journaling_destroy (data);
+      return B_ERROR_INTERNAL;
+    }
 
   /* Sync the node: */
   b_hash_zero (map.hash);
 
   b_io_seek (io, cache->pointer, SEEK_SET);
   if (b_io_write (io, &map, sizeof (b_map_t), data->max_cache) <= 0)
-    return B_ERROR_INTERNAL;
+    {
+      b_journaling_destroy (data);
+      return B_ERROR_INTERNAL;
+    }
 
+  b_journaling_destroy (data);
   return B_OK;
 }
 
@@ -234,9 +316,7 @@
 
   /* if it doesn't exist? */
   if ((error = b_get_triple_cache (data, triple, &cache)) != B_OK || !cache)
-    {
-      return error;
-    }
+    return error;
 
   if (cache->tmap_pointer)
     {
@@ -248,13 +328,16 @@
       if (b_io_read (data->triples_io, &tmap, sizeof (b_tmap_t)) <= 0)
 	return B_ERROR_INTERNAL;
 
+      b_journaling_new (data, data->triples_io, B_JOURNALING_WRITE,
+			cache->tmap_pointer, sizeof (b_tmap_t), &tmap);
+
       s_uri = s_bnode = p = o_uri = o_bnode = o_literal = c = d = l = 0;
 
       for (i = 0; i < B_TMAP_NUMB; i++)
 	{
 
 #define B_REMOVE_SWITCH( x , a ) \
-        if(!x && B_TMAP_DATA (tmap.a[i])==cache->tmap_index) \
+        if(!x && B_TMAP_DATA (tmap.a[i]) == cache->tmap_index) \
           x++; \
         \
         if (x) \
@@ -280,9 +363,14 @@
 
       b_io_seek (data->triples_io, cache->tmap_pointer, SEEK_SET);
 
-      if (b_io_write (data->triples_io, &tmap, sizeof (tmap), data->max_cache)
-	  <= 0)
-	return B_ERROR_POSIX;
+      if (b_io_write
+	  (data->triples_io, &tmap, sizeof (b_tmap_t), data->max_cache) <= 0)
+	{
+	  b_journaling_destroy (data);
+	  return B_ERROR_POSIX;
+	}
+
+      b_journaling_destroy (data);
 
       if ((error =
 	   b_tempty_check (data, &tmap, cache->tmap_pointer, 0)) != B_OK)

Modified: incubator/triplesoup/donations/TRIPLES-2-libb/src/bsync.c
URL: http://svn.apache.org/viewvc/incubator/triplesoup/donations/TRIPLES-2-libb/src/bsync.c?view=diff&rev=528519&r1=528518&r2=528519
==============================================================================
--- incubator/triplesoup/donations/TRIPLES-2-libb/src/bsync.c (original)
+++ incubator/triplesoup/donations/TRIPLES-2-libb/src/bsync.c Fri Apr 13 08:19:45 2007
@@ -68,8 +68,16 @@
     {
       b_error_t err;
 
+      /* This write must be protected: */
+      b_journaling_new (data, io, B_JOURNALING_CACHE_EMPTY);
+
       if ((err = b_sync_cache_empty (data, io)) != B_OK)
-	return err;
+	{
+	  b_journaling_destroy (data);
+	  return err;
+	}
+
+      b_journaling_destroy (data);
 
       /* Recursion: */
       return b_sync_cache (data, io, hash, what, len);
@@ -101,25 +109,44 @@
 	      /* Write the new element: */
 	      end = b_io_seek (io, 0, SEEK_END);
 
-	      if (b_io_write
-		  (io, &map, sizeof (b_map_t), data->max_cache) <= 0)
-		return B_ERROR_POSIX;
+	      b_journaling_new (data, io, B_JOURNALING_END_WRITE, end);
+
+	      if (b_io_write (io, &map, sizeof (b_map_t), data->max_cache) <=
+		  0)
+		{
+		  b_journaling_destroy (data);
+		  return B_ERROR_POSIX;
+		}
 
 	      if (map.len
 		  && b_io_write (io, what, map.len, data->max_cache) <= 0)
-		return B_ERROR_POSIX;
+		{
+		  b_journaling_destroy (data);
+		  return B_ERROR_POSIX;
+		}
 
 	      /* Set the left node to the parent: */
 	      b_io_seek (io, pointer, SEEK_SET);
 	      if (b_io_read (io, &m, sizeof (m)) <= 0)
-		return B_ERROR_INTERNAL;
+		{
+		  b_journaling_destroy (data);
+		  return B_ERROR_INTERNAL;
+		}
+
+	      b_journaling_new (data, io, B_JOURNALING_WRITE, pointer,
+				sizeof (b_map_t), &m);
 
 	      m.left = end;
 
 	      b_io_seek (io, pointer, SEEK_SET);
+
 	      if (b_io_write (io, &m, sizeof (b_map_t), data->max_cache) <= 0)
-		return B_ERROR_POSIX;
+		{
+		  b_journaling_destroy (data);
+		  return B_ERROR_POSIX;
+		}
 
+	      b_journaling_destroy (data);
 	      return B_OK;
 	    }
 	}
@@ -139,25 +166,44 @@
 	      /* Write the new element: */
 	      end = b_io_seek (io, 0, SEEK_END);
 
-	      if (b_io_write
-		  (io, &map, sizeof (b_map_t), data->max_cache) <= 0)
-		return B_ERROR_POSIX;
+	      b_journaling_new (data, io, B_JOURNALING_END_WRITE, end);
+
+	      if (b_io_write (io, &map, sizeof (b_map_t), data->max_cache) <=
+		  0)
+		{
+		  b_journaling_destroy (data);
+		  return B_ERROR_POSIX;
+		}
 
 	      if (map.len
 		  && b_io_write (io, what, map.len, data->max_cache) <= 0)
-		return B_ERROR_POSIX;
+		{
+		  b_journaling_destroy (data);
+		  return B_ERROR_POSIX;
+		}
 
 	      /* Set the right node to the parent: */
 	      b_io_seek (io, pointer, SEEK_SET);
 	      if (b_io_read (io, &m, sizeof (m)) <= 0)
-		return B_ERROR_INTERNAL;
+		{
+		  b_journaling_destroy (data);
+		  return B_ERROR_INTERNAL;
+		}
+
+	      b_journaling_new (data, io, B_JOURNALING_WRITE, pointer,
+				sizeof (b_map_t), &m);
 
 	      m.right = end;
 
 	      b_io_seek (io, pointer, SEEK_SET);
+
 	      if (b_io_write (io, &m, sizeof (b_map_t), data->max_cache) <= 0)
-		return B_ERROR_POSIX;
+		{
+		  b_journaling_destroy (data);
+		  return B_ERROR_POSIX;
+		}
 
+	      b_journaling_destroy (data);
 	      return B_OK;
 	    }
 	}
@@ -172,21 +218,39 @@
 {
   b_map_t map;
   b_error_t err;
+  b_string_t *str;
 
   memset (&map, 0, sizeof (b_map_t));
+  map.len = 1;
 
   if ((err = b_hash_new (data, (unsigned char *) "", 0, map.hash)) != B_OK)
     return err;
 
   b_io_seek (io, sizeof (b_uint64), SEEK_SET);
 
-  if (b_io_write (io, &map, sizeof (b_map_t), data->max_cache) <= 0)
-    return B_ERROR_POSIX;
+  if ((err = b_string_new (&str)) != B_OK)
+    return err;
 
-  if (map.len && b_io_write (io, "", 1, data->max_cache) <= 0)
-    return B_ERROR_POSIX;
+  if ((err =
+       b_string_add (str, (unsigned char *) &map, sizeof (b_map_t))) != B_OK)
+    {
+      b_string_destroy (str, NULL);
+      return err;
+    }
 
-  return B_OK;
+  if ((err = b_string_add (str, (unsigned char *) "", 1)) != B_OK)
+    {
+      b_string_destroy (str, NULL);
+      return err;
+    }
+
+  if (b_io_write (io, str->string, str->size, data->max_cache) <= 0)
+    {
+      b_string_destroy (str, NULL);
+      return B_ERROR_POSIX;
+    }
+
+  return b_string_destroy (str, NULL);
 }
 
 /* This function syncs a single triple list: */
@@ -404,6 +468,9 @@
 				      &write_data)) != B_OK)
 	    return error;
 
+	  b_journaling_new (data, data->triples_io,
+			    B_JOURNALING_END_WRITE, pointer);
+
 	  b_string_add (str, (unsigned char *) &tmap, sizeof (tmap));
 
 	  /* ...and later the triples: */
@@ -442,15 +509,25 @@
 
 	  /* Destroy of the b_string_t: */
 	  b_string_destroy (str, NULL);
+
+	  b_journaling_destroy (data);
 	}
       else
 	{
-	  b_io_seek (data->triples_io, pointer, SEEK_SET);
+	  b_uint64 pnew = pointer;
+
+	  pnew = b_io_seek (data->triples_io, pointer, SEEK_SET);
+
+	  b_journaling_new (data, data->triples_io, B_JOURNALING_WRITE,
+			    pnew, sizeof (b_tmap_t), NULL);
 
 	  if (b_io_write
 	      (data->triples_io, &tmap, sizeof (b_tmap_t),
 	       data->max_cache) <= 0)
-	    return B_ERROR_INTERNAL;
+	    {
+	      b_journaling_destroy (data);
+	      return B_ERROR_INTERNAL;
+	    }
 
 	  for (i = 0; i < B_TMAP_NUMB; i++)
 	    {
@@ -465,10 +542,17 @@
 		else \
 		  memset (&tmap_item, 0, sizeof (b_tmap_item_t)); \
                 \
+                b_journaling_new (data, data->triples_io, \
+				  B_JOURNALING_WRITE, pnew, \
+			          sizeof(b_tmap_item_t), NULL); \
+		\
 	        if (b_io_write (data->triples_io, &tmap_item, \
 			        sizeof (b_tmap_item_t), data->max_cache) \
 		    <= 0) \
-	          return B_ERROR_INTERNAL;
+		  { \
+		    b_journaling_destroy (data); \
+	            return B_ERROR_INTERNAL; \
+		  }
 
 		  B_SYNC_TCACHE3 (subject_uri);
 		  B_SYNC_TCACHE3 (subject_bnode);
@@ -481,8 +565,10 @@
 		  B_SYNC_TCACHE3 (lang);
 		}
 	      else
-		b_io_seek (data->triples_io, B_TRIPLE_SIZE, SEEK_CUR);
+		pnew = b_io_seek (data->triples_io, B_TRIPLE_SIZE, SEEK_CUR);
 	    }
+
+	  b_journaling_destroy (data);
 	}
 
       for (i = 0; i < B_TMAP_NUMB; i++)
@@ -588,12 +674,20 @@
   if (b_io_read (io, &instances, sizeof (instances)) <= 0)
     return B_ERROR_INTERNAL;
 
+  b_journaling_new (data, io, B_JOURNALING_WRITE, pointer,
+		    sizeof (b_uint64), &instances);
+
   instances += (add > 0 ? 1 : -1);
 
   b_io_seek (io, pointer, SEEK_SET);
 
   if (b_io_write (io, &instances, sizeof (instances), data->max_cache) <= 0)
-    return B_ERROR_INTERNAL;
+    {
+      b_journaling_destroy (data);
+      return B_ERROR_INTERNAL;
+    }
+
+  b_journaling_destroy (data);
 
   if (instances <= 0)
     return b_remove_type_cache (data, io, cache);

Modified: incubator/triplesoup/donations/TRIPLES-2-libb/src/btcache.c
URL: http://svn.apache.org/viewvc/incubator/triplesoup/donations/TRIPLES-2-libb/src/btcache.c?view=diff&rev=528519&r1=528518&r2=528519
==============================================================================
--- incubator/triplesoup/donations/TRIPLES-2-libb/src/btcache.c (original)
+++ incubator/triplesoup/donations/TRIPLES-2-libb/src/btcache.c Fri Apr 13 08:19:45 2007
@@ -96,7 +96,10 @@
   if (src->x) \
     { \
       if ((error = b_cache_copy (src->x, &new->x)) != B_OK) \
-	return error; \
+        { \
+	  b_tcache_destroy_single (NULL, NULL, new); \
+	  return error; \
+        } \
     }
 
   B_COPY_TCACHE (subject_uri);
@@ -134,7 +137,10 @@
   if (src->x) \
     { \
       if ((error = b_cache_copy_easy (src->x, &new->x)) != B_OK) \
-	return error; \
+        { \
+	  b_tcache_destroy_single (NULL, NULL, new); \
+	  return error; \
+        } \
     }
 
   B_COPY_TCACHE_EASY (subject_uri);

Modified: incubator/triplesoup/donations/TRIPLES-2-libb/src/btempty.c
URL: http://svn.apache.org/viewvc/incubator/triplesoup/donations/TRIPLES-2-libb/src/btempty.c?view=diff&rev=528519&r1=528518&r2=528519
==============================================================================
--- incubator/triplesoup/donations/TRIPLES-2-libb/src/btempty.c (original)
+++ incubator/triplesoup/donations/TRIPLES-2-libb/src/btempty.c Fri Apr 13 08:19:45 2007
@@ -45,6 +45,7 @@
 
       return B_OK;
     }
+
   /* Is it already in the list? */
   for (te = data->triples_empty; te; te = te->next)
     {

Modified: incubator/triplesoup/donations/TRIPLES-2-libb/src/btimer.c
URL: http://svn.apache.org/viewvc/incubator/triplesoup/donations/TRIPLES-2-libb/src/btimer.c?view=diff&rev=528519&r1=528518&r2=528519
==============================================================================
--- incubator/triplesoup/donations/TRIPLES-2-libb/src/btimer.c (original)
+++ incubator/triplesoup/donations/TRIPLES-2-libb/src/btimer.c Fri Apr 13 08:19:45 2007
@@ -10,7 +10,7 @@
 #include <b.h>
 
 #ifdef WIN32
-int
+static int
 gettimeofday (struct timeval *tv, void *tz)
 {
   struct _timeb timebuffer;

Added: incubator/triplesoup/donations/TRIPLES-2-libb/test/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/triplesoup/donations/TRIPLES-2-libb/test/Makefile.am?view=auto&rev=528519
==============================================================================
--- incubator/triplesoup/donations/TRIPLES-2-libb/test/Makefile.am (added)
+++ incubator/triplesoup/donations/TRIPLES-2-libb/test/Makefile.am Fri Apr 13 08:19:45 2007
@@ -0,0 +1,25 @@
+noinst_PROGRAMS = test1 test2 test3 test4 test5 test6 test7
+
+test1_SOURCES = test1.c
+test1_LDADD = ../src/libb.la
+
+test2_SOURCES = test2.c
+test2_LDADD = ../src/libb.la
+
+test3_SOURCES = test3.c
+test3_LDADD = ../src/libb.la
+
+test4_SOURCES = test4.c
+test4_LDADD = ../src/libb.la
+
+test5_SOURCES = test5.c
+test5_LDADD = ../src/libb.la
+
+test6_SOURCES = test6.c
+test6_LDADD = ../src/libb.la
+
+test7_SOURCES = test7.c
+test7_LDADD = ../src/libb.la
+
+INCLUDES = -I../src
+

Added: incubator/triplesoup/donations/TRIPLES-2-libb/test/Makefile.in
URL: http://svn.apache.org/viewvc/incubator/triplesoup/donations/TRIPLES-2-libb/test/Makefile.in?view=auto&rev=528519
==============================================================================
--- incubator/triplesoup/donations/TRIPLES-2-libb/test/Makefile.in (added)
+++ incubator/triplesoup/donations/TRIPLES-2-libb/test/Makefile.in Fri Apr 13 08:19:45 2007
@@ -0,0 +1,496 @@
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# 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@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+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 = :
+host_triplet = @host@
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_GTK_DOC_FALSE = @ENABLE_GTK_DOC_FALSE@
+ENABLE_GTK_DOC_TRUE = @ENABLE_GTK_DOC_TRUE@
+ENABLE_REDLAND_FALSE = @ENABLE_REDLAND_FALSE@
+ENABLE_REDLAND_TRUE = @ENABLE_REDLAND_TRUE@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GTK_DOC_USE_LIBTOOL_FALSE = @GTK_DOC_USE_LIBTOOL_FALSE@
+GTK_DOC_USE_LIBTOOL_TRUE = @GTK_DOC_USE_LIBTOOL_TRUE@
+HTML_DIR = @HTML_DIR@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+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@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+noinst_PROGRAMS = test1 test2 test3 test4 test5 test6 test7
+
+test1_SOURCES = test1.c
+test1_LDADD = ../src/libb.la
+
+test2_SOURCES = test2.c
+test2_LDADD = ../src/libb.la
+
+test3_SOURCES = test3.c
+test3_LDADD = ../src/libb.la
+
+test4_SOURCES = test4.c
+test4_LDADD = ../src/libb.la
+
+test5_SOURCES = test5.c
+test5_LDADD = ../src/libb.la
+
+test6_SOURCES = test6.c
+test6_LDADD = ../src/libb.la
+
+test7_SOURCES = test7.c
+test7_LDADD = ../src/libb.la
+
+INCLUDES = -I../src
+subdir = test
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+noinst_PROGRAMS = test1$(EXEEXT) test2$(EXEEXT) test3$(EXEEXT) \
+	test4$(EXEEXT) test5$(EXEEXT) test6$(EXEEXT) test7$(EXEEXT)
+PROGRAMS = $(noinst_PROGRAMS)
+
+am_test1_OBJECTS = test1.$(OBJEXT)
+test1_OBJECTS = $(am_test1_OBJECTS)
+test1_DEPENDENCIES = ../src/libb.la
+test1_LDFLAGS =
+am_test2_OBJECTS = test2.$(OBJEXT)
+test2_OBJECTS = $(am_test2_OBJECTS)
+test2_DEPENDENCIES = ../src/libb.la
+test2_LDFLAGS =
+am_test3_OBJECTS = test3.$(OBJEXT)
+test3_OBJECTS = $(am_test3_OBJECTS)
+test3_DEPENDENCIES = ../src/libb.la
+test3_LDFLAGS =
+am_test4_OBJECTS = test4.$(OBJEXT)
+test4_OBJECTS = $(am_test4_OBJECTS)
+test4_DEPENDENCIES = ../src/libb.la
+test4_LDFLAGS =
+am_test5_OBJECTS = test5.$(OBJEXT)
+test5_OBJECTS = $(am_test5_OBJECTS)
+test5_DEPENDENCIES = ../src/libb.la
+test5_LDFLAGS =
+am_test6_OBJECTS = test6.$(OBJEXT)
+test6_OBJECTS = $(am_test6_OBJECTS)
+test6_DEPENDENCIES = ../src/libb.la
+test6_LDFLAGS =
+am_test7_OBJECTS = test7.$(OBJEXT)
+test7_OBJECTS = $(am_test7_OBJECTS)
+test7_DEPENDENCIES = ../src/libb.la
+test7_LDFLAGS =
+
+DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/test1.Po ./$(DEPDIR)/test2.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/test3.Po ./$(DEPDIR)/test4.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/test5.Po ./$(DEPDIR)/test6.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/test7.Po
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
+	$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+DIST_SOURCES = $(test1_SOURCES) $(test2_SOURCES) $(test3_SOURCES) \
+	$(test4_SOURCES) $(test5_SOURCES) $(test6_SOURCES) \
+	$(test7_SOURCES)
+DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
+SOURCES = $(test1_SOURCES) $(test2_SOURCES) $(test3_SOURCES) $(test4_SOURCES) $(test5_SOURCES) $(test6_SOURCES) $(test7_SOURCES)
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  test/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+
+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
+test1$(EXEEXT): $(test1_OBJECTS) $(test1_DEPENDENCIES) 
+	@rm -f test1$(EXEEXT)
+	$(LINK) $(test1_LDFLAGS) $(test1_OBJECTS) $(test1_LDADD) $(LIBS)
+test2$(EXEEXT): $(test2_OBJECTS) $(test2_DEPENDENCIES) 
+	@rm -f test2$(EXEEXT)
+	$(LINK) $(test2_LDFLAGS) $(test2_OBJECTS) $(test2_LDADD) $(LIBS)
+test3$(EXEEXT): $(test3_OBJECTS) $(test3_DEPENDENCIES) 
+	@rm -f test3$(EXEEXT)
+	$(LINK) $(test3_LDFLAGS) $(test3_OBJECTS) $(test3_LDADD) $(LIBS)
+test4$(EXEEXT): $(test4_OBJECTS) $(test4_DEPENDENCIES) 
+	@rm -f test4$(EXEEXT)
+	$(LINK) $(test4_LDFLAGS) $(test4_OBJECTS) $(test4_LDADD) $(LIBS)
+test5$(EXEEXT): $(test5_OBJECTS) $(test5_DEPENDENCIES) 
+	@rm -f test5$(EXEEXT)
+	$(LINK) $(test5_LDFLAGS) $(test5_OBJECTS) $(test5_LDADD) $(LIBS)
+test6$(EXEEXT): $(test6_OBJECTS) $(test6_DEPENDENCIES) 
+	@rm -f test6$(EXEEXT)
+	$(LINK) $(test6_LDFLAGS) $(test6_OBJECTS) $(test6_LDADD) $(LIBS)
+test7$(EXEEXT): $(test7_OBJECTS) $(test7_DEPENDENCIES) 
+	@rm -f test7$(EXEEXT)
+	$(LINK) $(test7_LDFLAGS) $(test7_OBJECTS) $(test7_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT) core *.core
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test1.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test3.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test4.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test5.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test6.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test7.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+@am__fastdepCC_TRUE@	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+@am__fastdepCC_TRUE@	fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
+
+.c.obj:
+@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+@am__fastdepCC_TRUE@	  -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+@am__fastdepCC_TRUE@	fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
+
+.c.lo:
+@am__fastdepCC_TRUE@	if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+@am__fastdepCC_TRUE@	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
+@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+@am__fastdepCC_TRUE@	fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ETAGS = etags
+ETAGSFLAGS =
+
+CTAGS = ctags
+CTAGSFLAGS =
+
+tags: TAGS
+
+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; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+
+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; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(ETAGS_ARGS)$$tags$$unique" \
+	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	     $$tags $$unique
+
+ctags: CTAGS
+CTAGS:  $(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; } \
+	       END { 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
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkinstalldirs) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    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:
+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:
+	-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-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-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+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-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am info info-am install \
+	install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	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-info-am
+
+# 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:

Added: incubator/triplesoup/donations/TRIPLES-2-libb/test/test1.c
URL: http://svn.apache.org/viewvc/incubator/triplesoup/donations/TRIPLES-2-libb/test/test1.c?view=auto&rev=528519
==============================================================================
--- incubator/triplesoup/donations/TRIPLES-2-libb/test/test1.c (added)
+++ incubator/triplesoup/donations/TRIPLES-2-libb/test/test1.c Fri Apr 13 08:19:45 2007
@@ -0,0 +1,39 @@
+#include <b.h>
+
+#ifdef WIN32
+#define TEST1_FILE ".\\TEST1"
+#else
+#define TEST1_FILE "/tmp/test1"
+#endif
+
+int
+main (void)
+{
+  b_t *b;
+  b_uint64 value;
+  b_error_t err;
+
+  fprintf (stderr, "Creating new b struct... ");
+  if ((err = b_new (&b, (unsigned char *) TEST1_FILE)) != B_OK)
+    {
+      fprintf (stderr, "b_new: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "done.\nSetting the cache max to 16... ");
+  b_set_max_cache (b, 16);
+
+  fprintf (stderr, "done.\nGetting the cache max... ");
+  b_get_max_cache (b, &value);
+
+  fprintf (stderr, "%d.\nDestroing the b struct... ", (int) value);
+
+  if ((err = b_destroy (b)) != B_OK)
+    {
+      fprintf (stderr, "b_destroy: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "done.\n");
+  return 0;
+}

Added: incubator/triplesoup/donations/TRIPLES-2-libb/test/test2.c
URL: http://svn.apache.org/viewvc/incubator/triplesoup/donations/TRIPLES-2-libb/test/test2.c?view=auto&rev=528519
==============================================================================
--- incubator/triplesoup/donations/TRIPLES-2-libb/test/test2.c (added)
+++ incubator/triplesoup/donations/TRIPLES-2-libb/test/test2.c Fri Apr 13 08:19:45 2007
@@ -0,0 +1,63 @@
+#include <b.h>
+
+#define TEST2_MAX 1024
+
+#ifdef WIN32
+#define snprintf sprintf_s
+#define TEST2_FILE ".\\TEST2"
+#else
+#define TEST2_FILE "/tmp/test2"
+#endif
+
+
+int
+main (int argc, char **argv)
+{
+  b_t *b;
+  int i, c, m;
+  b_error_t err;
+
+  fprintf (stderr, "Creating new b struct... ");
+  if ((err = b_new (&b, (unsigned char *) TEST2_FILE)) != B_OK)
+    {
+      fprintf (stderr, "b_new: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  if (argc > 1 && (c = atoi (argv[1])))
+    {
+      fprintf (stderr, "done.\nSetting cache to %d... ", c);
+      b_set_max_cache (b, c);
+    }
+
+  if (argc <= 2 || !(m = atoi (argv[2])))
+    m = TEST2_MAX;
+
+  fprintf (stderr, "done.\nStoring %d datas...", m);
+
+  for (i = 0; i < m; i++)
+    {
+      char s[128];
+
+      snprintf (s, sizeof (s), "test %d", i);
+
+      if ((err =
+	   b_add_type (b, B_TYPE_URI, (unsigned char *) s,
+		       i % 2 ? 0 : strlen (s))) != B_OK)
+	{
+	  fprintf (stderr, "b_add: %s\n", b_strerror (err));
+	  return 1;
+	}
+    }
+
+  fprintf (stderr, "done.\nDestroing the b struct... ");
+
+  if ((err = b_destroy (b)) != B_OK)
+    {
+      fprintf (stderr, "b_destroy: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "done.\n");
+  return 0;
+}

Added: incubator/triplesoup/donations/TRIPLES-2-libb/test/test3.c
URL: http://svn.apache.org/viewvc/incubator/triplesoup/donations/TRIPLES-2-libb/test/test3.c?view=auto&rev=528519
==============================================================================
--- incubator/triplesoup/donations/TRIPLES-2-libb/test/test3.c (added)
+++ incubator/triplesoup/donations/TRIPLES-2-libb/test/test3.c Fri Apr 13 08:19:45 2007
@@ -0,0 +1,94 @@
+#include <b.h>
+
+#define TEST3_MAX 4096
+
+#ifdef WIN32
+#define snprintf sprintf_s
+#define TEST3_FILE ".\\TEST3"
+#else
+#define TEST3_FILE "/tmp/test3"
+#endif
+
+int
+main (int argc, char **argv)
+{
+  b_t *b;
+  char s[128];
+  int i, c, m;
+  b_error_t err;
+
+  b_iterator_type_t *iterator;
+  unsigned char *what;
+  b_uint64 size;
+
+  fprintf (stderr, "Creating new b struct... ");
+  if ((err = b_new (&b, (unsigned char *) TEST3_FILE)) != B_OK)
+    {
+      fprintf (stderr, "b_new: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  if (argc > 1 && (c = atoi (argv[1])))
+    {
+      fprintf (stderr, "done.\nSetting cache to %d... ", c);
+      b_set_max_cache (b, c);
+    }
+
+  if (argc <= 2 || !(m = atoi (argv[2])))
+    m = TEST3_MAX;
+
+  fprintf (stderr, "done.\nStoring %d datas...", m);
+
+  for (i = 0; i < m; i++)
+    {
+      snprintf (s, sizeof (s), "test %d", i);
+
+      if ((err =
+	   b_add_type (b, B_TYPE_URI, (unsigned char *) s,
+		       i % 2 ? 0 : strlen (s))) != B_OK)
+	{
+	  fprintf (stderr, "b_add: %s\n", b_strerror (err));
+	  return 1;
+	}
+    }
+
+  fprintf (stderr, "done.\nCreating a iterator type... ");
+  if ((err = b_iterator_type_new (b, B_TYPE_URI, &iterator)) != B_OK)
+    {
+      fprintf (stderr, "b_iterator_new: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "done.\n");
+
+  while ((err = b_iterator_type_step (iterator, &what, &size)) == B_OK
+	 && what)
+    {
+      fprintf (stderr, "Next Data: %s (%d)\n", what, (int) size);
+      free (what);
+    }
+
+  if (err != B_OK)
+    {
+      fprintf (stderr, "b_iterator_step: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "done.\nDestroying the iterator type... ");
+  if ((err = b_iterator_type_destroy (iterator)) != B_OK)
+    {
+      fprintf (stderr, "b_iterator_destroy: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "done.\nDestroing the b struct... ");
+
+  if ((err = b_destroy (b)) != B_OK)
+    {
+      fprintf (stderr, "b_destroy: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "done.\n");
+  return 0;
+}

Added: incubator/triplesoup/donations/TRIPLES-2-libb/test/test4.c
URL: http://svn.apache.org/viewvc/incubator/triplesoup/donations/TRIPLES-2-libb/test/test4.c?view=auto&rev=528519
==============================================================================
--- incubator/triplesoup/donations/TRIPLES-2-libb/test/test4.c (added)
+++ incubator/triplesoup/donations/TRIPLES-2-libb/test/test4.c Fri Apr 13 08:19:45 2007
@@ -0,0 +1,139 @@
+#include <b.h>
+
+#define TEST4_MAX 4096
+
+#ifdef WIN32
+#define snprintf sprintf_s
+#define TEST4_FILE ".\\TEST4"
+#else
+#define TEST4_FILE "/tmp/test4"
+#endif
+
+int
+main (int argc, char **argv)
+{
+  b_t *b;
+  b_triple_t *triple;
+  char subject[128];
+  int subject_type;
+  char property[128];
+  char object[128];
+  int object_type;
+  char context[128];
+  int context_type;
+  char datatype[128];
+  int datatype_type;
+  char lang[128];
+  int lang_type;
+  int i, m, c;
+  b_error_t err;
+
+  b_iterator_triple_t *iterator;
+
+  fprintf (stderr, "Creating new b struct... ");
+  if ((err = b_new (&b, (unsigned char *) TEST4_FILE)) != B_OK)
+    {
+      fprintf (stderr, "b_new: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  if (argc > 1 && (c = atoi (argv[1])))
+    {
+      fprintf (stderr, "done.\nSetting cache to %d... ", c);
+      b_set_max_cache (b, c);
+    }
+
+  if (argc <= 2 || !(m = atoi (argv[2])))
+    m = TEST4_MAX;
+
+  fprintf (stderr, "done.\nStoring %d triples...", m);
+
+  for (i = 0; i < m; i++)
+    {
+      subject_type = i % 2;
+      snprintf (subject, sizeof (subject), "subject %d %s", i % 111,
+		!subject_type ? "uri" : "bnode");
+
+      snprintf (property, sizeof (property), "property %d", i);
+
+      object_type = i % 3;
+      snprintf (object, sizeof (object), "object %d %s", i % 333,
+		!object_type ? "uri" : object_type ==
+		1 ? "bnode" : "literal");
+
+      context_type = i % 4;
+      snprintf (context, sizeof (context), "context %d", i % 222);
+
+      datatype_type = i % 5;
+      snprintf (datatype, sizeof (datatype), "datatype %d", i % 222);
+
+      lang_type = i % 6;
+      snprintf (lang, sizeof (lang), "lang %d", i % 222);
+
+      if ((err =
+	   b_triple_new (&triple,
+			 !subject_type ? (unsigned char *) subject : NULL, 0,
+			 !subject_type ? NULL : (unsigned char *) subject, 0,
+			 (unsigned char *) property, 0,
+			 !object_type ? (unsigned char *) object : NULL, 0,
+			 object_type == 1 ? (unsigned char *) object : NULL,
+			 0,
+			 object_type == 2 ? (unsigned char *) object : NULL,
+			 0, context_type ? (unsigned char *) context : NULL,
+			 0, datatype_type ? (unsigned char *) datatype : NULL,
+			 0, lang_type ? (unsigned char *) lang : NULL,
+			 0)) != B_OK)
+	{
+	  fprintf (stderr, "b_triple_new: %s\n", b_strerror (err));
+	  return 1;
+	}
+
+      if ((err = b_add_triple (b, triple)) != B_OK)
+	{
+	  fprintf (stderr, "b_add: %s\n", b_strerror (err));
+	  return 1;
+	}
+
+      b_triple_destroy (triple);
+    }
+
+  fprintf (stderr, "done.\nCreating iterator... ");
+  if ((err = b_iterator_triple_new (b, &iterator, NULL)) != B_OK)
+    {
+      fprintf (stderr, "b_iterator_new: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "done.\n");
+
+  while ((err = b_iterator_triple_step (iterator, &triple)) == B_OK && triple)
+    {
+      fprintf (stderr, "Next data: ");
+      b_triple_print (stderr, triple);
+      b_triple_destroy (triple);
+    }
+
+  if (err != B_OK)
+    {
+      fprintf (stderr, "b_iterator_step: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "Destroying iterator... ");
+  if ((err = b_iterator_triple_destroy (iterator)) != B_OK)
+    {
+      fprintf (stderr, "b_iterator_destroy: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "done.\nDestroing the b struct... ");
+
+  if ((err = b_destroy (b)) != B_OK)
+    {
+      fprintf (stderr, "b_destroy: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "done.\n");
+  return 0;
+}

Added: incubator/triplesoup/donations/TRIPLES-2-libb/test/test5.c
URL: http://svn.apache.org/viewvc/incubator/triplesoup/donations/TRIPLES-2-libb/test/test5.c?view=auto&rev=528519
==============================================================================
--- incubator/triplesoup/donations/TRIPLES-2-libb/test/test5.c (added)
+++ incubator/triplesoup/donations/TRIPLES-2-libb/test/test5.c Fri Apr 13 08:19:45 2007
@@ -0,0 +1,158 @@
+#include <b.h>
+
+#define TEST5_MAX 1024
+
+#ifdef WIN32
+#define snprintf sprintf_s
+#define TEST5_FILE ".\\TEST5"
+#else
+#define TEST5_FILE "/tmp/test5"
+#endif
+
+int
+main (int argc, char **argv)
+{
+  b_t *b;
+  b_triple_t *triple;
+  char subject[128];
+  int subject_type;
+  char property[128];
+  char object[128];
+  int object_type;
+  char context[128];
+  int context_type;
+  char datatype[128];
+  int datatype_type;
+  char lang[128];
+  int lang_type;
+  int i, m, c;
+  b_uint64 count;
+  b_error_t err;
+
+  fprintf (stderr, "Creating new b struct... ");
+  if ((err = b_new (&b, (unsigned char *) TEST5_FILE)) != B_OK)
+    {
+      fprintf (stderr, "b_new: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  if (argc > 1 && (c = atoi (argv[1])))
+    {
+      fprintf (stderr, "done.\nSetting cache to %d... ", c);
+      b_set_max_cache (b, c);
+    }
+
+  if (argc <= 2 || !(m = atoi (argv[2])))
+    m = TEST5_MAX;
+
+  fprintf (stderr, "done.\nStoring %d triples...", m);
+
+  for (i = 0; i < m; i++)
+    {
+      subject_type = i % 2;
+      snprintf (subject, sizeof (subject), "subject %d %s", i % 111,
+		!subject_type ? "uri" : "bnode");
+
+      snprintf (property, sizeof (property), "property %d", i % 222);
+
+      object_type = i % 3;
+      snprintf (object, sizeof (object), "object %d %s", i % 333,
+		!object_type ? "uri" : object_type ==
+		1 ? "bnode" : "literal");
+
+      context_type = i % 4;
+      snprintf (context, sizeof (context), "context %d", i % 222);
+
+      datatype_type = i % 6;
+      snprintf (datatype, sizeof (datatype), "datatype %d", i % 222);
+
+      lang_type = i % 6;
+      snprintf (lang, sizeof (lang), "lang %d", i % 222);
+
+      if ((err =
+	   b_triple_new (&triple,
+			 !subject_type ? (unsigned char *) subject : NULL, 0,
+			 !subject_type ? NULL : (unsigned char *) subject, 0,
+			 (unsigned char *) property, 0,
+			 !object_type ? (unsigned char *) object : NULL, 0,
+			 object_type == 1 ? (unsigned char *) object : NULL,
+			 0,
+			 object_type == 2 ? (unsigned char *) object : NULL,
+			 0, context_type ? (unsigned char *) context : NULL,
+			 0, datatype_type ? (unsigned char *) datatype : NULL,
+			 0, lang_type ? (unsigned char *) lang : NULL,
+			 0)) != B_OK)
+	{
+	  fprintf (stderr, "b_triple_new: %s\n", b_strerror (err));
+	  return 1;
+	}
+
+      if ((err = b_add_triple (b, triple)) != B_OK)
+	{
+	  fprintf (stderr, "b_triple_new: %s\n", b_strerror (err));
+	  return 1;
+	}
+
+      b_triple_destroy (triple);
+    }
+
+  fprintf (stderr, "done.\nNumber of uris: ");
+  if ((err = b_count_type (b, B_TYPE_URI, &count)) != B_OK)
+    {
+      fprintf (stderr, "b_destroy: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "%d\nNumber of properties: ", (int) count);
+  if ((err = b_count_type (b, B_TYPE_PROPERTY, &count)) != B_OK)
+    {
+      fprintf (stderr, "b_destroy: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "%d\nNumber of literals: ", (int) count);
+  if ((err = b_count_type (b, B_TYPE_LITERAL, &count)) != B_OK)
+    {
+      fprintf (stderr, "b_destroy: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "%d\nNumber of bnodes: ", (int) count);
+  if ((err = b_count_type (b, B_TYPE_BNODE, &count)) != B_OK)
+    {
+      fprintf (stderr, "b_destroy: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "%d\nNumber of contexts: ", (int) count);
+  if ((err = b_count_type (b, B_TYPE_CONTEXT, &count)) != B_OK)
+    {
+      fprintf (stderr, "b_destroy: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "%d\nNumber of datatypes: ", (int) count);
+  if ((err = b_count_type (b, B_TYPE_DATATYPE, &count)) != B_OK)
+    {
+      fprintf (stderr, "b_destroy: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "%d\nNumber of triples: ", (int) count);
+  if ((err = b_count_triple (b, &count)) != B_OK)
+    {
+      fprintf (stderr, "b_destroy: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "%d\nDestroing the b struct... ", (int) count);
+
+  if ((err = b_destroy (b)) != B_OK)
+    {
+      fprintf (stderr, "b_destroy: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "done.\n");
+  return 0;
+}

Added: incubator/triplesoup/donations/TRIPLES-2-libb/test/test6.c
URL: http://svn.apache.org/viewvc/incubator/triplesoup/donations/TRIPLES-2-libb/test/test6.c?view=auto&rev=528519
==============================================================================
--- incubator/triplesoup/donations/TRIPLES-2-libb/test/test6.c (added)
+++ incubator/triplesoup/donations/TRIPLES-2-libb/test/test6.c Fri Apr 13 08:19:45 2007
@@ -0,0 +1,155 @@
+#include <b.h>
+
+#define TEST6_MAX 1024
+
+#ifdef WIN32
+#define snprintf sprintf_s
+#define TEST6_FILE ".\\TEST6"
+#else
+#define TEST6_FILE "/tmp/test6"
+#endif
+
+int
+main (int argc, char **argv)
+{
+  b_t *b;
+  b_triple_t *triple;
+  b_triple_t *compare;
+  char subject[128];
+  int subject_type;
+  char property[128];
+  char object[128];
+  int object_type;
+  char context[128];
+  int context_type;
+  char datatype[128];
+  char lang[128];
+  int lang_type;
+  int i, m, c;
+  b_error_t err;
+
+  b_iterator_triple_t *iterator;
+
+  fprintf (stderr, "Creating new b struct... ");
+  if ((err = b_new (&b, (unsigned char *) TEST6_FILE)) != B_OK)
+    {
+      fprintf (stderr, "b_new: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  if (argc > 1 && (c = atoi (argv[1])))
+    {
+      fprintf (stderr, "done.\nSetting cache to %d... ", c);
+      b_set_max_cache (b, c);
+    }
+
+  if (argc <= 2 || !(m = atoi (argv[2])))
+    m = TEST6_MAX;
+
+  fprintf (stderr, "done.\nStoring %d triples...", m);
+  snprintf (datatype, sizeof (datatype), "datatype");
+
+  for (i = 0; i < m; i++)
+    {
+      subject_type = i % 2;
+      snprintf (subject, sizeof (subject), "subject %d %s", i % 111,
+		!subject_type ? "uri" : "bnode");
+
+      snprintf (property, sizeof (property), "property %d", i);
+
+      object_type = i % 3;
+      snprintf (object, sizeof (object), "object %d %s", i % 333,
+		!object_type ? "uri" : object_type ==
+		1 ? "bnode" : "literal");
+
+      context_type = i % 4;
+      snprintf (context, sizeof (context), "context %d", i % 222);
+
+      lang_type = i % 7;
+      snprintf (lang, sizeof (lang), "lang %d", i % 222);
+
+      if ((err =
+	   b_triple_new (&triple,
+			 !subject_type ? (unsigned char *) subject : NULL, 0,
+			 !subject_type ? NULL : (unsigned char *) subject, 0,
+			 (unsigned char *) property, 0,
+			 !object_type ? (unsigned char *) object : NULL, 0,
+			 object_type == 1 ? (unsigned char *) object : NULL, 0,
+			 object_type == 2 ? (unsigned char *) object : NULL, 0, 
+			 context_type ? (unsigned char *) context : NULL, 0, 
+			 (unsigned char *)datatype, 0, 
+			 lang_type ? (unsigned char *) lang : NULL,
+			 0)) != B_OK)
+	{
+	  fprintf (stderr, "b_triple_new: %s\n", b_strerror (err));
+	  return 1;
+	}
+
+      if ((err = b_add_triple (b, triple)) != B_OK)
+	{
+	  fprintf (stderr, "b_triple_new: %s\n", b_strerror (err));
+	  return 1;
+	}
+
+      b_triple_destroy (triple);
+    }
+
+  fprintf (stderr, "done.\nCreating a incomplete triple...");
+
+  if ((err =
+       b_triple_new_incomplete (&compare, NULL, 0, NULL, 0, NULL, 0, NULL, 0,
+				NULL, 0, NULL, 0, NULL, 0,
+				(unsigned char *) "datatype", 0, NULL,
+				0)) != B_OK)
+    {
+      fprintf (stderr, "b_triple_new_incomplete: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "done.\nCreating iterator... ");
+  if ((err = b_iterator_triple_new (b, &iterator, compare)) != B_OK)
+    {
+      fprintf (stderr, "b_iterator_new: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "done.\nDestroing the incomplete triple...");
+  if ((err = b_triple_destroy (compare)) != B_OK)
+    {
+      fprintf (stderr, "b_triple_desotry: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "done.\n");
+
+  while ((err = b_iterator_triple_step (iterator, &triple)) == B_OK && triple)
+    {
+      fprintf (stderr, "Next data: ");
+      b_triple_print (stderr, triple);
+      b_triple_destroy (triple);
+    }
+
+  if (err != B_OK)
+    {
+      fprintf (stderr, "b_iterator_step: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "Destroying iterator... ");
+  if ((err = b_iterator_triple_destroy (iterator)) != B_OK)
+    {
+      fprintf (stderr, "b_iterator_destroy: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "done.\nDestroing the b struct... ");
+
+  if ((err = b_destroy (b)) != B_OK)
+    {
+      fprintf (stderr, "b_destroy: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "done.\n");
+  return 0;
+}

Added: incubator/triplesoup/donations/TRIPLES-2-libb/test/test7.c
URL: http://svn.apache.org/viewvc/incubator/triplesoup/donations/TRIPLES-2-libb/test/test7.c?view=auto&rev=528519
==============================================================================
--- incubator/triplesoup/donations/TRIPLES-2-libb/test/test7.c (added)
+++ incubator/triplesoup/donations/TRIPLES-2-libb/test/test7.c Fri Apr 13 08:19:45 2007
@@ -0,0 +1,194 @@
+#include <b.h>
+
+#define TEST7_MAX 1024
+
+#ifdef WIN32
+#define snprintf sprintf_s
+#define TEST7_FILE ".\\TEST7"
+#else
+#define TEST7_FILE "/tmp/test7"
+#endif
+
+int
+main (int argc, char **argv)
+{
+  b_t *b;
+  b_triple_t *triple;
+  char subject[128];
+  int subject_type;
+  char property[128];
+  char object[128];
+  int object_type;
+  char context[128];
+  int context_type;
+  char datatype[128];
+  char lang[128];
+  int lang_type;
+  int i, m, c;
+  b_error_t err;
+
+  b_iterator_triple_t *iterator;
+
+  fprintf (stderr, "Creating new b struct... ");
+  if ((err = b_new (&b, (unsigned char *) TEST7_FILE)) != B_OK)
+    {
+      fprintf (stderr, "b_new: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  if (argc > 1 && (c = atoi (argv[1])))
+    {
+      fprintf (stderr, "done.\nSetting cache to %d... ", c);
+      b_set_max_cache (b, c);
+    }
+
+  if (argc <= 2 || !(m = atoi (argv[2])))
+    m = TEST7_MAX;
+
+  fprintf (stderr, "done.\nStoring %d triples...", m);
+
+  for (i = 0; i < m; i++)
+    {
+      subject_type = i % 2;
+      snprintf (subject, sizeof (subject), "subject %d %s", i % 111,
+		!subject_type ? "uri" : "bnode");
+
+      snprintf (property, sizeof (property), "property %d", i);
+
+      object_type = i % 3;
+      snprintf (object, sizeof (object), "object %d %s", i % 333,
+		!object_type ? "uri" : object_type ==
+		1 ? "bnode" : "literal");
+
+      context_type = i % 4;
+      snprintf (context, sizeof (context), "context %d", i % 222);
+
+      snprintf (datatype, sizeof (datatype), "datatype");
+
+      lang_type = i % 7;
+      snprintf (lang, sizeof (lang), "lang %d", i % 222);
+
+      if ((err =
+	   b_triple_new (&triple,
+			 !subject_type ? (unsigned char *) subject : NULL, 0,
+			 !subject_type ? NULL : (unsigned char *) subject, 0,
+			 (unsigned char *) property, 0,
+			 !object_type ? (unsigned char *) object : NULL, 0,
+			 object_type == 1 ? (unsigned char *) object : NULL,
+			 0,
+			 object_type == 2 ? (unsigned char *) object : NULL,
+			 0, context_type ? (unsigned char *) context : NULL,
+			 0, (unsigned char *) datatype,
+			 0, lang_type ? (unsigned char *) lang : NULL,
+			 0)) != B_OK)
+	{
+	  fprintf (stderr, "b_triple_new: %s\n", b_strerror (err));
+	  return 1;
+	}
+
+      if ((err = b_add_triple (b, triple)) != B_OK)
+	{
+	  fprintf (stderr, "b_triple_new: %s\n", b_strerror (err));
+	  return 1;
+	}
+
+      b_triple_destroy (triple);
+    }
+
+  fprintf (stderr, "done.\nDeleting %d triples...", m / 2);
+
+  for (i = 0; i < m; i++)
+    {
+      if ((i % 2))
+	{
+	  subject_type = i % 2;
+	  snprintf (subject, sizeof (subject), "subject %d %s", i % 111,
+		    !subject_type ? "uri" : "bnode");
+
+	  snprintf (property, sizeof (property), "property %d", i);
+
+	  object_type = i % 3;
+	  snprintf (object, sizeof (object), "object %d %s", i % 333,
+		    !object_type ? "uri" : object_type ==
+		    1 ? "bnode" : "literal");
+
+	  context_type = i % 4;
+	  snprintf (context, sizeof (context), "context %d", i % 222);
+
+	  snprintf (datatype, sizeof (datatype), "datatype");
+
+	  lang_type = i % 7;
+	  snprintf (lang, sizeof (lang), "lang %d", i % 222);
+
+	  if ((err =
+	       b_triple_new (&triple,
+			     !subject_type ? (unsigned char *) subject : NULL,
+			     0,
+			     !subject_type ? NULL : (unsigned char *) subject,
+			     0, (unsigned char *) property, 0,
+			     !object_type ? (unsigned char *) object : NULL,
+			     0,
+			     object_type ==
+			     1 ? (unsigned char *) object : NULL, 0,
+			     object_type ==
+			     2 ? (unsigned char *) object : NULL, 0,
+			     context_type ? (unsigned char *) context : NULL,
+			     0,
+			     (unsigned char *) datatype, 0,
+			     lang_type ? (unsigned char *) lang : NULL,
+			     0)) != B_OK)
+	    {
+	      fprintf (stderr, "b_triple_new: %s\n", b_strerror (err));
+	      return 1;
+	    }
+
+	  if ((err = b_remove_triple (b, triple)) != B_OK)
+	    {
+	      fprintf (stderr, "b_triple_new: %s\n", b_strerror (err));
+	      return 1;
+	    }
+
+	  b_triple_destroy (triple);
+	}
+    }
+
+  fprintf (stderr, "done.\nCreating iterator... ");
+  if ((err = b_iterator_triple_new (b, &iterator, NULL)) != B_OK)
+    {
+      fprintf (stderr, "b_iterator_new: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "done.\n");
+
+  while ((err = b_iterator_triple_step (iterator, &triple)) == B_OK && triple)
+    {
+      fprintf (stderr, "Next data: ");
+      b_triple_print (stderr, triple);
+      b_triple_destroy (triple);
+    }
+
+  if (err != B_OK)
+    {
+      fprintf (stderr, "b_iterator_step: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "Destroying iterator... ");
+  if ((err = b_iterator_triple_destroy (iterator)) != B_OK)
+    {
+      fprintf (stderr, "b_iterator_destroy: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "done.\nDestroing the b struct... ");
+
+  if ((err = b_destroy (b)) != B_OK)
+    {
+      fprintf (stderr, "b_destroy: %s\n", b_strerror (err));
+      return 1;
+    }
+
+  fprintf (stderr, "done.\n");
+  return 0;
+}

Added: incubator/triplesoup/donations/TRIPLES-2-libb/utils/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/triplesoup/donations/TRIPLES-2-libb/utils/Makefile.am?view=auto&rev=528519
==============================================================================
--- incubator/triplesoup/donations/TRIPLES-2-libb/utils/Makefile.am (added)
+++ incubator/triplesoup/donations/TRIPLES-2-libb/utils/Makefile.am Fri Apr 13 08:19:45 2007
@@ -0,0 +1,15 @@
+if ENABLE_REDLAND
+  rdf2b = rdf2b
+  LIBS = -lrdf
+endif
+
+bin_PROGRAMS = bproc $(rdf2b)
+
+bproc_SOURCES = bproc.c
+bproc_LDADD = ../src/libb.la
+
+rdf2b_SOURCES = rdf2b.c
+rdf2b_LDADD = ../src/libb.la
+
+INCLUDES = -I../src
+

Modified: incubator/triplesoup/donations/TRIPLES-2-libb/utils/Makefile.in
URL: http://svn.apache.org/viewvc/incubator/triplesoup/donations/TRIPLES-2-libb/utils/Makefile.in?view=diff&rev=528519&r1=528518&r2=528519
==============================================================================
--- incubator/triplesoup/donations/TRIPLES-2-libb/utils/Makefile.in (original)
+++ incubator/triplesoup/donations/TRIPLES-2-libb/utils/Makefile.in Fri Apr 13 08:19:45 2007
@@ -1,37 +1,462 @@
-# (c) 2006 Satis Superque Merce B.V. All rights reserved. This code
-# contains trade secrets of Satis Superque Merce B.V. and any
-# unauthorized use or disclosure is strictly prohibited.
-#
-# $Id: Makefile.in 29834 2006-10-19 16:22:05Z Andrea Marchesini <baku@theveniceproject.com> $
-#
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
+# @configure_input@
 
-DEPTH		= ../../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE		= bproc
-
-REQUIRES        = b
-
-SIMPLE_PROGRAMS = \
-		  bproc$(BIN_SUFFIX) \
-		  $(NULL)
-
-
-include $(topsrcdir)/config/rules.mk
-
-LOCAL_INCLUDES += \
-                 -I$(srcdir)/../src \
-                 -I$(srcdir) \
-                 $(NULL)
-
-LOCAL_LIBS = \
-	../src/$(LIB_PREFIX)mozb_s.$(LIB_SUFFIX) \
-	$(NULL)
-
-LIBS += $(LOCAL_LIBS) 
-
-$(SIMPLE_PROGRAMS): %$(BIN_SUFFIX): %.$(OBJ_SUFFIX) $(LOCAL_LIBS)
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# 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@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+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 = :
+host_triplet = @host@
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_GTK_DOC_FALSE = @ENABLE_GTK_DOC_FALSE@
+ENABLE_GTK_DOC_TRUE = @ENABLE_GTK_DOC_TRUE@
+ENABLE_REDLAND_FALSE = @ENABLE_REDLAND_FALSE@
+ENABLE_REDLAND_TRUE = @ENABLE_REDLAND_TRUE@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GTK_DOC_USE_LIBTOOL_FALSE = @GTK_DOC_USE_LIBTOOL_FALSE@
+GTK_DOC_USE_LIBTOOL_TRUE = @GTK_DOC_USE_LIBTOOL_TRUE@
+HTML_DIR = @HTML_DIR@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+@ENABLE_REDLAND_TRUE@LIBS = -lrdf
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+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@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+@ENABLE_REDLAND_TRUE@rdf2b = rdf2b
+
+bin_PROGRAMS = bproc $(rdf2b)
+
+bproc_SOURCES = bproc.c
+bproc_LDADD = ../src/libb.la
+
+rdf2b_SOURCES = rdf2b.c
+rdf2b_LDADD = ../src/libb.la
+
+INCLUDES = -I../src
+subdir = utils
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+@ENABLE_REDLAND_TRUE@bin_PROGRAMS = bproc$(EXEEXT) rdf2b$(EXEEXT)
+@ENABLE_REDLAND_FALSE@bin_PROGRAMS = bproc$(EXEEXT)
+PROGRAMS = $(bin_PROGRAMS)
+
+am_bproc_OBJECTS = bproc.$(OBJEXT)
+bproc_OBJECTS = $(am_bproc_OBJECTS)
+bproc_DEPENDENCIES = ../src/libb.la
+bproc_LDFLAGS =
+am_rdf2b_OBJECTS = rdf2b.$(OBJEXT)
+rdf2b_OBJECTS = $(am_rdf2b_OBJECTS)
+rdf2b_DEPENDENCIES = ../src/libb.la
+rdf2b_LDFLAGS =
+
+DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/bproc.Po ./$(DEPDIR)/rdf2b.Po
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
+	$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+DIST_SOURCES = $(bproc_SOURCES) $(rdf2b_SOURCES)
+DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
+SOURCES = $(bproc_SOURCES) $(rdf2b_SOURCES)
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  utils/Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(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) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
+	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --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
+bproc$(EXEEXT): $(bproc_OBJECTS) $(bproc_DEPENDENCIES) 
+	@rm -f bproc$(EXEEXT)
+	$(LINK) $(bproc_LDFLAGS) $(bproc_OBJECTS) $(bproc_LDADD) $(LIBS)
+rdf2b$(EXEEXT): $(rdf2b_OBJECTS) $(rdf2b_DEPENDENCIES) 
+	@rm -f rdf2b$(EXEEXT)
+	$(LINK) $(rdf2b_LDFLAGS) $(rdf2b_OBJECTS) $(rdf2b_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT) core *.core
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bproc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdf2b.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+@am__fastdepCC_TRUE@	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+@am__fastdepCC_TRUE@	fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
+
+.c.obj:
+@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+@am__fastdepCC_TRUE@	  -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+@am__fastdepCC_TRUE@	fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
+
+.c.lo:
+@am__fastdepCC_TRUE@	if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+@am__fastdepCC_TRUE@	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
+@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+@am__fastdepCC_TRUE@	fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+uninstall-info-am:
+
+ETAGS = etags
+ETAGSFLAGS =
+
+CTAGS = ctags
+CTAGSFLAGS =
+
+tags: TAGS
+
+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; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+
+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; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(ETAGS_ARGS)$$tags$$unique" \
+	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	     $$tags $$unique
+
+ctags: CTAGS
+CTAGS:  $(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; } \
+	       END { 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
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkinstalldirs) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    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:
+	$(mkinstalldirs) $(DESTDIR)$(bindir)
+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:
+	-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 mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+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 uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic clean-libtool ctags distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am info info-am install install-am install-binPROGRAMS \
+	install-data install-data-am install-exec install-exec-am \
+	install-info install-info-am install-man 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 \
+	uninstall-info-am
+
+# 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:



Mime
View raw message