file/src/compress.c File Reference

#include "file.h"
#include "magic.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/ioctl.h>

Include dependency graph for compress.c:

Go to the source code of this file.

Defines

#define NODATA   ((size_t)~0)

Functions

static const char * rcsid (const char *p)
static ssize_t swrite (int fd, const void *buf, size_t n)
static size_t uncompressbuf (struct magic_set *ms, int fd, size_t method, const unsigned char *old, unsigned char **newch, size_t n)
int file_zmagic (struct magic_set *ms, int fd, const char *name, const unsigned char *buf, size_t nbytes)
ssize_t sread (int fd, void *buf, size_t n, int canbepipe)
int file_pipe2file (struct magic_set *ms, int fd, const void *startbuf, size_t nbytes)

Variables

struct {
   const char *   magic
   size_t   maglen
   const char *const   argv [3]
   int   silent
compr []
static size_t ncompr = sizeof(compr) / sizeof(compr[0])


Define Documentation

#define NODATA   ((size_t)~0)

Definition at line 89 of file compress.c.

Referenced by file_zmagic(), and uncompressbuf().


Function Documentation

int file_pipe2file ( struct magic_set ms,
int  fd,
const void *  startbuf,
size_t  nbytes 
)

Definition at line 236 of file compress.c.

References errno, file_badseek(), file_error(), SEEK_SET, sread(), and swrite().

int file_zmagic ( struct magic_set ms,
int  fd,
const char *  name,
const unsigned char *  buf,
size_t  nbytes 
)

Definition at line 106 of file compress.c.

References file_buffer(), file_printf(), magic_set::flags, MAGIC_COMPRESS, maglen, NODATA, and uncompressbuf().

Referenced by file_buffer().

static const char* rcsid ( const char *  p  )  [static]

Definition at line 58 of file compress.c.

ssize_t sread ( int  fd,
void *  buf,
size_t  n,
int  canbepipe 
)

Definition at line 172 of file compress.c.

References check, errno, and STDIN_FILENO.

Referenced by file_pipe2file(), magic_file(), and uncompressbuf().

static ssize_t swrite ( int  fd,
const void *  buf,
size_t  n 
) [static]

Definition at line 147 of file compress.c.

References errno.

Referenced by file_pipe2file(), and uncompressbuf().

static size_t uncompressbuf ( struct magic_set ms,
int  fd,
size_t  method,
const unsigned char *  old,
unsigned char **  newch,
size_t  n 
) [static]

Definition at line 373 of file compress.c.

References argv, errno, EXIT_FAILURE, file_error(), HOWMANY, NODATA, SEEK_SET, silent, sread(), strerror, and swrite().

Referenced by file_zmagic().


Variable Documentation

const char* const argv[3]

Definition at line 68 of file compress.c.

Referenced by addOrAppendListEntry(), doScript(), doSetupMacro(), grabArgs(), headerMacrosLoad(), headerMacrosUnload(), mireSkip(), missingokTag(), parseDescription(), parseFiles(), parseScript(), processBinaryFile(), rpmfcExpandAppend(), rpmGlob(), rpmReadPackageManifest(), runInstScript(), runScript(), uncompressbuf(), and XpoptParseArgvString().

struct { ... } compr[] [static]

const char* magic

Definition at line 65 of file compress.c.

Referenced by apprentice_1(), byteswap(), load(), main(), match(), and process().

size_t maglen

Definition at line 66 of file compress.c.

Referenced by file_zmagic().

size_t ncompr = sizeof(compr) / sizeof(compr[0]) [static]

Definition at line 87 of file compress.c.

int silent

Definition at line 69 of file compress.c.

Referenced by uncompressbuf().


Generated on Fri May 25 21:18:40 2007 for rpm by  doxygen 1.5.2