#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
|
ar_stream * | ar_open_file (const char *path) |
|
ar_stream * | ar_open_memory (const void *data, size_t datalen) |
|
void | ar_close (ar_stream *stream) |
|
size_t | ar_read (ar_stream *stream, void *buffer, size_t count) |
|
bool | ar_seek (ar_stream *stream, off64_t offset, int origin) |
|
bool | ar_skip (ar_stream *stream, off64_t count) |
|
off64_t | ar_tell (ar_stream *stream) |
|
void | ar_close_archive (ar_archive *ar) |
|
bool | ar_parse_entry (ar_archive *ar) |
|
bool | ar_parse_entry_at (ar_archive *ar, off64_t offset) |
|
bool | ar_parse_entry_for (ar_archive *ar, const char *entry_name) |
|
bool | ar_at_eof (ar_archive *ar) |
|
const char * | ar_entry_get_name (ar_archive *ar) |
|
off64_t | ar_entry_get_offset (ar_archive *ar) |
|
size_t | ar_entry_get_size (ar_archive *ar) |
|
time64_t | ar_entry_get_filetime (ar_archive *ar) |
|
bool | ar_entry_uncompress (ar_archive *ar, void *buffer, size_t count) |
|
size_t | ar_get_global_comment (ar_archive *ar, void *buffer, size_t count) |
|
ar_archive * | ar_open_rar_archive (ar_stream *stream) |
|
ar_archive * | ar_open_tar_archive (ar_stream *stream) |
|
ar_archive * | ar_open_zip_archive (ar_stream *stream, bool deflatedonly) |
|
ar_archive * | ar_open_7z_archive (ar_stream *stream) |
|
#define UNARR_API_VERSION 100 |
bool ar_entry_uncompress |
( |
ar_archive * |
ar, |
|
|
void * |
buffer, |
|
|
size_t |
count |
|
) |
| |
size_t ar_get_global_comment |
( |
ar_archive * |
ar, |
|
|
void * |
buffer, |
|
|
size_t |
count |
|
) |
| |
Definition at line 86 of file stream.c.
88 FILE *f = path ? fopen(path,
"rb") : NULL;
ar_stream* ar_open_memory |
( |
const void * |
data, |
|
|
size_t |
datalen |
|
) |
| |
Definition at line 205 of file rar.c.
208 if (!
ar_seek(stream, 0, SEEK_SET))
210 if (
ar_read(stream, signature,
sizeof(signature)) !=
sizeof(signature))
212 if (memcmp(signature,
"Rar!\x1A\x07\x00",
sizeof(signature)) != 0) {
213 if (memcmp(signature,
"Rar!\x1A\x07\x01",
sizeof(signature)) == 0)
214 warn(
"RAR 5 format isn't supported");
215 else if (memcmp(signature,
"RE~^", 4) == 0)
216 warn(
"Ancient RAR format isn't supported");
217 else if (memcmp(signature,
"MZ", 2) == 0 || memcmp(signature,
"\x7F\x45LF", 4) == 0)
218 warn(
"SFX archives aren't supported");
bool ar_parse_entry_for |
( |
ar_archive * |
ar, |
|
|
const char * |
entry_name |
|
) |
| |
Definition at line 48 of file unarr.c.
57 if (name && strcmp(name, entry_name) == 0)
size_t ar_read |
( |
ar_stream * |
stream, |
|
|
void * |
buffer, |
|
|
size_t |
count |
|
) |
| |
Definition at line 28 of file stream.c.
30 return stream->
read(stream->
data, buffer, count);
Definition at line 38 of file stream.c.
40 return stream->
seek(stream->
data, count, SEEK_CUR);