25 #include "posixstat.h" 27 #if defined (HAVE_UNISTD_H) 45 if (hashed_filenames == 0)
93 char *filename, *full_path;
101 if (hashed_filenames == 0)
104 item =
hash_insert (filename, hashed_filenames, 0);
116 if (*full_path !=
'/')
128 const char *filename;
131 char *path, *dotted_filename, *tail;
135 return ((
char *)
NULL);
137 item =
hash_search (filename, hashed_filenames, 0);
140 return ((
char *)NULL);
150 if (tail[0] !=
'.' || tail[1] !=
'/')
152 dotted_filename = (
char *)
xmalloc (3 + strlen (tail));
153 dotted_filename[0] =
'.'; dotted_filename[1] =
'/';
154 strcpy (dotted_filename + 2, tail);
160 return (dotted_filename);
162 free (dotted_filename);
166 return ((
char *)NULL);
181 tail = (
char *)
strrchr (path,
'/');
186 same =
same_file (
".", path, (
struct stat *)NULL, (
struct stat *)NULL);
190 return same ? (
char *)NULL :
savestring (path);
HASH_TABLE * hash_create(int buckets)
#define FILENAME_HASH_BUCKETS
static void phash_freedata(char *data)
BUCKET_CONTENTS * hash_remove(char *string, HASH_TABLE *table, int flags) const
BUCKET_CONTENTS * hash_insert(char *string, HASH_TABLE *table, int flags)
BUCKET_CONTENTS * hash_search(char *string, HASH_TABLE *table, int flags) const
char * phash_search(char *filename) const
int same_file(char *path1, char *path2, struct stat *stp1, struct stat *stp2) const
HASH_TABLE * hashed_filenames
char * savestring(const char *s)
void phash_insert(char *filename, char *full_path, int check_dot, int found)
int executable_file(char *file) const
void hash_flush(HASH_TABLE *table, sh_free_func_t *free_data)
static void phash_freedata __P((char *))
int phash_remove(char *filename) const