xref: /haiku/headers/private/fs_shell/fssh_api_wrapper.h (revision ae0a10cad3999b13cbfa47a3d947a5219d2d90f4)
1 /*
2  * Copyright 2007-2014, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _FSSH_API_WRAPPER_H
6 #define _FSSH_API_WRAPPER_H
7 
8 
9 #include <string.h>
10 #ifdef __cplusplus
11 #include <new>
12 #endif
13 #include <stdlib.h>
14 
15 #undef __THROW
16 #define __THROW
17 
18 #include "fssh_dirent.h"
19 #include "fssh_errno.h"
20 #include "fssh_fcntl.h"
21 #include "fssh_stat.h"
22 #include "fssh_stdio.h"
23 #include "fssh_string.h"
24 #include "fssh_time.h"
25 #include "fssh_uio.h"
26 #include "fssh_unistd.h"
27 
28 #include "fssh_atomic.h"
29 #include "fssh_byte_order.h"
30 #include "fssh_defs.h"
31 #include "fssh_disk_device_defs.h"
32 #include "fssh_disk_device_manager.h"
33 #include "fssh_driver_settings.h"
34 #include "fssh_drivers.h"
35 #include "fssh_errors.h"
36 #include "fssh_fs_attr.h"
37 #include "fssh_fs_cache.h"
38 #include "fssh_fs_index.h"
39 #include "fssh_fs_info.h"
40 #include "fssh_fs_interface.h"
41 #include "fssh_fs_query.h"
42 #include "fssh_fs_volume.h"
43 #include "fssh_kernel_export.h"
44 #include "fssh_lock.h"
45 #include "fssh_module.h"
46 #include "fssh_node_monitor.h"
47 #include "fssh_os.h"
48 #include "fssh_type_constants.h"
49 #include "fssh_types.h"
50 
51 #include "DoublyLinkedList.h"
52 #include "SinglyLinkedList.h"
53 #include "Stack.h"
54 
55 
56 ////////////////////////////////////////////////////////////////////////////////
57 // #pragma mark - fssh_atomic.h
58 
59 #define atomic_set			fssh_atomic_set
60 #define atomic_get_and_Set	fssh_atomic_get_and_set
61 #define atomic_test_and_set	fssh_atomic_test_and_set
62 #define atomic_add			fssh_atomic_add
63 #define atomic_and			fssh_atomic_and
64 #define atomic_or			fssh_atomic_or
65 #define atomic_get			fssh_atomic_get
66 
67 
68 ////////////////////////////////////////////////////////////////////////////////
69 // #pragma mark - fssh_bytes_order.h
70 
71 // swap directions
72 #define B_SWAP_HOST_TO_LENDIAN	FSSH_B_SWAP_HOST_TO_LENDIAN
73 #define B_SWAP_HOST_TO_BENDIAN	FSSH_B_SWAP_HOST_TO_BENDIAN
74 #define B_SWAP_LENDIAN_TO_HOST	FSSH_B_SWAP_LENDIAN_TO_HOST
75 #define B_SWAP_BENDIAN_TO_HOST	FSSH_B_SWAP_BENDIAN_TO_HOST
76 #define B_SWAP_ALWAYS			FSSH_B_SWAP_ALWAYS
77 
78 #define swap_action	fssh_swap_action
79 
80 // BSD/networking macros
81 #define htonl(x)	fssh_htonl(x)
82 #define ntohl(x)	fssh_ntohl(x)
83 #define htons(x)	fssh_htons(x)
84 #define ntohs(x)	fssh_ntohs(x)
85 
86 // always swap macros
87 #define B_SWAP_DOUBLE(arg)	FSSH_B_SWAP_DOUBLE(arg)
88 #define B_SWAP_FLOAT(arg)	FSSH_B_SWAP_FLOAT(arg)
89 #define B_SWAP_INT64(arg)	FSSH_B_SWAP_INT64(arg)
90 #define B_SWAP_INT32(arg)	FSSH_B_SWAP_INT32(arg)
91 #define B_SWAP_INT16(arg)	FSSH_B_SWAP_INT16(arg)
92 
93 #define B_HOST_IS_LENDIAN	FSSH_B_HOST_IS_LENDIAN
94 #define B_HOST_IS_BENDIAN	FSSH_B_HOST_IS_BENDIAN
95 
96 // Host native to little endian
97 #define B_HOST_TO_LENDIAN_DOUBLE(arg)	FSSH_B_HOST_TO_LENDIAN_DOUBLE(arg)
98 #define B_HOST_TO_LENDIAN_FLOAT(arg)	FSSH_B_HOST_TO_LENDIAN_FLOAT(arg)
99 #define B_HOST_TO_LENDIAN_INT64(arg)	FSSH_B_HOST_TO_LENDIAN_INT64(arg)
100 #define B_HOST_TO_LENDIAN_INT32(arg)	FSSH_B_HOST_TO_LENDIAN_INT32(arg)
101 #define B_HOST_TO_LENDIAN_INT16(arg)	FSSH_B_HOST_TO_LENDIAN_INT16(arg)
102 
103 // Little endian to host native
104 #define B_LENDIAN_TO_HOST_DOUBLE(arg)	FSSH_B_LENDIAN_TO_HOST_DOUBLE(arg)
105 #define B_LENDIAN_TO_HOST_FLOAT(arg)	FSSH_B_LENDIAN_TO_HOST_FLOAT(arg)
106 #define B_LENDIAN_TO_HOST_INT64(arg)	FSSH_B_LENDIAN_TO_HOST_INT64(arg)
107 #define B_LENDIAN_TO_HOST_INT32(arg)	FSSH_B_LENDIAN_TO_HOST_INT32(arg)
108 #define B_LENDIAN_TO_HOST_INT16(arg)	FSSH_B_LENDIAN_TO_HOST_INT16(arg)
109 
110 // Host native to big endian
111 #define B_HOST_TO_BENDIAN_DOUBLE(arg)	FSSH_B_HOST_TO_BENDIAN_DOUBLE(arg)
112 #define B_HOST_TO_BENDIAN_FLOAT(arg)	FSSH_B_HOST_TO_BENDIAN_FLOAT(arg)
113 #define B_HOST_TO_BENDIAN_INT64(arg)	FSSH_B_HOST_TO_BENDIAN_INT64(arg)
114 #define B_HOST_TO_BENDIAN_INT32(arg)	FSSH_B_HOST_TO_BENDIAN_INT32(arg)
115 #define B_HOST_TO_BENDIAN_INT16(arg)	FSSH_B_HOST_TO_BENDIAN_INT16(arg)
116 
117 // Big endian to host native
118 #define B_BENDIAN_TO_HOST_DOUBLE(arg)	FSSH_B_BENDIAN_TO_HOST_DOUBLE(arg)
119 #define B_BENDIAN_TO_HOST_FLOAT(arg)	FSSH_B_BENDIAN_TO_HOST_FLOAT(arg)
120 #define B_BENDIAN_TO_HOST_INT64(arg)	FSSH_B_BENDIAN_TO_HOST_INT64(arg)
121 #define B_BENDIAN_TO_HOST_INT32(arg)	FSSH_B_BENDIAN_TO_HOST_INT32(arg)
122 #define B_BENDIAN_TO_HOST_INT16(arg)	FSSH_B_BENDIAN_TO_HOST_INT16(arg)
123 
124 #define swap_data			fssh_swap_data
125 #define is_type_swapped		fssh_is_type_swapped
126 
127 
128 // Private implementations
129 #define __swap_double		__fssh_swap_double
130 #define __swap_float		__fssh_swap_float
131 #define __swap_int64		__fssh_swap_int64
132 #define __swap_int32		__fssh_swap_int32
133 #define __swap_int16		__fssh_swap_int16
134 
135 
136 ////////////////////////////////////////////////////////////////////////////////
137 // #pragma mark - fssh_defs.h
138 
139 // 32/64 bitness
140 #undef B_HAIKU_32_BIT
141 #undef B_HAIKU_64_BIT
142 #ifdef FSSH_B_HAIKU_64_BIT
143 #	define B_HAIKU_64_BIT		FSSH_B_HAIKU_64_BIT
144 #endif
145 #ifdef FSSH_B_HAIKU_32_BIT
146 #	define B_HAIKU_32_BIT		FSSH_B_HAIKU_32_BIT
147 #endif
148 
149 // Limits
150 #define B_DEV_NAME_LENGTH	FSSH_B_DEV_NAME_LENGTH
151 #define B_FILE_NAME_LENGTH	FSSH_B_FILE_NAME_LENGTH
152 #define B_PATH_NAME_LENGTH	FSSH_B_PATH_NAME_LENGTH
153 #define B_ATTR_NAME_LENGTH	FSSH_B_ATTR_NAME_LENGTH
154 #define B_MIME_TYPE_LENGTH	FSSH_B_MIME_TYPE_LENGTH
155 #define B_MAX_SYMLINKS		FSSH_B_MAX_SYMLINKS
156 
157 // Open Modes
158 #define B_READ_ONLY			FSSH_B_READ_ONLY
159 #define B_WRITE_ONLY		FSSH_B_WRITE_ONLY
160 #define B_READ_WRITE		FSSH_B_READ_WRITE
161 
162 #define	B_FAIL_IF_EXISTS	FSSH_B_FAIL_IF_EXISTS
163 #define B_CREATE_FILE		FSSH_B_CREATE_FILE
164 #define B_ERASE_FILE		FSSH_B_ERASE_FILE
165 #define B_OPEN_AT_END		FSSH_B_OPEN_AT_END
166 
167 // Node Flavors
168 #define node_flavor			fssh_node_flavor
169 #define	B_FILE_NODE			FSSH_B_FILE_NODE
170 #define	B_SYMLINK_NODE		FSSH_B_SYMLINK_NODE
171 #define	B_DIRECTORY_NODE	FSSH_B_DIRECTORY_NODE
172 #define	B_ANY_NODE			FSSH_B_ANY_NODE
173 
174 #undef	offsetof
175 #define offsetof(type,member)	fssh_offsetof(type,member)
176 
177 #define min_c(a,b)				fssh_min_c(a,b)
178 #define max_c(a,b)				fssh_max_c(a,b)
179 
180 #undef	_PACKED
181 #define _PACKED	_FSSH_PACKED
182 
183 
184 ////////////////////////////////////////////////////////////////////////////////
185 // #pragma mark - fssh_dirent.h
186 
187 #define dirent		fssh_dirent
188 #define dirent_t	fssh_dirent_t
189 
190 #define DIR			fssh_DIR
191 
192 
193 
194 ////////////////////////////////////////////////////////////////////////////////
195 // #pragma mark - fssh_disk_device_defs.h
196 
197 #define partition_id	fssh_partition_id
198 #define disk_system_id	fssh_disk_system_id
199 #define disk_job_id		fssh_disk_job_id
200 
201 // partition flags
202 #define B_PARTITION_IS_DEVICE			FSSH_B_PARTITION_IS_DEVICE
203 #define B_PARTITION_FILE_SYSTEM			FSSH_B_PARTITION_FILE_SYSTEM
204 #define B_PARTITION_PARTITIONING_SYSTEM	FSSH_B_PARTITION_PARTITIONING_SYSTEM
205 #define B_PARTITION_READ_ONLY			FSSH_B_PARTITION_READ_ONLY
206 #define B_PARTITION_MOUNTED				FSSH_B_PARTITION_MOUNTED
207 #define B_PARTITION_BUSY				FSSH_B_PARTITION_BUSY
208 #define B_PARTITION_DESCENDANT_BUSY		FSSH_B_PARTITION_DESCENDANT_BUSY
209 
210 // partition statuses
211 #define B_PARTITION_VALID			FSSH_B_PARTITION_VALID
212 #define B_PARTITION_CORRUPT			FSSH_B_PARTITION_CORRUPT
213 #define B_PARTITION_UNRECOGNIZED	FSSH_B_PARTITION_UNRECOGNIZED
214 #define B_PARTITION_UNINITIALIZED	FSSH_B_PARTITION_UNINITIALIZED
215 
216 // partition change flags
217 #define B_PARTITION_CHANGED_OFFSET				FSSH_B_PARTITION_CHANGED_OFFSET
218 #define B_PARTITION_CHANGED_SIZE				FSSH_B_PARTITION_CHANGED_SIZE
219 #define B_PARTITION_CHANGED_CONTENT_SIZE		FSSH_B_PARTITION_CHANGED_CONTENT_SIZE
220 #define B_PARTITION_CHANGED_BLOCK_SIZE			FSSH_B_PARTITION_CHANGED_BLOCK_SIZE
221 #define B_PARTITION_CHANGED_STATUS				FSSH_B_PARTITION_CHANGED_STATUS
222 #define B_PARTITION_CHANGED_FLAGS				FSSH_B_PARTITION_CHANGED_FLAGS
223 #define B_PARTITION_CHANGED_VOLUME				FSSH_B_PARTITION_CHANGED_VOLUME
224 #define B_PARTITION_CHANGED_NAME				FSSH_B_PARTITION_CHANGED_NAME
225 #define B_PARTITION_CHANGED_CONTENT_NAME		FSSH_B_PARTITION_CHANGED_CONTENT_NAME
226 #define B_PARTITION_CHANGED_TYPE				FSSH_B_PARTITION_CHANGED_TYPE
227 #define B_PARTITION_CHANGED_CONTENT_TYPE		FSSH_B_PARTITION_CHANGED_CONTENT_TYPE
228 #define B_PARTITION_CHANGED_PARAMETERS			FSSH_B_PARTITION_CHANGED_PARAMETERS
229 #define B_PARTITION_CHANGED_CONTENT_PARAMETERS	FSSH_B_PARTITION_CHANGED_CONTENT_PARAMETERS
230 #define B_PARTITION_CHANGED_CHILDREN			FSSH_B_PARTITION_CHANGED_CHILDREN
231 #define B_PARTITION_CHANGED_DESCENDANTS			FSSH_B_PARTITION_CHANGED_DESCENDANTS
232 #define B_PARTITION_CHANGED_DEFRAGMENTATION		FSSH_B_PARTITION_CHANGED_DEFRAGMENTATION
233 #define B_PARTITION_CHANGED_CHECK				FSSH_B_PARTITION_CHANGED_CHECK
234 #define B_PARTITION_CHANGED_REPAIR				FSSH_B_PARTITION_CHANGED_REPAIR
235 #define B_PARTITION_CHANGED_INITIALIZATION		FSSH_B_PARTITION_CHANGED_INITIALIZATION
236 
237 // disk device flags
238 #define B_DISK_DEVICE_REMOVABLE		FSSH_B_DISK_DEVICE_REMOVABLE
239 #define B_DISK_DEVICE_HAS_MEDIA		FSSH_B_DISK_DEVICE_HAS_MEDIA
240 #define B_DISK_DEVICE_READ_ONLY		FSSH_B_DISK_DEVICE_READ_ONLY
241 #define B_DISK_DEVICE_WRITE_ONCE	FSSH_B_DISK_DEVICE_WRITE_ONCE
242 
243 // disk system flags
244 #define B_DISK_SYSTEM_IS_FILE_SYSTEM	FSSH_B_DISK_SYSTEM_IS_FILE_SYSTEM
245 
246 // flags common for both file and partitioning systems
247 #define B_DISK_SYSTEM_SUPPORTS_CHECKING						FSSH_B_DISK_SYSTEM_SUPPORTS_CHECKING
248 #define B_DISK_SYSTEM_SUPPORTS_REPAIRING					FSSH_B_DISK_SYSTEM_SUPPORTS_REPAIRING
249 #define B_DISK_SYSTEM_SUPPORTS_RESIZING						FSSH_B_DISK_SYSTEM_SUPPORTS_RESIZING
250 #define B_DISK_SYSTEM_SUPPORTS_MOVING						FSSH_B_DISK_SYSTEM_SUPPORTS_MOVING
251 #define B_DISK_SYSTEM_SUPPORTS_SETTING_CONTENT_NAME			FSSH_B_DISK_SYSTEM_SUPPORTS_SETTING_CONTENT_NAME
252 #define B_DISK_SYSTEM_SUPPORTS_SETTING_CONTENT_PARAMETERS	FSSH_B_DISK_SYSTEM_SUPPORTS_SETTING_CONTENT_PARAMETERS
253 #define B_DISK_SYSTEM_SUPPORTS_INITIALIZING					FSSH_B_DISK_SYSTEM_SUPPORTS_INITIALIZING
254 #define B_DISK_SYSTEM_SUPPORTS_CONTENT_NAME					FSSH_B_DISK_SYSTEM_SUPPORTS_CONTENT_NAME
255 
256 // file system specific flags
257 #define B_DISK_SYSTEM_SUPPORTS_DEFRAGMENTING							FSSH_B_DISK_SYSTEM_SUPPORTS_DEFRAGMENTING
258 #define B_DISK_SYSTEM_SUPPORTS_DEFRAGMENTING_WHILE_MOUNTED				FSSH_B_DISK_SYSTEM_SUPPORTS_DEFRAGMENTING_WHILE_MOUNTED
259 #define B_DISK_SYSTEM_SUPPORTS_CHECKING_WHILE_MOUNTED					FSSH_B_DISK_SYSTEM_SUPPORTS_CHECKING_WHILE_MOUNTED
260 #define B_DISK_SYSTEM_SUPPORTS_REPAIRING_WHILE_MOUNTED					FSSH_B_DISK_SYSTEM_SUPPORTS_REPAIRING_WHILE_MOUNTED
261 #define B_DISK_SYSTEM_SUPPORTS_RESIZING_WHILE_MOUNTED					FSSH_B_DISK_SYSTEM_SUPPORTS_RESIZING_WHILE_MOUNTED
262 #define B_DISK_SYSTEM_SUPPORTS_MOVING_WHILE_MOUNTED						FSSH_B_DISK_SYSTEM_SUPPORTS_MOVING_WHILE_MOUNTED
263 #define B_DISK_SYSTEM_SUPPORTS_SETTING_CONTENT_NAME_WHILE_MOUNTED		FSSH_B_DISK_SYSTEM_SUPPORTS_SETTING_CONTENT_NAME_WHILE_MOUNTED
264 #define B_DISK_SYSTEM_SUPPORTS_SETTING_CONTENT_PARAMETERS_WHILE_MOUNTED	FSSH_B_DISK_SYSTEM_SUPPORTS_SETTING_CONTENT_PARAMETERS_WHILE_MOUNTED
265 #define B_DISK_SYSTEM_SUPPORTS_WRITING									FSSH_B_DISK_SYSTEM_SUPPORTS_WRITING
266 
267 // partitioning system specific flags
268 #define B_DISK_SYSTEM_SUPPORTS_RESIZING_CHILD		FSSH_B_DISK_SYSTEM_SUPPORTS_RESIZING_CHILD
269 #define B_DISK_SYSTEM_SUPPORTS_MOVING_CHILD			FSSH_B_DISK_SYSTEM_SUPPORTS_MOVING_CHILD
270 #define B_DISK_SYSTEM_SUPPORTS_SETTING_NAME			FSSH_B_DISK_SYSTEM_SUPPORTS_SETTING_NAME
271 #define B_DISK_SYSTEM_SUPPORTS_SETTING_TYPE			FSSH_B_DISK_SYSTEM_SUPPORTS_SETTING_TYPE
272 #define B_DISK_SYSTEM_SUPPORTS_SETTING_PARAMETERS	FSSH_B_DISK_SYSTEM_SUPPORTS_SETTING_PARAMETERS
273 #define B_DISK_SYSTEM_SUPPORTS_CREATING_CHILD		FSSH_B_DISK_SYSTEM_SUPPORTS_CREATING_CHILD
274 #define B_DISK_SYSTEM_SUPPORTS_DELETING_CHILD		FSSH_B_DISK_SYSTEM_SUPPORTS_DELETING_CHILD
275 #define B_DISK_SYSTEM_SUPPORTS_NAME					FSSH_B_DISK_SYSTEM_SUPPORTS_NAME
276 
277 // disk device job types
278 #define B_DISK_DEVICE_JOB_BAD_TYPE				FSSH_B_DISK_DEVICE_JOB_BAD_TYPE
279 #define B_DISK_DEVICE_JOB_DEFRAGMENT			FSSH_B_DISK_DEVICE_JOB_DEFRAGMENT
280 #define B_DISK_DEVICE_JOB_REPAIR				FSSH_B_DISK_DEVICE_JOB_REPAIR
281 #define B_DISK_DEVICE_JOB_RESIZE				FSSH_B_DISK_DEVICE_JOB_RESIZE
282 #define B_DISK_DEVICE_JOB_MOVE					FSSH_B_DISK_DEVICE_JOB_MOVE
283 #define B_DISK_DEVICE_JOB_SET_NAME				FSSH_B_DISK_DEVICE_JOB_SET_NAME
284 #define B_DISK_DEVICE_JOB_SET_CONTENT_NAME		FSSH_B_DISK_DEVICE_JOB_SET_CONTENT_NAME
285 #define B_DISK_DEVICE_JOB_SET_TYPE				FSSH_B_DISK_DEVICE_JOB_SET_TYPE
286 #define B_DISK_DEVICE_JOB_SET_PARMETERS			FSSH_B_DISK_DEVICE_JOB_SET_PARMETERS
287 #define B_DISK_DEVICE_JOB_SET_CONTENT_PARMETERS	FSSH_B_DISK_DEVICE_JOB_SET_CONTENT_PARMETERS
288 #define B_DISK_DEVICE_JOB_INITIALIZE			FSSH_B_DISK_DEVICE_JOB_INITIALIZE
289 #define B_DISK_DEVICE_JOB_UNINITIALIZE			FSSH_B_DISK_DEVICE_JOB_UNINITIALIZE
290 #define B_DISK_DEVICE_JOB_CREATE				FSSH_B_DISK_DEVICE_JOB_CREATE
291 #define B_DISK_DEVICE_JOB_DELETE				FSSH_B_DISK_DEVICE_JOB_DELETE
292 #define B_DISK_DEVICE_JOB_SCAN					FSSH_B_DISK_DEVICE_JOB_SCAN
293 
294 // disk device job statuses
295 #define B_DISK_DEVICE_JOB_UNINITIALIZED	FSSH_B_DISK_DEVICE_JOB_UNINITIALIZED
296 #define B_DISK_DEVICE_JOB_SCHEDULED		FSSH_B_DISK_DEVICE_JOB_SCHEDULED
297 #define B_DISK_DEVICE_JOB_IN_PROGRESS	FSSH_B_DISK_DEVICE_JOB_IN_PROGRESS
298 #define B_DISK_DEVICE_JOB_SUCCEEDED		FSSH_B_DISK_DEVICE_JOB_SUCCEEDED
299 #define B_DISK_DEVICE_JOB_FAILED		FSSH_B_DISK_DEVICE_JOB_FAILED
300 #define B_DISK_DEVICE_JOB_CANCELED		FSSH_B_DISK_DEVICE_JOB_CANCELED
301 
302 #define disk_device_job_progress_info	fssh_disk_device_job_progress_info
303 
304 // disk device job interrupt properties
305 #define B_DISK_DEVICE_JOB_CAN_CANCEL		FSSH_B_DISK_DEVICE_JOB_CAN_CANCEL
306 #define B_DISK_DEVICE_JOB_STOP_ON_CANCEL	FSSH_B_DISK_DEVICE_JOB_STOP_ON_CANCEL
307 #define B_DISK_DEVICE_JOB_REVERSE_ON_CANCEL	FSSH_B_DISK_DEVICE_JOB_REVERSE_ON_CANCEL
308 #define B_DISK_DEVICE_JOB_CAN_PAUSE			FSSH_B_DISK_DEVICE_JOB_CAN_PAUSE
309 
310 // string length constants, all of which include the NULL terminator
311 #define B_DISK_DEVICE_TYPE_LENGTH	FSSH_B_DISK_DEVICE_TYPE_LENGTH
312 #define B_DISK_DEVICE_NAME_LENGTH	FSSH_B_DISK_DEVICE_NAME_LENGTH
313 #define B_DISK_SYSTEM_NAME_LENGTH	FSSH_B_DISK_SYSTEM_NAME_LENGTH
314 
315 // max size of parameter string buffers, including NULL terminator
316 #define B_DISK_DEVICE_MAX_PARAMETER_SIZE	FSSH_B_DISK_DEVICE_MAX_PARAMETER_SIZE
317 
318 
319 ////////////////////////////////////////////////////////////////////////////////
320 // #pragma mark - fssh_disk_device_manager.h
321 
322 #define partition_data				fssh_partition_data
323 #define disk_device_data			fssh_disk_device_data
324 #define partitionable_space_data	fssh_partitionable_space_data
325 
326 // operations on partitions
327 #define B_PARTITION_DEFRAGMENT				FSSH_B_PARTITION_DEFRAGMENT
328 #define B_PARTITION_REPAIR					FSSH_B_PARTITION_REPAIR
329 #define B_PARTITION_RESIZE					FSSH_B_PARTITION_RESIZE
330 #define B_PARTITION_RESIZE_CHILD			FSSH_B_PARTITION_RESIZE_CHILD
331 #define B_PARTITION_MOVE					FSSH_B_PARTITION_MOVE
332 #define B_PARTITION_MOVE_CHILD				FSSH_B_PARTITION_MOVE_CHILD
333 #define B_PARTITION_SET_NAME				FSSH_B_PARTITION_SET_NAME
334 #define B_PARTITION_SET_CONTENT_NAME		FSSH_B_PARTITION_SET_CONTENT_NAME
335 #define B_PARTITION_SET_TYPE				FSSH_B_PARTITION_SET_TYPE
336 #define B_PARTITION_SET_PARAMETERS			FSSH_B_PARTITION_SET_PARAMETERS
337 #define B_PARTITION_SET_CONTENT_PARAMETERS	FSSH_B_PARTITION_SET_CONTENT_PARAMETERS
338 #define B_PARTITION_INITIALIZE				FSSH_B_PARTITION_INITIALIZE
339 #define B_PARTITION_CREATE_CHILD			FSSH_B_PARTITION_CREATE_CHILD
340 #define B_PARTITION_DELETE_CHILD			FSSH_B_PARTITION_DELETE_CHILD
341 
342 // disk device job cancel status
343 #define B_DISK_DEVICE_JOB_CONTINUE	FSSH_B_DISK_DEVICE_JOB_CONTINUE
344 #define B_DISK_DEVICE_JOB_CANCEL	FSSH_B_DISK_DEVICE_JOB_CANCEL
345 #define B_DISK_DEVICE_JOB_REVERSE	FSSH_B_DISK_DEVICE_JOB_REVERSE
346 
347 // disk device locking
348 #define write_lock_disk_device		fssh_write_lock_disk_device
349 #define write_unlock_disk_device	fssh_write_unlock_disk_device
350 #define read_lock_disk_device		fssh_read_lock_disk_device
351 #define read_unlock_disk_device		fssh_read_unlock_disk_device
352 
353 // getting disk devices/partitions by path
354 #define find_disk_device	fssh_find_disk_device
355 #define find_partition		fssh_find_partition
356 
357 // disk device/partition read access
358 #define get_disk_device			fssh_get_disk_device
359 #define get_partition			fssh_get_partition
360 #define get_parent_partition	fssh_get_parent_partition
361 #define get_child_partition		fssh_get_child_partition
362 
363 // partition write access
364 #define create_child_partition	fssh_create_child_partition
365 #define delete_partition		fssh_delete_partition
366 #define partition_modified		fssh_partition_modified
367 
368 #define scan_partition			fssh_scan_partition
369 
370 // disk systems
371 #define find_disk_system		fssh_find_disk_system
372 
373 // jobs
374 #define update_disk_device_job_progress				fssh_update_disk_device_job_progress
375 #define update_disk_device_job_extra_progress		fssh_update_disk_device_job_extra_progress
376 #define set_disk_device_job_error_message			fssh_set_disk_device_job_error_message
377 #define update_disk_device_job_interrupt_properties	fssh_update_disk_device_job_interrupt_properties
378 
379 
380 ////////////////////////////////////////////////////////////////////////////////
381 // #pragma mark - fssh_driver_settings.h
382 
383 #define driver_parameter	fssh_driver_parameter
384 #define driver_settings		fssh_driver_settings
385 
386 #define load_driver_settings			fssh_load_driver_settings
387 #define unload_driver_settings			fssh_unload_driver_settings
388 #define parse_driver_settings_string	fssh_parse_driver_settings_string
389 #define get_driver_settings_string		fssh_get_driver_settings_string
390 #define delete_driver_settings			fssh_delete_driver_settings
391 #define get_driver_parameter			fssh_get_driver_parameter
392 #define get_driver_boolean_parameter	fssh_get_driver_boolean_parameter
393 #define get_driver_settings				fssh_get_driver_settings
394 
395 #define B_SAFEMODE_DRIVER_SETTINGS	FSSH_B_SAFEMODE_DRIVER_SETTINGS
396 #define B_SAFEMODE_SAFE_MODE		FSSH_B_SAFEMODE_SAFE_MODE
397 
398 
399 ////////////////////////////////////////////////////////////////////////////////
400 // #pragma mark - fssh_drivers.h
401 
402 #define device_open_hook		fssh_device_open_hook
403 #define device_close_hook		fssh_device_close_hook
404 #define device_free_hook		fssh_device_free_hook
405 #define device_control_hook		fssh_device_control_hook
406 #define device_read_hook		fssh_device_read_hook
407 #define device_write_hook		fssh_device_write_hook
408 #define device_select_hook		fssh_device_select_hook
409 #define device_deselect_hook	fssh_device_deselect_hook
410 #define device_read_pages_hook	fssh_device_read_pages_hook
411 #define device_write_pages_hook	fssh_device_write_pages_hook
412 
413 #define B_CUR_DRIVER_API_VERSION	FSSH_B_CUR_DRIVER_API_VERSION
414 
415 #define device_hooks	fssh_device_hooks
416 
417 #define init_hardware	fssh_init_hardware
418 #define publish_devices	fssh_publish_devices
419 #define find_device		fssh_find_device
420 #define init_driver		fssh_init_driver
421 #define uninit_driver	fssh_uninit_driver
422 
423 #define api_version		fssh_api_version
424 
425 #define B_GET_DEVICE_SIZE			FSSH_B_GET_DEVICE_SIZE
426 #define B_SET_DEVICE_SIZE			FSSH_B_SET_DEVICE_SIZE
427 #define B_SET_NONBLOCKING_IO		FSSH_B_SET_NONBLOCKING_IO
428 #define B_SET_BLOCKING_IO			FSSH_B_SET_BLOCKING_IO
429 #define B_GET_READ_STATUS			FSSH_B_GET_READ_STATUS
430 #define B_GET_WRITE_STATUS			FSSH_B_GET_WRITE_STATUS
431 #define B_GET_GEOMETRY				FSSH_B_GET_GEOMETRY
432 #define B_GET_DRIVER_FOR_DEVICE		FSSH_B_GET_DRIVER_FOR_DEVICE
433 #define B_GET_PARTITION_INFO		FSSH_B_GET_PARTITION_INFO
434 #define B_SET_PARTITION				FSSH_B_SET_PARTITION
435 #define B_FORMAT_DEVICE				FSSH_B_FORMAT_DEVICE
436 #define B_EJECT_DEVICE				FSSH_B_EJECT_DEVICE
437 #define B_GET_ICON					FSSH_B_GET_ICON
438 #define B_GET_BIOS_GEOMETRY			FSSH_B_GET_BIOS_GEOMETRY
439 #define B_GET_MEDIA_STATUS			FSSH_B_GET_MEDIA_STATUS
440 #define B_LOAD_MEDIA				FSSH_B_LOAD_MEDIA
441 #define B_GET_BIOS_DRIVE_ID			FSSH_B_GET_BIOS_DRIVE_ID
442 #define B_SET_UNINTERRUPTABLE_IO	FSSH_B_SET_UNINTERRUPTABLE_IO
443 #define B_SET_INTERRUPTABLE_IO		FSSH_B_SET_INTERRUPTABLE_IO
444 #define B_FLUSH_DRIVE_CACHE			FSSH_B_FLUSH_DRIVE_CACHE
445 #define B_GET_PATH_FOR_DEVICE		FSSH_B_GET_PATH_FOR_DEVICE
446 #define B_GET_ICON_NAME				FSSH_B_GET_ICON_NAME
447 #define B_GET_VECTOR_ICON			FSSH_B_GET_VECTOR_ICON
448 #define B_GET_DEVICE_NAME			FSSH_B_GET_DEVICE_NAME
449 #define B_TRIM_DEVICE				FSSH_B_TRIM_DEVICE
450 #define B_GET_NEXT_OPEN_DEVICE		FSSH_B_GET_NEXT_OPEN_DEVICE
451 #define B_ADD_FIXED_DRIVER			FSSH_B_ADD_FIXED_DRIVER
452 #define B_REMOVE_FIXED_DRIVER		FSSH_B_REMOVE_FIXED_DRIVER
453 #define B_AUDIO_DRIVER_BASE			FSSH_B_AUDIO_DRIVER_BASE
454 #define B_MIDI_DRIVER_BASE			FSSH_B_MIDI_DRIVER_BASE
455 #define B_JOYSTICK_DRIVER_BASE		FSSH_B_JOYSTICK_DRIVER_BASE
456 #define B_GRAPHIC_DRIVER_BASE		FSSH_B_GRAPHIC_DRIVER_BASE
457 #define B_DEVICE_OP_CODES_END		FSSH_B_DEVICE_OP_CODES_END
458 
459 #define device_geometry	fssh_device_geometry
460 
461 #define B_DISK		FSSH_B_DISK
462 #define B_TAPE		FSSH_B_TAPE
463 #define B_PRINTER	FSSH_B_PRINTER
464 #define B_CPU		FSSH_B_CPU
465 #define B_WORM		FSSH_B_WORM
466 #define B_CD		FSSH_B_CD
467 #define B_SCANNER	FSSH_B_SCANNER
468 #define B_OPTICAL	FSSH_B_OPTICAL
469 #define B_JUKEBOX	FSSH_B_JUKEBOX
470 #define B_NETWORK	FSSH_B_NETWORK
471 
472 
473 #define partition_info			fssh_partition_info
474 #define driver_path				fssh_driver_path
475 #define open_device_iterator	fssh_open_device_iterator
476 #define device_icon				fssh_device_icon
477 #define fs_trim_data			fssh_fs_trim_data
478 
479 
480 ////////////////////////////////////////////////////////////////////////////////
481 // #pragma mark - fssh_errors.h
482 
483 /* Error baselines */
484 #define B_GENERAL_ERROR_BASE		FSSH_B_GENERAL_ERROR_BASE
485 #define B_OS_ERROR_BASE				FSSH_B_OS_ERROR_BASE
486 #define B_APP_ERROR_BASE			FSSH_B_APP_ERROR_BASE
487 #define B_INTERFACE_ERROR_BASE		FSSH_B_INTERFACE_ERROR_BASE
488 #define B_MEDIA_ERROR_BASE			FSSH_B_MEDIA_ERROR_BASE
489 #define B_TRANSLATION_ERROR_BASE	FSSH_B_TRANSLATION_ERROR_BASE
490 #define B_MIDI_ERROR_BASE			FSSH_B_MIDI_ERROR_BASE
491 #define B_STORAGE_ERROR_BASE		FSSH_B_STORAGE_ERROR_BASE
492 #define B_POSIX_ERROR_BASE			FSSH_B_POSIX_ERROR_BASE
493 #define B_MAIL_ERROR_BASE			FSSH_B_MAIL_ERROR_BASE
494 #define B_PRINT_ERROR_BASE			FSSH_B_PRINT_ERROR_BASE
495 #define B_DEVICE_ERROR_BASE			FSSH_B_DEVICE_ERROR_BASE
496 
497 /* Developer-defined errors start at (B_ERRORS_END+1) */
498 #define B_ERRORS_END				FSSH_B_ERRORS_END
499 
500 /* General Errors */
501 #define B_NO_MEMORY			FSSH_B_NO_MEMORY
502 #define B_IO_ERROR			FSSH_B_IO_ERROR
503 #define B_PERMISSION_DENIED	FSSH_B_PERMISSION_DENIED
504 #define B_BAD_INDEX			FSSH_B_BAD_INDEX
505 #define B_BAD_TYPE			FSSH_B_BAD_TYPE
506 #define B_BAD_VALUE			FSSH_B_BAD_VALUE
507 #define B_MISMATCHED_VALUES	FSSH_B_MISMATCHED_VALUES
508 #define B_NAME_NOT_FOUND	FSSH_B_NAME_NOT_FOUND
509 #define B_NAME_IN_USE		FSSH_B_NAME_IN_USE
510 #define B_TIMED_OUT			FSSH_B_TIMED_OUT
511 #define B_INTERRUPTED		FSSH_B_INTERRUPTED
512 #define B_WOULD_BLOCK		FSSH_B_WOULD_BLOCK
513 #define B_CANCELED			FSSH_B_CANCELED
514 #define B_NO_INIT			FSSH_B_NO_INIT
515 #define B_BUSY				FSSH_B_BUSY
516 #define B_NOT_ALLOWED		FSSH_B_NOT_ALLOWED
517 #define B_BAD_DATA			FSSH_B_BAD_DATA
518 #define B_DONT_DO_THAT		FSSH_B_DONT_DO_THAT
519 
520 #define B_ERROR				FSSH_B_ERROR
521 #define B_OK				FSSH_B_OK
522 #define B_NO_ERROR			FSSH_B_NO_ERROR
523 
524 /* Kernel Kit Errors */
525 #define B_BAD_SEM_ID		FSSH_B_BAD_SEM_ID
526 #define B_NO_MORE_SEMS		FSSH_B_NO_MORE_SEMS
527 
528 #define B_BAD_THREAD_ID		FSSH_B_BAD_THREAD_ID
529 #define B_NO_MORE_THREADS	FSSH_B_NO_MORE_THREADS
530 #define B_BAD_THREAD_STATE	FSSH_B_BAD_THREAD_STATE
531 #define B_BAD_TEAM_ID		FSSH_B_BAD_TEAM_ID
532 #define B_NO_MORE_TEAMS		FSSH_B_NO_MORE_TEAMS
533 
534 #define B_BAD_PORT_ID		FSSH_B_BAD_PORT_ID
535 #define B_NO_MORE_PORTS		FSSH_B_NO_MORE_PORTS
536 
537 #define B_BAD_IMAGE_ID		FSSH_B_BAD_IMAGE_ID
538 #define B_BAD_ADDRESS		FSSH_B_BAD_ADDRESS
539 #define B_NOT_AN_EXECUTABLE	FSSH_B_NOT_AN_EXECUTABLE
540 #define B_MISSING_LIBRARY	FSSH_B_MISSING_LIBRARY
541 #define B_MISSING_SYMBOL	FSSH_B_MISSING_SYMBOL
542 
543 #define B_DEBUGGER_ALREADY_INSTALLED	FSSH_B_DEBUGGER_ALREADY_INSTALLED
544 
545 /* Application Kit Errors */
546 #define B_BAD_REPLY							FSSH_B_BAD_REPLY
547 #define B_DUPLICATE_REPLY					FSSH_B_DUPLICATE_REPLY
548 #define B_MESSAGE_TO_SELF					FSSH_B_MESSAGE_TO_SELF
549 #define B_BAD_HANDLER						FSSH_B_BAD_HANDLER
550 #define B_ALREADY_RUNNING					FSSH_B_ALREADY_RUNNING
551 #define B_LAUNCH_FAILED						FSSH_B_LAUNCH_FAILED
552 #define B_AMBIGUOUS_APP_LAUNCH				FSSH_B_AMBIGUOUS_APP_LAUNCH
553 #define B_UNKNOWN_MIME_TYPE					FSSH_B_UNKNOWN_MIME_TYPE
554 #define B_BAD_SCRIPT_SYNTAX					FSSH_B_BAD_SCRIPT_SYNTAX
555 #define B_LAUNCH_FAILED_NO_RESOLVE_LINK		FSSH_B_LAUNCH_FAILED_NO_RESOLVE_LINK
556 #define B_LAUNCH_FAILED_EXECUTABLE			FSSH_B_LAUNCH_FAILED_EXECUTABLE
557 #define B_LAUNCH_FAILED_APP_NOT_FOUND		FSSH_B_LAUNCH_FAILED_APP_NOT_FOUND
558 #define B_LAUNCH_FAILED_APP_IN_TRASH		FSSH_B_LAUNCH_FAILED_APP_IN_TRASH
559 #define B_LAUNCH_FAILED_NO_PREFERRED_APP	FSSH_B_LAUNCH_FAILED_NO_PREFERRED_APP
560 #define B_LAUNCH_FAILED_FILES_APP_NOT_FOUND	FSSH_B_LAUNCH_FAILED_FILES_APP_NOT_FOUND
561 #define B_BAD_MIME_SNIFFER_RULE				FSSH_B_BAD_MIME_SNIFFER_RULE
562 #define B_NOT_A_MESSAGE						FSSH_B_NOT_A_MESSAGE
563 #define B_SHUTDOWN_CANCELLED				FSSH_B_SHUTDOWN_CANCELLED
564 #define B_SHUTTING_DOWN						FSSH_B_SHUTTING_DOWN
565 
566 /* Storage Kit/File System Errors */
567 #define B_FILE_ERROR			FSSH_B_FILE_ERROR
568 #define B_FILE_NOT_FOUND		FSSH_B_FILE_NOT_FOUND
569 #define B_FILE_EXISTS			FSSH_B_FILE_EXISTS
570 #define B_ENTRY_NOT_FOUND		FSSH_B_ENTRY_NOT_FOUND
571 #define B_NAME_TOO_LONG			FSSH_B_NAME_TOO_LONG
572 #define B_NOT_A_DIRECTORY		FSSH_B_NOT_A_DIRECTORY
573 #define B_DIRECTORY_NOT_EMPTY	FSSH_B_DIRECTORY_NOT_EMPTY
574 #define B_DEVICE_FULL			FSSH_B_DEVICE_FULL
575 #define B_READ_ONLY_DEVICE		FSSH_B_READ_ONLY_DEVICE
576 #define B_IS_A_DIRECTORY		FSSH_B_IS_A_DIRECTORY
577 #define B_NO_MORE_FDS			FSSH_B_NO_MORE_FDS
578 #define B_CROSS_DEVICE_LINK		FSSH_B_CROSS_DEVICE_LINK
579 #define B_LINK_LIMIT			FSSH_B_LINK_LIMIT
580 #define B_BUSTED_PIPE			FSSH_B_BUSTED_PIPE
581 #define B_UNSUPPORTED			FSSH_B_UNSUPPORTED
582 #define B_PARTITION_TOO_SMALL	FSSH_B_PARTITION_TOO_SMALL
583 #define B_PARTIAL_READ			FSSH_B_PARTIAL_READ
584 #define B_PARTIAL_WRITE			FSSH_B_PARTIAL_WRITE
585 
586 /* POSIX Errors */
587 #define E2BIG			FSSH_E2BIG
588 #define ECHILD			FSSH_ECHILD
589 #define EDEADLK			FSSH_EDEADLK
590 #define EFBIG			FSSH_EFBIG
591 #define EMLINK			FSSH_EMLINK
592 #define ENFILE			FSSH_ENFILE
593 #define ENODEV			FSSH_ENODEV
594 #define ENOLCK			FSSH_ENOLCK
595 #define ENOSYS			FSSH_ENOSYS
596 #define ENOTTY			FSSH_ENOTTY
597 #define ENXIO			FSSH_ENXIO
598 #define ESPIPE			FSSH_ESPIPE
599 #define ESRCH			FSSH_ESRCH
600 #define EFPOS			FSSH_EFPOS
601 #define ESIGPARM		FSSH_ESIGPARM
602 #define EDOM			FSSH_EDOM
603 #define ERANGE			FSSH_ERANGE
604 #define EPROTOTYPE		FSSH_EPROTOTYPE
605 #define EPROTONOSUPPORT	FSSH_EPROTONOSUPPORT
606 #define EPFNOSUPPORT	FSSH_EPFNOSUPPORT
607 #define EAFNOSUPPORT	FSSH_EAFNOSUPPORT
608 #define EADDRINUSE		FSSH_EADDRINUSE
609 #define EADDRNOTAVAIL	FSSH_EADDRNOTAVAIL
610 #define ENETDOWN		FSSH_ENETDOWN
611 #define ENETUNREACH		FSSH_ENETUNREACH
612 #define ENETRESET		FSSH_ENETRESET
613 #define ECONNABORTED	FSSH_ECONNABORTED
614 #define ECONNRESET		FSSH_ECONNRESET
615 #define EISCONN			FSSH_EISCONN
616 #define ENOTCONN		FSSH_ENOTCONN
617 #define ESHUTDOWN		FSSH_ESHUTDOWN
618 #define ECONNREFUSED	FSSH_ECONNREFUSED
619 #define EHOSTUNREACH	FSSH_EHOSTUNREACH
620 #define ENOPROTOOPT		FSSH_ENOPROTOOPT
621 #define ENOBUFS			FSSH_ENOBUFS
622 #define EINPROGRESS		FSSH_EINPROGRESS
623 #define EALREADY		FSSH_EALREADY
624 #define EILSEQ			FSSH_EILSEQ
625 #define ENOMSG			FSSH_ENOMSG
626 #define ESTALE			FSSH_ESTALE
627 #define EOVERFLOW		FSSH_EOVERFLOW
628 #define EMSGSIZE		FSSH_EMSGSIZE
629 #define EOPNOTSUPP		FSSH_EOPNOTSUPP
630 #define ENOTSOCK		FSSH_ENOTSOCK
631 #define EHOSTDOWN		FSSH_EHOSTDOWN
632 #define EBADMSG			FSSH_EBADMSG
633 #define ECANCELED		FSSH_ECANCELED
634 #define EDESTADDRREQ	FSSH_EDESTADDRREQ
635 #define EDQUOT			FSSH_EDQUOT
636 #define EIDRM			FSSH_EIDRM
637 #define EMULTIHOP		FSSH_EMULTIHOP
638 #define ENODATA			FSSH_ENODATA
639 #define ENOLINK			FSSH_ENOLINK
640 #define ENOSR			FSSH_ENOSR
641 #define ENOSTR			FSSH_ENOSTR
642 #define ENOTSUP			FSSH_ENOTSUP
643 #define EPROTO			FSSH_EPROTO
644 #define ETIME			FSSH_ETIME
645 #define ETXTBSY			FSSH_ETXTBSY
646 
647 /* POSIX errors that can be mapped to BeOS error codes */
648 #define ENOMEM			FSSH_ENOMEM
649 #define EACCES			FSSH_EACCES
650 #define EINTR			FSSH_EINTR
651 #define EIO				FSSH_EIO
652 #define EBUSY			FSSH_EBUSY
653 #define EFAULT			FSSH_EFAULT
654 #define ETIMEDOUT		FSSH_ETIMEDOUT
655 #define EAGAIN			FSSH_EAGAIN
656 #define EWOULDBLOCK		FSSH_EWOULDBLOCK
657 #define EBADF			FSSH_EBADF
658 #define EEXIST			FSSH_EEXIST
659 #define EINVAL			FSSH_EINVAL
660 #define ENAMETOOLONG	FSSH_ENAMETOOLONG
661 #define ENOENT			FSSH_ENOENT
662 #define EPERM			FSSH_EPERM
663 #define ENOTDIR			FSSH_ENOTDIR
664 #define EISDIR			FSSH_EISDIR
665 #define ENOTEMPTY		FSSH_ENOTEMPTY
666 #define ENOSPC			FSSH_ENOSPC
667 #define EROFS			FSSH_EROFS
668 #define EMFILE			FSSH_EMFILE
669 #define EXDEV			FSSH_EXDEV
670 #define ELOOP			FSSH_ELOOP
671 #define ENOEXEC			FSSH_ENOEXEC
672 #define EPIPE			FSSH_EPIPE
673 
674 /* new error codes that can be mapped to POSIX errors */
675 #define B_BUFFER_OVERFLOW			FSSH_B_BUFFER_OVERFLOW
676 #define B_TOO_MANY_ARGS				FSSH_B_TOO_MANY_ARGS
677 #define	B_FILE_TOO_LARGE			FSSH_B_FILE_TOO_LARGE
678 #define B_RESULT_NOT_REPRESENTABLE	FSSH_B_RESULT_NOT_REPRESENTABLE
679 #define	B_DEVICE_NOT_FOUND			FSSH_B_DEVICE_NOT_FOUND
680 #define B_NOT_SUPPORTED				FSSH_B_NOT_SUPPORTED
681 
682 /* Media Kit Errors */
683 #define B_STREAM_NOT_FOUND			FSSH_B_STREAM_NOT_FOUND
684 #define B_SERVER_NOT_FOUND			FSSH_B_SERVER_NOT_FOUND
685 #define B_RESOURCE_NOT_FOUND		FSSH_B_RESOURCE_NOT_FOUND
686 #define B_RESOURCE_UNAVAILABLE		FSSH_B_RESOURCE_UNAVAILABLE
687 #define B_BAD_SUBSCRIBER			FSSH_B_BAD_SUBSCRIBER
688 #define B_SUBSCRIBER_NOT_ENTERED	FSSH_B_SUBSCRIBER_NOT_ENTERED
689 #define B_BUFFER_NOT_AVAILABLE		FSSH_B_BUFFER_NOT_AVAILABLE
690 #define B_LAST_BUFFER_ERROR			FSSH_B_LAST_BUFFER_ERROR
691 
692 /* Mail Kit Errors */
693 #define B_MAIL_NO_DAEMON		FSSH_B_MAIL_NO_DAEMON
694 #define B_MAIL_UNKNOWN_USER		FSSH_B_MAIL_UNKNOWN_USER
695 #define B_MAIL_WRONG_PASSWORD	FSSH_B_MAIL_WRONG_PASSWORD
696 #define B_MAIL_UNKNOWN_HOST		FSSH_B_MAIL_UNKNOWN_HOST
697 #define B_MAIL_ACCESS_ERROR		FSSH_B_MAIL_ACCESS_ERROR
698 #define B_MAIL_UNKNOWN_FIELD	FSSH_B_MAIL_UNKNOWN_FIELD
699 #define B_MAIL_NO_RECIPIENT		FSSH_B_MAIL_NO_RECIPIENT
700 #define B_MAIL_INVALID_MAIL		FSSH_B_MAIL_INVALID_MAIL
701 
702 /* Printing Errors */
703 #define B_NO_PRINT_SERVER		FSSH_B_NO_PRINT_SERVER
704 
705 /* Device Kit Errors */
706 #define B_DEV_INVALID_IOCTL				FSSH_B_DEV_INVALID_IOCTL
707 #define B_DEV_NO_MEMORY					FSSH_B_DEV_NO_MEMORY
708 #define B_DEV_BAD_DRIVE_NUM				FSSH_B_DEV_BAD_DRIVE_NUM
709 #define B_DEV_NO_MEDIA					FSSH_B_DEV_NO_MEDIA
710 #define B_DEV_UNREADABLE				FSSH_B_DEV_UNREADABLE
711 #define B_DEV_FORMAT_ERROR				FSSH_B_DEV_FORMAT_ERROR
712 #define B_DEV_TIMEOUT					FSSH_B_DEV_TIMEOUT
713 #define B_DEV_RECALIBRATE_ERROR			FSSH_B_DEV_RECALIBRATE_ERROR
714 #define B_DEV_SEEK_ERROR				FSSH_B_DEV_SEEK_ERROR
715 #define B_DEV_ID_ERROR					FSSH_B_DEV_ID_ERROR
716 #define B_DEV_READ_ERROR				FSSH_B_DEV_READ_ERROR
717 #define B_DEV_WRITE_ERROR				FSSH_B_DEV_WRITE_ERROR
718 #define B_DEV_NOT_READY					FSSH_B_DEV_NOT_READY
719 #define B_DEV_MEDIA_CHANGED				FSSH_B_DEV_MEDIA_CHANGED
720 #define B_DEV_MEDIA_CHANGE_REQUESTED	FSSH_B_DEV_MEDIA_CHANGE_REQUESTED
721 #define B_DEV_RESOURCE_CONFLICT			FSSH_B_DEV_RESOURCE_CONFLICT
722 #define B_DEV_CONFIGURATION_ERROR		FSSH_B_DEV_CONFIGURATION_ERROR
723 #define B_DEV_DISABLED_BY_USER			FSSH_B_DEV_DISABLED_BY_USER
724 #define B_DEV_DOOR_OPEN					FSSH_B_DEV_DOOR_OPEN
725 
726 #define B_DEV_INVALID_PIPE				FSSH_B_DEV_INVALID_PIPE
727 #define B_DEV_CRC_ERROR					FSSH_B_DEV_CRC_ERROR
728 #define B_DEV_STALLED					FSSH_B_DEV_STALLED
729 #define B_DEV_BAD_PID					FSSH_B_DEV_BAD_PID
730 #define B_DEV_UNEXPECTED_PID			FSSH_B_DEV_UNEXPECTED_PID
731 #define B_DEV_DATA_OVERRUN				FSSH_B_DEV_DATA_OVERRUN
732 #define B_DEV_DATA_UNDERRUN				FSSH_B_DEV_DATA_UNDERRUN
733 #define B_DEV_FIFO_OVERRUN				FSSH_B_DEV_FIFO_OVERRUN
734 #define B_DEV_FIFO_UNDERRUN				FSSH_B_DEV_FIFO_UNDERRUN
735 #define B_DEV_PENDING					FSSH_B_DEV_PENDING
736 #define B_DEV_MULTIPLE_ERRORS			FSSH_B_DEV_MULTIPLE_ERRORS
737 #define B_DEV_TOO_LATE					FSSH_B_DEV_TOO_LATE
738 
739 
740 ////////////////////////////////////////////////////////////////////////////////
741 // #pragma mark - fssh_errno.h
742 
743 #define ENOERR	FSSH_ENOERR
744 #define EOK		FSSH_EOK
745 
746 #define errno	fssh_errno
747 
748 
749 ////////////////////////////////////////////////////////////////////////////////
750 // #pragma mark - fssh_fcntl.h
751 
752 /* commands that can be passed to fcntl() */
753 #define F_DUPFD		FSSH_F_DUPFD
754 #define F_GETFD		FSSH_F_GETFD
755 #define F_SETFD		FSSH_F_SETFD
756 #define F_GETFL		FSSH_F_GETFL
757 #define F_SETFL		FSSH_F_SETFL
758 #define F_GETLK		FSSH_F_GETLK
759 #define F_SETLK		FSSH_F_SETLK
760 #define F_SETLKW	FSSH_F_SETLKW
761 
762 /* advisory locking types */
763 #define F_RDLCK	FSSH_F_RDLCK
764 #define F_UNLCK	FSSH_F_UNLCK
765 #define F_WRLCK	FSSH_F_WRLCK
766 
767 /* file descriptor flags for fcntl() */
768 #define FD_CLOEXEC	FSSH_FD_CLOEXEC
769 
770 /* file access modes for open() */
771 #define O_RDONLY	FSSH_O_RDONLY
772 #define O_WRONLY	FSSH_O_WRONLY
773 #define O_RDWR		FSSH_O_RDWR
774 #define O_ACCMODE	FSSH_O_ACCMODE
775 #define O_RWMASK	FSSH_O_RWMASK
776 
777 /* flags for open() */
778 #define O_EXCL			FSSH_O_EXCL
779 #define O_CREAT			FSSH_O_CREAT
780 #define O_TRUNC			FSSH_O_TRUNC
781 #define O_NOCTTY		FSSH_O_NOCTTY
782 #define O_NOTRAVERSE	FSSH_O_NOTRAVERSE
783 
784 /* flags for open() and fcntl() */
785 #define O_CLOEXEC	FSSH_O_CLOEXEC
786 #define O_NONBLOCK	FSSH_O_NONBLOCK
787 #define O_APPEND	FSSH_O_APPEND
788 #define O_TEXT		FSSH_O_TEXT
789 #define O_BINARY	FSSH_O_BINARY
790 #define O_SYNC		FSSH_O_SYNC
791 #define O_RSYNC		FSSH_O_RSYNC
792 #define O_DSYNC		FSSH_O_DSYNC
793 
794 #define O_NOFOLLOW	FSSH_O_NOFOLLOW
795 #define O_NOCACHE	FSSH_O_NOCACHE
796 #define O_DIRECT	FSSH_O_DIRECT
797 #define O_DIRECTORY	FSSH_O_DIRECTORY
798 #define O_TEMPORARY	FSSH_O_TEMPORARY
799 
800 #define S_IREAD		FSSH_S_IREAD
801 #define S_IWRITE	FSSH_S_IWRITE
802 
803 #define creat	fssh_creat
804 #define open	fssh_open
805 #define fcntl	fssh_fcntl
806 
807 
808 ////////////////////////////////////////////////////////////////////////////////
809 // #pragma mark - fssh_fs_attr.h
810 
811 #define attr_info	fssh_attr_info
812 
813 
814 ////////////////////////////////////////////////////////////////////////////////
815 // #pragma mark - fssh_fs_cache.h
816 
817 #define TRANSACTION_WRITTEN				FSSH_TRANSACTION_WRITTEN
818 #define TRANSACTION_ABORTED				FSSH_TRANSACTION_ABORTED
819 #define TRANSACTION_ENDED				FSSH_TRANSACTION_ENDED
820 #define TRANSACTION_IDLE				FSSH_TRANSACTION_IDLE
821 
822 #define FILE_MAP_CACHE_ON_DEMAND		FSSH_FILE_MAP_CACHE_ON_DEMAND
823 #define FILE_MAP_CACHE_ALL				FSSH_FILE_MAP_CACHE_ALL
824 
825 #define transaction_notification_hook	fssh_transaction_notification_hook
826 
827 /* transactions */
828 #define cache_start_transaction			fssh_cache_start_transaction
829 #define cache_sync_transaction			fssh_cache_sync_transaction
830 #define cache_end_transaction			fssh_cache_end_transaction
831 #define cache_abort_transaction			fssh_cache_abort_transaction
832 #define cache_detach_sub_transaction	fssh_cache_detach_sub_transaction
833 #define cache_abort_sub_transaction		fssh_cache_abort_sub_transaction
834 #define cache_start_sub_transaction		fssh_cache_start_sub_transaction
835 #define cache_add_transaction_listener	fssh_cache_add_transaction_listener
836 #define cache_remove_transaction_listener fssh_cache_remove_transaction_listener
837 #define cache_next_block_in_transaction	fssh_cache_next_block_in_transaction
838 #define cache_blocks_in_transaction		fssh_cache_blocks_in_transaction
839 #define cache_blocks_in_main_transaction fssh_cache_blocks_in_main_transaction
840 #define cache_blocks_in_sub_transaction	fssh_cache_blocks_in_sub_transaction
841 #define cache_has_block_in_transaction	fssh_cache_has_block_in_transaction
842 
843 /* block cache */
844 #define block_cache_delete				fssh_block_cache_delete
845 #define block_cache_create				fssh_block_cache_create
846 #define block_cache_sync				fssh_block_cache_sync
847 #define block_cache_sync_etc			fssh_block_cache_sync_etc
848 #define block_cache_discard				fssh_block_cache_discard
849 #define block_cache_make_writable		fssh_block_cache_make_writable
850 #define block_cache_get_writable_etc	fssh_block_cache_get_writable_etc
851 #define block_cache_get_writable		fssh_block_cache_get_writable
852 #define block_cache_get_empty			fssh_block_cache_get_empty
853 #define block_cache_get_etc				fssh_block_cache_get_etc
854 #define block_cache_get					fssh_block_cache_get
855 #define block_cache_set_dirty			fssh_block_cache_set_dirty
856 #define block_cache_put					fssh_block_cache_put
857 
858 /* file cache */
859 #define file_cache_create				fssh_file_cache_create
860 #define file_cache_delete				fssh_file_cache_delete
861 #define file_cache_enable				fssh_file_cache_enable
862 #define file_cache_disable				fssh_file_cache_disable
863 #define file_cache_set_size				fssh_file_cache_set_size
864 #define file_cache_sync					fssh_file_cache_sync
865 
866 #define file_cache_read					fssh_file_cache_read
867 #define file_cache_write				fssh_file_cache_write
868 
869 /* file map */
870 #define file_map_create					fssh_file_map_create
871 #define file_map_delete					fssh_file_map_delete
872 #define file_map_set_size				fssh_file_map_set_size
873 #define file_map_invalidate				fssh_file_map_invalidate
874 #define file_map_translate				fssh_file_map_translate
875 
876 /* entry cache */
877 #define entry_cache_add					fssh_entry_cache_add
878 #define entry_cache_add_missing			fssh_entry_cache_add_missing
879 #define entry_cache_remove				fssh_entry_cache_remove
880 
881 ////////////////////////////////////////////////////////////////////////////////
882 // #pragma mark - fssh_fs_index.h
883 
884 #define index_info	fssh_index_info
885 
886 
887 ////////////////////////////////////////////////////////////////////////////////
888 // #pragma mark - fssh_fs_info.h
889 
890 /* fs_info.flags */
891 #define	B_FS_IS_READONLY				FSSH_B_FS_IS_READONLY
892 #define	B_FS_IS_REMOVABLE				FSSH_B_FS_IS_REMOVABLE
893 #define	B_FS_IS_PERSISTENT				FSSH_B_FS_IS_PERSISTENT
894 #define	B_FS_IS_SHARED					FSSH_B_FS_IS_SHARED
895 #define	B_FS_HAS_MIME					FSSH_B_FS_HAS_MIME
896 #define	B_FS_HAS_ATTR					FSSH_B_FS_HAS_ATTR
897 #define	B_FS_HAS_QUERY					FSSH_B_FS_HAS_QUERY
898 // those additions are preliminary and may be removed
899 #define B_FS_HAS_SELF_HEALING_LINKS		FSSH_B_FS_HAS_SELF_HEALING_LINKS
900 #define B_FS_HAS_ALIASES				FSSH_B_FS_HAS_ALIASES
901 #define B_FS_SUPPORTS_NODE_MONITORING	FSSH_B_FS_SUPPORTS_NODE_MONITORING
902 #define B_FS_SUPPORTS_MONITOR_CHILDREN	FSSH_B_FS_SUPPORTS_MONITOR_CHILDREN
903 
904 #define fs_info	fssh_fs_info
905 
906 
907 ////////////////////////////////////////////////////////////////////////////////
908 // #pragma mark - fssh_fs_interface.h
909 
910 #define mount_id	fssh_mount_id
911 #define vnode_id	fssh_vnode_id
912 
913 // TODO: These two don't belong here!
914 #define IORequest	FSSHIORequest
915 #define io_request	fssh_io_request
916 
917 /* additional flags passed to write_stat() */
918 #define B_STAT_SIZE_INSECURE	FSSH_B_STAT_SIZE_INSECURE
919 
920 /* passed to write_fs_info() */
921 #define FS_WRITE_FSINFO_NAME	FSSH_FS_WRITE_FSINFO_NAME
922 
923 #define file_io_vec	fssh_file_io_vec
924 
925 #define B_CURRENT_FS_API_VERSION	FSSH_B_CURRENT_FS_API_VERSION
926 
927 // flags for publish_vnode() and fs_volume_ops::get_vnode()
928 #define B_VNODE_PUBLISH_REMOVED					FSSH_B_VNODE_PUBLISH_REMOVED
929 #define B_VNODE_DONT_CREATE_SPECIAL_SUB_NODE	FSSH_B_VNODE_DONT_CREATE_SPECIAL_SUB_NODE
930 
931 #define fs_volume				fssh_fs_volume
932 #define fs_volume_ops			fssh_fs_volume_ops
933 #define fs_vnode				fssh_fs_vnode
934 #define fs_vnode_ops			fssh_fs_vnode_ops
935 #define file_system_module_info	fssh_file_system_module_info
936 
937 
938 /* file system add-ons only prototypes */
939 #define iterative_io_get_vecs		fssh_iterative_io_get_vecs
940 #define iterative_io_finished		fssh_iterative_io_finished
941 
942 #define new_vnode 					fssh_new_vnode
943 #define publish_vnode				fssh_publish_vnode
944 #define get_vnode					fssh_get_vnode
945 #define put_vnode					fssh_put_vnode
946 #define acquire_vnode				fssh_acquire_vnode
947 #define remove_vnode				fssh_remove_vnode
948 #define unremove_vnode				fssh_unremove_vnode
949 #define get_vnode_removed			fssh_get_vnode_removed
950 #define mark_vnode_busy				fssh_mark_vnode_busy
951 #define change_vnode_id				fssh_change_vnode_id
952 #define volume_for_vnode			fssh_volume_for_vnode
953 #define check_access_permissions	fssh_check_access_permissions
954 #define read_pages					fssh_read_pages
955 #define write_pages					fssh_write_pages
956 #define read_file_io_vec_pages		fssh_read_file_io_vec_pages
957 #define write_file_io_vec_pages		fssh_write_file_io_vec_pages
958 #define do_fd_io					fssh_do_fd_io
959 #define do_iterative_fd_io			fssh_do_iterative_fd_io
960 
961 #define notify_entry_created		fssh_notify_entry_created
962 #define notify_entry_removed		fssh_notify_entry_removed
963 #define notify_entry_moved			fssh_notify_entry_moved
964 #define notify_stat_changed			fssh_notify_stat_changed
965 #define notify_attribute_changed	fssh_notify_attribute_changed
966 
967 #define notify_query_entry_created	fssh_notify_query_entry_created
968 #define notify_query_entry_removed	fssh_notify_query_entry_removed
969 #define notify_query_attr_changed	fssh_notify_query_attr_changed
970 
971 
972 ////////////////////////////////////////////////////////////////////////////////
973 // #pragma mark - fssh_fs_query.h
974 
975 #define B_LIVE_QUERY		FSSH_B_LIVE_QUERY
976 #define B_QUERY_NON_INDEXED	FSSH_B_QUERY_NON_INDEXED
977 
978 
979 ////////////////////////////////////////////////////////////////////////////////
980 // #pragma mark - fssh_fs_volume.h
981 
982 #define B_MOUNT_READ_ONLY		FSSH_B_MOUNT_READ_ONLY
983 #define B_MOUNT_VIRTUAL_DEVICE	FSSH_B_MOUNT_VIRTUAL_DEVICE
984 
985 /* unmount flags */
986 #define B_FORCE_UNMOUNT			FSSH_B_FORCE_UNMOUNT
987 
988 
989 ////////////////////////////////////////////////////////////////////////////////
990 // #pragma mark - fssh_kernel_export.h
991 
992 /* kernel threads */
993 #define spawn_kernel_thread	fssh_spawn_kernel_thread
994 
995 /* misc */
996 #define user_memcpy			fssh_user_memcpy
997 
998 /* primitive kernel debugging facilities */
999 #define dprintf				fssh_dprintf
1000 #define kprintf				fssh_kprintf
1001 #define dump_block			fssh_dump_block
1002 #define panic				fssh_panic
1003 #define kernel_debugger		fssh_kernel_debugger
1004 #define parse_expression	fssh_parse_expression
1005 
1006 #define debugger_command_hook	fssh_debugger_command_hook
1007 #define add_debugger_command	fssh_add_debugger_command
1008 #define remove_debugger_command	fssh_remove_debugger_command
1009 
1010 
1011 ////////////////////////////////////////////////////////////////////////////////
1012 // #pragma mark - fssh_lock.h
1013 
1014 #define mutex						fssh_mutex
1015 #define rw_lock						fssh_rw_lock
1016 #define recursive_lock				fssh_recursive_lock
1017 
1018 #define MUTEX_FLAG_CLONE_NAME		FSSH_MUTEX_FLAG_CLONE_NAME
1019 #define RW_LOCK_FLAG_CLONE_NAME		FSSH_RW_LOCK_FLAG_CLONE_NAME
1020 
1021 #define ASSERT_LOCKED_RECURSIVE(r)	FSSH_ASSERT_LOCKED_RECURSIVE(r)
1022 #define ASSERT_LOCKED_MUTEX(m)		FSSH_ASSERT_LOCKED_MUTEX(m)
1023 #define ASSERT_WRITE_LOCKED_RW_LOCK(l) FSSH_ASSERT_WRITE_LOCKED_RW_LOCK(l)
1024 #define ASSERT_READ_LOCKED_RW_LOCK(l) FSSH_ASSERT_READ_LOCKED_RW_LOCK(l)
1025 
1026 #define MUTEX_INITIALIZER(name)		FSSH_MUTEX_INITIALIZER(name)
1027 #define RECURSIVE_LOCK_INITIALIZER(name) FSSH_RECURSIVE_LOCK_INITIALIZER(name)
1028 #define RW_LOCK_INITIALIZER(name)	FSSH_RW_LOCK_INITIALIZER(name)
1029 
1030 #define	recursive_lock_init			fssh_recursive_lock_init
1031 #define recursive_lock_init_etc		fssh_recursive_lock_init_etc
1032 #define recursive_lock_destroy		fssh_recursive_lock_destroy
1033 #define recursive_lock_lock			fssh_recursive_lock_lock
1034 #define recursive_lock_trylock		fssh_recursive_lock_trylock
1035 #define recursive_lock_unlock		fssh_recursive_lock_unlock
1036 #define recursive_lock_get_recursion fssh_recursive_lock_get_recursion
1037 #define recursive_lock_transfer_lock fssh_recursive_lock_transfer_lock
1038 
1039 #define rw_lock_init				fssh_rw_lock_init
1040 #define rw_lock_init_etc			fssh_rw_lock_init_etc
1041 #define rw_lock_destroy				fssh_rw_lock_destroy
1042 #define rw_lock_read_lock			fssh_rw_lock_read_lock
1043 #define rw_lock_read_unlock			fssh_rw_lock_read_unlock
1044 #define rw_lock_write_lock			fssh_rw_lock_write_lock
1045 #define rw_lock_write_unlock		fssh_rw_lock_write_unlock
1046 
1047 #define mutex_init					fssh_mutex_init
1048 #define mutex_init_etc				fssh_mutex_init_etc
1049 #define mutex_destroy				fssh_mutex_destroy
1050 #define mutex_lock					fssh_mutex_lock
1051 #define mutex_trylock				fssh_mutex_trylock
1052 #define mutex_unlock				fssh_mutex_unlock
1053 #define mutex_transfer_lock			fssh_mutex_transfer_lock
1054 
1055 
1056 ////////////////////////////////////////////////////////////////////////////////
1057 // #pragma mark - fssh_module.h
1058 
1059 #define module_info	fssh_module_info
1060 
1061 /* module standard operations */
1062 #define B_MODULE_INIT	FSSH_B_MODULE_INIT
1063 #define B_MODULE_UNINIT	FSSH_B_MODULE_UNINIT
1064 
1065 /* module flags */
1066 #define B_KEEP_LOADED	FSSH_B_KEEP_LOADED
1067 
1068 
1069 #define module_dependency	fssh_module_dependency
1070 
1071 
1072 ////////////////////////////////////////////////////////////////////////////////
1073 // #pragma mark - fssh_node_monitor.h
1074 
1075 #define B_STOP_WATCHING			FSSH_B_STOP_WATCHING
1076 #define B_WATCH_NAME			FSSH_B_WATCH_NAME
1077 #define B_WATCH_STAT			FSSH_B_WATCH_STAT
1078 #define B_WATCH_ATTR			FSSH_B_WATCH_ATTR
1079 #define B_WATCH_DIRECTORY		FSSH_B_WATCH_DIRECTORY
1080 #define B_WATCH_ALL				FSSH_B_WATCH_ALL
1081 #define B_WATCH_MOUNT			FSSH_B_WATCH_MOUNT
1082 #define B_WATCH_INTERIM_STAT	FSSH_B_WATCH_INTERIM_STAT
1083 
1084 #define B_ENTRY_CREATED		FSSH_B_ENTRY_CREATED
1085 #define B_ENTRY_REMOVED		FSSH_B_ENTRY_REMOVED
1086 #define B_ENTRY_MOVED		FSSH_B_ENTRY_MOVED
1087 #define B_STAT_CHANGED		FSSH_B_STAT_CHANGED
1088 #define B_ATTR_CHANGED		FSSH_B_ATTR_CHANGED
1089 #define B_DEVICE_MOUNTED	FSSH_B_DEVICE_MOUNTED
1090 #define B_DEVICE_UNMOUNTED	FSSH_B_DEVICE_UNMOUNTED
1091 
1092 #define B_ATTR_CREATED		FSSH_B_ATTR_CREATED
1093 #define B_ATTR_REMOVED		FSSH_B_ATTR_REMOVED
1094 
1095 #define B_STAT_MODE					FSSH_B_STAT_MODE
1096 #define B_STAT_UID					FSSH_B_STAT_UID
1097 #define B_STAT_GID					FSSH_B_STAT_GID
1098 #define B_STAT_SIZE					FSSH_B_STAT_SIZE
1099 #define B_STAT_ACCESS_TIME			FSSH_B_STAT_ACCESS_TIME
1100 #define B_STAT_MODIFICATION_TIME	FSSH_B_STAT_MODIFICATION_TIME
1101 #define B_STAT_CREATION_TIME		FSSH_B_STAT_CREATION_TIME
1102 #define B_STAT_CHANGE_TIME			FSSH_B_STAT_CHANGE_TIME
1103 #define B_STAT_INTERIM_UPDATE		FSSH_B_STAT_INTERIM_UPDATE
1104 
1105 
1106 ////////////////////////////////////////////////////////////////////////////////
1107 // #pragma mark - fssh_os.h
1108 
1109 /* System constants */
1110 
1111 #define B_OS_NAME_LENGTH	FSSH_B_OS_NAME_LENGTH
1112 #define B_PAGE_SIZE			FSSH_B_PAGE_SIZE
1113 #define B_INFINITE_TIMEOUT	FSSH_B_INFINITE_TIMEOUT
1114 
1115 
1116 /* Types */
1117 
1118 #define area_id		fssh_area_id
1119 #define port_id		fssh_port_id
1120 #define sem_id		fssh_sem_id
1121 #define team_id		fssh_team_id
1122 #define thread_id	fssh_thread_id
1123 
1124 
1125 /* Semaphores */
1126 
1127 #define sem_info	fssh_sem_info
1128 
1129 /* semaphore flags */
1130 #define B_CAN_INTERRUPT			FSSH_B_CAN_INTERRUPT
1131 #define B_CHECK_PERMISSION		FSSH_B_CHECK_PERMISSION
1132 #define B_KILL_CAN_INTERRUPT	FSSH_B_KILL_CAN_INTERRUPT
1133 
1134 #define B_DO_NOT_RESCHEDULE			FSSH_B_DO_NOT_RESCHEDULE
1135 #define B_RELEASE_ALL				FSSH_B_RELEASE_ALL
1136 #define B_RELEASE_IF_WAITING_ONLY	FSSH_B_RELEASE_IF_WAITING_ONLY
1137 
1138 #define create_sem		fssh_create_sem
1139 #define delete_sem		fssh_delete_sem
1140 #define acquire_sem		fssh_acquire_sem
1141 #define acquire_sem_etc	fssh_acquire_sem_etc
1142 #define release_sem		fssh_release_sem
1143 #define release_sem_etc	fssh_release_sem_etc
1144 #define get_sem_count	fssh_get_sem_count
1145 #define set_sem_owner	fssh_set_sem_owner
1146 
1147 #define get_sem_info(sem, info)					fssh_get_sem_info(sem, info)
1148 #define get_next_sem_info(team, cookie, info)	fssh_get_next_sem_info(team, cookie, info)
1149 
1150 #define B_TIMEOUT			FSSH_B_TIMEOUT
1151 #define B_RELATIVE_TIMEOUT	FSSH_B_RELATIVE_TIMEOUT
1152 #define B_ABSOLUTE_TIMEOUT	FSSH_B_ABSOLUTE_TIMEOUT
1153 
1154 
1155 /* Teams */
1156 
1157 #define B_CURRENT_TEAM	FSSH_B_CURRENT_TEAM
1158 #define B_SYSTEM_TEAM	FSSH_B_SYSTEM_TEAM
1159 
1160 
1161 /* Threads */
1162 
1163 #define B_THREAD_RUNNING	FSSH_B_THREAD_RUNNING
1164 #define B_THREAD_READY		FSSH_B_THREAD_READY
1165 #define B_THREAD_RECEIVING	FSSH_B_THREAD_RECEIVING
1166 #define B_THREAD_ASLEEP		FSSH_B_THREAD_ASLEEP
1167 #define B_THREAD_SUSPENDED	FSSH_B_THREAD_SUSPENDED
1168 #define B_THREAD_WAITING	FSSH_B_THREAD_WAITING
1169 
1170 #define thread_state		fssh_thread_state
1171 #define thread_info			fssh_thread_info
1172 
1173 #define B_IDLE_PRIORITY					FSSH_B_IDLE_PRIORITY
1174 #define B_LOWEST_ACTIVE_PRIORITY		FSSH_B_LOWEST_ACTIVE_PRIORITY
1175 #define B_LOW_PRIORITY					FSSH_B_LOW_PRIORITY
1176 #define B_NORMAL_PRIORITY				FSSH_B_NORMAL_PRIORITY
1177 #define B_DISPLAY_PRIORITY				FSSH_B_DISPLAY_PRIORITY
1178 #define B_URGENT_DISPLAY_PRIORITY		FSSH_B_URGENT_DISPLAY_PRIORITY
1179 #define B_REAL_TIME_DISPLAY_PRIORITY	FSSH_B_REAL_TIME_DISPLAY_PRIORITY
1180 #define B_URGENT_PRIORITY				FSSH_B_URGENT_PRIORITY
1181 #define B_REAL_TIME_PRIORITY			FSSH_B_REAL_TIME_PRIORITY
1182 
1183 #define B_FIRST_REAL_TIME_PRIORITY		FSSH_B_FIRST_REAL_TIME_PRIORITY
1184 #define B_MIN_PRIORITY					FSSH_B_MIN_PRIORITY
1185 #define B_MAX_PRIORITY					FSSH_B_MAX_PRIORITY
1186 
1187 #define B_SYSTEM_TIMEBASE				FSSH_B_SYSTEM_TIMEBASE
1188 
1189 #define thread_func			fssh_thread_func
1190 #define thread_entry		fssh_thread_entry
1191 
1192 #define spawn_thread		fssh_spawn_thread
1193 #define kill_thread			fssh_kill_thread
1194 #define resume_thread		fssh_resume_thread
1195 #define suspend_thread		fssh_suspend_thread
1196 
1197 #define rename_thread		fssh_rename_thread
1198 #define set_thread_priority	fssh_set_thread_priority
1199 #define exit_thread			fssh_exit_thread
1200 #define wait_for_thread 	fssh_wait_for_thread
1201 #define on_exit_thread		fssh_on_exit_thread
1202 
1203 #define find_thread			fssh_find_thread
1204 
1205 #define send_data			fssh_send_data
1206 #define receive_data		fssh_receive_data
1207 #define has_data			fssh_has_data
1208 
1209 #define snooze				fssh_snooze
1210 #define snooze_etc			fssh_snooze_etc
1211 #define snooze_until		fssh_snooze_until
1212 
1213 #define get_thread_info(id, info)					fssh_get_thread_info(id, info)
1214 #define get_next_thread_info(team, cookie, info)	fssh_get_next_thread_info(team, cookie, info)
1215 
1216 
1217 /* Time */
1218 
1219 #define real_time_clock			fssh_real_time_clock
1220 #define set_real_time_clock		fssh_set_real_time_clock
1221 #define real_time_clock_usecs	fssh_real_time_clock_usecs
1222 #define set_timezone			fssh_set_timezone
1223 #define system_time				fssh_system_time
1224 
1225 
1226 ////////////////////////////////////////////////////////////////////////////////
1227 // #pragma mark - fssh_stat.h
1228 
1229 #define stat	fssh_stat
1230 
1231 // struct stat fields
1232 #undef st_dev
1233 #undef st_ino
1234 #undef st_mode
1235 #undef st_nlink
1236 #undef st_uid
1237 #undef st_gid
1238 #undef st_size
1239 #undef st_rdev
1240 #undef st_blksize
1241 #undef st_atime
1242 #undef st_mtime
1243 #undef st_ctime
1244 #undef st_crtime
1245 #undef st_type
1246 
1247 #define st_dev		fssh_st_dev
1248 #define st_ino		fssh_st_ino
1249 #define st_mode		fssh_st_mode
1250 #define st_nlink	fssh_st_nlink
1251 #define st_uid		fssh_st_uid
1252 #define st_gid		fssh_st_gid
1253 #define st_size		fssh_st_size
1254 #define st_rdev		fssh_st_rdev
1255 #define st_blksize	fssh_st_blksize
1256 #define st_atim		fssh_st_atim
1257 #define st_mtim		fssh_st_mtim
1258 #define st_ctim		fssh_st_ctim
1259 #define st_crtim	fssh_st_crtim
1260 #define st_atime	fssh_st_atime
1261 #define st_mtime	fssh_st_mtime
1262 #define st_ctime	fssh_st_ctime
1263 #define st_crtime	fssh_st_crtime
1264 #define st_type		fssh_st_type
1265 #define st_blocks	fssh_st_blocks
1266 
1267 /* extended file types */
1268 #define S_ATTR_DIR			FSSH_S_ATTR_DIR
1269 #define S_ATTR				FSSH_S_ATTR
1270 #define S_INDEX_DIR			FSSH_S_INDEX_DIR
1271 #define S_STR_INDEX			FSSH_S_STR_INDEX
1272 #define S_INT_INDEX			FSSH_S_INT_INDEX
1273 #define S_UINT_INDEX		FSSH_S_UINT_INDEX
1274 #define S_LONG_LONG_INDEX	FSSH_S_LONG_LONG_INDEX
1275 #define S_ULONG_LONG_INDEX	FSSH_S_ULONG_LONG_INDEX
1276 #define S_FLOAT_INDEX		FSSH_S_FLOAT_INDEX
1277 #define S_DOUBLE_INDEX		FSSH_S_DOUBLE_INDEX
1278 #define S_ALLOW_DUPS		FSSH_S_ALLOW_DUPS
1279 
1280 /* link types */
1281 #define S_LINK_SELF_HEALING	FSSH_S_LINK_SELF_HEALING
1282 #define S_LINK_AUTO_DELETE	FSSH_S_LINK_AUTO_DELETE
1283 
1284 /* standard file types */
1285 #define S_IFMT		FSSH_S_IFMT
1286 #define S_IFSOCK	FSSH_S_IFSOCK
1287 #define S_IFLNK		FSSH_S_IFLNK
1288 #define S_IFREG		FSSH_S_IFREG
1289 #define S_IFBLK		FSSH_S_IFBLK
1290 #define S_IFDIR		FSSH_S_IFDIR
1291 #define S_IFCHR		FSSH_S_IFCHR
1292 #define S_IFIFO		FSSH_S_IFIFO
1293 
1294 #define S_ISREG(mode)	FSSH_S_ISREG(mode)
1295 #define S_ISLNK(mode)	FSSH_S_ISLNK(mode)
1296 #define S_ISBLK(mode)	FSSH_S_ISBLK(mode)
1297 #define S_ISDIR(mode)	FSSH_S_ISDIR(mode)
1298 #define S_ISCHR(mode)	FSSH_S_ISCHR(mode)
1299 #define S_ISFIFO(mode)	FSSH_S_ISFIFO(mode)
1300 #define S_ISINDEX(mode)	FSSH_S_ISINDEX(mode)
1301 
1302 #define S_IUMSK	FSSH_S_IUMSK
1303 
1304 #define S_ISUID	FSSH_S_ISUID
1305 #define S_ISGID	FSSH_S_ISGID
1306 
1307 #define S_ISVTX	FSSH_S_ISVTX
1308 
1309 #define S_IRWXU	FSSH_S_IRWXU
1310 #define S_IRUSR	FSSH_S_IRUSR
1311 #define S_IWUSR	FSSH_S_IWUSR
1312 #define S_IXUSR	FSSH_S_IXUSR
1313 #define S_IRWXG	FSSH_S_IRWXG
1314 #define S_IRGRP	FSSH_S_IRGRP
1315 #define S_IWGRP	FSSH_S_IWGRP
1316 #define S_IXGRP	FSSH_S_IXGRP
1317 #define S_IRWXO	FSSH_S_IRWXO
1318 #define S_IROTH	FSSH_S_IROTH
1319 #define S_IWOTH	FSSH_S_IWOTH
1320 #define S_IXOTH	FSSH_S_IXOTH
1321 
1322 #define ACCESSPERMS	FSSH_ACCESSPERMS
1323 #define ALLPERMS	FSSH_ALLPERMS
1324 #define DEFFILEMODE	FSSH_DEFFILEMODE
1325 
1326 #define chmod	fssh_chmod
1327 #define fchmod	fssh_fchmod
1328 #define mkdir	fssh_mkdir
1329 #define mkfifo	fssh_mkfifo
1330 #define umask	fssh_umask
1331 
1332 //#define stat	fssh_stat
1333 	// Already mapped above for "struct stat".
1334 #define fstat	fssh_fstat
1335 #define lstat	fssh_lstat
1336 
1337 
1338 ////////////////////////////////////////////////////////////////////////////////
1339 // #pragma mark - fssh_stdio.h
1340 
1341 #define EOF	FSSH_EOF
1342 
1343 /* file operations */
1344 #define remove		fssh_remove
1345 #define rename		fssh_rename
1346 
1347 /* formatted I/O */
1348 #define sprintf		fssh_sprintf
1349 #define snprintf	fssh_snprintf
1350 #define vsprintf	fssh_vsprintf
1351 #define vsnprintf	fssh_vsnprintf
1352 
1353 #define sscanf		fssh_sscanf
1354 #define vsscanf		fssh_vsscanf
1355 
1356 
1357 ////////////////////////////////////////////////////////////////////////////////
1358 // #pragma mark - fssh_string.h
1359 
1360 /* memXXX() functions */
1361 #define memchr		fssh_memchr
1362 #define memcmp		fssh_memcmp
1363 #define memcpy		fssh_memcpy
1364 #define memccpy		fssh_memccpy
1365 #define memmove		fssh_memmove
1366 #define memset		fssh_memset
1367 
1368 /* string functions */
1369 #define strcpy		fssh_strcpy
1370 #define strncpy		fssh_strncpy
1371 #define strcat		fssh_strcat
1372 #define strncat		fssh_strncat
1373 #define strlen		fssh_strlen
1374 #define strcmp		fssh_strcmp
1375 #define strncmp		fssh_strncmp
1376 #define strchr		fssh_strchr
1377 #define strrchr		fssh_strrchr
1378 #define strstr		fssh_strstr
1379 #define strchrnul	fssh_strchrnul
1380 #define strpbrk		fssh_strpbrk
1381 #define strtok		fssh_strtok
1382 #define strtok_r	fssh_strtok_r
1383 #define strspn		fssh_strspn
1384 #define strcspn		fssh_strcspn
1385 #define strcoll		fssh_strcoll
1386 #define strxfrm		fssh_strxfrm
1387 #define strerror	fssh_strerror
1388 #define strerror_r	fssh_strerror_r
1389 
1390 /* non-standard string functions */
1391 #define strcasecmp	fssh_strcasecmp
1392 #define strncasecmp	fssh_strncasecmp
1393 #define strcasestr	fssh_strcasestr
1394 #define strdup		fssh_strdup
1395 #define stpcpy		fssh_stpcpy
1396 #define strtcopy	fssh_strtcopy
1397 #define strlcat		fssh_strlcat
1398 #define strlcpy		fssh_strlcpy
1399 #define strnlen		fssh_strnlen
1400 
1401 #define ffs			fssh_ffs
1402 #define index		fssh_index
1403 #define rindex		fssh_rindex
1404 
1405 /* SMAP-specific functions */
1406 #define user_strlcpy	fssh_strlcpy
1407 
1408 ////////////////////////////////////////////////////////////////////////////////
1409 // #pragma mark - fssh_time.h
1410 
1411 #define clock_t		fssh_clock_t
1412 #define time_t		fssh_time_t
1413 #define suseconds_t	fssh_suseconds_t
1414 #define useconds_t	fssh_useconds_t
1415 
1416 #undef CLOCKS_PER_SEC
1417 #undef CLK_TCK
1418 #undef MAX_TIMESTR
1419 
1420 #define CLOCKS_PER_SEC	FSSH_CLOCKS_PER_SEC
1421 #define CLK_TCK			FSSH_CLK_TCK
1422 #define MAX_TIMESTR		FSSH_MAX_TIMESTR
1423 
1424 #define timespec	fssh_timespec
1425 #define itimerspec	fssh_itimerspec
1426 #define tm			fssh_tm
1427 
1428 /* special timezone support */
1429 #define tzname		fssh_tzname
1430 #define daylight	fssh_daylight
1431 #define timezone	fssh_timezone
1432 
1433 #define clock		fssh_clock
1434 #define difftime	fssh_difftime
1435 #define mktime		fssh_mktime
1436 #define time		fssh_time
1437 #define asctime		fssh_asctime
1438 #define asctime_r	fssh_asctime_r
1439 #define ctime		fssh_ctime
1440 #define ctime_r		fssh_ctime_r
1441 #define gmtime		fssh_gmtime
1442 #define gmtime_r	fssh_gmtime_r
1443 #define localtime	fssh_localtime
1444 #define localtime_r	fssh_localtime_r
1445 #define strftime	fssh_strftime
1446 #define strptime	fssh_strptime
1447 
1448 /* special timezone support */
1449 #define tzset	fssh_tzset
1450 #define stime	fssh_stime
1451 
1452 
1453 ////////////////////////////////////////////////////////////////////////////////
1454 // #pragma mark - fssh_type_constants.h
1455 
1456 #define B_ANY_TYPE						FSSH_B_ANY_TYPE
1457 #define B_ATOM_TYPE						FSSH_B_ATOM_TYPE
1458 #define B_ATOMREF_TYPE					FSSH_B_ATOMREF_TYPE
1459 #define B_BOOL_TYPE						FSSH_B_BOOL_TYPE
1460 #define B_CHAR_TYPE						FSSH_B_CHAR_TYPE
1461 #define B_COLOR_8_BIT_TYPE				FSSH_B_COLOR_8_BIT_TYPE
1462 #define B_DOUBLE_TYPE					FSSH_B_DOUBLE_TYPE
1463 #define B_FLOAT_TYPE					FSSH_B_FLOAT_TYPE
1464 #define B_GRAYSCALE_8_BIT_TYPE			FSSH_B_GRAYSCALE_8_BIT_TYPE
1465 #define B_INT16_TYPE					FSSH_B_INT16_TYPE
1466 #define B_INT32_TYPE					FSSH_B_INT32_TYPE
1467 #define B_INT64_TYPE					FSSH_B_INT64_TYPE
1468 #define B_INT8_TYPE						FSSH_B_INT8_TYPE
1469 #define B_LARGE_ICON_TYPE				FSSH_B_LARGE_ICON_TYPE
1470 #define B_MEDIA_PARAMETER_GROUP_TYPE	FSSH_B_MEDIA_PARAMETER_GROUP_TYPE
1471 #define B_MEDIA_PARAMETER_TYPE			FSSH_B_MEDIA_PARAMETER_TYPE
1472 #define B_MEDIA_PARAMETER_WEB_TYPE		FSSH_B_MEDIA_PARAMETER_WEB_TYPE
1473 #define B_MESSAGE_TYPE					FSSH_B_MESSAGE_TYPE
1474 #define B_MESSENGER_TYPE				FSSH_B_MESSENGER_TYPE
1475 #define B_MIME_TYPE						FSSH_B_MIME_TYPE
1476 #define B_MINI_ICON_TYPE				FSSH_B_MINI_ICON_TYPE
1477 #define B_MONOCHROME_1_BIT_TYPE			FSSH_B_MONOCHROME_1_BIT_TYPE
1478 #define B_OBJECT_TYPE					FSSH_B_OBJECT_TYPE
1479 #define B_OFF_T_TYPE					FSSH_B_OFF_T_TYPE
1480 #define B_PATTERN_TYPE					FSSH_B_PATTERN_TYPE
1481 #define B_POINTER_TYPE					FSSH_B_POINTER_TYPE
1482 #define B_POINT_TYPE					FSSH_B_POINT_TYPE
1483 #define B_PROPERTY_INFO_TYPE			FSSH_B_PROPERTY_INFO_TYPE
1484 #define B_RAW_TYPE						FSSH_B_RAW_TYPE
1485 #define B_RECT_TYPE						FSSH_B_RECT_TYPE
1486 #define B_REF_TYPE						FSSH_B_REF_TYPE
1487 #define B_RGB_32_BIT_TYPE				FSSH_B_RGB_32_BIT_TYPE
1488 #define B_RGB_COLOR_TYPE				FSSH_B_RGB_COLOR_TYPE
1489 #define B_SIZE_T_TYPE					FSSH_B_SIZE_T_TYPE
1490 #define B_SSIZE_T_TYPE					FSSH_B_SSIZE_T_TYPE
1491 #define B_STRING_TYPE					FSSH_B_STRING_TYPE
1492 #define B_TIME_TYPE						FSSH_B_TIME_TYPE
1493 #define B_UINT16_TYPE					FSSH_B_UINT16_TYPE
1494 #define B_UINT32_TYPE					FSSH_B_UINT32_TYPE
1495 #define B_UINT64_TYPE					FSSH_B_UINT64_TYPE
1496 #define B_UINT8_TYPE					FSSH_B_UINT8_TYPE
1497 #define B_VECTOR_ICON_TYPE				FSSH_B_VECTOR_ICON_TYPE
1498 #define B_ASCII_TYPE					FSSH_B_ASCII_TYPE
1499 #define B_XATTR_TYPE					FSSH_B_XATTR_TYPE
1500 #define B_NETWORK_ADDRESS_TYPE			FSSH_B_NETWORK_ADDRESS_TYPE
1501 #define B_MIME_STRING_TYPE				FSSH_B_MIME_STRING_TYPE
1502 
1503 //----- System-wide MIME types for handling URL's ------------------------------
1504 
1505 #define B_URL_HTTP		FSSH_B_URL_HTTP
1506 #define B_URL_HTTPS		FSSH_B_URL_HTTPS
1507 #define B_URL_FTP		FSSH_B_URL_FTP
1508 #define B_URL_GOPHER	FSSH_B_URL_GOPHER
1509 #define B_URL_MAILTO	FSSH_B_URL_MAILTO
1510 #define B_URL_NEWS		FSSH_B_URL_NEWS
1511 #define B_URL_NNTP		FSSH_B_URL_NNTP
1512 #define B_URL_TELNET	FSSH_B_URL_TELNET
1513 #define B_URL_RLOGIN	FSSH_B_URL_RLOGIN
1514 #define B_URL_TN3270	FSSH_B_URL_TN3270
1515 #define B_URL_WAIS		FSSH_B_URL_WAIS
1516 #define B_URL_FILE		FSSH_B_URL_FILE
1517 
1518 
1519 ////////////////////////////////////////////////////////////////////////////////
1520 // #pragma mark - fssh_types.h
1521 
1522 #define addr_t			fssh_addr_t
1523 #define phys_addr_t		fssh_phys_addr_t
1524 #define phys_size_t		fssh_phys_size_t
1525 #define generic_addr_t	fssh_generic_addr_t
1526 #define generic_size_t	fssh_generic_size_t
1527 
1528 #define dev_t			fssh_dev_t
1529 #define ino_t			fssh_ino_t
1530 
1531 #define size_t			fssh_size_t
1532 #define ssize_t			fssh_ssize_t
1533 #define off_t			fssh_off_t
1534 
1535 #define bigtime_t		fssh_bigtime_t
1536 
1537 #define status_t		fssh_status_t
1538 #define type_code		fssh_type_code
1539 
1540 #define mode_t			fssh_mode_t
1541 #define nlink_t			fssh_nlink_t
1542 #define uid_t			fssh_uid_t
1543 #define gid_t			fssh_gid_t
1544 #define pid_t			fssh_pid_t
1545 
1546 /* printf()/scanf() format strings for [u]int* types */
1547 #define B_PRId8			FSSH_B_PRId8
1548 #define B_PRIi8			FSSH_B_PRIi8
1549 #define B_PRId16		FSSH_B_PRId16
1550 #define B_PRIi16		FSSH_B_PRIi16
1551 #define B_PRId32		FSSH_B_PRId32
1552 #define B_PRIi32		FSSH_B_PRIi32
1553 #define B_PRId64		FSSH_B_PRId64
1554 #define B_PRIi64		FSSH_B_PRIi64
1555 #define B_PRIu8			FSSH_B_PRIu8
1556 #define B_PRIo8			FSSH_B_PRIo8
1557 #define B_PRIx8			FSSH_B_PRIx8
1558 #define B_PRIX8			FSSH_B_PRIX8
1559 #define B_PRIu16		FSSH_B_PRIu16
1560 #define B_PRIo16		FSSH_B_PRIo16
1561 #define B_PRIx16		FSSH_B_PRIx16
1562 #define B_PRIX16		FSSH_B_PRIX16
1563 #define B_PRIu32		FSSH_B_PRIu32
1564 #define B_PRIo32		FSSH_B_PRIo32
1565 #define B_PRIx32		FSSH_B_PRIx32
1566 #define B_PRIX32		FSSH_B_PRIX32
1567 #define B_PRIu64		FSSH_B_PRIu64
1568 #define B_PRIo64		FSSH_B_PRIo64
1569 #define B_PRIx64		FSSH_B_PRIx64
1570 #define B_PRIX64		FSSH_B_PRIX64
1571 
1572 #define B_SCNd8			FSSH_B_SCNd8
1573 #define B_SCNi8			FSSH_B_SCNi8
1574 #define B_SCNd16		FSSH_B_SCNd16
1575 #define B_SCNi16		FSSH_B_SCNi16
1576 #define B_SCNd32		FSSH_B_SCNd32
1577 #define B_SCNi32		FSSH_B_SCNi32
1578 #define B_SCNd64		FSSH_B_SCNd64
1579 #define B_SCNi64		FSSH_B_SCNi64
1580 #define B_SCNu8			FSSH_B_SCNu8
1581 #define B_SCNo8			FSSH_B_SCNo8
1582 #define B_SCNx8			FSSH_B_SCNx8
1583 #define B_SCNu16		FSSH_B_SCNu16
1584 #define B_SCNu16		FSSH_B_SCNu16
1585 #define B_SCNx16		FSSH_B_SCNx16
1586 #define B_SCNu32		FSSH_B_SCNu32
1587 #define B_SCNo32		FSSH_B_SCNo32
1588 #define B_SCNx32		FSSH_B_SCNx32
1589 #define B_SCNu64		FSSH_B_SCNu64
1590 #define B_SCNo64		FSSH_B_SCNo64
1591 #define B_SCNx64		FSSH_B_SCNx64
1592 
1593 /* printf() format strings for some standard types */
1594 /* size_t */
1595 #define B_PRIuSIZE		FSSH_B_PRIuSIZE
1596 #define B_PRIoSIZE		FSSH_B_PRIoSIZE
1597 #define B_PRIxSIZE		FSSH_B_PRIxSIZE
1598 #define B_PRIXSIZE		FSSH_B_PRIXSIZE
1599 /* ssize_t */
1600 #define B_PRIdSSIZE		FSSH_B_PRIdSSIZE
1601 #define B_PRIiSSIZE		FSSH_B_PRIiSSIZE
1602 /* addr_t */
1603 #define B_PRIuADDR		FSSH_B_PRIuADDR
1604 #define B_PRIoADDR		FSSH_B_PRIoADDR
1605 #define B_PRIxADDR		FSSH_B_PRIxADDR
1606 #define B_PRIXADDR		FSSH_B_PRIXADDR
1607 /* phys_addr_t */
1608 #define B_PRIuPHYSADDR	FSSH_B_PRIuPHYSADDR
1609 #define B_PRIoPHYSADDR	FSSH_B_PRIoPHYSADDR
1610 #define B_PRIxPHYSADDR	FSSH_B_PRIxPHYSADDR
1611 #define B_PRIXPHYSADDR	FSSH_B_PRIXPHYSADDR
1612 /* generic_addr_t */
1613 #define B_PRIuGENADDR	FSSH_B_PRIuGENADDR
1614 #define B_PRIoGENADDR	FSSH_B_PRIoGENADDR
1615 #define B_PRIxGENADDR	FSSH_B_PRIxGENADDR
1616 #define B_PRIXGENADDR	FSSH_B_PRIXGENADDR
1617 /* off_t */
1618 #define B_PRIdOFF		FSSH_B_PRIdOFF
1619 #define B_PRIiOFF		FSSH_B_PRIiOFF
1620 /* dev_t */
1621 #define B_PRIdDEV		FSSH_B_PRIdDEV
1622 #define B_PRIiDEV		FSSH_B_PRIiDEV
1623 /* ino_t */
1624 #define B_PRIdINO		FSSH_B_PRIdINO
1625 #define B_PRIiINO		FSSH_B_PRIiINO
1626 /* time_t */
1627 #if defined(__i386__) && !defined(__x86_64__)
1628 #	define B_PRIdTIME		FSSH_B_PRId32
1629 #	define B_PRIiTIME		FSSH_B_PRIi32
1630 #else
1631 #	define B_PRIdTIME		FSSH_B_PRId64
1632 #	define B_PRIiTIME		FSSH_B_PRIi64
1633 #endif
1634 
1635 
1636 ////////////////////////////////////////////////////////////////////////////////
1637 // #pragma mark - fssh_uio.h
1638 
1639 #define iovec		fssh_iovec
1640 
1641 #define readv		fssh_readv
1642 #define readv_pos	fssh_readv_pos
1643 #define writev		fssh_writev
1644 #define writev_pos	fssh_writev_pos
1645 
1646 
1647 ////////////////////////////////////////////////////////////////////////////////
1648 // #pragma mark - fssh_unistd.h
1649 
1650 /* access modes */
1651 #define R_OK	FSSH_R_OK
1652 #define W_OK	FSSH_W_OK
1653 #define X_OK	FSSH_X_OK
1654 #define F_OK	FSSH_F_OK
1655 
1656 /* standard file descriptors */
1657 #define STDIN_FILENO	FSSH_STDIN_FILENO
1658 #define STDOUT_FILENO	FSSH_STDOUT_FILENO
1659 #define STDERR_FILENO	FSSH_STDERR_FILENO
1660 
1661 /* lseek() constants */
1662 #define SEEK_SET	FSSH_SEEK_SET
1663 #define SEEK_CUR	FSSH_SEEK_CUR
1664 #define SEEK_END	FSSH_SEEK_END
1665 
1666 /* file functions */
1667 #define access		fssh_access
1668 
1669 #define chdir		fssh_chdir
1670 #define fchdir		fssh_fchdir
1671 #define getcwd		fssh_getcwd
1672 
1673 #define dup			fssh_dup
1674 #define dup2		fssh_dup2
1675 #define close		fssh_close
1676 #define link		fssh_link
1677 #define unlink		fssh_unlink
1678 #define rmdir		fssh_rmdir
1679 
1680 #define readlink	fssh_readlink
1681 #define symlink		fssh_symlink
1682 
1683 #define ftruncate	fssh_ftruncate
1684 #define truncate	fssh_truncate
1685 #define ioctl		fssh_ioctl
1686 
1687 #define read		fssh_read
1688 #define read_pos	fssh_read_pos
1689 #define pread		fssh_pread
1690 #define write		fssh_write
1691 #define write_pos	fssh_write_pos
1692 #define pwrite		fssh_pwrite
1693 #define lseek		fssh_lseek
1694 
1695 #define sync		fssh_sync
1696 #define fsync		fssh_fsync
1697 
1698 /* access permissions */
1699 #define getegid		fssh_getegid
1700 #define geteuid		fssh_geteuid
1701 #define getgid		fssh_getgid
1702 #define getgroups	fssh_getgroups
1703 #define getuid		fssh_getuid
1704 
1705 
1706 ////////////////////////////////////////////////////////////////////////////////
1707 // int types
1708 
1709 #define int8	int8_t
1710 #define uint8	uint8_t
1711 #define int16	int16_t
1712 #define uint16	uint16_t
1713 #define int32	int32_t
1714 #define uint32	uint32_t
1715 #define int64	int64_t
1716 #define uint64	uint64_t
1717 
1718 #define vint32	vint32_t
1719 
1720 
1721 #endif	// _FSSH_API_WRAPPER_H
1722