#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <mspack.h>
#include "mspack/macros.h"
Go to the source code of this file.
◆ BUF_SIZE
#define BUF_SIZE (1024*4096) |
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 64 of file cabrip.c.
76 for (
c = cab;
c;
c =
c->next) {
void rip(char *fname, off_t offset, unsigned int length)
static static fork const void static count static fd const char const char static newpath char char argv
struct mscabd_cabinet *(* search)(struct mscab_decompressor *self, const char *filename)
void(* close)(struct mscab_decompressor *self, struct mscabd_cabinet *cab)
int(* set_param)(struct mscab_decompressor *self, int param, int value)
References argv, c, cabd, mscab_decompressor::close, err, MSCABD_PARAM_SALVAGE, mspack_create_cab_decompressor(), mspack_destroy_cab_decompressor(), MSPACK_SYS_SELFTEST, NULL, rip(), mscab_decompressor::search, and mscab_decompressor::set_param.
◆ rip()
Definition at line 18 of file cabrip.c.
19 static unsigned int counter = 1;
27 }
while (
stat(outname, &st_buf) == 0);
29 printf(
"ripping %s offset %" LD " length %u to %s\n",
32 if (!(
in = fopen(
fname,
"rb"))) {
36 if (!(
out = fopen(outname,
"wb"))) {
41 fprintf(stderr,
"%s: can't seek to cab offset %"LD"\n",
fname,
offset);
46 size_t actual = fread(&
buf[0], 1,
run,
in);
48 fprintf(stderr,
"%s: file %u bytes shorter than expected\n",
const lzma_allocator const uint8_t * in
const lzma_allocator const uint8_t size_t uint8_t * out
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
static int run(int i, const char *arg)
References BUF_SIZE, cleanup(), counter, benchmark::FILE, create_tags_rz::fname, in, LD, length, NULL, out, printf(), run(), SEEK_SET, snprintf, and stat.
Referenced by main(), parse_thread(), rz_test_run_asm_test(), and subvar().
◆ buf