aboutsummaryrefslogtreecommitdiffhomepage
path: root/path.h
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-10-19 21:50:23 +1000
committerGravatar axel <axel@liljencrantz.se>2006-10-19 21:50:23 +1000
commitea998b03f236be4e8af73474d994af5bbc4b0287 (patch)
tree327fef8d81e4ea82967eeb274d137420044a4de3 /path.h
parent52b2525b0e07970d613ef6e9cc3da41583662e8b (diff)
First stab at directory transition. Test with care...
darcs-hash:20061019115023-ac50b-30c3fd51d8af8a616d63dfcac39370d7fe6d144e.gz
Diffstat (limited to 'path.h')
-rw-r--r--path.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/path.h b/path.h
new file mode 100644
index 00000000..c825160b
--- /dev/null
+++ b/path.h
@@ -0,0 +1,43 @@
+/** \file path.h
+
+ Directory utilities. This library contains functions for locating
+ configuration directories, for testing if a command with a given
+ name can be found in the PATH, and various other path-related
+ issues.
+*/
+
+#ifndef FISH_PATH_H
+#define FISH_PATH_H
+
+/**
+ Returns the user configuration directory for fish. If the directory
+ or one of it's parents doesn't exist, they are first created.
+
+ \param context the halloc context to use for memory allocations
+ \return 0 if the no configuration directory can be located or created, the directory path otherwise.
+*/
+wchar_t *path_get_config( void *context);
+
+/**
+ Finds the full path of an executable in a newly allocated string.
+
+ \param cmd The name of the executable.
+ \param context the halloc context to use for memory allocations
+ \return 0 if the command can not be found, the path of the command otherwise.
+*/
+wchar_t *path_get_path( void *context, const wchar_t *cmd );
+
+/**
+ Returns the full path of the specified directory. If the \c in is a
+ full path to an existing directory, a copy of the string is
+ returned. If \c in is a directory relative to one of the
+ directories i the CDPATH, the full path is returned. If no
+ directory can be found, 0 is returned.
+
+ \param in The name of the directory.
+ \param context the halloc context to use for memory allocations
+ \return 0 if the command can not be found, the path of the command otherwise.
+*/
+wchar_t *path_get_cdpath( void *context, wchar_t *in );
+
+#endif