diff options
Diffstat (limited to 'src/lib/hd24utils.h')
-rwxr-xr-x | src/lib/hd24utils.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/lib/hd24utils.h b/src/lib/hd24utils.h new file mode 100755 index 0000000..b7a9fa7 --- /dev/null +++ b/src/lib/hd24utils.h | |||
@@ -0,0 +1,64 @@ | |||
1 | #ifndef __hd24utils_h__ | ||
2 | #define __hd24utils_h__ | ||
3 | #ifndef WINDOWS | ||
4 | #define PATHSLASH "/" | ||
5 | # include <sys/dir.h> | ||
6 | # include <dirent.h> | ||
7 | #else | ||
8 | #define PATHSLASH "\\" | ||
9 | # include <dir.h> | ||
10 | # include <windows.h> | ||
11 | # include <winioctl.h> | ||
12 | # define FSHANDLE HANDLE | ||
13 | # define FSHANDLE_INVALID INVALID_HANDLE_VALUE | ||
14 | #endif | ||
15 | |||
16 | #if defined(LINUX) || defined(DARWIN) | ||
17 | # define FSHANDLE int | ||
18 | # define FSHANDLE_INVALID -1 | ||
19 | #endif | ||
20 | |||
21 | #include <config.h> | ||
22 | #include <stdio.h> | ||
23 | #include <string> | ||
24 | #include <FL/FLTKstuff.H> | ||
25 | #include "convertlib.h" | ||
26 | #include "memutils.h" | ||
27 | #include <hd24fs.h> | ||
28 | |||
29 | using namespace std; | ||
30 | class hd24fs; | ||
31 | class hd24project; | ||
32 | class hd24song; | ||
33 | |||
34 | class hd24utils | ||
35 | { | ||
36 | friend class hd24fs; | ||
37 | friend class hd24project; | ||
38 | friend class hd24song; | ||
39 | private: | ||
40 | // static void savecatalog_showprojects(hd24fs* currenthd24,fstream & to_out); | ||
41 | // static void savecatalog_showsongs(hd24project* currentproj,fstream & to_out); | ||
42 | static void gencatalog_showprojects(hd24fs* currenthd24,string* strcatalog); | ||
43 | static void gencatalog_showsongs(hd24project* currentproj,string* strcatalog); | ||
44 | |||
45 | public: | ||
46 | // static int savecatalog(hd24fs* currenthd24,string* headerfilename,bool toprint); | ||
47 | // static int gencatalog(hd24fs* currenthd24,string* headerfilename,bool toprint); | ||
48 | static string* savecatalog(hd24fs* currenthd24,string* filename); | ||
49 | static void findfile(const char* rawfilename, const char* searchpath, char* result); | ||
50 | static int gencatalog(hd24fs* currenthd24,string* strcatalog); | ||
51 | static string* printcatalog(hd24fs* currenthd24); | ||
52 | static int saveheader(hd24fs* currenthd24,string* headerfilename); | ||
53 | static int savedriveimage(hd24fs* currenthd24,string* imagefilename, char* message,int* cancel); | ||
54 | static int newdriveimage(string* imagefilename,__uint32 endsector,char* message,int* cancel); | ||
55 | static int savedrivesectors(hd24fs* currenthd24,string* imagefilename,unsigned long startsector,unsigned long endsector,char* message,int* cancel); | ||
56 | static void interlacetobuffer(unsigned char* sourcebuf,unsigned char* targetbuf, __uint32 totbytes,__uint32 bytespersam,__uint32 trackwithingroup,__uint32 trackspergroup); | ||
57 | static bool dirExists(const char * pszDirName); | ||
58 | static bool fileExists(const char * filename); | ||
59 | static string* getlastdir(string which); | ||
60 | static void dumpsector (const char* buffer); | ||
61 | static void setlastdir(string which,const char* newdir); | ||
62 | }; | ||
63 | |||
64 | #endif | ||