grub2: bring back build of aros-side grub2 tools
[AROS.git] / tools / adflib / adflib.h
blob97328bc1a322d8803f702f19fde6bfc87ac5d542
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 */
16 #include "adf_defs.h"
17 #include "adf_str.h"
19 /* util */
20 PREFIX struct List* newCell(struct List* list, void* content);
21 PREFIX void freeList(struct List* list);
23 /* dir */
24 PREFIX RETCODE adfToRootDir(struct Volume *vol);
25 PREFIX RETCODE adfCreateDir(struct Volume* vol, SECTNUM parent, char* name);
26 PREFIX SECTNUM adfCurrentDir(struct Volume *vol);
27 PREFIX RETCODE adfChangeDir(struct Volume* vol, char *name);
28 PREFIX RETCODE adfParentDir(struct Volume* vol);
29 PREFIX RETCODE adfRemoveEntry(struct Volume *vol, SECTNUM pSect, char *name);
30 PREFIX struct List* adfGetDirEnt(struct Volume* vol, SECTNUM nSect );
31 PREFIX struct List* adfGetRDirEnt(struct Volume* vol, SECTNUM nSect, BOOL recurs );
32 PREFIX void printEntry(struct Entry* entry);
33 PREFIX void adfFreeDirList(struct List* list);
34 PREFIX void adfFreeEntry(struct Entry *);
35 PREFIX RETCODE adfRenameEntry(struct Volume *vol, SECTNUM, char *old,SECTNUM,char *new);
36 PREFIX RETCODE adfSetEntryAccess(struct Volume*, SECTNUM, char*, ULONG);
37 PREFIX RETCODE adfSetEntryComment(struct Volume*, SECTNUM, char*, char*);
39 /* file */
40 PREFIX ULONG adfFileRealSize(ULONG size, int blockSize, ULONG *dataN, ULONG *extN);
41 PREFIX struct File* adfOpenFile(struct Volume *vol, char* name, char *mode);
42 PREFIX void adfCloseFile(struct File *file);
43 PREFIX ULONG adfReadFile(struct File* file, ULONG n, unsigned char *buffer);
44 PREFIX BOOL adfEndOfFile(struct File* file);
45 PREFIX ULONG adfWriteFile(struct File *file, ULONG n, unsigned char *buffer);
46 PREFIX void adfFlushFile(struct File *file);
48 /* volume */
49 PREFIX RETCODE adfInstallBootBlock(struct Volume *vol,unsigned char*);
50 PREFIX struct Volume* adfMount( struct Device *dev, int nPart, BOOL readOnly );
51 PREFIX void adfUnMount(struct Volume *vol);
52 PREFIX void adfVolumeInfo(struct Volume *vol);
54 /* device */
55 PREFIX void adfDeviceInfo(struct Device *dev);
56 PREFIX struct Device* adfMountDev( char* filename,BOOL ro);
57 PREFIX void adfUnMountDev( struct Device* dev);
58 PREFIX RETCODE adfCreateHd(struct Device* dev, int n, struct Partition** partList );
59 PREFIX RETCODE adfCreateFlop(struct Device* dev, char* volName, int volType );
60 PREFIX RETCODE adfCreateHdFile(struct Device* dev, char* volName, int volType);
62 /* dump device */
63 PREFIX struct Device* adfCreateDumpDevice(char* filename, ULONG cyl, ULONG heads, ULONG sec);
65 /* env */
66 PREFIX void adfEnvInitDefault();
67 PREFIX void adfEnvCleanUp();
68 PREFIX void adfChgEnvProp(int prop, void *new);
69 PREFIX char* adfGetVersionNumber();
70 PREFIX char* adfGetVersionDate();
71 /* obsolete */
72 PREFIX void adfSetEnvFct( void(*e)(char*), void(*w)(char*), void(*v)(char*) );
74 /* link */
75 PREFIX RETCODE adfBlockPtr2EntryName(struct Volume *, SECTNUM, SECTNUM,char **, ULONG *);
77 /* salv */
78 PREFIX struct List* adfGetDelEnt(struct Volume *vol);
79 PREFIX RETCODE adfUndelEntry(struct Volume* vol, SECTNUM parent, SECTNUM nSect);
80 PREFIX void adfFreeDelList(struct List* list);
81 PREFIX RETCODE adfCheckEntry(struct Volume* vol, SECTNUM nSect, int level);
83 /* middle level API */
85 PREFIX BOOL isSectNumValid(struct Volume *vol, SECTNUM nSect);
87 /* low level API */
89 PREFIX RETCODE adfReadBlock(struct Volume* , ULONG nSect, unsigned char* buf);
90 PREFIX RETCODE adfWriteBlock(struct Volume* , ULONG nSect, unsigned char* buf);
91 PREFIX ULONG adfCountFreeBlocks(struct Volume* vol);
94 #ifdef __cplusplus
96 #endif
98 #endif /* ADFLIB_H */
99 /*##########################################################################*/