Rizin
unix-like reverse engineering framework and cli tools
|
#include "zipint.h"
#include "zip_source_file.h"
#include "zip_source_file_stdio.h"
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
Go to the source code of this file.
Functions | |
ZIP_EXTERN zip_source_t * | zip_source_filep (zip_t *za, FILE *file, zip_uint64_t start, zip_int64_t len) |
ZIP_EXTERN zip_source_t * | zip_source_filep_create (FILE *file, zip_uint64_t start, zip_int64_t length, zip_error_t *error) |
void | _zip_stdio_op_close (zip_source_file_context_t *ctx) |
zip_int64_t | _zip_stdio_op_read (zip_source_file_context_t *ctx, void *buf, zip_uint64_t len) |
bool | _zip_stdio_op_seek (zip_source_file_context_t *ctx, void *f, zip_int64_t offset, int whence) |
bool | _zip_stdio_op_stat (zip_source_file_context_t *ctx, zip_source_file_stat_t *st) |
zip_int64_t | _zip_stdio_op_tell (zip_source_file_context_t *ctx, void *f) |
FILE * | _zip_fopen_close_on_exec (const char *name, bool writeable) |
Variables | |
static zip_source_file_operations_t | ops_stdio_read |
Definition at line 187 of file zip_source_file_stdio.c.
References fd, benchmark::FILE, flags, NULL, O_CLOEXEC, O_RDONLY, and O_RDWR.
Referenced by _zip_stdio_op_open().
void _zip_stdio_op_close | ( | zip_source_file_context_t * | ctx | ) |
Definition at line 91 of file zip_source_file_stdio.c.
References benchmark::FILE.
zip_int64_t _zip_stdio_op_read | ( | zip_source_file_context_t * | ctx, |
void * | buf, | ||
zip_uint64_t | len | ||
) |
Definition at line 97 of file zip_source_file_stdio.c.
References ctx::error, benchmark::FILE, i, len, SIZE_MAX, ZIP_ER_READ, and zip_error_set().
bool _zip_stdio_op_seek | ( | zip_source_file_context_t * | ctx, |
void * | f, | ||
zip_int64_t | offset, | ||
int | whence | ||
) |
Definition at line 115 of file zip_source_file_stdio.c.
References EOVERFLOW, ctx::error, f, benchmark::FILE, fseeko, ZIP_ER_SEEK, zip_error_set(), ZIP_FSEEK_MAX, and ZIP_FSEEK_MIN.
bool _zip_stdio_op_stat | ( | zip_source_file_context_t * | ctx, |
zip_source_file_stat_t * | st | ||
) |
Definition at line 132 of file zip_source_file_stdio.c.
References ENOENT, ctx::error, zip_source_file_stat::exists, benchmark::FILE, fstat, zip_source_file_stat::mtime, zip_source_file_stat::regular_file, S_ISREG, sb, zip_source_file_stat::size, stat, ZIP_ER_READ, zip_error_set(), ZIP_FILE_ATTRIBUTES_EXTERNAL_FILE_ATTRIBUTES, ZIP_FILE_ATTRIBUTES_HOST_SYSTEM, and ZIP_OPSYS_UNIX.
zip_int64_t _zip_stdio_op_tell | ( | zip_source_file_context_t * | ctx, |
void * | f | ||
) |
Definition at line 170 of file zip_source_file_stdio.c.
References ctx::error, f, benchmark::FILE, ftello, ZIP_ER_SEEK, and zip_error_set().
ZIP_EXTERN zip_source_t* zip_source_filep | ( | zip_t * | za, |
FILE * | file, | ||
zip_uint64_t | start, | ||
zip_int64_t | len | ||
) |
Definition at line 70 of file zip_source_file_stdio.c.
References zip::error, len, NULL, start, za, and zip_source_filep_create().
Referenced by add_file(), and main().
ZIP_EXTERN zip_source_t* zip_source_filep_create | ( | FILE * | file, |
zip_uint64_t | start, | ||
zip_int64_t | length, | ||
zip_error_t * | error | ||
) |
Definition at line 80 of file zip_source_file_stdio.c.
References error(), length, NULL, ops_stdio_read, start, ZIP_ER_INVAL, zip_error_set(), and zip_source_file_common_new().
Referenced by zip_fdopen(), and zip_source_filep().
|
static |
Definition at line 51 of file zip_source_file_stdio.c.
Referenced by zip_source_filep_create().