2 * Filesystem utility definitions
4 * $Id: filesystem.h,v 1.7 2001/10/22 23:16:01 guy Exp $
6 * Ethereal - Network traffic analyzer
7 * By Gerald Combs <gerald@ethereal.com>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 * Given a pathname, return a pointer to the last pathname separator
30 * character in the pathname, or NULL if the pathname contains no
33 char *find_last_pathname_separator(char *);
36 * Given a pathname, return the last component.
38 char *get_basename(char *);
41 * Given a pathname, return a string containing everything but the
42 * last component. NOTE: this overwrites the pathname handed into
45 char *get_dirname(char *);
48 * Given a pathname, return:
50 * the errno, if an attempt to "stat()" the file fails;
52 * EISDIR, if the attempt succeeded and the file turned out
55 * 0, if the attempt succeeded and the file turned out not
58 int test_for_directory(const char *);
61 * Get the directory in which global configuration and data files are
64 const char *get_datafile_dir(void);
67 * Get the directory in which files that, at least on UNIX, are
68 * system files (such as "/etc/ethers") are stored; on Windows,
69 * there's no "/etc" directory, so we get them from the Ethereal
70 * global configuration and data file directory.
72 const char *get_systemfile_dir(void);
75 * Get the directory in which personal configuration files are stored.
77 const char *get_persconffile_dir(void);
79 #endif /* FILESYSTEM_H */