]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Move file-set and hash-triple modules to gnulib.
authorJim Meyering <jim@meyering.net>
Tue, 25 Sep 2007 20:24:21 +0000 (22:24 +0200)
committerJim Meyering <jim@meyering.net>
Thu, 27 Sep 2007 08:53:36 +0000 (10:53 +0200)
* bootstrap.conf (gnulib_modules): Remove file-set, now that
it's in gnulib, and the canonicalize module requires it there.
* gl/lib/file-set.c, gl/lib/file-set.h, gl/modules/hash-triple: Remove.
* gl/lib/hash-triple.c, gl/lib/hash-triple.h, gl/modules/file-set: Remove.

ChangeLog
bootstrap.conf
gl/lib/file-set.c [deleted file]
gl/lib/file-set.h [deleted file]
gl/lib/hash-triple.c [deleted file]
gl/lib/hash-triple.h [deleted file]
gl/modules/file-set [deleted file]
gl/modules/hash-triple [deleted file]

index 0e3ff577b2670b146682ea2731ae56b0312524fb..d8bdd87279ee99045936556e7204a175b4cd3dc9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2007-09-27  Jim Meyering  <jim@meyering.net>
 
+       Move file-set and hash-triple modules to gnulib.
+       * bootstrap.conf (gnulib_modules): Remove file-set, now that
+       it's in gnulib, and the canonicalize module requires it there.
+       * gl/lib/file-set.c, gl/lib/file-set.h, gl/modules/hash-triple: Remove.
+       * gl/lib/hash-triple.c, gl/lib/hash-triple.h, gl/modules/file-set:
+       Remove.
+
        Add a test to exercise a readlink bug.
        * tests/misc/readlink-fp-loop: New file.  Test for the readlink bug
        fixed through today's change to Gnulib's canonicalize module.
index 93bada9d417a3dcd48ecd6bc48f4f62de9dfc7bd..de53c8d59bead4db6e76f7266fbae536b30098e4 100644 (file)
@@ -45,7 +45,6 @@ gnulib_modules="
        cycle-check
        d-ino d-type diacrit dirfd dirname dup2
        error euidaccess exclude exitfail fchdir fcntl fcntl-safer fdl
-       file-set
        file-type fileblocks filemode filenamecat fnmatch-gnu
        fopen-safer
        fprintftime
diff --git a/gl/lib/file-set.c b/gl/lib/file-set.c
deleted file mode 100644 (file)
index ad03f90..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#include <config.h>
-#include "file-set.h"
-
-#include "hash-triple.h"
-#include "xalloc.h"
-
-/* Record destination file, FILE, and dev/ino from *STATS,
-   in the hash table, HT.  If HT is NULL, return immediately.
-   If memory allocation fails, exit immediately.  */
-void
-record_file (Hash_table *ht, char const *file, struct stat const *stats)
-{
-  struct F_triple *ent;
-
-  if (ht == NULL)
-    return;
-
-  ent = xmalloc (sizeof *ent);
-  ent->name = xstrdup (file);
-  ent->st_ino = stats->st_ino;
-  ent->st_dev = stats->st_dev;
-
-  {
-    struct F_triple *ent_from_table = hash_insert (ht, ent);
-    if (ent_from_table == NULL)
-      {
-       /* Insertion failed due to lack of memory.  */
-       xalloc_die ();
-      }
-
-    if (ent_from_table != ent)
-      {
-       /* There was alread a matching entry in the table, so ENT was
-          not inserted.  Free it.  */
-       triple_free (ent);
-      }
-  }
-}
-
-/* Return true if there is an entry in hash table, HT,
-   for the file described by FILE and STATS.  */
-bool
-seen_file (Hash_table const *ht, char const *file,
-          struct stat const *stats)
-{
-  struct F_triple new_ent;
-
-  if (ht == NULL)
-    return false;
-
-  new_ent.name = (char *) file;
-  new_ent.st_ino = stats->st_ino;
-  new_ent.st_dev = stats->st_dev;
-
-  return !!hash_lookup (ht, &new_ent);
-}
diff --git a/gl/lib/file-set.h b/gl/lib/file-set.h
deleted file mode 100644 (file)
index a5a159e..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdbool.h>
-
-#include "hash.h"
-
-extern void record_file (Hash_table *ht, char const *file,
-                        struct stat const *stats)
-  __attribute__((nonnull(2, 3)));
-
-extern bool seen_file (Hash_table const *ht, char const *file,
-                      struct stat const *stats);
diff --git a/gl/lib/hash-triple.c b/gl/lib/hash-triple.c
deleted file mode 100644 (file)
index 74b9de8..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <config.h>
-
-#include "hash-triple.h"
-
-#include <stdlib.h>
-
-#include "hash-pjw.h"
-#include "same.h"
-#include "same-inode.h"
-
-/* Hash an F_triple, and *do* consider the file name.  */
-size_t
-triple_hash (void const *x, size_t table_size)
-{
-  struct F_triple const *p = x;
-  size_t tmp = hash_pjw (p->name, table_size);
-
-  /* Ignoring the device number here should be fine.  */
-  return (tmp ^ p->st_ino) % table_size;
-}
-
-/* Hash an F_triple, without considering the file name.  */
-size_t
-triple_hash_no_name (void const *x, size_t table_size)
-{
-  struct F_triple const *p = x;
-
-  /* Ignoring the device number here should be fine.  */
-  return p->st_ino % table_size;
-}
-
-/* Compare two F_triple structs.  */
-bool
-triple_compare (void const *x, void const *y)
-{
-  struct F_triple const *a = x;
-  struct F_triple const *b = y;
-  return (SAME_INODE (*a, *b) && same_name (a->name, b->name)) ? true : false;
-}
-
-/* Free an F_triple.  */
-void
-triple_free (void *x)
-{
-  struct F_triple *a = x;
-  free (a->name);
-  free (a);
-}
diff --git a/gl/lib/hash-triple.h b/gl/lib/hash-triple.h
deleted file mode 100644 (file)
index 7abe970..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef HASH_TRIPLE_H
-#define HASH_TRIPLE_H
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdbool.h>
-
-/* Describe a just-created or just-renamed destination file.  */
-struct F_triple
-{
-  char *name;
-  ino_t st_ino;
-  dev_t st_dev;
-};
-
-extern size_t triple_hash (void const *x, size_t table_size);
-extern size_t triple_hash_no_name (void const *x, size_t table_size);
-extern bool triple_compare (void const *x, void const *y);
-extern void triple_free (void *x);
-
-#endif
diff --git a/gl/modules/file-set b/gl/modules/file-set
deleted file mode 100644 (file)
index 7895cda..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-Description:
-Very specialized set-of-files code.
-
-Files:
-lib/file-set.c
-lib/file-set.h
-
-Depends-on:
-hash
-hash-triple
-stdbool
-xalloc
-xalloc-die
-
-configure.ac:
-
-Makefile.am:
-lib_SOURCES += file-set.c
-
-Include:
-"file-set.h"
-
-License:
-GPL
-
-Maintainer:
-Jim Meyering
diff --git a/gl/modules/hash-triple b/gl/modules/hash-triple
deleted file mode 100644 (file)
index b746d47..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-Description:
-Hash functions for file-related triples: name, device, inode.
-
-Files:
-lib/hash-triple.c
-lib/hash-triple.h
-
-Depends-on:
-hash-pjw
-same
-same-inode
-
-configure.ac:
-
-Makefile.am:
-lib_SOURCES += hash-triple.c
-
-Include:
-"hash-triple.h"
-
-License:
-GPL
-
-Maintainer:
-Jim Meyering