file/src/file.c File Reference

#include "file.h"
#include "magic.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <netinet/in.h>
#include "patchlevel.h"

Go to the source code of this file.

Defines

#define SYMLINKFLAG   ""
#define USAGE   "Usage: %s [-bcik" SYMLINKFLAG "nNsvz] [-f namefile] [-F separator] [-m magicfiles] file...\n %s -C -m magicfiles\n"
#define MAXPATHLEN   512
#define OPTSTRING   "bcCdf:F:ikLm:nNprsvz"

Functions

static const char * rcsid (const char *p)
static void unwrap (char *fn)
static void usage (void)
static void process (const char *inname, int wid)
static void load (const char *m, int flags)
int main (int argc, char *argv[])
size_t file_mbswidth (const char *s)

Variables

static int bflag = 0
static int nopad = 0
static int nobuffer = 0
static const char * magicfile = 0
static const char * default_magicfile = "/etc/magic"
static const char * separator = ":"
static char * progname
static struct magic_setmagic


Define Documentation

#define MAXPATHLEN   512

Definition at line 88 of file file.c.

#define OPTSTRING   "bcCdf:F:ikLm:nNprsvz"

Referenced by main().

#define SYMLINKFLAG   ""

Definition at line 82 of file file.c.

#define USAGE   "Usage: %s [-bcik" SYMLINKFLAG "nNsvz] [-f namefile] [-F separator] [-m magicfiles] file...\n %s -C -m magicfiles\n"

Definition at line 85 of file file.c.

Referenced by usage().


Function Documentation

size_t file_mbswidth ( const char *  s  ) 

Definition at line 480 of file file.c.

Referenced by main(), process(), and unwrap().

static void load ( const char *  m,
int  flags 
) [static]

Definition at line 348 of file file.c.

References errno, EXIT_FAILURE, magic, and strerror.

Referenced by main().

int main ( int  argc,
char *  argv[] 
)

Definition at line 140 of file file.c.

References bflag, magic_set::c, errno, FILE_CHECK, FILE_COMPILE, file_mbswidth(), magic_set::flags, getenv(), load(), magic, nobuffer, nopad, OPTSTRING, process(), setlocale, strerror, unwrap(), and usage().

static void process ( const char *  inname,
int  wid 
) [static]

Definition at line 405 of file file.c.

References bflag, file_mbswidth(), magic, and nopad.

Referenced by main(), and unwrap().

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

Definition at line 75 of file file.c.

static void unwrap ( char *  fn  )  [static]

Definition at line 368 of file file.c.

References errno, EXIT_FAILURE, file_mbswidth(), MAXPATHLEN, nobuffer, process(), and strerror.

Referenced by main().

static void usage ( void   )  [static]

Definition at line 514 of file file.c.

References EXIT_FAILURE, and USAGE.

Referenced by main().


Variable Documentation

int bflag = 0 [static]

Definition at line 93 of file file.c.

Referenced by main(), and process().

const char* default_magicfile = "/etc/magic" [static]

Definition at line 100 of file file.c.

struct magic_set* magic [static]

Definition at line 108 of file file.c.

const char* magicfile = 0 [static]

Definition at line 98 of file file.c.

Referenced by rpmfcClassify().

int nobuffer = 0 [static]

Definition at line 95 of file file.c.

Referenced by main(), and unwrap().

int nopad = 0 [static]

Definition at line 94 of file file.c.

Referenced by main(), and process().

char* progname [static]

Definition at line 105 of file file.c.

Referenced by main().

const char* separator = ":" [static]

Definition at line 102 of file file.c.


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