aboutsummaryrefslogtreecommitdiff
path: root/system/hfsprogs/patches/0009-Rename-dprintf-to-dbg_printf.patch
blob: 23f85183cd0db5f5c22cb087786e0ad4264edaed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= <rbrito@ime.usp.br>
Date: Thu, 24 Oct 2013 01:11:21 -0200
Subject: Rename dprintf to dbg_printf

---
 fsck_hfs.tproj/dfalib/SRepair.c  | 18 +++++++++---------
 fsck_hfs.tproj/dfalib/SVerify1.c |  6 +++---
 fsck_hfs.tproj/fsck_debug.c      | 10 +++++-----
 fsck_hfs.tproj/fsck_debug.h      | 10 +++++-----
 4 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/fsck_hfs.tproj/dfalib/SRepair.c b/fsck_hfs.tproj/dfalib/SRepair.c
index 8eb759c..89c12d6 100644
--- a/fsck_hfs.tproj/dfalib/SRepair.c
+++ b/fsck_hfs.tproj/dfalib/SRepair.c
@@ -1825,13 +1825,13 @@ static OSErr FixAttrSize(SGlobPtr GPtr, RepairOrderPtr p)
 	result = BTSearchRecord(GPtr->calculatedAttributesFCB, &iterator, 
 				kInvalidMRUCacheKey, &btRecord, &recSize, &iterator);
 	if (result) {
-		dprintf (d_error|d_xattr, "%s: Cannot find attribute record (err = %d)\n", __FUNCTION__, result);
+		dbg_printf (d_error|d_xattr, "%s: Cannot find attribute record (err = %d)\n", __FUNCTION__, result);
 		goto out;
 	}
 
 	/* We should only get record of type kHFSPlusAttrForkData */
 	if (record.recordType != kHFSPlusAttrForkData) {
-		dprintf (d_error|d_xattr, "%s: Record found is not attribute fork data\n", __FUNCTION__);
+		dbg_printf (d_error|d_xattr, "%s: Record found is not attribute fork data\n", __FUNCTION__);
 		result = btNotFound;
 		goto out;
 	}
@@ -1862,7 +1862,7 @@ static OSErr FixAttrSize(SGlobPtr GPtr, RepairOrderPtr p)
 		result = BTReplaceRecord(GPtr->calculatedAttributesFCB, &iterator,
 					&btRecord, recSize);
 		if (result) {
-			dprintf (d_error|d_xattr, "%s: Cannot replace attribute record (err=%d)\n", __FUNCTION__, result);
+			dbg_printf (d_error|d_xattr, "%s: Cannot replace attribute record (err=%d)\n", __FUNCTION__, result);
 			goto out;
 		}
 	}
@@ -2058,7 +2058,7 @@ del_overflow_extents:
 
 		/* Delete the extent record */ 
 		err = DeleteBTreeRecord(GPtr->calculatedExtentsFCB, &extentKey);
-		dprintf (d_info, "%s: Deleting extent overflow for fileID=%u, forkType=%u, startBlock=%u\n", __FUNCTION__, fileID, forkType, foundStartBlock);
+		dbg_printf (d_info, "%s: Deleting extent overflow for fileID=%u, forkType=%u, startBlock=%u\n", __FUNCTION__, fileID, forkType, foundStartBlock);
 		if (err) {
 			goto create_symlink;
 		}
@@ -3227,12 +3227,12 @@ static OSErr MoveExtent(SGlobPtr GPtr, ExtentInfo *extentInfo)
 											  &extentData, &recordSize, &foundExtentIndex);
 				foundLocation = extentsBTree;
 				if (err != noErr) {
-					dprintf (d_error|d_overlap, "%s: No matching extent record found in extents btree for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
+					dbg_printf (d_error|d_overlap, "%s: No matching extent record found in extents btree for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
 					goto out;
 				}
 			} else {
 				/* No more extents exist for this file */
-				dprintf (d_error|d_overlap, "%s: No matching extent record found for fileID = %d\n", __FUNCTION__, extentInfo->fileID);
+				dbg_printf (d_error|d_overlap, "%s: No matching extent record found for fileID = %d\n", __FUNCTION__, extentInfo->fileID);
 				goto out;
 			}
 		}
@@ -3241,7 +3241,7 @@ static OSErr MoveExtent(SGlobPtr GPtr, ExtentInfo *extentInfo)
 	err = CopyDiskBlocks(GPtr, extentInfo->startBlock, extentInfo->blockCount, 
 						 extentInfo->newStartBlock);
 	if (err != noErr) {
-		dprintf (d_error|d_overlap, "%s: Error in copying disk blocks for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
+		dbg_printf (d_error|d_overlap, "%s: Error in copying disk blocks for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
 		goto out;
 	}
 	
@@ -3260,7 +3260,7 @@ static OSErr MoveExtent(SGlobPtr GPtr, ExtentInfo *extentInfo)
 
 	}
 	if (err != noErr) {
-		dprintf (d_error|d_overlap, "%s: Error in updating extent record for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
+		dbg_printf (d_error|d_overlap, "%s: Error in updating extent record for fileID = %d (err=%d)\n", __FUNCTION__, extentInfo->fileID, err);
 		goto out;
 	}
 
@@ -3491,7 +3491,7 @@ static OSErr SearchExtentInAttributeBT(SGlobPtr GPtr, ExtentInfo *extentInfo,
 	result = BTSearchRecord(GPtr->calculatedAttributesFCB, &iterator, 
 				kInvalidMRUCacheKey, &btRecord, recordSize, &iterator);
 	if (result) {
-		dprintf (d_error|d_overlap, "%s: Error finding attribute record (err=%d) for fileID = %d, attrname = %d\n", __FUNCTION__, result, extentInfo->fileID, extentInfo->attrname);
+		dbg_printf (d_error|d_overlap, "%s: Error finding attribute record (err=%d) for fileID = %d, attrname = %d\n", __FUNCTION__, result, extentInfo->fileID, extentInfo->attrname);
 		goto out;	
 	}
 	
diff --git a/fsck_hfs.tproj/dfalib/SVerify1.c b/fsck_hfs.tproj/dfalib/SVerify1.c
index a273bf3..39bda5c 100644
--- a/fsck_hfs.tproj/dfalib/SVerify1.c
+++ b/fsck_hfs.tproj/dfalib/SVerify1.c
@@ -2157,9 +2157,9 @@ CheckAttributeRecord(SGlobPtr GPtr, const HFSPlusAttrKey *key, const HFSPlusAttr
 	
 	if (doDelete == true) {
 		result = DeleteBTreeRecord(GPtr->calculatedAttributesFCB, key);
-		dprintf (d_info|d_xattr, "%s: Deleting attribute %s for fileID %d, type = %d\n", __FUNCTION__, attrname, key->fileID, rec->recordType);
+		dbg_printf (d_info|d_xattr, "%s: Deleting attribute %s for fileID %d, type = %d\n", __FUNCTION__, attrname, key->fileID, rec->recordType);
 		if (result) {
-			dprintf (d_error|d_xattr, "%s: Error in deleting record for %s for fileID %d, type = %d\n", __FUNCTION__, attrname, key->fileID, rec->recordType);
+			dbg_printf (d_error|d_xattr, "%s: Error in deleting record for %s for fileID %d, type = %d\n", __FUNCTION__, attrname, key->fileID, rec->recordType);
 		}
 		
 		/* Set flags to mark header and map dirty */
@@ -3034,7 +3034,7 @@ OSErr	CheckFileExtents( SGlobPtr GPtr, UInt32 fileNumber, UInt8 forkType,
 		//	checkout the extent record first
 		err = ChkExtRec( GPtr, extents, &lastExtentIndex );
 		if (err != noErr) {
-			dprintf (d_info, "%s: Bad extent for fileID %u in extent %u for startblock %u\n", __FUNCTION__, fileNumber, lastExtentIndex, blockCount);
+			dbg_printf (d_info, "%s: Bad extent for fileID %u in extent %u for startblock %u\n", __FUNCTION__, fileNumber, lastExtentIndex, blockCount);
 
 			/* Stop verification if bad extent is found for system file or EA */
 			if ((fileNumber < kHFSFirstUserCatalogNodeID) ||
diff --git a/fsck_hfs.tproj/fsck_debug.c b/fsck_hfs.tproj/fsck_debug.c
index 1be3fc5..77e8e51 100644
--- a/fsck_hfs.tproj/fsck_debug.c
+++ b/fsck_hfs.tproj/fsck_debug.c
@@ -25,18 +25,18 @@
 #include <stdio.h>
 #include <stdarg.h>
 
-/* Current debug level of fsck_hfs for printing messages via dprintf */
+/* Current debug level of fsck_hfs for printing messages via dbg_printf */
 unsigned long cur_debug_level;
 
-/* Function: dprintf
+/* Function: dbg_printf
  *
  * Description: Debug function similar to printf except the first parameter
- * which indicates the type of message to be printed by dprintf. Based on 
+ * which indicates the type of message to be printed by dbg_printf. Based on
  * current debug level and the type of message, the function decides 
  * whether to print the message or not.
  *
  * Each unique message type has a bit assigned to it.  The message type 
- * passed to dprintf can be one or combination (OR-ed value) of pre-defined 
+ * passed to dbg_printf can be one or combination (OR-ed value) of pre-defined
  * debug message types.  Only the messages whose type have one or more similar
  * bits set in comparison with current global debug level are printed. 
  *
@@ -56,7 +56,7 @@ unsigned long cur_debug_level;
  * Output:
  *	Nothing
  */
-void dprintf (unsigned long type, char *fmt, ...) 
+void dbg_printf (unsigned long type, char *fmt, ...)
 {
 	if (cur_debug_level & type) {
 		va_list ap;
diff --git a/fsck_hfs.tproj/fsck_debug.h b/fsck_hfs.tproj/fsck_debug.h
index 81e3932..cb1b9be 100644
--- a/fsck_hfs.tproj/fsck_debug.h
+++ b/fsck_hfs.tproj/fsck_debug.h
@@ -36,18 +36,18 @@ enum debug_message_type {
 	d_overlap	=	0x0020 	/* Overlap extents related messages */
 };
 
-/* Current debug level of fsck_hfs for printing messages via dprintf */
+/* Current debug level of fsck_hfs for printing messages via dbg_printf */
 extern unsigned long cur_debug_level;
 
-/* Function: dprintf
+/* Function: dbg_printf
  *
  * Description: Debug function similar to printf except the first parameter
- * which indicates the type of message to be printed by dprintf. Based on 
+ * which indicates the type of message to be printed by dbg_printf. Based on
  * current debug level and the type of message, the function decides 
  * whether to print the message or not.
  *
  * Each unique message type has a bit assigned to it.  The message type 
- * passed to dprintf can be one or combination (OR-ed value) of pre-defined 
+ * passed to dbg_printf can be one or combination (OR-ed value) of pre-defined
  * debug message types.  Only the messages whose type have one or more similar
  * bits set in comparison with current global debug level are printed. 
  *
@@ -67,6 +67,6 @@ extern unsigned long cur_debug_level;
  * Output:
  *	Nothing
  */
-extern void dprintf (unsigned long message_type, char *format, ...);
+extern void dbg_printf (unsigned long message_type, char *format, ...);
 
 #endif /* __FSCK_DEBUG__ */