14 extern struct Env adfEnv
;
19 * must fill 'dev->size'
21 RETCODE
myInitDevice(struct Device
* dev
, char* name
,BOOL ro
)
23 struct nativeDevice
* nDev
;
25 nDev
= (struct nativeDevice
*)dev
->nativeDev
;
27 nDev
= (struct nativeDevice
*)malloc(sizeof(struct nativeDevice
));
29 (*adfEnv
.eFct
)("myInitDevice : malloc");
32 dev
->nativeDev
= nDev
;
34 /* check if device is writable, if not, force readOnly to TRUE */
35 dev
->readOnly
= FALSE
;
37 /* mount device as read only */
50 RETCODE
myReadSector(struct Device
*dev
, long n
, int size
, unsigned char* buf
)
60 RETCODE
myWriteSector(struct Device
*dev
, long n
, int size
, unsigned char* buf
)
71 RETCODE
myReleaseDevice(struct Device
*dev
)
73 struct nativeDevice
* nDev
;
75 nDev
= (struct nativeDevice
*)dev
->nativeDev
;
87 void adfInitNativeFct()
89 struct nativeFunctions
*nFct
;
91 nFct
= (struct nativeFunctions
*)adfEnv
.nativeFct
;
93 nFct
->adfInitDevice
= myInitDevice
;
94 nFct
->adfNativeReadSector
= myReadSector
;
95 nFct
->adfNativeWriteSector
= myWriteSector
;
96 nFct
->adfReleaseDevice
= myReleaseDevice
;
97 nFct
->adfIsDevNative
= myIsDevNative
;
105 BOOL
myIsDevNative(char *devName
)
107 return (strncmp(devName
,"/xxx/",5)==0);
109 /*##########################################################################*/