1 /*
2  *  ADF Library. (C) 1997-2002 Laurent Clevy
3  *
4  *  adf_raw.h
5  *
6  *  $Id$
7  *
8  *  blocks level code
9  *
10  *  This file is part of ADFLib.
11  *
12  *  ADFLib is free software; you can redistribute it and/or modify
13  *  it under the terms of the GNU General Public License as published by
14  *  the Free Software Foundation; either version 2 of the License, or
15  *  (at your option) any later version.
16  *
17  *  ADFLib is distributed in the hope that it will be useful,
18  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  *  GNU General Public License for more details.
21  *
22  *  You should have received a copy of the GNU General Public License
23  *  along with Foobar; if not, write to the Free Software
24  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
25  *
26  */
27 
28 #ifndef _ADF_RAW_H
29 #define _ADF_RAW_H 1
30 
31 #include "adf_str.h"
32 
33 #define SW_LONG  4
34 #define SW_SHORT 2
35 #define SW_CHAR  1
36 
37 #define MAX_SWTYPE 11
38 
39 #define SWBL_BOOT         0
40 #define SWBL_ROOT         1
41 #define SWBL_DATA         2
42 #define SWBL_FILE         3
43 #define SWBL_ENTRY        3
44 #define SWBL_DIR          3
45 #define SWBL_CACHE        4
46 #define SWBL_BITMAP       5
47 #define SWBL_FEXT         5
48 #define SWBL_LINK         6
49 #define SWBL_BITMAPE      5
50 #define SWBL_RDSK         7
51 #define SWBL_BADB         8
52 #define SWBL_PART         9
53 #define SWBL_FSHD         10
54 #define SWBL_LSEG         11
55 
56 RETCODE adfReadRootBlock(struct Volume*, int32_t nSect, struct bRootBlock* root);
57 RETCODE adfWriteRootBlock(struct Volume* vol, int32_t nSect, struct bRootBlock* root);
58 RETCODE adfReadBootBlock(struct Volume*, struct bBootBlock* boot);
59 RETCODE adfWriteBootBlock(struct Volume* vol, struct bBootBlock* boot);
60 
61 uint32_t adfBootSum(uint8_t *buf);
62 uint32_t adfNormalSum( uint8_t *buf, int offset, int bufLen );
63 
64 void swapEndian( uint8_t *buf, int type );
65 
66 #endif /* _ADF_RAW_H */
67 
68 /*##########################################################################*/
69