zip_source_file_stdio.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef _HAD_ZIP_SOURCE_FILE_STDIO_H
  2. #define _HAD_ZIP_SOURCE_FILE_STDIO_H
  3. /*
  4. zip_source_file_stdio.h -- common header for stdio file implementation
  5. Copyright (C) 2020 Dieter Baron and Thomas Klausner
  6. This file is part of libzip, a library to manipulate ZIP archives.
  7. The authors can be contacted at <libzip@nih.at>
  8. Redistribution and use in source and binary forms, with or without
  9. modification, are permitted provided that the following conditions
  10. are met:
  11. 1. Redistributions of source code must retain the above copyright
  12. notice, this list of conditions and the following disclaimer.
  13. 2. Redistributions in binary form must reproduce the above copyright
  14. notice, this list of conditions and the following disclaimer in
  15. the documentation and/or other materials provided with the
  16. distribution.
  17. 3. The names of the authors may not be used to endorse or promote
  18. products derived from this software without specific prior
  19. written permission.
  20. THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
  21. OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  22. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  23. ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
  24. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  25. DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  26. GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  27. INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  28. IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  29. OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  30. IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. */
  32. #include <stdio.h>
  33. void _zip_stdio_op_close(zip_source_file_context_t *ctx);
  34. zip_int64_t _zip_stdio_op_read(zip_source_file_context_t *ctx, void *buf, zip_uint64_t len);
  35. bool _zip_stdio_op_seek(zip_source_file_context_t *ctx, void *f, zip_int64_t offset, int whence);
  36. bool _zip_stdio_op_stat(zip_source_file_context_t *ctx, zip_source_file_stat_t *st);
  37. zip_int64_t _zip_stdio_op_tell(zip_source_file_context_t *ctx, void *f);
  38. FILE *_zip_fopen_close_on_exec(const char *name, bool writeable);
  39. #endif /* _HAD_ZIP_SOURCE_FILE_STDIO_H */