diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-01-25 05:48:47 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-01-25 05:48:47 +0000 |
commit | d1aac3e35f7e2d1430a198f8c41a5bed7ac3b3a7 (patch) | |
tree | b81626683b8737b43718d8b234fcbc1cf300ba5b /util.h | |
parent | f71823a907ee22663dd666a0733c068f5475e69e (diff) |
Provide a "get_dirname()" routine, that takes a pathname and returns
either a pointer to the directory part of the pathname (after stomping
on the pathname separator with a '\0', so don't use this on pathnames
you plan to use afterwards), or NULL if the pathname contains no
directory part, and make it handle Win32 pathnames on Win32 systems.
Use it to get the containing directory of the currently open file, so
that the "chdir()" stuff we do to cause the "File:Open" dialog box to
show you files in the directory in which you last looked works on Win32
systems.
svn path=/trunk/; revision=1555
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -1,7 +1,7 @@ /* util.h * Utility definitions * - * $Id: util.h,v 1.16 2000/01/25 04:31:17 guy Exp $ + * $Id: util.h,v 1.17 2000/01/25 05:48:39 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -30,8 +30,18 @@ extern "C" { #endif /* __cplusplus */ +/* + * Given a pathname, return the last component. + */ char *get_basename(char *); +/* + * Given a pathname, return a string containing everything but the + * last component. NOTE: this overwrites the pathname handed into + * it.... + */ +char *get_dirname(char *); + int create_tempfile(char *, int, const char *); void ASCII_to_EBCDIC(guint8 *buf, guint bytes); |