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