summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-11-26 00:15:06 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-11-26 00:15:06 +0000
commiteba128dcc01aae25f688a05683436ab4d508aef6 (patch)
tree7215180cb738dee1dd1c4bc33f8156b0f332f9ad /FL
parent2b826b0f318e8df5176d3a5fa2edba4b1811e78d (diff)
New filename_relative() function, and use it from fl_file_chooser() and
fl_dir_chooser(), so that apps like FLUID won't get absolute paths all the time... Update filename_xyz() functions to take a destination size, and provide inline methods for the old FL_PATH_MAX convention. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1731 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
-rw-r--r--FL/filename.H19
1 files changed, 12 insertions, 7 deletions
diff --git a/FL/filename.H b/FL/filename.H
index 342d8f411..ecc82210b 100644
--- a/FL/filename.H
+++ b/FL/filename.H
@@ -1,5 +1,5 @@
//
-// "$Id: filename.H,v 1.11.2.4.2.1 2001/08/04 12:21:33 easysw Exp $"
+// "$Id: filename.H,v 1.11.2.4.2.2 2001/11/26 00:15:06 easysw Exp $"
//
// Filename header file for the Fast Light Tool Kit (FLTK).
//
@@ -32,11 +32,16 @@
FL_EXPORT const char *filename_name(const char *); // return pointer to name
FL_EXPORT const char *filename_ext(const char *); // return pointer to .ext
-FL_EXPORT char *filename_setext(char *,const char *ext); // clobber .ext
-FL_EXPORT int filename_expand(char *, const char *from); // do $x and ~x
-FL_EXPORT int filename_absolute(char *, const char *from); // prepend getcwd()
-FL_EXPORT int filename_match(const char *, const char *pattern); // glob match
-FL_EXPORT int filename_isdir(const char*);
+FL_EXPORT char *filename_setext(char *to, int tolen, const char *ext); // clobber .ext
+inline char *filename_setext(char *to, const char *ext) { return filename_setext(to, FL_PATH_MAX, ext); }
+FL_EXPORT int filename_expand(char *to, int tolen, const char *from); // do $x and ~x
+inline int filename_expand(char *to, const char *from) { return filename_expand(to, FL_PATH_MAX, from); }
+FL_EXPORT int filename_absolute(char *to, int tolen, const char *from); // prepend getcwd()
+inline int filename_absolute(char *to, const char *from) { return filename_absolute(to, FL_PATH_MAX, from); }
+FL_EXPORT int filename_relative(char *to, int tolen, const char *from); // make local to getcwd()
+inline int filename_relative(char *to, const char *from) { return filename_relative(to, FL_PATH_MAX, from); }
+FL_EXPORT int filename_match(const char *name, const char *pattern); // glob match
+FL_EXPORT int filename_isdir(const char *name);
// Portable "scandir" function. Ugly but apparently necessary...
@@ -64,5 +69,5 @@ FL_EXPORT int filename_list(const char *d, struct dirent ***list);
#endif
//
-// End of "$Id: filename.H,v 1.11.2.4.2.1 2001/08/04 12:21:33 easysw Exp $".
+// End of "$Id: filename.H,v 1.11.2.4.2.2 2001/11/26 00:15:06 easysw Exp $".
//