Added "support" for the 64 bit data structures of EHCI in appendix B, in case the...
[cake.git] / tools / adflib / adflib.h
blob34ee361b636cfd1f5a27fc639ce9acf090b44ad4
1 #ifndef ADFLIB_H
2 #define ADFLIB_H 1
4 /*
5 * ADF Library. (C) 1997-1998 Laurent Clevy
7 * adflib.h
9 * include file
12 #ifdef __cplusplus
13 extern "C" {
14 #endif /* __cplusplus */
17 /* Visual C++ DLL specific, define WIN32DLL or not in the makefile */
19 #ifdef WIN32DLL
20 #define PREFIX __declspec(dllimport)
21 #else
22 #define PREFIX
23 #endif /* WIN32DLL */
25 #include "adf_defs.h"
26 #include "adf_str.h"
28 /* util */
29 PREFIX struct List* newCell(struct List* list, void* content);
30 PREFIX void freeList(struct List* list);
32 /* dir */
33 PREFIX RETCODE adfToRootDir(struct Volume *vol);
34 PREFIX RETCODE adfCreateDir(struct Volume* vol, SECTNUM parent, char* name);
35 PREFIX RETCODE adfChangeDir(struct Volume* vol, char *name);
36 PREFIX RETCODE adfParentDir(struct Volume* vol);
37 PREFIX RETCODE adfRemoveEntry(struct Volume *vol, SECTNUM pSect, char *name);
38 PREFIX struct List* adfGetDirEnt(struct Volume* vol, SECTNUM nSect );
39 PREFIX struct List* adfGetRDirEnt(struct Volume* vol, SECTNUM nSect, BOOL recurs );
40 PREFIX void printEntry(struct Entry* entry);
41 PREFIX void adfFreeDirList(struct List* list);
42 PREFIX void adfFreeEntry(struct Entry *);
43 PREFIX RETCODE adfRenameEntry(struct Volume *vol, SECTNUM, char *old,SECTNUM,char *new);
44 PREFIX RETCODE adfSetEntryAccess(struct Volume*, SECTNUM, char*, long);
45 PREFIX RETCODE adfSetEntryComment(struct Volume*, SECTNUM, char*, char*);
47 /* file */
48 PREFIX long adfFileRealSize(unsigned long size, int blockSize, long *dataN, long *extN);
49 PREFIX struct File* adfOpenFile(struct Volume *vol, char* name, char *mode);
50 PREFIX void adfCloseFile(struct File *file);
51 PREFIX long adfReadFile(struct File* file, long n, unsigned char *buffer);
52 PREFIX BOOL adfEndOfFile(struct File* file);
53 PREFIX long adfWriteFile(struct File *file, long n, unsigned char *buffer);
54 PREFIX void adfFlushFile(struct File *file);
56 /* volume */
57 PREFIX RETCODE adfInstallBootBlock(struct Volume *vol,unsigned char*);
58 PREFIX struct Volume* adfMount( struct Device *dev, int nPart, BOOL readOnly );
59 PREFIX void adfUnMount(struct Volume *vol);
60 PREFIX void adfVolumeInfo(struct Volume *vol);
62 /* device */
63 PREFIX void adfDeviceInfo(struct Device *dev);
64 PREFIX struct Device* adfMountDev( char* filename,BOOL ro);
65 PREFIX void adfUnMountDev( struct Device* dev);
66 PREFIX RETCODE adfCreateHd(struct Device* dev, int n, struct Partition** partList );
67 PREFIX RETCODE adfCreateFlop(struct Device* dev, char* volName, int volType );
68 PREFIX RETCODE adfCreateHdFile(struct Device* dev, char* volName, int volType);
70 /* dump device */
71 PREFIX struct Device* adfCreateDumpDevice(char* filename, long cyl, long heads, long sec);
73 /* env */
74 PREFIX void adfEnvInitDefault();
75 PREFIX void adfEnvCleanUp();
76 PREFIX void adfChgEnvProp(int prop, void *new);
77 PREFIX char* adfGetVersionNumber();
78 PREFIX char* adfGetVersionDate();
79 /* obsolete */
80 PREFIX void adfSetEnvFct( void(*e)(char*), void(*w)(char*), void(*v)(char*) );
82 /* link */
83 PREFIX RETCODE adfBlockPtr2EntryName(struct Volume *, SECTNUM, SECTNUM,char **, long *);
85 /* salv */
86 PREFIX struct List* adfGetDelEnt(struct Volume *vol);
87 PREFIX RETCODE adfUndelEntry(struct Volume* vol, SECTNUM parent, SECTNUM nSect);
88 PREFIX void adfFreeDelList(struct List* list);
89 PREFIX RETCODE adfCheckEntry(struct Volume* vol, SECTNUM nSect, int level);
91 /* middle level API */
93 PREFIX BOOL isSectNumValid(struct Volume *vol, SECTNUM nSect);
95 /* low level API */
97 PREFIX RETCODE adfReadBlock(struct Volume* , long nSect, unsigned char* buf);
98 PREFIX RETCODE adfWriteBlock(struct Volume* , long nSect, unsigned char* buf);
99 PREFIX long adfCountFreeBlocks(struct Volume* vol);
102 #ifdef __cplusplus
104 #endif
106 #endif /* ADFLIB_H */
107 /*##########################################################################*/