diff --git a/CMakeLists.txt b/CMakeLists.txt index 10393a6..e6fd300 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,100 +1,101 @@ cmake_minimum_required(VERSION 2.8) project(xmount C) include(CheckIncludeFiles) #include(CheckCSourceCompiles) # Only for internal packaging #set(STATIC 1) if(STATIC) set(STATIC_EWF 1) set(STATIC_AFF 1) endif(STATIC) add_definitions(-DXMOUNT_VERSION="1.0.0") if(APPLE) # On OSx, do not try to find frameworks but only std headers / libraries set(CMAKE_FIND_FRAMEWORK "NEVER") endif(APPLE) # Make sure CMAKE_BUILD_TYPE is set if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") else(NOT CMAKE_BUILD_TYPE) if(NOT (CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "Debug")) message(FATAL_ERROR "Only build types 'Release' and 'Debug' are supported!") endif(NOT (CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "Debug")) endif(NOT CMAKE_BUILD_TYPE) # Add cmake_modules dir to CMAKE_MODULE_PATH set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules/") # Check required headers check_include_files(stdlib.h HAVE_STDLIB_H) check_include_files(stdio.h HAVE_STDIO_H) check_include_files(stdint.h HAVE_STDINT_H) check_include_files(stdarg.h HAVE_STDARG_H) check_include_files(string.h HAVE_STRING_H) check_include_files(errno.h HAVE_ERRNO_H) check_include_files(fcntl.h HAVE_FCNTL_H) check_include_files(dlfcn.h HAVE_DLFCN_H) check_include_files(dirent.h HAVE_DIRENT_H) check_include_files(unistd.h HAVE_UNISTD_H) check_include_files(sys/ioctl.h HAVE_SYS_IOCTL_H) check_include_files(sys/stat.h HAVE_SYS_STAT_H) check_include_files(sys/types.h HAVE_SYS_TYPES_H) check_include_files(linux/fs.h HAVE_LINUX_FS_H) check_include_files(grp.h HAVE_GRP_H) check_include_files(pwd.h HAVE_PWD_H) check_include_files(pthread.h HAVE_PTHREAD_H) check_include_files(time.h HAVE_TIME_H) check_include_files(inttypes.h HAVE_INTTYPES_H) check_include_files(byteswap.h HAVE_BYTESWAP_H) check_include_files(endian.h HAVE_ENDIAN_H) check_include_files(libkern/OSByteOrder.h HAVE_LIBKERN_OSBYTEORDER_H) # Check for required libs if(NOT APPLE) find_package(LibFUSE REQUIRED) else(NOT APPLE) # On OSx, search for osxfuse find_package(LibOSXFUSE REQUIRED) endif(NOT APPLE) find_package(libgidafs REQUIRED) # Generate config.h and add it's path to the include dirs configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) include_directories(${CMAKE_CURRENT_BINARY_DIR}) # Add preprocessor definitions add_definitions(-D_LARGEFILE64_SOURCE) add_definitions(-D_FILE_OFFSET_BITS=64) add_definitions(-D_GNU_SOURCE) set(CMAKE_C_FLAGS "-fno-strict-aliasing -std=c99 -Wall") set(CMAKE_C_FLAGS_RELEASE "-O2 ${CMAKE_C_FLAGS}") set(CMAKE_C_FLAGS_DEBUG "-ggdb -O0 ${CMAKE_C_FLAGS}") # Check that off_t can represent 2**63 - 1 correctly. # If it can't, we need to set _FILE_OFFSET_BITS=64 #check_c_source_compiles(" # #include # #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) # int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; # int main() { return 0; } #" _OFFT_IS_64BIT) #if(NOT ${_OFFT_IS_64BIT}) # set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-D_FILE_OFFSET_BITS=64") #endif(NOT ${_OFFT_IS_64BIT}) # Compile stuff in sub dirs add_subdirectory(libxmount_input) add_subdirectory(libxmount_morphing) +add_subdirectory(libxmount_output) add_subdirectory(src) # Install man page INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/xmount.1 DESTINATION share/man/man1) diff --git a/codelite/xmount.project b/codelite/xmount.project index 5b57c3f..d2f0f42 100644 --- a/codelite/xmount.project +++ b/codelite/xmount.project @@ -1,240 +1,249 @@ cmake ../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1 make clean && make -j4 make clean make -j4 None $(WorkspacePath)/build-debug cmake .. -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1 mingw32-make clean && mingw32-make -j4 mingw32-make clean mingw32-make -j4 None $(WorkspacePath)/build-debug cmake ../.. -DCMAKE_EXPORT_COMPILE_COMMANDS=1 make clean && make -j4 make clean make -j4 None $(WorkspacePath)/build-release cmake .. -G "MinGW Makefiles" -DCMAKE_EXPORT_COMPILE_COMMANDS=1 mingw32-make clean && mingw32-make -j4 mingw32-make clean mingw32-make -j4 None $(WorkspacePath)/build-release + + + + + + + + + diff --git a/libxmount_output/CMakeLists.txt b/libxmount_output/CMakeLists.txt new file mode 100644 index 0000000..fdc74b6 --- /dev/null +++ b/libxmount_output/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(libxmount_output_raw) diff --git a/libxmount_output/libxmount_output.h b/libxmount_output/libxmount_output.h new file mode 100644 index 0000000..a7b0238 --- /dev/null +++ b/libxmount_output/libxmount_output.h @@ -0,0 +1,267 @@ +/******************************************************************************* +* xmount Copyright (c) 2008-2016 by Gillen Daniel * +* * +* This program is free software: you can redistribute it and/or modify it * +* under the terms of the GNU General Public License as published by the Free * +* Software Foundation, either version 3 of the License, or (at your option) * +* any later version. * +* * +* This program is distributed in the hope that it will be useful, but WITHOUT * +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * +* more details. * +* * +* You should have received a copy of the GNU General Public License along with * +* this program. If not, see . * +*******************************************************************************/ + +#ifndef LIBXMOUNT_OUTPUT_H +#define LIBXMOUNT_OUTPUT_H + +#define LIBXMOUNT_OUTPUT_API_VERSION 1 + +#include + +#include // For alloc, calloc, free +#include // For printf +#include // For int*_t and uint*_t +#include // For va_*, vprintf +#include // For PRI* + +#include "../libxmount/libxmount.h" + +/******************************************************************************* + * Type defs + ******************************************************************************/ +//! Struct containing pointers to input image functions +typedef struct s_LibXmountOutput_InputFunctions { + //! Function to get the size of the morphed image + /*! + * \param p_size Pointer to store input image's size to + * \return 0 on success + */ + int (*Size)(uint64_t *p_size); + + //! Function to read data from the morphed image + /*! + * \param p_buf Buffer to store read data to + * \param offset Position at which to start reading + * \param count Amount of bytes to read + * \param p_read Number of read bytes on success + * \return 0 on success or negated error code on error + */ + int (*Read)(char *p_buf, + off_t offset, + size_t count, + size_t *p_read); + + //! Function to write data to the morphed image + /*! + * \param p_buf Buffer with data tp write + * \param offset Position at which to start writing + * \param count Amount of bytes to write + * \param p_written Number of written bytes on success + * \return 0 on success or negated error code on error + */ + int (*Write)(char *p_buf, + off_t offset, + size_t count, + size_t *p_written); +} ts_LibXmountOutput_InputFunctions, *pts_LibXmountOutput_InputFunctions; + +//! Structure containing pointers to the lib's functions +typedef struct s_LibXmountOutput_Functions { + //! Function to initialize handle + /*! + * This function is called once to allow the lib to alloc any needed + * structures before other functions that rely upon a valid handle are called + * (for ex. OptionsParse). + * + * The p_format parameter specifies one of the output formats returned by + * LibXmount_Output_GetSupportedFormats() which should be used for this + * handle. + * + * \param pp_handle Pointer to store handle to + * \param p_format Output format to use + * \param debug If set to 1, print debugging infos to stdout + * \return 0 on success or error code + */ + int (*CreateHandle)(void **pp_handle, + const char *p_format, + uint8_t debug); + + //! Function to destroy handle + /*! + * In this function, any structures allocated with CreateHandle should be + * freed. It is generally the last function called before unloading of lib + * happens. + * + * By convention, after this function has been called, *pp_handle must be + * NULL. + * + * \param pp_handle Pointer to store handle to + * \return 0 on success or error code + */ + int (*DestroyHandle)(void **pp_handle); + + //! Function to transform morphed into output image + /*! + * Converts the input (morphed) image into the output (virtual) image. + * + * \param p_handle Handle + * \param p_input_functions ts_LibXmountInputFunctions structure + * \return 0 on success or error code + */ + int (*Transform)(void *p_handle, + pts_LibXmountOutput_InputFunctions p_input_functions); + + //! Function to get the size of the output image + /*! + * \param p_handle Handle + * \param p_size Pointer to store output image's size to + * \return 0 on success or error code + */ + int (*Size)(void *p_handle, + uint64_t *p_size); + + //! Function to read data from output image + /*! + * Reads count bytes at offset from output image and copies them into memory + * starting at the address of p_buf. Memory is pre-allocated to as much bytes + * as should be read. + * + * \param p_handle Handle + * \param p_buf Buffer to store read data to + * \param offset Position at which to start reading + * \param count Amount of bytes to read + * \param p_read Number of read bytes on success + * \return 0 on success or negated error code on error + */ + int (*Read)(void *p_handle, + char *p_buf, + off_t offset, + size_t count, + size_t *p_read); + + //! Function to write data to output image + /*! + * Writes count bytes from buffer p_buf starting at offset to output image. + * + * \param p_handle Handle + * \param p_buf Buffer with data to write + * \param offset Position at which to start writing + * \param count Amount of bytes to read + * \param p_written Number of read bytes on success + * \return 0 on success or negated error code on error + */ + int (*Write)(void *p_handle, + char *p_buf, + off_t offset, + size_t count, + size_t *p_written); + + //! Function to get a help message for any supported lib-specific options + /*! + * Calling this function should return a string containing help messages for + * any supported lib-specific options. Lines should be formated as follows: + * + * " option : description\n" + * + * Returned string will be freed by the caller using FreeBuffer(). + * + * If there is no help text, this function must return NULL in pp_help. + * + * \param Pointer to a string to return help text + * \return 0 on success or error code on error + */ + int (*OptionsHelp)(const char **pp_help); + + //! Function to parse any lib-specific options + /*! + * This function is called with the option string given after the --outopts + * parameter. All contained options are for the lib. If errors or unknown + * options are found, this function should fail and return an error message + * in pp_error. pp_error will be freed by the caller using FreeBuffer. + * + * \param p_handle Handle + * \param p_options String with specified options + * \param pp_error Pointer to a string with error message + * \return 0 on success or error code and error message + */ + int (*OptionsParse)(void *p_handle, + uint32_t options_count, + const pts_LibXmountOptions *pp_options, + const char **pp_error); + + //! Function to get content to add to the info file + /*! + * The returned string is added to xmount's info file. This function is only + * called once when the info file is generated. The returned string is then + * freed with a call to FreeBuffer. + * + * \param p_handle Handle + * \param pp_info_buf Pointer to store the null-terminated content + * \return 0 on success or error code + */ + int (*GetInfofileContent)(void *p_handle, + const char **pp_info_buf); + + //! Function to get an error message + /*! + * This function should translate an error code that was previously returned + * by one of the library functions into a human readable error message. + * + * By convention, this function must always return a valid pointer to a + * NULL-terminated string! + * + * \param err_num Error code as returned by lib + */ + const char* (*GetErrorMessage)(int err_num); + + //! Function to free buffers that were allocated by lib + /*! + * \param p_buf Buffer to free + */ + void (*FreeBuffer)(void *p_buf); +} ts_LibXmountOutput_Functions, *pts_LibXmountOutput_Functions; + +/******************************************************************************* + * API functions + ******************************************************************************/ +//! Get library API version +/*! + * This function should return the value of LIBXMOUNT_OUTPUT_API_VERSION + * + * \return Supported version + */ +uint8_t LibXmount_Output_GetApiVersion(); +typedef uint8_t (*t_LibXmount_Output_GetApiVersion)(); + +//! Get a list of supported output formats +/*! + * Gets a list of supported output formats. These are the strings + * specified with xmount's --out command line option. The returned + * string must be a constant vector of output formats split by \0 chars. To + * mark the end of the vector, a single \0 must be used. + * + * As an example, "first\0second\0\0" would be a correct string to return for + * a lib supporting two output formats. + * + * \return Vector containing supported output formats + */ +const char* LibXmount_Output_GetSupportedFormats(); +typedef const char* (*t_LibXmount_Output_GetSupportedFormats)(); + +//! Get the lib's s_LibXmountOutput_Functions structure +/*! + * This function should set the members of the given + * s_LibXmountOutputFunctions structure to the internal lib functions. All + * members have to be set. + * + * \param p_functions s_LibXmountOutput_Functions structure to fill + */ +void LibXmount_Output_GetFunctions(pts_LibXmountOutput_Functions p_functions); +typedef void (*t_LibXmount_Output_GetFunctions)(pts_LibXmountOutput_Functions); + +#endif // LIBXMOUNT_OUTPUT_H + diff --git a/libxmount_output/libxmount_output_raw/CMakeLists.txt b/libxmount_output/libxmount_output_raw/CMakeLists.txt new file mode 100644 index 0000000..f443fe3 --- /dev/null +++ b/libxmount_output/libxmount_output_raw/CMakeLists.txt @@ -0,0 +1,10 @@ +if(POLICY CMP0042) + cmake_policy(SET CMP0042 NEW) # CMake 3.0 +endif(POLICY CMP0042) + +project(libxmount_output_raw C) + +add_library(xmount_output_raw SHARED libxmount_output_raw.c ../../libxmount/libxmount.c) + +install(TARGETS xmount_output_raw DESTINATION lib/xmount) + diff --git a/libxmount_output/libxmount_output_raw/libxmount_output_raw.c b/libxmount_output/libxmount_output_raw/libxmount_output_raw.c new file mode 100644 index 0000000..ac87a90 --- /dev/null +++ b/libxmount_output/libxmount_output_raw/libxmount_output_raw.c @@ -0,0 +1,268 @@ +/******************************************************************************* +* xmount Copyright (c) 2008-2016 by Gillen Daniel * +* * +* This program is free software: you can redistribute it and/or modify it * +* under the terms of the GNU General Public License as published by the Free * +* Software Foundation, either version 3 of the License, or (at your option) * +* any later version. * +* * +* This program is distributed in the hope that it will be useful, but WITHOUT * +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * +* more details. * +* * +* You should have received a copy of the GNU General Public License along with * +* this program. If not, see . * +*******************************************************************************/ + +#include +#include +#include + +#include "../libxmount_output.h" +#include "libxmount_output_raw.h" + +#define LOG_DEBUG(...) { \ + LIBXMOUNT_LOG_DEBUG(p_raw_handle->debug,__VA_ARGS__); \ +} + +/******************************************************************************* + * LibXmount_Output API implementation + ******************************************************************************/ +/* + * LibXmount_Output_GetApiVersion + */ +uint8_t LibXmount_Output_GetApiVersion() { + return LIBXMOUNT_OUTPUT_API_VERSION; +} + +/* + * LibXmount_Output_GetSupportedFormats + */ +const char* LibXmount_Output_GetSupportedFormats() { + return "raw\0dmg\0\0"; +} + +/* + * LibXmount_Output_GetFunctions + */ +void LibXmount_Output_GetFunctions(ts_LibXmountOutput_Functions *p_functions) { + p_functions->CreateHandle=&RawCreateHandle; + p_functions->DestroyHandle=&RawDestroyHandle; + p_functions->Transform=&RawTransform; + p_functions->Size=&RawSize; + p_functions->Read=&RawRead; + p_functions->Write=&RawWrite; + p_functions->OptionsHelp=&RawOptionsHelp; + p_functions->OptionsParse=&RawOptionsParse; + p_functions->GetInfofileContent=&RawGetInfofileContent; + p_functions->GetErrorMessage=&RawGetErrorMessage; + p_functions->FreeBuffer=&RawFreeBuffer; +} + +/******************************************************************************* + * Private + ******************************************************************************/ +/* + * RawCreateHandle + */ +static int RawCreateHandle(void **pp_handle, + const char *p_format, + uint8_t debug) +{ + pts_RawHandle p_raw_handle; + + // Alloc new handle + p_raw_handle=malloc(sizeof(ts_RawHandle)); + if(p_raw_handle==NULL) return RAW_MEMALLOC_FAILED; + + // Init handle values + p_raw_handle->debug=debug; + p_raw_handle->p_input_functions=NULL; + p_raw_handle->output_image_size=0; + + LOG_DEBUG("Created new LibXmount_Output_Raw handle\n"); + + // Return new handle + *pp_handle=p_raw_handle; + return RAW_OK; +} + +/* + * RawDestroyHandle + */ +static int RawDestroyHandle(void **pp_handle) { + pts_RawHandle p_raw_handle=(pts_RawHandle)*pp_handle; + + LOG_DEBUG("Destroying LibXmount_Output_Raw handle\n"); + + // Free handle + free(p_raw_handle); + + *pp_handle=NULL; + return RAW_OK; +} + +/* + * RawTransform + */ +static int RawTransform(void *p_handle, + pts_LibXmountOutput_InputFunctions p_input_functions) +{ + pts_RawHandle p_raw_handle=(pts_RawHandle)p_handle; + int ret; + + LOG_DEBUG("Initializing LibXmount_Ouptut_Raw\n"); + + // Set input functions and get image count + p_raw_handle->p_input_functions=p_input_functions; + + // Output image size == morphed image size + ret=p_raw_handle-> + p_input_functions-> + Size(&p_raw_handle->output_image_size); + if(ret!=0) return RAW_CANNOT_GET_IMAGESIZE; + + LOG_DEBUG("Total output image size is %" PRIu64 " bytes\n", + p_raw_handle->output_image_size); + + return RAW_OK; +} + +/* + * RawSize + */ +static int RawSize(void *p_handle, uint64_t *p_size) { + *p_size=((pts_RawHandle)(p_handle))->output_image_size; + return RAW_OK; +} + +/* + * RawRead + */ +static int RawRead(void *p_handle, + char *p_buf, + off_t offset, + size_t count, + size_t *p_read) +{ + pts_RawHandle p_raw_handle=(pts_RawHandle)p_handle; + int ret; + + LOG_DEBUG("Reading %zu bytes at offset %zu from output image\n", + count, + offset); + + // Make sure read parameters are within output image bounds + if(offset>=p_raw_handle->output_image_size || + offset+count>p_raw_handle->output_image_size) + { + return RAW_READ_BEYOND_END_OF_IMAGE; + } + + // Read data + ret=p_raw_handle->p_input_functions->Read(p_buf, + offset, + count, + p_read); + if(ret!=0 || *p_read!=count) return RAW_CANNOT_READ_DATA; + + return RAW_OK; +} + +/* + * RawWrite + */ +static int RawWrite(void *p_handle, + char *p_buf, + off_t offset, + size_t count, + size_t *p_written) +{ + pts_RawHandle p_raw_handle=(pts_RawHandle)p_handle; + int ret; + + LOG_DEBUG("Writing %zu bytes at offset %zu to output image\n", + count, + offset); + + // Make sure write parameters are within output image bounds + if(offset>=p_raw_handle->output_image_size || + offset+count>p_raw_handle->output_image_size) + { + return RAW_WRITE_BEYOND_END_OF_IMAGE; + } + + // Write data + ret=p_raw_handle->p_input_functions->Write(p_buf, + offset, + count, + p_written); + if(ret!=0 || *p_written!=count) return RAW_CANNOT_WRITE_DATA; + + return RAW_OK; +} + +/* + * RawOptionsHelp + */ +static int RawOptionsHelp(const char **pp_help) { + *pp_help=NULL; + return RAW_OK; +} + +/* + * RawOptionsParse + */ +static int RawOptionsParse(void *p_handle, + uint32_t options_count, + const pts_LibXmountOptions *pp_options, + const char **pp_error) +{ + return RAW_OK; +} + +/* + * RawGetInfofileContent + */ +static int RawGetInfofileContent(void *p_handle, + const char **pp_info_buf) +{ + *pp_info_buf=NULL; + return RAW_OK; +} + +/* + * RawGetErrorMessage + */ +static const char* RawGetErrorMessage(int err_num) { + switch(err_num) { + case RAW_MEMALLOC_FAILED: + return "Unable to allocate memory"; + break; + case RAW_CANNOT_GET_IMAGESIZE: + return "Unable to get input image size"; + break; + case RAW_READ_BEYOND_END_OF_IMAGE: + return "Unable to read data: Attempt to read past EOF"; + break; + case RAW_WRITE_BEYOND_END_OF_IMAGE: + return "Unable to write data: Attempt to write past EOF"; + break; + case RAW_CANNOT_READ_DATA: + return "Unable to read data"; + break; + case RAW_CANNOT_WRITE_DATA: + return "Unable to write data"; + break; + default: + return "Unknown error"; + } +} + +/* + * RawFreeBuffer + */ +static void RawFreeBuffer(void *p_buf) { + free(p_buf); +} diff --git a/libxmount_output/libxmount_output_raw/libxmount_output_raw.h b/libxmount_output/libxmount_output_raw/libxmount_output_raw.h new file mode 100644 index 0000000..01436e0 --- /dev/null +++ b/libxmount_output/libxmount_output_raw/libxmount_output_raw.h @@ -0,0 +1,71 @@ +/******************************************************************************* +* xmount Copyright (c) 2008-2016 by Gillen Daniel * +* * +* This program is free software: you can redistribute it and/or modify it * +* under the terms of the GNU General Public License as published by the Free * +* Software Foundation, either version 3 of the License, or (at your option) * +* any later version. * +* * +* This program is distributed in the hope that it will be useful, but WITHOUT * +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * +* more details. * +* * +* You should have received a copy of the GNU General Public License along with * +* this program. If not, see . * +*******************************************************************************/ + +#ifndef LIBXMOUNT_OUTPUT_RAW_H +#define LIBXMOUNT_OUTPUT_RAW_H + +/******************************************************************************* + * Enums, type defs, etc... + ******************************************************************************/ +enum { + RAW_OK=0, + RAW_MEMALLOC_FAILED, + RAW_CANNOT_GET_IMAGESIZE, + RAW_READ_BEYOND_END_OF_IMAGE, + RAW_WRITE_BEYOND_END_OF_IMAGE, + RAW_CANNOT_READ_DATA, + RAW_CANNOT_WRITE_DATA +}; + +typedef struct s_RawHandle { + uint8_t debug; + pts_LibXmountOutput_InputFunctions p_input_functions; + uint64_t output_image_size; +} ts_RawHandle, *pts_RawHandle; + +/******************************************************************************* + * Forward declarations + ******************************************************************************/ +static int RawCreateHandle(void **pp_handle, + const char *p_format, + uint8_t debug); +static int RawDestroyHandle(void **pp_handle); +static int RawTransform(void *p_handle, + pts_LibXmountOutput_InputFunctions p_input_functions); +static int RawSize(void *p_handle, + uint64_t *p_size); +static int RawRead(void *p_handle, + char *p_buf, + off_t offset, + size_t count, + size_t *p_read); +static int RawWrite(void *p_handle, + char *p_buf, + off_t offset, + size_t count, + size_t *p_written); +static int RawOptionsHelp(const char **pp_help); +static int RawOptionsParse(void *p_handle, + uint32_t options_count, + const pts_LibXmountOptions *pp_options, + const char **pp_error); +static int RawGetInfofileContent(void *p_handle, + const char **pp_info_buf); +static const char* RawGetErrorMessage(int err_num); +static void RawFreeBuffer(void *p_buf); + +#endif // LIBXMOUNT_OUTPUT_RAW_H