00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _LCN_DIRECTORY_H
00023 #define _LCN_DIRECTORY_H
00024
00025 #include "lcn_types.h"
00026 #include "lcn_istream.h"
00027
00028 #include <apr_hash.h>
00029 #include <apr_tables.h>
00030 #include <apr_time.h>
00031
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035
00036
00037 typedef struct lcn_directory_t lcn_directory_t;
00038
00039
00040 typedef struct {
00041 const char *bytes;
00042 apr_size_t len;
00043 apr_time_t mtime;
00044 } lcn_directory_entry_t;
00045
00046
00047
00048
00049
00050
00051 lcn_error_t *
00052 lcn_ram_directory_open (lcn_directory_t **dir,
00053 apr_hash_t *contents,
00054 apr_pool_t *pool);
00055
00056
00057
00058
00059 lcn_error_t *
00060 lcn_fs_directory_open (lcn_directory_t **dir,
00061 const char *path,
00062 apr_pool_t *pool);
00063
00064
00065
00066
00067 lcn_error_t *
00068 lcn_cfs_directory_open (lcn_directory_t **dir,
00069 lcn_istream_t *cfsfile,
00070 apr_pool_t *pool);
00071
00072
00073
00074
00075
00076
00077 lcn_error_t *
00078 lcn_directory_list (apr_array_header_t **contents,
00079 const lcn_directory_t *d,
00080 apr_pool_t *pool);
00081
00082
00083
00084
00085
00086
00087 lcn_error_t *
00088 lcn_directory_file_exists (lcn_boolean_t *result,
00089 const lcn_directory_t *d,
00090 const char *name,
00091 apr_pool_t *pool);
00092
00093
00094
00095
00096 lcn_error_t *
00097 lcn_directory_file_modified (apr_time_t *result,
00098 const lcn_directory_t *d,
00099 const char *name,
00100 apr_pool_t *pool);
00101
00102
00103
00104
00105 lcn_error_t *
00106 lcn_directory_touch_file (lcn_directory_t *d,
00107 const char *name,
00108 apr_pool_t *pool);
00109
00110
00111
00112
00113 lcn_error_t *
00114 lcn_directory_delete_file (lcn_directory_t *d,
00115 const char *name,
00116 apr_pool_t *pool);
00117
00118
00119
00120
00121 lcn_error_t *
00122 lcn_directory_rename_file (lcn_directory_t *d,
00123 const char *from,
00124 const char *to,
00125 apr_pool_t *pool);
00126
00127 #ifdef NOTYET
00128 lcn_error_t *
00129 lcn_directory_create_file (lcn_ostream_t **result,
00130 lcn_directory_t *d,
00131 const char *name,
00132 apr_pool_t *pool);
00133 #endif
00134
00135
00136
00137
00138 lcn_error_t *
00139 lcn_directory_open_file (lcn_istream_t **result,
00140 const lcn_directory_t *d,
00141 const char *name,
00142 apr_pool_t *pool);
00143
00144 #ifdef NOTYET
00145 lcn_error_t *
00146 lcn_directory_make_lock (lcn_lock_t **lock,
00147 lcn_directory_t *d,
00148 const char *name,
00149 apr_pool_t *pool);
00150 #endif
00151
00152
00153
00154
00155
00156
00157 lcn_error_t *
00158 lcn_directory_close (lcn_directory_t *d, apr_pool_t *pool);
00159
00160 #ifdef __cplusplus
00161 }
00162 #endif
00163
00164 #endif