#include <stdio.h>
#include "cp.h"
-char *hash_insert ();
-char *hash_insert2 ();
-
struct htab *htab;
char new_file;
Return 0 if successful, 1 if not. */
int
-remember_created (path)
- char *path;
+remember_created (const char *path)
{
struct stat sb;
Return NULL if inserted, otherwise non-NULL. */
char *
-remember_copied (node, ino, dev)
- char *node;
- ino_t ino;
- dev_t dev;
+remember_copied (const char *node, ino_t ino, dev_t dev)
{
return hash_insert (ino, dev, node);
}
doubled.) */
void
-hash_init (modulus, entry_tab_size)
- unsigned modulus;
- unsigned entry_tab_size;
+hash_init (unsigned int modulus, unsigned int entry_tab_size)
{
struct htab *htab_r;
contain no entries. */
void
-forget_all ()
+forget_all (void)
{
int i;
struct entry **p;
Return NULL if inserted, otherwise non-NULL. */
char *
-hash_insert (ino, dev, node)
- ino_t ino;
- dev_t dev;
- char *node;
+hash_insert (ino_t ino, dev_t dev, const char *node)
{
struct htab *htab_r = htab;
Return NULL if inserted, otherwise non-NULL. */
char *
-hash_insert2 (htab, ino, dev, node)
- struct htab *htab;
- ino_t ino;
- dev_t dev;
- char *node;
+hash_insert2 (struct htab *htab, ino_t ino, dev_t dev, const char *node)
{
struct entry **hp, *ep2, *ep;
hp = &htab->hash[ino % htab->modulus];
ep = *hp = &htab->entry_tab[htab->first_free_entry++];
ep->ino = ino;
ep->dev = dev;
- ep->node = node;
+ ep->node = (char *) node;
ep->coll_link = ep2; /* ep2 is NULL if not collision. */
return NULL;