You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

112 lines
3.1 KiB

  1. /*
  2. * Attached file IO handle functions
  3. *
  4. * Copyright (C) 2008-2019, Joachim Metz <joachim.metz@gmail.com>
  5. *
  6. * Refer to AUTHORS for acknowledgements.
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Lesser General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. */
  21. #if !defined( _LIBPFF_ATTACHED_FILE_IO_HANDLE_H )
  22. #define _LIBPFF_ATTACHED_FILE_IO_HANDLE_H
  23. #include <common.h>
  24. #include <types.h>
  25. #include "libpff_libcerror.h"
  26. #include "libpff_types.h"
  27. #if defined( __cplusplus )
  28. extern "C" {
  29. #endif
  30. typedef struct libpff_attached_file_io_handle libpff_attached_file_io_handle_t;
  31. struct libpff_attached_file_io_handle
  32. {
  33. /* The attachment item
  34. */
  35. libpff_item_t *attachment;
  36. /* Value to indicate the IO handle is open
  37. */
  38. uint8_t is_open;
  39. /* The current access flags
  40. */
  41. int access_flags;
  42. };
  43. int libpff_attached_file_io_handle_initialize(
  44. libpff_attached_file_io_handle_t **io_handle,
  45. libpff_item_t *attachment,
  46. libcerror_error_t **error );
  47. int libpff_attached_file_io_handle_free(
  48. libpff_attached_file_io_handle_t **io_handle,
  49. libcerror_error_t **error );
  50. int libpff_attached_file_io_handle_clone(
  51. libpff_attached_file_io_handle_t **destination_io_handle,
  52. libpff_attached_file_io_handle_t *source_io_handle,
  53. libcerror_error_t **error );
  54. int libpff_attached_file_io_handle_open(
  55. libpff_attached_file_io_handle_t *io_handle,
  56. int flags,
  57. libcerror_error_t **error );
  58. int libpff_attached_file_io_handle_close(
  59. libpff_attached_file_io_handle_t *io_handle,
  60. libcerror_error_t **error );
  61. ssize_t libpff_attached_file_io_handle_read(
  62. libpff_attached_file_io_handle_t *io_handle,
  63. uint8_t *buffer,
  64. size_t size,
  65. libcerror_error_t **error );
  66. ssize_t libpff_attached_file_io_handle_write(
  67. libpff_attached_file_io_handle_t *io_handle,
  68. const uint8_t *buffer,
  69. size_t size,
  70. libcerror_error_t **error );
  71. off64_t libpff_attached_file_io_handle_seek_offset(
  72. libpff_attached_file_io_handle_t *io_handle,
  73. off64_t offset,
  74. int whence,
  75. libcerror_error_t **error );
  76. int libpff_attached_file_io_handle_exists(
  77. libpff_attached_file_io_handle_t *io_handle,
  78. libcerror_error_t **error );
  79. int libpff_attached_file_io_handle_is_open(
  80. libpff_attached_file_io_handle_t *io_handle,
  81. libcerror_error_t **error );
  82. int libpff_attached_file_io_handle_get_size(
  83. libpff_attached_file_io_handle_t *io_handle,
  84. size64_t *size,
  85. libcerror_error_t **error );
  86. #if defined( __cplusplus )
  87. }
  88. #endif
  89. #endif /* !defined( _LIBPFF_ATTACHED_FILE_IO_HANDLE_H ) */