summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2001-03-31 06:22:38 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2001-03-31 06:22:38 +0000
commit7b1c5b1c7d2b9880dde34b25d582ba3b1e38794f (patch)
treea5fef39ae8dc38d53cc928eee146baa2d9548d1e /include
parent2e62323f39db334ef3e298f9ca076cd451f455df (diff)
downloadlibapr-7b1c5b1c7d2b9880dde34b25d582ba3b1e38794f.tar.gz
First draft implementation of unix apr_filepath_ get, set, merge, and
parse_root. [William Rowe] git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61403 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include')
-rw-r--r--include/apr_file_info.h45
1 files changed, 41 insertions, 4 deletions
diff --git a/include/apr_file_info.h b/include/apr_file_info.h
index 924ea09fb..17ff8ef3b 100644
--- a/include/apr_file_info.h
+++ b/include/apr_file_info.h
@@ -291,6 +291,25 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir);
*/
#define APR_FILEPATH_TRUENAME 0x20
+/**
+ * Extract the rootpath from the given filepath
+ * @param rootpath the root file path returned with APR_SUCCESS or APR_EINCOMPLETE
+ * @param filepath the pathname to parse for it's root component
+ * @param p the pool to allocate the new path string from
+ * @deffunc apr_status_t apr_filepath_root(const char **rootpath, const char **inpath, apr_pool_t *p)
+ * @tip on return, filepath now points to the character following the root.
+ * In the simplest example, given a filepath of "/foo", returns the rootpath
+ * of "/" and filepath points at "foo". This is far more complex on other
+ * platforms, which even changes alternate format of rootpath to canonical
+ * form. The function returns APR_ERELATIVE if filepath isn't rooted (an
+ * error), APR_EINCOMPLETE if the root path is ambigious (but potentially
+ * legitimate, e.g. "/" on Windows is incomplete because it doesn't specify
+ * the drive letter), or APR_EBADPATH if the root is simply invalid.
+ * APR_SUCCESS is returned if filepath is an absolute path.
+ */
+APR_DECLARE(apr_status_t) apr_filepath_root(const char **rootpath,
+ const char **filepath,
+ apr_pool_t *p);
/**
* Merge additional file path onto the previously processed rootpath
@@ -301,10 +320,28 @@ APR_DECLARE(apr_status_t) apr_dir_rewind(apr_dir_t *thedir);
* @param p the pool to allocate the new path string from
* @deffunc apr_status_t apr_filepath_merge(char **newpath, const char *rootpath, const char *addpath, apr_int32_t flags, apr_pool_t *p)
*/
-APR_DECLARE(apr_status_t)
- apr_filepath_merge(char **newpath, const char *rootpath,
- const char *addpath, apr_int32_t flags,
- apr_pool_t *p);
+APR_DECLARE(apr_status_t) apr_filepath_merge(char **newpath,
+ const char *rootpath,
+ const char *addpath,
+ apr_int32_t flags,
+ apr_pool_t *p);
+
+/**
+ * Return the default file path (for relative file names)
+ * @param path the default path string returned
+ * @param p the pool to allocate the default path string from
+ * @deffunc apr_status_t apr_filepath_get(char **path, apr_pool_t *p)
+ */
+APR_DECLARE(apr_status_t) apr_filepath_get(char **path, apr_pool_t *p);
+
+/**
+ * Set the default file path (for relative file names)
+ * @param path the default path returned
+ * @param p the pool to allocate any working storage
+ * @deffunc apr_status_t apr_filepath_get(char **defpath, apr_pool_t *p)
+ */
+APR_DECLARE(apr_status_t) apr_filepath_set(const char *path, apr_pool_t *p);
+
#ifdef __cplusplus
}