]>
git.saurik.com Git - hfs.git/blob - fsck_hfs/dfalib/CheckHFS.h
2 * Copyright (c) 1999-2000, 2002, 2007 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 #include "../fsck_messages.h"
26 /* External API to CheckHFS */
29 kNeverCheck
= 0, /* never check (clean/dirty status only) */
30 kDirtyCheck
= 1, /* only check if dirty */
31 kAlwaysCheck
= 2, /* always check */
32 kPartialCheck
= 3, /* used with kForceRepairs in order to set up environment */
34 kMajorCheck
= 5, /* Check for major vs. minor errors */
36 kNeverRepair
= 0, /* never repair */
37 kMinorRepairs
= 1, /* only do minor repairs (fsck preen) */
38 kMajorRepairs
= 2, /* do all possible repairs */
39 kForceRepairs
= 3, /* force a repair of catalog B-Tree */
42 kFatalLog
= 1, /* (fsck preen) */
43 kVerboseLog
= 2, /* (Disk First Aid) */
48 R_NoMem
= 1, /* not enough memory to do scavenge */
49 R_IntErr
= 2, /* internal Scavenger error */
50 R_NoVol
= 3, /* no volume in drive */
51 R_RdErr
= 4, /* unable to read from disk */
52 R_WrErr
= 5, /* unable to write to disk */
53 R_BadSig
= 6, /* not HFS/HFS+ signature */
54 R_VFail
= 7, /* verify failed */
55 R_RFail
= 8, /* repair failed */
56 R_UInt
= 9, /* user interrupt */
57 R_Modified
= 10, /* volume modifed by another app */
58 R_BadVolumeHeader
= 11, /* Invalid VolumeHeader */
59 R_FileSharingIsON
= 12, /* File Sharing is on */
60 R_Dirty
= 13, /* Dirty, but no checks were done */
62 Max_RCode
= 13 /* maximum result code */
65 /* Option bits to indicate which type of btree to rebuild */
66 #define REBUILD_CATALOG 0x1
67 #define REBUILD_EXTENTS 0x2
68 #define REBUILD_ATTRIBUTE 0x4
70 extern int gGUIControl
;
72 extern int CheckHFS( const char *rdevnode
, int fsReadRef
, int fsWriteRef
,
73 int checkLevel
, int repairLevel
,
74 fsck_ctx_t fsckContext
,
75 int lostAndFoundMode
, int canWrite
,
76 int *modified
, int liveMode
, int rebuildOptions
);
78 extern int journal_replay(const char *);