+Sun Apr 16 16:42:47 2006 Ben Pfaff <blp@gnu.org>
+
+ * filename.c: (fn_dirname) Renamed fn_dir_name(), all references
+ updated.
+ (fn_basename) Removed (dead code).
+ (fn_absolute_p) Renamed fn_is_absolute(), all references updated.
+ (fn_special_p) Renamed fn_is_special(), all references updated.
+ (fn_exists_p) Renamed fn_exists(), all references updated.
+
Sun Apr 16 16:33:58 2006 Ben Pfaff <blp@gnu.org>
* filename.c: (fn_tilde_expand) Rewrite for cleaner code.
struct string file = DS_INITIALIZER;
size_t save_idx = 0;
- if (fn_absolute_p (base_name))
+ if (fn_is_absolute (base_name))
return fn_tilde_expand (base_name);
/* Interpolate environment variables. */
/* Construct file name. */
ds_clear (&file);
- if (prefix != NULL && !fn_absolute_p (ds_c_str (&dir)))
+ if (prefix != NULL && !fn_is_absolute (ds_c_str (&dir)))
{
ds_puts (&file, prefix);
ds_putc (&file, DIR_SEPARATOR);
ds_puts (&file, base_name);
/* Check whether file exists. */
- if (fn_exists_p (ds_c_str (&file)))
+ if (fn_exists (ds_c_str (&file)))
{
verbose_msg (2, _("...found \"%s\""), ds_c_str (&file));
ds_destroy (&path);
char *fn1, *fn2, *dest;
int maxlen;
- if (fn_special_p (filename))
+ if (fn_is_special (filename))
return xstrdup (filename);
fn1 = fn_tilde_expand (filename);
/* Returns the directory part of FILENAME, as a malloc()'d
string. */
char *
-fn_dirname (const char *filename)
+fn_dir_name (const char *filename)
{
const char *p;
char *s;
return s;
}
-/* Returns the basename part of FILENAME as a malloc()'d string. */
-#if 0
-char *
-fn_basename (const char *filename)
-{
- /* Not used, not implemented. */
- abort ();
-}
-#endif
-
/* Returns the extension part of FILENAME as a malloc()'d string.
If FILENAME does not have an extension, returns an empty
string. */
/* Returns nonzero iff NAME specifies an absolute filename. */
int
-fn_absolute_p (const char *name)
+fn_is_absolute (const char *name)
{
#ifdef unix
if (name[0] == '/'
/* Returns 1 if the filename specified is a virtual file that doesn't
really exist on disk, 0 if it's a real filename. */
int
-fn_special_p (const char *filename)
+fn_is_special (const char *filename)
{
if (!strcmp (filename, "-") || !strcmp (filename, "stdin")
|| !strcmp (filename, "stdout") || !strcmp (filename, "stderr")
/* Returns nonzero if file with name NAME exists. */
int
-fn_exists_p (const char *name)
+fn_exists (const char *name)
{
#ifdef unix
struct stat temp;
struct string;
void fn_interp_vars (struct string *target,
- const char *(*getenv) (const char *));
+ const char *(*getenv) (const char *));
char *fn_tilde_expand (const char *fn);
char *fn_search_path (const char *base_name, const char *path,
const char *prefix);
char *fn_normalize (const char *fn);
-char *fn_dirname (const char *fn);
-char *fn_basename (const char *fn);
+char *fn_dir_name (const char *fn);
char *fn_extension (const char *fn);
char *fn_get_cwd (void);
-int fn_absolute_p (const char *fn);
-int fn_special_p (const char *fn);
-int fn_exists_p (const char *fn);
+int fn_is_absolute (const char *fn);
+int fn_is_special (const char *fn);
+int fn_exists (const char *fn);
char *fn_readlink (const char *fn);
const char *fn_getenv (const char *variable);