Remove unused functions fn_dir_name fn_getenv and fn_getenv_default
authorJohn Darrington <john@darrington.wattle.id.au>
Tue, 27 Oct 2015 20:23:06 +0000 (21:23 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Tue, 27 Oct 2015 20:38:15 +0000 (21:38 +0100)
src/data/file-name.c
src/data/file-name.h

index ac3378e300941f1603886ee7c5edf5dbbcead30c..b5cc43deaa2c81b8e5137f5b6a6340c1d7a3acc1 100644 (file)
@@ -82,14 +82,6 @@ fn_search_path (const char *base_name, char **path)
   return NULL;
 }
 
-/* Returns the directory part of FILE_NAME, as a malloc()'d
-   string. */
-char *
-fn_dir_name (const char *file_name)
-{
-  return dir_name (file_name);
-}
-
 /* Returns the extension part of FILE_NAME as a malloc()'d string.
    If FILE_NAME does not have an extension, returns an empty
    string. */
@@ -122,28 +114,7 @@ fn_exists (const char *name)
 
   return ! S_ISDIR (temp.st_mode);
 }
-\f
-/* Environment variables. */
-
-/* Simulates $VER and $ARCH environment variables. */
-const char *
-fn_getenv (const char *s)
-{
-  if (!strcmp (s, "VER"))
-    return fn_getenv_default ("STAT_VER", bare_version);
-  else if (!strcmp (s, "ARCH"))
-    return fn_getenv_default ("STAT_ARCH", host_system);
-  else
-    return getenv (s);
-}
 
-/* Returns getenv(KEY) if that's non-NULL; else returns DEF. */
-const char *
-fn_getenv_default (const char *key, const char *def)
-{
-  const char *value = getenv (key);
-  return value ? value : def;
-}
 \f
 /* Basic file handling. */
 
index 4ce24e8f24fd45295f1d7f82b27f7fc907c14d51..5f848174e3873840ab44f0a19a1ea74bae63444d 100644 (file)
 #include <stdbool.h>
 #include <sys/types.h>
 
-struct string_set;
-
 char *fn_search_path (const char *base_name, char **path);
-char *fn_dir_name (const char *fn);
 char *fn_extension (const char *fn);
 
 bool fn_is_absolute (const char *fn);
 bool fn_exists (const char *fn);
 
-const char *fn_getenv (const char *variable);
-const char *fn_getenv_default (const char *variable, const char *def);
-
 FILE *fn_open (const char *fn, const char *mode);
 int fn_close (const char *fn, FILE *file);