file/src/softmagic.c File Reference

#include "file.h"
#include "magic.h"
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <time.h>
#include <regex.h>

Go to the source code of this file.

Functions

static const char * rcsid (const char *p)
static int match (struct magic_set *ms, struct magic *magic, uint32_t nmagic, const unsigned char *s, size_t nbytes)
static int mget (struct magic_set *ms, union VALUETYPE *p, const unsigned char *s, struct magic *m, size_t nbytes, unsigned int cont_level)
static int mymcheck (struct magic_set *ms, union VALUETYPE *p, struct magic *m)
static int32_t mprint (struct magic_set *ms, union VALUETYPE *p, struct magic *m)
static void mdebug (uint32_t offset, const char *str, size_t len)
static int mcopy (struct magic_set *ms, union VALUETYPE *p, int type, int indir, const unsigned char *s, size_t offset, size_t nbytes)
static int mconvert (struct magic_set *ms, union VALUETYPE *p, struct magic *m)
static int check_mem (struct magic_set *ms, unsigned int level)
int file_softmagic (struct magic_set *ms, const unsigned char *buf, size_t nbytes)


Function Documentation

static int check_mem ( struct magic_set ms,
unsigned int  level 
) [static]

Definition at line 251 of file softmagic.c.

References magic_set::c, file_oomem(), magic_set::cont::len, and magic_set::cont::off.

Referenced by match().

int file_softmagic ( struct magic_set ms,
const unsigned char *  buf,
size_t  nbytes 
)

Definition at line 82 of file softmagic.c.

References mlist::magic, match(), magic_set::mlist, mlist::next, and mlist::nmagic.

static int match ( struct magic_set ms,
struct magic magic,
uint32_t  nmagic,
const unsigned char *  s,
size_t  nbytes 
) [static]

static int mconvert ( struct magic_set ms,
union VALUETYPE *  p,
struct magic m 
) [static]

static int mcopy ( struct magic_set ms,
union VALUETYPE *  p,
int  type,
int  indir,
const unsigned char *  s,
size_t  offset,
size_t  nbytes 
) [static]

Definition at line 638 of file softmagic.c.

References FILE_BESTRING16, FILE_LESTRING16, file_oomem(), and FILE_REGEX.

Referenced by mget().

static void mdebug ( uint32_t  offset,
const char *  str,
size_t  len 
) [static]

Definition at line 629 of file softmagic.c.

References file_showstr().

Referenced by mget().

static int mget ( struct magic_set ms,
union VALUETYPE *  p,
const unsigned char *  s,
struct magic m,
size_t  nbytes,
unsigned int  cont_level 
) [static]

static int32_t mprint ( struct magic_set ms,
union VALUETYPE *  p,
struct magic m 
) [static]

static int mymcheck ( struct magic_set ms,
union VALUETYPE *  p,
struct magic m 
) [static]

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

Definition at line 47 of file softmagic.c.


Generated on Fri Dec 12 13:02:10 2008 for rpm by  doxygen 1.5.6