xref: /haiku/src/add-ons/kernel/file_systems/udf/Utils.h (revision 9eb55bc1d104b8fda80898f8b25c94d8000c8255)
1 //----------------------------------------------------------------------
2 //  This software is part of the OpenBeOS distribution and is covered
3 //  by the OpenBeOS license.
4 //
5 //  Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net
6 //---------------------------------------------------------------------
7 #ifndef _UDF_UTILS_H
8 #define _UDF_UTILS_H
9 
10 /*! \file Utils.h
11 
12 	Miscellaneous Udf utility functions.
13 */
14 
15 extern "C" {
16 	#ifndef _IMPEXP_KERNEL
17 	#	define _IMPEXP_KERNEL
18 	#endif
19 
20 	#include <fsproto.h>
21 }
22 
23 #include "UdfStructures.h"
24 
25 namespace Udf {
26 
27 long_address to_long_address(vnode_id id, uint32 length = 0);
28 
29 vnode_id to_vnode_id(long_address address);
30 
31 time_t make_time(timestamp &timestamp);
32 
33 status_t get_block_shift(uint32 blockSize, uint32 &blockShift);
34 
35 const char* bool_to_string(bool value);
36 
37 status_t check_size_error(ssize_t bytesReturned, ssize_t bytesExpected);
38 
39 uint16 calculate_crc(uint8 *data, uint16 length);
40 
41 } // namespace Udf
42 
43 #endif	// _UDF_UTILS_H
44 
45