170081c0dSSalvatore Benedetto /* 270081c0dSSalvatore Benedetto * Copyright 2003, Tyler Dauwalder, tyler@dauwalder.net. 370081c0dSSalvatore Benedetto * Distributed under the terms of the MIT License. 470081c0dSSalvatore Benedetto */ 524ec5f43STyler Dauwalder #ifndef _UDF_UTILS_H 624ec5f43STyler Dauwalder #define _UDF_UTILS_H 724ec5f43STyler Dauwalder 820d84995SRene Gollent #include <SupportDefs.h> 920d84995SRene Gollent 1070081c0dSSalvatore Benedetto /*! \file Utils.h - Miscellaneous Udf utility functions. */ 1124ec5f43STyler Dauwalder 1220d84995SRene Gollent class timestamp; 1320d84995SRene Gollent struct long_address; 1424ec5f43STyler Dauwalder 1570081c0dSSalvatore Benedetto const char *bool_to_string(bool value); 1670081c0dSSalvatore Benedetto uint16 calculate_crc(uint8 *data, uint16 length); 1770081c0dSSalvatore Benedetto status_t check_size_error(ssize_t bytesReturned, ssize_t bytesExpected); 1870081c0dSSalvatore Benedetto status_t get_block_shift(uint32 blockSize, uint32 &blockShift); 19*c530d46cSJérôme Duval status_t decode_time(timestamp ×tamp, struct timespec ×pec); 20245aecdaSAxel Dörfler long_address to_long_address(ino_t id, uint32 length = 0); 21245aecdaSAxel Dörfler ino_t to_vnode_id(long_address address); 2224ec5f43STyler Dauwalder 2324ec5f43STyler Dauwalder #endif // _UDF_UTILS_H 24