1 #ifndef DIRENT_H
2 #define DIRENT_H
3
4 // CHDK dirent
5
6 // Note: used in modules and platform independent code.
7 // Do not add platform dependent stuff in here (#ifdef/#endif compile options or camera dependent values)
8
9 //==========================================================
10
11 // CHDK structs for opendir/readdir/closedir
12 // Conversion to/from camera specific versions done in wrapper code
13 struct dirent // Returned from readdir
14 {
15 char d_name[100]; // We only use the name value
16 };
17
18 // Returned from opendir
19 typedef struct
20 {
21 void *cam_DIR; // Camera specific internal DIR structure
22 int fw_dir; // 1 if firmware function is used, 0 if CHDK implementation
23 struct dirent dir; // Last info returned from readdir
24 } DIR;
25
26 // opendir_chdk has non-standard second arg
27 #define OPENDIR_FL_NONE 0x0
28 #define OPENDIR_FL_CHDK_LFN 0x1 // use CHDK long file name support, if available.
29 // No effect on VxWorks, which supports LFNs natively
30 // Non-CHDK LFN support on DryOS varies by OS version and filesystem
31 extern DIR* opendir (const char* name); // wrapper of opendir_chdk(name,FL_NONE) for easy compatibility
32 extern DIR* opendir_chdk (const char* name,unsigned flags);
33 extern struct dirent* readdir (DIR*);
34 extern int closedir (DIR*);
35
36 //---------------------------------------------------------------
37
38 #endif