#include <stdio.h>
#include <stdlib.h>
#include "puff.h"
Go to the source code of this file.
◆ local
◆ SET_BINARY_MODE
#define SET_BINARY_MODE |
( |
|
file | ) |
|
◆ bythirds()
◆ load()
Definition at line 60 of file pufftest.c.
const lzma_allocator const uint8_t * in
RZ_API void Ht_() free(HtName_(Ht) *ht)
void * realloc(void *ptr, size_t size)
void * malloc(size_t size)
size_t bythirds(size_t size)
References bythirds(), benchmark::FILE, free(), in, len, malloc(), NULL, realloc(), and swap.
Referenced by avr_il_elpm(), avr_il_lac(), avr_il_las(), avr_il_lat(), avr_il_lpm(), bf_dec(), bf_inc(), ldm(), main(), rz_il_op_new_load(), rz_il_op_pure_dup(), and rz_il_op_pure_free().
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 88 of file pufftest.c.
90 int ret, put = 0,
fail = 0;
95 unsigned long sourcelen, destlen;
100 if (
arg[1] ==
'w' &&
arg[2] == 0)
102 else if (
arg[1] ==
'f' &&
arg[2] == 0)
104 else if (
arg[1] >=
'0' &&
arg[1] <=
'9')
107 fprintf(stderr,
"invalid option %s\n",
arg);
112 fprintf(stderr,
"only one file name allowed\n");
119 fprintf(stderr,
"memory allocation failure\n");
123 fprintf(stderr,
"could not read %s, or it was empty\n",
129 fprintf(stderr,
"skip request of %d leaves no input\n",
skip);
136 sourcelen = (
unsigned long)
len;
139 fprintf(stderr,
"puff() failed with return code %d\n", ret);
141 fprintf(stderr,
"puff() succeeded uncompressing %lu bytes\n", destlen);
142 if (sourcelen <
len) fprintf(stderr,
"%lu compressed bytes unused\n",
147 if (put && ret == 0) {
152 fprintf(stderr,
"memory allocation failure\n");
158 fwrite(
dest, 1, destlen, stdout);
static const char * arg(RzAnalysis *a, csh *handle, cs_insn *insn, char *buf, int n)
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 long
void skip(file *in, unsigned n)
static static fork const void static count static fd const char const char static newpath char char argv
static void struct sockaddr socklen_t static fromlen static backlog static fork char char char static envp int struct rusage static rusage struct utsname static buf struct sembuf unsigned
int puff(unsigned char *dest, unsigned long *destlen, const unsigned char *source, unsigned long *sourcelen)
#define SET_BINARY_MODE(file)
void * load(const char *name, size_t *len)
References arg(), argv, dest, fail, free(), len, load(), long, malloc(), NIL, NULL, puff(), SET_BINARY_MODE, skip(), source, and unsigned.