grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / system / BHFormat / format.h
bloba118e16fa6fa09cc6c6989c2022ca054dc86d322
1 /*
2 * Format -- disk formatting and file-system creation program
3 * Copyright (C) 1999 Ben Hutchings <womble@zzumbouk.demon.co.uk>
4 * Copyright (C) 2008 Pavel Fedin <sonic_amiga@rambler.ru>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef __GNUC__
23 #error "You need to use GNU CC to compile this."
24 #endif
26 #ifdef __MORPHOS__
27 #define HAVE_NEWRAWDOFMT
28 #endif
29 #ifdef __AROS__
30 #define HAVE_NEWRAWDOFMT
31 #endif
33 #include <dos/dos.h>
34 #include <exec/types.h>
35 #ifdef HAVE_NEWRAWDOFMT
36 #include <exec/rawfmt.h>
37 #endif
39 #include <stdarg.h>
41 #ifdef __AROS__
42 #include <aros/debug.h>
43 #define _WBenchMsg WBenchMsg
44 #else
45 #include <clib/debug_protos.h>
46 #define bug kprintf
47 #ifdef DEBUG
48 #define D(x) (x)
49 #else
50 #define D(x)
51 #endif
52 #endif
55 /* Maximum length of a name component - I can't find this defined anywhere */
56 #define MAX_FS_NAME_LEN 30
58 /* Short name for an unsigned 64-bit integer type */
59 typedef unsigned long long ULLONG;
61 typedef enum {
62 ertWarning, /* Just a warning of some odd condition */
63 ertError, /* Arguments were invalid or system configuration is wierd */
64 ertFailure, /* Something failed, and we can't go on */
65 } ErrorType;
67 extern struct WBStartup * _WBenchMsg;
68 extern BPTR bpfhStdErr;
69 extern char szDosDevice[MAX_FS_NAME_LEN+2];
70 extern char * pchDosDeviceColon;
71 extern ULLONG ibyStart, ibyEnd;
72 extern IPTR MaxTransfer;
73 extern IPTR LowCyl, HighCyl;
74 extern ULONG DosType;
75 extern const char szVersion[];
77 void ReportErrSz( ErrorType ert, LONG err, const char * pszMessage, ... );
78 BOOL bSetSzDosDeviceFromSz( const char * pszDevice );
79 BOOL bSetSzVolumeFromSz( const char * pszVolume );
80 BOOL bSetFstFromSz( const char * pszFileSysType );
81 BOOL bSetDevfFromSz( const char * pszDevFlags );
82 BOOL bGetDosDevice(struct DosList *pdlList, ULONG flags);
83 void FreeDosDevice(void);
84 BOOL bGetExecDevice( BOOL bWillVerify );
85 void FreeExecDevice(void);
86 BOOL bFormatCylinder( ULONG icyl );
87 BOOL bVerifyCylinder( ULONG icyl );
88 BOOL bMakeFileSys( BOOL bFFS, BOOL bOFS, BOOL bIntl, BOOL bNoIntl,
89 BOOL bDirCache, BOOL bNoDirCache );
90 BOOL bMakeFiles( BOOL bDiskIcon );
91 void FreeAll(void);
92 int rcCliMain(void);
93 int rcGuiMain(void);
95 #ifdef HAVE_NEWRAWDOFMT
96 #define RawDoFmtSz(pszBuffer, pszFormat, args...) NewRawDoFmt(pszFormat, RAWFMTFUNC_STRING, pszBuffer, args)
97 #define RawDoVFmtSz(pszBuffer, pszFormat, pData) VNewRawDoFmt(pszFormat, RAWFMTFUNC_STRING, pszBuffer, pData)
98 #else
99 void RawDoFmtSz( char * pszBuffer, const char * pszFormat, ... );
100 void RawDoVFmtSz( char * pszBuffer, const char * pszFormat, va_list pData );
101 #endif