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>

Go to the source code of this file.

Functions

static const char * rcsid (const char *p)
static ssize_t swrite (int fd, const void *buf, size_t n)
static ssize_t sread (int fd, 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 unsigned char *buf, size_t nbytes)
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 int ncompr = sizeof(compr) / sizeof(compr[0])


Function Documentation

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

Definition at line 190 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 unsigned char *  buf,
size_t  nbytes 
)

Definition at line 101 of file compress.c.

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

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

Definition at line 53 of file compress.c.

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

Definition at line 167 of file compress.c.

References errno.

Referenced by file_pipe2file(), and uncompressbuf().

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

Definition at line 142 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 326 of file compress.c.

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

Referenced by file_zmagic().


Variable Documentation

const char* const argv[3]

Definition at line 64 of file compress.c.

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

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

const char* magic

Definition at line 61 of file compress.c.

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

size_t maglen

Definition at line 62 of file compress.c.

Referenced by file_zmagic().

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

Definition at line 83 of file compress.c.

int silent

Definition at line 65 of file compress.c.

Referenced by uncompressbuf().


Generated on Fri Oct 12 08:44:55 2007 for rpm by  doxygen 1.5.2