diff options
Diffstat (limited to 'include/apr_file_io.h')
-rw-r--r-- | include/apr_file_io.h | 330 |
1 files changed, 123 insertions, 207 deletions
diff --git a/include/apr_file_io.h b/include/apr_file_io.h index 4a4e3919b..06658c6ce 100644 --- a/include/apr_file_io.h +++ b/include/apr_file_io.h @@ -134,11 +134,6 @@ typedef struct apr_finfo_t apr_finfo_t; */ typedef struct apr_dir_t apr_dir_t; /** - * Structure for determining canonical filenames. - * @defvar apr_canon_t - */ -typedef struct apr_canon_t apr_canon_t; -/** * Structure for determining file permissions. * @defvar apr_fileperms_t */ @@ -216,157 +211,6 @@ struct apr_finfo_t { #define APR_FLOCK_NONBLOCK 0x0010 /* do not block while acquiring the file lock */ - -/* Make and Merge Canonical Name Options */ -#define APR_CANON_ONLY_ABSOLUTE 0 -#define APR_CANON_ALLOW_RELATIVE 2 -#define APR_CANON_ONLY_RELATIVE 3 -#define APR_CANON_CHILD_OF_TRUSTED 4 -#define APR_CANON_LOWERCASE -#define APR_CANON_TRUECASE - - -/* This is a hack, because none of these functions actually exist yet. The - * problem is that we generate our exports from the header files, so we are - * trying to export these functions, but they don't exist, so we can't link. - * This just makes sure that we don't try to link these functions until - * they actually exist. - */ -#ifdef APR_NOT_DONE_YET -/** - * Canonicalize the path and name. - * @param new_name The newly allocated canonicalized trusted+child name - * @param trusted_name Already canonical parent path; may be NULL. - * @param child_name An absolute path or path relative to trusted_name. - * @param options Bit-wise OR of: - * <PRE> - * APR_CANON_ONLY_ABSOLUTE Require the trusted_name+child_name result is - * an absolute product or fail with error for the - * make and merge canonical name functions. - * APR_CANON_ALLOW_RELATIVE Allow that the trusted_name+child_name result - * may be a relative result for the make and - * merge canonical name functions. - * APR_CANON_ONLY_RELATIVE Require the trusted_name+child_name result is - * not an absolute path or fail with error for - * the make and merge canonical name functions. - * APR_CANON_CHILD_OF_TRUSTED Require the trusted_name+child_name result is - * a child of trusted_name or fail with error for - * the make and merge canonical name functions. - * APR_CANON_LOWERCASE If file path elements exist (can stat) then - * fold the element's name to lowercase for the - * make and merge canonical name functions. - * APR_CANON_TRUECASE If file path elements exist (can readdir) then - * fold the element's name to the true case - * lowercase for the make and merge canonical - * name functions. - * </PRE> - * @param pool The pool in which to allocate the new_name apr_canon_t - * - * @tip A canonical name is a name stripped of embedded backrefs "../", - * thisrefs "./", successive slashes (//), or any other ambigious file - * name element. Absolute canonical names referencing the same file must - * strcmp() identically, excluding symlinks or inconsistent use of the - * APR_CANON_LOWERCASE or APR_CANON_TRUECASE options. - * - * If the name does not exist, or resolves to a relative name the given case - * is preserved. Insignificant elements are eliminated. For example, on Win32 - * this function removes trailing dots (which are allowed, but not stored in - * the file system), and "/../" under Unix is resolved to "/". The relative - * canonical name may contain leading backrefs "../", but will never contain - * any other prohibited element. - */ -apr_status_t apr_make_canonical_name(apr_canon_t **new_name, - const apr_canon_t *trusted_name, - const char *child_name, - int options, - apr_pool_t *pool); - -/** - * Merge two canonical names into a single canonical name. - * @param new_name The newly allocated canonicalized trusted+child name - * @param trusted_name Already canonical parent path; may be NULL. - * @param child_name An already canonical absolute path or path relative to - * trusted_name. - * @param options See apr_make_canonical_name for options - * @param pool The pool to allocate the new_name out of. - * @see apr_make_canonical_name - */ -apr_status_t apr_merge_canonical_name(apr_canon_t **new_name, - const apr_canon_t *trusted_name, - const apr_canon_t *child_name, - int options, - apr_pool_t *pool); - -/** - * Get the canonical path in a character string - * @param path A location to store the canocical name - * @param trusted_name An already canonicalized file path - * @param pool The pool to allocate the path out of. - */ -apr_status_t apr_get_canonical_name(char **path, - const apr_canon_t *trusted_name, - apr_pool_t *pool); - -/** - * Count the number of elements in a canonical name. - * @param trusted_name An already canonicalized file path - * @return The number of elements in the name - */ -int apr_count_canonical_elements(const apr_canon_t *trusted_name); - -/** - * Query the length of some elements of the canonical name - * @param trusted_name An already canonicalized file path - * @param firstelement The numerical position of the element to start the - * length at. - * @param lastelement The numerical position of the element to end the - * length at. - * @return The length of requested elements. - */ -int apr_get_canonical_elements_length(const apr_canon_t *trusted_name, - int firstelement, int lastelement); - -/** - * Get the requested elements of a canonical name in a character string - * @param path_elements A location to store the path elements. - * @param trusted_name An already canonicalized file path - * @param firstelement The numerical position of the element to start the - * length at. - * @param lastelement The numerical position of the element to end the - * length at. - * @param pool The pool to allocate the path out of. - */ -apr_status_t apr_get_canonical_elements(char **path_elements, - const apr_canon_t *trusted_name, - int firstelement, int lastelement, - apr_pool_t *pool); - -/** - * Determine if a canonical name is absolute. - * @param path The canonical name to check - * @warning Do not trust !apr_is_absolute to determine if the path is - * relative. Also, test apr_is_virtualroot to avoid non-filesystem - * pseudo roots. - */ -apr_status_t apr_is_absolute(apr_canon_t **path); - -/** - * Determine if a canonical name is relative - * @param path The canonical name to check - * @warning Do not trust !apr_is_relative to determine if the path is absolute - */ -apr_status_t apr_is_relative(apr_canon_t **path); - -/** - * Determine if the elements 0..elements resolves to a platform's non-physical - * root, e.g. the //machine/ name that isn't an adaquately complete root for - * UNC paths. - * @param path The canonical name to check - * @param elements The number of elements to check. - */ -apr_status_t apr_is_virtualroot(apr_canon_t **path, int elements); -#endif - /** * Open the specified file. * @param new_file The opened file descriptor. @@ -386,26 +230,30 @@ apr_status_t apr_is_virtualroot(apr_canon_t **path, int elements); * </PRE> * @param perm Access permissions for file. * @param cont The pool to use. + * @deffunc apr_status_t apr_open(apr_file_t **new_file, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *cont) * @tip If perm is APR_OS_DEFAULT and the file is being created, appropriate * default permissions will be used. *arg1 must point to a valid file_t, * or NULL (in which case it will be allocated) */ -apr_status_t apr_open(apr_file_t **new_file, const char *fname, apr_int32_t flag, - apr_fileperms_t perm, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_open(apr_file_t **new_file, const char *fname, + apr_int32_t flag, apr_fileperms_t perm, + apr_pool_t *cont); /** * Close the specified file. * @param file The file descriptor to close. + * @deffunc apr_status_t apr_close(apr_file_t *file) */ -apr_status_t apr_close(apr_file_t *file); +APR_DECLARE(apr_status_t) apr_close(apr_file_t *file); /** * delete the specified file. * @param path The full path to the file (using / on all systems) * @param cont The pool to use. + * @deffunc apr_status_t apr_remove_file(const char *path, apr_pool_t *cont) * @tip If the file is open, it won't be removed until all instances are closed. */ -apr_status_t apr_remove_file(const char *path, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_remove_file(const char *path, apr_pool_t *cont); /** * rename the specified file. @@ -414,30 +262,36 @@ apr_status_t apr_remove_file(const char *path, apr_pool_t *cont); * @param pool The pool to use. * @tip If a file exists at the new location, then it will be overwritten. * Moving files or directories across devices may not be possible. + * @deffunc apr_status_t apr_rename_file(const char *from_path, const char *to_path, apr_pool_t *pool) */ -apr_status_t apr_rename_file(const char *from_path, const char *to_path, - apr_pool_t *pool); +APR_DECLARE(apr_status_t) apr_rename_file(const char *from_path, + const char *to_path, + apr_pool_t *pool); /** * Are we at the end of the file * @param fptr The apr file we are testing. * @tip Returns APR_EOF if we are at the end of file, APR_SUCCESS otherwise. + * @deffunc apr_status_t apr_eof(apr_file_t *fptr) */ -apr_status_t apr_eof(apr_file_t *fptr); +APR_DECLARE(apr_status_t) apr_eof(apr_file_t *fptr); /** * Is there an error on the stream? * @param fptr The apr file we are testing. * @tip Returns -1 if the error indicator is set, APR_SUCCESS otherwise. + * @deffunc apr_status_t apr_ferror(apr_file_t *fptr) */ -apr_status_t apr_ferror(apr_file_t *fptr); +APR_DECLARE(apr_status_t) apr_ferror(apr_file_t *fptr); /** * open standard error as an apr file pointer. * @param thefile The apr file to use as stderr. * @param cont The pool to allocate the file out of. + * @deffunc apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont) */ -apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_open_stderr(apr_file_t **thefile, + apr_pool_t *cont); /** * Read data from the specified file. @@ -454,8 +308,10 @@ apr_status_t apr_open_stderr(apr_file_t **thefile, apr_pool_t *cont); * error to be returned. * * APR_EINTR is never returned. + * @deffunc apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes) */ -apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes); +APR_DECLARE(apr_status_t) apr_read(apr_file_t *thefile, void *buf, + apr_size_t *nbytes); /** * Write data to the specified file. @@ -471,8 +327,10 @@ apr_status_t apr_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes); * It is possible for both bytes to be written and an error to be returned. * * APR_EINTR is never returned. + * @deffunc apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) */ -apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes); +APR_DECLARE(apr_status_t) apr_write(apr_file_t *thefile, const void *buf, + apr_size_t *nbytes); /** * Write data from iovec array to the specified file. @@ -488,9 +346,11 @@ apr_status_t apr_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes) * apr_writev is available even if the underlying operating system * * doesn't provide writev(). + * @deffunc apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, apr_size_t nvec, apr_size_t *nbytes) */ -apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, - apr_size_t nvec, apr_size_t *nbytes); +APR_DECLARE(apr_status_t) apr_writev(apr_file_t *thefile, + const struct iovec *vec, + apr_size_t nvec, apr_size_t *nbytes); /** * Read data from the specified file, ensuring that the buffer is filled @@ -509,9 +369,11 @@ apr_status_t apr_writev(apr_file_t *thefile, const struct iovec *vec, * error to be returned. * * APR_EINTR is never returned. + * @deffunc apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes, apr_size_t *bytes_read) */ -apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes, - apr_size_t *bytes_read); +APR_DECLARE(apr_status_t) apr_full_read(apr_file_t *thefile, void *buf, + apr_size_t nbytes, + apr_size_t *bytes_read); /** * Write data to the specified file, ensuring that all of the data is @@ -528,51 +390,59 @@ apr_status_t apr_full_read(apr_file_t *thefile, void *buf, apr_size_t nbytes, * It is possible for both bytes to be written and an error to be returned. * * APR_EINTR is never returned. + * @deffunc apr_status_t apr_full_write(apr_file_t *thefile, const void *buf, apr_size_t nbytes, apr_size_t *bytes_written) */ -apr_status_t apr_full_write(apr_file_t *thefile, const void *buf, - apr_size_t nbytes, apr_size_t *bytes_written); +APR_DECLARE(apr_status_t) apr_full_write(apr_file_t *thefile, const void *buf, + apr_size_t nbytes, + apr_size_t *bytes_written); /** * put a character into the specified file. * @param ch The character to write. * @param thefile The file descriptor to write to + * @deffunc apr_status_t apr_putc(char ch, apr_file_t *thefile) */ -apr_status_t apr_putc(char ch, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_putc(char ch, apr_file_t *thefile); /** * get a character from the specified file. * @param ch The character to write. * @param thefile The file descriptor to write to + * @deffunc apr_status_t apr_getc(char *ch, apr_file_t *thefile) */ -apr_status_t apr_getc(char *ch, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_getc(char *ch, apr_file_t *thefile); /** * put a character back onto a specified stream. * @param ch The character to write. * @param thefile The file descriptor to write to + * @deffunc apr_status_t apr_ungetc(char ch, apr_file_t *thefile) */ -apr_status_t apr_ungetc(char ch, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_ungetc(char ch, apr_file_t *thefile); /** * Get a string from a specified file. * @param str The buffer to store the string in. * @param len The length of the string * @param thefile The file descriptor to read from + * @deffunc apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile) */ -apr_status_t apr_fgets(char *str, int len, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_fgets(char *str, int len, apr_file_t *thefile); /** * Put the string into a specified file. * @param str The string to write. * @param thefile The file descriptor to write to + * @deffunc apr_status_t apr_puts(const char *str, apr_file_t *thefile) */ -apr_status_t apr_puts(const char *str, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_puts(const char *str, apr_file_t *thefile); /** * Flush the file's buffer. * @param thefile The file descriptor to flush + * @deffunc apr_status_t apr_flush(apr_file_t *thefile) */ -apr_status_t apr_flush(apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_flush(apr_file_t *thefile); /** * duplicate the specified file descriptor. @@ -580,15 +450,20 @@ apr_status_t apr_flush(apr_file_t *thefile); * @param old_file The file to duplicate. * @param p The pool to use for the new file. * @tip *arg1 must point to a valid apr_file_t, or point to NULL + * @deffunc apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p) */ -apr_status_t apr_dupfile(apr_file_t **new_file, apr_file_t *old_file, apr_pool_t *p); +APR_DECLARE(apr_status_t) apr_dupfile(apr_file_t **new_file, + apr_file_t *old_file, + apr_pool_t *p); /** * get the specified file's stats. * @param finfo Where to store the information about the file. * @param thefile The file to get information about. + * @deffunc apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile) */ -apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_getfileinfo(apr_finfo_t *finfo, + apr_file_t *thefile); /** * set the specified file's permission bits. @@ -599,8 +474,10 @@ apr_status_t apr_getfileinfo(apr_finfo_t *finfo, apr_file_t *thefile); * are specified which could not be set. * * Platforms which do not implement this feature will return APR_ENOTIMPL. + * @deffunc apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms) */ -apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms); +APR_DECLARE(apr_status_t) apr_setfileperms(const char *fname, + apr_fileperms_t perms); /** * get the specified file's stats. The file is specified by filename, @@ -609,8 +486,10 @@ apr_status_t apr_setfileperms(const char *fname, apr_fileperms_t perms); * never touched if the call fails. * @param fname The name of the file to stat. * @param cont the pool to use to allocate the new file. + * @deffunc apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) */ -apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_stat(apr_finfo_t *finfo, const char *fname, + apr_pool_t *cont); /** * get the specified file's stats. The file is specified by filename, @@ -620,8 +499,10 @@ apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont); * never touched if the call fails. * @param fname The name of the file to stat. * @param cont the pool to use to allocate the new file. + * @deffunc apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont) */ -apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_lstat(apr_finfo_t *finfo, const char *fname, + apr_pool_t *cont); /** * Move the read/write file offset to a specified byte within a file. @@ -634,83 +515,102 @@ apr_status_t apr_lstat(apr_finfo_t *finfo, const char *fname, apr_pool_t *cont); * @param offset The offset to move the pointer to. * @tip The third argument is modified to be the offset the pointer was actually moved to. + * @deffunc apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset) */ -apr_status_t apr_seek(apr_file_t *thefile, apr_seek_where_t where,apr_off_t *offset); +APR_DECLARE(apr_status_t) apr_seek(apr_file_t *thefile, + apr_seek_where_t where, + apr_off_t *offset); /** * Open the specified directory. * @param new_dir The opened directory descriptor. * @param dirname The full path to the directory (use / on all systems) * @param cont The pool to use. + * @deffunc apr_status_t apr_dir_open(apr_dir_t **new_dir, const char *dirname, apr_pool_t *cont) */ -apr_status_t apr_dir_open(apr_dir_t **new_dir, const char *dirname, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_dir_open(apr_dir_t **new_dir, + const char *dirname, + apr_pool_t *cont); /** * close the specified directory. * @param thedir the directory descriptor to close. + * @deffunc apr_status_t apr_closedir(apr_dir_t *thedir) */ -apr_status_t apr_closedir(apr_dir_t *thedir); +APR_DECLARE(apr_status_t) apr_closedir(apr_dir_t *thedir); /** * Read the next entry from the specified directory. * @param thedir the directory descriptor to read from, and fill out. * @tip All systems return . and .. as the first two files. + * @deffunc apr_status_t apr_readdir(apr_dir_t *thedir) */ -apr_status_t apr_readdir(apr_dir_t *thedir); +APR_DECLARE(apr_status_t) apr_readdir(apr_dir_t *thedir); /** * Rewind the directory to the first entry. * @param thedir the directory descriptor to rewind. + * @deffunc apr_status_t apr_rewinddir(apr_dir_t *thedir) */ -apr_status_t apr_rewinddir(apr_dir_t *thedir); +APR_DECLARE(apr_status_t) apr_rewinddir(apr_dir_t *thedir); /** * Create a new directory on the file system. * @param path the path for the directory to be created. (use / on all systems) * @param perm Permissions for the new direcoty. * @param cont the pool to use. + * @deffunc apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont) */ -apr_status_t apr_make_dir(const char *path, apr_fileperms_t perm, +APR_DECLARE(apr_status_t) apr_make_dir(const char *path, apr_fileperms_t perm, apr_pool_t *cont); /** * Remove directory from the file system. * @param path the path for the directory to be removed. (use / on all systems) * @param cont the pool to use. + * @deffunc apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont) */ -apr_status_t apr_remove_dir(const char *path, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_remove_dir(const char *path, apr_pool_t *cont); /** * Create an anonymous pipe. * @param in The file descriptor to use as input to the pipe. * @param out The file descriptor to use as output from the pipe. * @param cont The pool to operate on. + * @deffunc apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont) */ -apr_status_t apr_create_pipe(apr_file_t **in, apr_file_t **out, apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_create_pipe(apr_file_t **in, apr_file_t **out, + apr_pool_t *cont); /** * Create a named pipe. * @param filename The filename of the named pipe * @param perm The permissions for the newly created pipe. * @param cont The pool to operate on. + * @deffunc apr_status_t apr_create_namedpipe(const char *filename, apr_fileperms_t perm, apr_pool_t *cont) */ -apr_status_t apr_create_namedpipe(const char *filename, apr_fileperms_t perm, - apr_pool_t *cont); +APR_DECLARE(apr_status_t) apr_create_namedpipe(const char *filename, + apr_fileperms_t perm, + apr_pool_t *cont); /** * Get the timeout value for a pipe or manipulate the blocking state. * @param thepipe The pipe we are getting a timeout for. * @param timeout The current timeout value in microseconds. + * @deffunc apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout) */ -apr_status_t apr_get_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t *timeout); +APR_DECLARE(apr_status_t) apr_get_pipe_timeout(apr_file_t *thepipe, + apr_interval_time_t *timeout); /** * Set the timeout value for a pipe or manipulate the blocking state. * @param thepipe The pipe we are setting a timeout on. * @param timeout The timeout value in microseconds. Values < 0 mean wait * forever, 0 means do not wait at all. + * @deffunc apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout) */ -apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeout); +APR_DECLARE(apr_status_t) apr_set_pipe_timeout(apr_file_t *thepipe, + apr_interval_time_t timeout); /** file (un)locking functions. */ @@ -722,14 +622,16 @@ apr_status_t apr_set_pipe_timeout(apr_file_t *thepipe, apr_interval_time_t timeo * block. * @param thefile The file to lock. * @param type The type of lock to establish on the file. + * @deffunc apr_status_t apr_lock_file(apr_file_t *thefile, int type) */ -apr_status_t apr_lock_file(apr_file_t *thefile, int type); +APR_DECLARE(apr_status_t) apr_lock_file(apr_file_t *thefile, int type); /** * Remove any outstanding locks on the file. * @param thefile The file to unlock. + * @deffunc apr_status_t apr_unlock_file(apr_file_t *thefile) */ -apr_status_t apr_unlock_file(apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_unlock_file(apr_file_t *thefile); /**accessor and general file_io functions. */ @@ -737,23 +639,29 @@ apr_status_t apr_unlock_file(apr_file_t *thefile); * return the file name of the current file. * @param new_path The path of the file. * @param thefile The currently open file. + * @deffunc apr_status_t apr_get_filename(const char **new_path, apr_file_t *thefile) */ -apr_status_t apr_get_filename(const char **new_path, apr_file_t *thefile); +APR_DECLARE(apr_status_t) apr_get_filename(const char **new_path, + apr_file_t *thefile); /** * Get the file name of the current directory entry. * @param new_path the file name of the directory entry. * @param thedir the currently open directory. + * @deffunc apr_status_t apr_get_dir_filename(const char **new_path, apr_dir_t *thedir) */ -apr_status_t apr_get_dir_filename(const char **new_path, apr_dir_t *thedir); +APR_DECLARE(apr_status_t) apr_get_dir_filename(const char **new_path, + apr_dir_t *thedir); /** * Return the data associated with the current file. * @param data The user data associated with the file. * @param key The key to use for retreiving data associated with this file. * @param file The currently open file. + * @deffunc apr_status_t apr_get_filedata(void **data, const char *key, apr_file_t *file) */ -apr_status_t apr_get_filedata(void **data, const char *key, apr_file_t *file); +APR_DECLARE(apr_status_t) apr_get_filedata(void **data, const char *key, + apr_file_t *file); /** * Set the data associated with the current file. @@ -761,30 +669,38 @@ apr_status_t apr_get_filedata(void **data, const char *key, apr_file_t *file); * @param data The user data to associate with the file. * @param key The key to use for assocaiteing data with the file. * @param cleanup The cleanup routine to use when the file is destroyed. + * @deffunc apr_status_t apr_set_filedata(apr_file_t *file, void *data, const char *key, apr_status_t (*cleanup)(void *)) */ -apr_status_t apr_set_filedata(apr_file_t *file, void *data, const char *key, - apr_status_t (*cleanup) (void *)); +APR_DECLARE(apr_status_t) apr_set_filedata(apr_file_t *file, void *data, + const char *key, + apr_status_t (*cleanup)(void *)); /** * Get the size of the current directory entry. * @param size the size of the directory entry. * @param thedir the currently open directory. + * @deffunc apr_status_t apr_dir_entry_size(apr_size_t *size, apr_dir_t *thedir) */ -apr_status_t apr_dir_entry_size(apr_size_t *size, apr_dir_t *thedir); +APR_DECLARE(apr_status_t) apr_dir_entry_size(apr_size_t *size, + apr_dir_t *thedir); /** * Get the last modified time of the current directory entry. * @param mtime the last modified time of the directory entry. * @param thedir the currently open directory. + * @deffunc apr_status_t apr_dir_entry_mtime(apr_time_t *mtime, apr_dir_t *thedir) */ -apr_status_t apr_dir_entry_mtime(apr_time_t *mtime, apr_dir_t *thedir); +APR_DECLARE(apr_status_t) apr_dir_entry_mtime(apr_time_t *mtime, + apr_dir_t *thedir); /** * Get the file type of the current directory entry. * @param type the file type of the directory entry. * @param thedir the currently open directory. + * @deffunc apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir) */ -apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir); +APR_DECLARE(apr_status_t) apr_dir_entry_ftype(apr_filetype_e *type, + apr_dir_t *thedir); /** * Write a string to a file using a printf format. @@ -794,7 +710,7 @@ apr_status_t apr_dir_entry_ftype(apr_filetype_e *type, apr_dir_t *thedir); * @return The number of bytes written * @deffunc int apr_fprintf(apr_file_t *fptr, const char *format, ...) */ -APR_DECLARE(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) +APR_DECLARE_NONSTD(int) apr_fprintf(apr_file_t *fptr, const char *format, ...) __attribute__((format(printf,2,3))); #ifdef __cplusplus |