NetBurner 3.5.0
PDF Version
 
fsmf.h
1/*NB_REVISION*/
2
3#ifndef _FSMF_H_
4#define _FSMF_H_
5
6/****************************************************************************
7 *
8 * Copyright (c) 2003 by HCC Embedded
9 *
10 * This software is copyrighted by and is the sole property of
11 * HCC. All rights, title, ownership, or other interests
12 * in the software remain the property of HCC. This
13 * software may only be used in accordance with the corresponding
14 * license agreement. Any unauthorized use, duplication, transmission,
15 * distribution, or disclosure of this software is expressly forbidden.
16 *
17 * This Copyright notice may not be removed or modified without prior
18 * written consent of HCC.
19 *
20 * HCC reserves the right to modify this software without notice.
21 *
22 * HCC Embedded
23 * Budapest 1132
24 * Victor Hugo Utca 11-15
25 * Hungary
26 *
27 * Tel: +36 (1) 450 1302
28 * Fax: +36 (1) 450 1303
29 * http: www.hcc-embedded.com
30 * email: info@hcc-embedded.com
31 *
32 ***************************************************************************/
33
34#ifdef __cplusplus
35extern "C"
36{
37#endif
38
39 /* //////////////////////////////////////////////////////////////////////////////////// */
40 /* */
41 /* Init Functions */
42 /* */
43 /* //////////////////////////////////////////////////////////////////////////////////// */
44
45#define fsm_getversion fg_getversion
46#define fsm_init fg_init
47#define fsm_mountdrive fg_mountdrive
48#define fsm_unmountdrive fg_unmountdrive
49 extern int fsm_getfreespace(int drivenum, FS_SPACE *space);
50 extern void fsm_releaseFS(long ID);
51
52 extern int fsm_format(int drivenum);
53 extern int fsm_get_drive_list(int *buf);
54 extern int fsm_get_drive_count(void);
55
56 /* //////////////////////////////////////////////////////////////////////////////////// */
57 /* */
58 /* Directory handler functions */
59 /* */
60 /* //////////////////////////////////////////////////////////////////////////////////// */
61
62 extern int fsm_getdrive(void);
63 extern int fsm_chdrive(int drivenum);
64
65 extern int fsm_getcwd(char *buffer, int maxlen);
66 extern int fsm_getdcwd(int drivenum, char *buffer, int maxlen);
67
68 extern int fsm_mkdir(const char *dirname);
69 extern int fsm_chdir(const char *dirname);
70 extern int fsm_rmdir(const char *dirname);
71
72 /* //////////////////////////////////////////////////////////////////////////////////// */
73 /* */
74 /* files functions */
75 /* */
76 /* //////////////////////////////////////////////////////////////////////////////////// */
77
78 extern int fsm_rename(const char *filename, const char *newname);
79 extern int fsm_move(const char *filename, const char *newname);
80 extern int fsm_delete(const char *filename);
81
82 extern long fsm_filelength(const char *filename);
83
84 extern int fsm_findfirst(const char *filename, FS_FIND *find);
85 extern int fsm_findnext(FS_FIND *find);
86
87 extern int fsm_getpermission(const char *filename, unsigned long *psecure);
88 extern int fsm_setpermission(const char *filename, unsigned long secure);
89
90 /* //////////////////////////////////////////////////////////////////////////////////// */
91 /* */
92 /* file read/write functions */
93 /* */
94 /* //////////////////////////////////////////////////////////////////////////////////// */
95
96 extern FS_FILE *fsm_open(const char *filename, const char *mode);
97 extern int fsm_close(FS_FILE *filehandle);
98 extern long fsm_write(const void *buf, long size, long size_st, FS_FILE *filehandle);
99 extern long fsm_read(void *buf, long size, long size_st, FS_FILE *filehandle);
100 extern int fsm_seek(FS_FILE *filehandle, long offset, long whence);
101 extern long fsm_tell(FS_FILE *filehandle);
102 extern int fsm_eof(FS_FILE *filehandle);
103 extern int fsm_rewind(FS_FILE *filehandle);
104 extern int fsm_putc(int ch, FS_FILE *filehandle);
105 extern int fsm_getc(FS_FILE *filehandle);
106 extern int fsm_flush(FS_FILE *filehandle);
107 extern int fsm_seteof(FS_FILE *filehandle);
108
109 extern int fsm_settimedate(const char *filename, unsigned short ctime, unsigned short cdate);
110 extern int fsm_gettimedate(const char *filename, unsigned short *ctime, unsigned short *cdate);
111 extern int fsm_getlabel(int drivenum, char *label, long len);
112 extern int fsm_setlabel(int drivenum, const char *label);
113 extern FS_FILE *fsm_truncate(const char *filename, unsigned long length);
114
115#ifdef HCC_UNICODE
116 extern int fsm_wgetcwd(W_CHAR *buffer, int maxlen);
117 extern int fsm_wgetdcwd(int drivenum, W_CHAR *buffer, int maxlen);
118 extern int fsm_wmkdir(const W_CHAR *dirname);
119 extern int fsm_wchdir(const W_CHAR *dirname);
120 extern int fsm_wrmdir(const W_CHAR *dirname);
121 extern int fsm_wrename(const W_CHAR *filename, const W_CHAR *newname);
122 extern int fsm_wmove(const W_CHAR *filename, const W_CHAR *newname);
123 extern int fsm_wdelete(const W_CHAR *filename);
124 extern long fsm_wfilelength(const W_CHAR *filename);
125 extern int fsm_wfindfirst(const W_CHAR *filename, FS_WFIND *find);
126 extern int fsm_wfindnext(FS_WFIND *find);
127 extern int fsm_wgetpermission(const W_CHAR *filename, unsigned long *psecure);
128 extern int fsm_wsetpermission(const W_CHAR *filename, unsigned long secure);
129 extern FS_FILE *fsm_wopen(const W_CHAR *filename, const W_CHAR *mode);
130 extern int fsm_wsettimedate(const W_CHAR *filename, unsigned short ctime, unsigned short cdate);
131 extern int fsm_wgettimedate(const W_CHAR *filename, unsigned short *ctime, unsigned short *cdate);
132 extern FS_FILE *fsm_wtruncate(const W_CHAR *filename, unsigned long length);
133#endif
134
135 /****************************************************************************
136 *
137 * internal common functions for reantrancy
138 *
139 ***************************************************************************/
140
141 extern int _fsm_checksemaphore(FS_MULTI *fm, FS_VOLUMEINFO *vi);
142 extern void _fsm_releasesemaphore(FS_MULTI *fm);
143 extern int _fsm_settask(FS_MULTI **fm);
144
145#ifdef __cplusplus
146}
147#endif
148
149/****************************************************************************
150 *
151 * End of fsmf.h
152 *
153 ***************************************************************************/
154
155#endif /* _FSMF_H_ */