00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00043
00044
00045
00046
00047 #ifndef RECLS_DOCUMENTATION_SKIP_SECTION
00048 # define RECLS_VER_RECLS_H_RECLS_MAJOR 3
00049 # define RECLS_VER_RECLS_H_RECLS_MINOR 0
00050 # define RECLS_VER_RECLS_H_RECLS_REVISION 1
00051 # define RECLS_VER_RECLS_H_RECLS_EDIT 63
00052 #endif
00053
00068
00069 #define RECLS_VER_MAJOR 1
00070 #define RECLS_VER_MINOR 7
00071 #define RECLS_VER_REVISION 1
00072 #define RECLS_VER_1_0_1 0x01000100
00073 #define RECLS_VER_1_1_1 0x01010100
00074 #define RECLS_VER_1_2_1 0x01020100
00075 #define RECLS_VER_1_3_1 0x01030100
00076 #define RECLS_VER_1_4_1 0x01040100
00077 #define RECLS_VER_1_4_2 0x01040200
00078 #define RECLS_VER_1_5_1 0x01050100
00079 #define RECLS_VER_1_5_2 0x01050200
00080 #define RECLS_VER_1_5_3 0x01050300
00081 #define RECLS_VER_1_6_1 0x01060100
00082 #define RECLS_VER_1_6_2 0x01060200
00083 #define RECLS_VER_1_6_3 0x01060300
00084 #define RECLS_VER_1_6_4 0x01060400
00085 #define RECLS_VER_1_6_5 0x01060500
00086 #define RECLS_VER_1_7_1 0x01070100
00087 #define RECLS_VER RECLS_VER_1_7_1
00088
00089
00090
00091
00092
00093 #ifndef RECLS_NO_STRICT
00094 # define RECLS_STRICT
00095 #endif
00096
00097
00098
00099
00100
00101
00102 #include <recls/internal/language.h>
00103
00104 #include <recls/internal/platform.h>
00105
00106 #include <recls/internal/compiler.h>
00107
00108 #include <recls/internal/platform_types.h>
00109
00110
00111
00112
00113
00114 #if !defined(RECLS_NO_NAMESPACE)
00115 namespace recls
00116 {
00117 #endif
00118
00119 #if !defined(RECLS_NO_NAMESPACE)
00120 # define RECLS_QUAL(x) ::recls::x
00121 #else
00122 # define RECLS_QUAL(x) x
00123 #endif
00124
00125
00126
00127
00128
00129
00130 #if defined(RECLS_PLATFORM_IS_WIN32)
00131 # define RECLS_ROOT_NAME_LEN (3)
00132 #elif defined(RECLS_PLATFORM_IS_UNIX)
00133 # define RECLS_ROOT_NAME_LEN (1)
00134 #elif defined(RECLS_OVERRIDE_PLATFORM)
00135
00136 #else
00137 # error Platform not recognised
00138 #endif
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149 #define RECLS_FNDECL(rt) RECLS_LINKAGE_C rt RECLS_CALLCONV_DEFAULT
00150
00151
00152
00153
00154
00155
00156 #ifdef __cplusplus
00157
00159 typedef recls_sint32_t recls_rc_t;
00160
00162 const recls_rc_t RECLS_RC_OK(0);
00164 const recls_rc_t RECLS_RC_FAIL(-1);
00165
00167 inline bool RECLS_FAILED(recls_rc_t const &rc)
00168 {
00169 return rc < 0;
00170 }
00171
00173 inline bool RECLS_SUCCEEDED(recls_rc_t const &rc)
00174 {
00175 return !RECLS_FAILED(rc);
00176 }
00177
00178 #else
00179
00181 typedef recls_sint32_t recls_rc_t;
00182
00184 # define RECLS_RC_OK (0)
00185
00186 # define RECLS_RC_FAIL (-1)
00187
00189 # define RECLS_FAILED(rc) ((rc) < 0)
00190
00191 # define RECLS_SUCCEEDED(rc) (!RECLS_FAILED(rc))
00192
00193 #endif
00194
00195
00196
00197 #if !defined(RECLS_DOCUMENTATION_SKIP_SECTION) && \
00198 defined(RECLS_COMPILER_IS_BORLAND) && \
00199 __BORLANDC__ < 0x0560
00200 struct hrecls_t_
00201 {
00202 int dummy;
00203 };
00204 #else
00205 struct hrecls_t_;
00206 #endif
00207
00209 typedef struct hrecls_t_ const * hrecls_t;
00210
00211
00212
00213
00214
00215
00216 #if !defined(RECLS_NO_NAMESPACE)
00217 }
00218 #endif
00219
00220
00221
00222
00223
00224
00225 #include <recls/internal/retcodes.h>
00226
00227
00228
00229
00230
00231 #if !defined(RECLS_NO_NAMESPACE)
00232 namespace recls
00233 {
00234 #endif
00235
00236
00237
00238
00239
00246 enum RECLS_FLAG
00247 {
00248 RECLS_F_FILES = 0x00000001
00249 , RECLS_F_DIRECTORIES = 0x00000002
00250 , RECLS_F_LINKS = 0x00000004
00251 , RECLS_F_DEVICES = 0x00000008
00252 , RECLS_F_TYPEMASK = 0x00000FFF
00253 , RECLS_F_DIR_PROGRESS = 0x00001000
00254 , RECLS_F_RECURSIVE = 0x00010000
00255 , RECLS_F_NO_FOLLOW_LINKS = 0x00020000
00256 , RECLS_F_DIRECTORY_PARTS = 0x00040000
00257 , RECLS_F_DETAILS_LATER = 0x00080000
00258 , RECLS_F_PASSIVE_FTP = 0x00100000
00259 , RECLS_F_MARK_DIRS = 0x00200000
00260 , RECLS_F_ALLOW_REPARSE_DIRS = 0x00400000
00261 #if 0
00262 , RECLS_F_CALC_CHECKSUM = 0x00800000
00263 #endif
00264 , RECLS_F_CALLBACKS_STDCALL_ON_WIN32 = 0x01000000
00265
00266
00267 #if !defined(FILES)
00268 , FILES = RECLS_F_FILES
00269 #endif
00270 #if !defined(DIRECTORIES)
00271 , DIRECTORIES = RECLS_F_DIRECTORIES
00272 #endif
00273 #if !defined(LINKS)
00274 , LINKS = RECLS_F_LINKS
00275 #endif
00276 #if !defined(DEVICES)
00277 , DEVICES = RECLS_F_DEVICES
00278 #endif
00279 #if !defined(TYPEMASK)
00280 , TYPEMASK = RECLS_F_TYPEMASK
00281 #endif
00282 #if !defined(DIR_PROGRESS)
00283 , DIR_PROGRESS = RECLS_F_DIR_PROGRESS
00284 #endif
00285 #if !defined(RECURSIVE)
00286 , RECURSIVE = RECLS_F_RECURSIVE
00287 #endif
00288 #if !defined(NO_FOLLOW_LINKS)
00289 , NO_FOLLOW_LINKS = RECLS_F_NO_FOLLOW_LINKS
00290 #endif
00291 #if !defined(DIRECTORY_PARTS)
00292 , DIRECTORY_PARTS = RECLS_F_DIRECTORY_PARTS
00293 #endif
00294 #if !defined(DETAILS_LATER)
00295 , DETAILS_LATER = RECLS_F_DETAILS_LATER
00296 #endif
00297 #if !defined(PASSIVE_FTP)
00298 , PASSIVE_FTP = RECLS_F_PASSIVE_FTP
00299 #endif
00300 #if !defined(MARK_DIRS)
00301 , MARK_DIRS = RECLS_F_MARK_DIRS
00302 #endif
00303 #if !defined(ALLOW_REPARSE_DIRS)
00304 , ALLOW_REPARSE_DIRS = RECLS_F_ALLOW_REPARSE_DIRS
00305 #endif
00306 #if 0
00307 #if !defined(CALC_CHECKSUM)
00308 , CALC_CHECKSUM = RECLS_F_CALC_CHECKSUM
00309 #endif
00310 #endif
00311 #if !defined(CALLBACKS_STDCALL_ON_WIN32)
00312 , CALLBACKS_STDCALL_ON_WIN32 = RECLS_F_CALLBACKS_STDCALL_ON_WIN32
00313 #endif
00314
00315 };
00316
00324 enum RECLS_ROOTS_FLAG
00325 {
00326 RECLS_F_FIXED_DRIVES = 0x0001
00327 , RECLS_F_NETWORK_DRIVES = 0x0002
00328 , RECLS_F_CDROM_DRIVES = 0x0004
00329 , RECLS_F_REMOVABLE_DRIVES = 0x0008
00330 , RECLS_F_RAM_DRIVES = 0x0010
00331 };
00332
00333 #if !defined(__cplusplus) && \
00334 !defined(RECLS_DOCUMENTATION_SKIP_SECTION)
00335 typedef enum RECLS_FLAG RECLS_FLAG;
00336 typedef enum RECLS_ROOTS_FLAG RECLS_ROOTS_FLAG;
00337 #endif
00338
00339
00340
00341
00342
00343
00346
00347
00348
00349
00350 #ifndef RECLS_COMPILER_IS_CH
00351 typedef struct recls_root
00352 {
00354 recls_char_t name[1 + RECLS_ROOT_NAME_LEN];
00355 } recls_root_t;
00356 #endif
00357
00358 #ifndef RECLS_COMPILER_IS_CH
00359 struct recls_fileinfo_t;
00360 #endif
00361
00363 typedef struct recls_fileinfo_t const *recls_info_t;
00364
00366 typedef void *recls_process_fn_param_t;
00367
00377 typedef int (RECLS_CALLCONV_DEFAULT *hrecls_process_fn_t)( recls_info_t hEntry
00378 , recls_process_fn_param_t param);
00379
00391 typedef int (RECLS_CALLCONV_DEFAULT *hrecls_progress_fn_t)( recls_char_t const *dir
00392 , size_t dirLen
00393 , recls_process_fn_param_t param
00394 , void *reserved0
00395 , recls_uint32_t reserved1);
00396
00397
00398
00399
00400
00401 #if !defined(RECLS_NO_NAMESPACE)
00402 typedef recls_info_t info_t;
00403 typedef recls_process_fn_param_t process_fn_param_t;
00404 #endif
00405
00406
00407
00408
00409
00410
00411
00412
00413
00420 #ifndef RECLS_COMPILER_IS_CH
00421
00445 RECLS_FNDECL(size_t) Recls_GetRoots( recls_root_t *roots
00446 , size_t cRoots);
00447
00458 RECLS_FNDECL(size_t) Recls_GetSelectedRoots( recls_root_t *roots
00459 , size_t cRoots
00460 , recls_uint32_t flags);
00461 #endif
00462
00475 RECLS_FNDECL(recls_char_t const*) Recls_GetPathNameSeparator(void);
00476
00489 RECLS_FNDECL(recls_char_t const*) Recls_GetPathSeparator(void);
00490
00503 RECLS_FNDECL(recls_char_t const*) Recls_GetWildcardsAll(void);
00504
00507
00508
00509
00510
00528 RECLS_FNDECL(recls_rc_t) Recls_Search( recls_char_t const *searchRoot
00529 , recls_char_t const *pattern
00530 , recls_uint32_t flags
00531 , hrecls_t *phSrch);
00532
00544 RECLS_FNDECL(recls_rc_t) Recls_SearchFeedback( recls_char_t const *searchRoot
00545 , recls_char_t const *pattern
00546 , recls_uint32_t flags
00547 , hrecls_progress_fn_t pfn
00548 , recls_process_fn_param_t param
00549 , hrecls_t *phSrch);
00550
00551
00564 RECLS_FNDECL(recls_rc_t) Recls_SearchProcess( recls_char_t const *searchRoot
00565 , recls_char_t const *pattern
00566 , recls_uint32_t flags
00567 , hrecls_process_fn_t pfn
00568 , recls_process_fn_param_t param);
00569
00574 RECLS_FNDECL(void) Recls_SearchClose( hrecls_t hSrch);
00575
00576
00588 RECLS_FNDECL(recls_rc_t) Recls_Stat( recls_char_t const *path
00589 , recls_uint32_t flags
00590 , recls_info_t *phEntry);
00591
00594
00595
00596
00597
00613 RECLS_FNDECL(recls_rc_t) Recls_GetNext( hrecls_t hSrch);
00614
00625 RECLS_FNDECL(recls_rc_t) Recls_GetDetails( hrecls_t hSrch
00626 , recls_info_t *phEntry);
00627
00637 RECLS_FNDECL(recls_rc_t) Recls_GetNextDetails( hrecls_t hSrch
00638 , recls_info_t *phEntry);
00639
00642
00643
00644
00645
00656 RECLS_FNDECL(void) Recls_CloseDetails( recls_info_t hEntry);
00657
00667 RECLS_FNDECL(recls_rc_t) Recls_CopyDetails( recls_info_t hEntry
00668 , recls_info_t *phEntry);
00669
00679 RECLS_FNDECL(recls_rc_t) Recls_OutstandingDetails(hrecls_t hSrch
00680 , recls_uint32_t *count);
00681
00684
00685
00686
00687
00700 RECLS_FNDECL(recls_rc_t) Recls_GetLastError( hrecls_t hSrch);
00701
00710 RECLS_FNDECL(size_t) Recls_GetErrorString( recls_rc_t rc
00711 , recls_char_t *buffer
00712 , size_t cchBuffer);
00713
00722 RECLS_FNDECL(size_t) Recls_GetLastErrorString( hrecls_t hSrch
00723 , recls_char_t *buffer
00724 , size_t cchBuffer);
00725
00728
00729
00730
00731
00746 RECLS_FNDECL(size_t) Recls_GetPathProperty( recls_info_t hEntry
00747 , recls_char_t *buffer
00748 , size_t cchBuffer);
00749
00758 RECLS_FNDECL(size_t) Recls_GetSearchRelativePathProperty( recls_info_t hEntry
00759 , recls_char_t *buffer
00760 , size_t cchBuffer);
00761
00770 RECLS_FNDECL(size_t) Recls_GetDirectoryProperty(recls_info_t hEntry
00771 , recls_char_t *buffer
00772 , size_t cchBuffer);
00773
00784 RECLS_FNDECL(size_t) Recls_GetDirectoryPathProperty( recls_info_t hEntry
00785 , recls_char_t *buffer
00786 , size_t cchBuffer);
00787
00796 RECLS_FNDECL(size_t) Recls_GetSearchDirectoryProperty( recls_info_t hEntry
00797 , recls_char_t *buffer
00798 , size_t cchBuffer);
00799
00810 RECLS_FNDECL(size_t) Recls_GetUNCDriveProperty( recls_info_t hEntry
00811 , recls_char_t *buffer
00812 , size_t cchBuffer);
00813
00822 RECLS_FNDECL(size_t) Recls_GetFileProperty( recls_info_t hEntry
00823 , recls_char_t *buffer
00824 , size_t cchBuffer);
00825
00836 RECLS_FNDECL(size_t) Recls_GetShortFileProperty(recls_info_t hEntry
00837 , recls_char_t *buffer
00838 , size_t cchBuffer);
00839
00848 RECLS_FNDECL(size_t) Recls_GetFileNameProperty( recls_info_t hEntry
00849 , recls_char_t *buffer
00850 , size_t cchBuffer);
00851
00860 RECLS_FNDECL(size_t) Recls_GetFileExtProperty( recls_info_t hEntry
00861 , recls_char_t *buffer
00862 , size_t cchBuffer);
00863
00875 RECLS_FNDECL(size_t) Recls_GetDirectoryPartProperty(recls_info_t hEntry
00876 , int part
00877 , recls_char_t *buffer
00878 , size_t cchBuffer);
00879
00880
00889 RECLS_FNDECL(recls_bool_t) Recls_IsFileReadOnly(recls_info_t hEntry);
00890
00899 RECLS_FNDECL(recls_bool_t) Recls_IsFileDirectory(recls_info_t hEntry);
00900
00909 RECLS_FNDECL(recls_bool_t) Recls_IsFileLink( recls_info_t hEntry);
00910
00919 RECLS_FNDECL(recls_bool_t) Recls_IsFileUNC( recls_info_t hEntry);
00920
00928 RECLS_FNDECL(void) Recls_GetSizeProperty( recls_info_t hEntry
00929 , recls_filesize_t *size);
00930
00932 RECLS_FNDECL(recls_time_t) Recls_GetCreationTime(recls_info_t hEntry);
00933
00935 RECLS_FNDECL(recls_time_t) Recls_GetModificationTime(recls_info_t hEntry);
00936
00938 RECLS_FNDECL(recls_time_t) Recls_GetLastAccessTime(recls_info_t hEntry);
00939
00941 RECLS_FNDECL(recls_time_t) Recls_GetLastStatusChangeTime(recls_info_t hEntry);
00942
00943 #if 0
00944
00949 RECLS_FNDECL(recls_uint32_t) Recls_GetChecksum( recls_info_t hEntry);
00950 #endif
00951
00954
00955
00956
00957
00964
00965
00966
00967
00968
00969 RECLS_FNDECL(recls_bool_t) Recls_IsDirectoryEmpty(recls_char_t const *dir);
00970
00971 RECLS_FNDECL(recls_bool_t) Recls_IsDirectoryEntryEmpty(recls_info_t hEntry);
00972
00973 RECLS_FNDECL(recls_filesize_t) Recls_CalcDirectorySize(recls_char_t const *dir);
00974
00975 RECLS_FNDECL(recls_filesize_t) Recls_CalcDirectoryEntrySize(recls_info_t hEntry);
00976
00979
00980
00981
00982
00983 #if !defined(RECLS_NO_NAMESPACE)
00984 }
00985 #endif
00986
00987 #ifdef __cplusplus
00988
00989 # ifndef _STLSOFT_NO_NAMESPACE
00990 namespace stlsoft
00991 {
00992 # endif
00993
00994 # if defined(RECLS_NO_NAMESPACE)
00995 inline recls_char_t const *c_str_ptr(recls_root_t const &root)
00996 # else
00997 inline ::recls::recls_char_t const *c_str_ptr(::recls::recls_root_t const &root)
00998 # endif
00999 {
01000 return root.name;
01001 }
01002
01003 # ifndef _STLSOFT_NO_NAMESPACE
01004 }
01005 # endif
01006
01007 #endif
01008
01009
01010
01011
01012
01013
01014
01015
01016 #ifdef RECLS_PLATFORM_API_WIN32
01017 # undef RECLS_PLATFORM_API_WIN32
01018 #endif
01019
01020 #ifdef RECLS_PLATFORM_API_UNIX
01021 # undef RECLS_PLATFORM_API_UNIX
01022 #endif
01023
01024 #if !defined(RECLS_PURE_API)
01025 # if defined(RECLS_PLATFORM_IS_WIN32)
01026 # include <recls/win32.h>
01027 # define RECLS_PLATFORM_API_WIN32
01028 # elif defined(RECLS_PLATFORM_IS_UNIX)
01029 # include <recls/unix.h>
01030 # define RECLS_PLATFORM_API_UNIX
01031 # else
01032 # error Platform not recognised
01033 # endif
01034 #endif
01035
01036
01037
01038
01039
01040