file/src/magic.h File Reference

#include <sys/types.h>

Include dependency graph for magic.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define MAGIC_NONE   0x000000
#define MAGIC_DEBUG   0x000001
#define MAGIC_SYMLINK   0x000002
#define MAGIC_COMPRESS   0x000004
#define MAGIC_DEVICES   0x000008
#define MAGIC_MIME   0x000010
#define MAGIC_CONTINUE   0x000020
#define MAGIC_CHECK   0x000040
#define MAGIC_PRESERVE_ATIME   0x000080
#define MAGIC_RAW   0x000100
#define MAGIC_ERROR   0x000200
#define MAGIC_NO_CHECK_COMPRESS   0x001000
#define MAGIC_NO_CHECK_TAR   0x002000
#define MAGIC_NO_CHECK_SOFT   0x004000
#define MAGIC_NO_CHECK_APPTYPE   0x008000
#define MAGIC_NO_CHECK_ELF   0x010000
#define MAGIC_NO_CHECK_ASCII   0x020000
#define MAGIC_NO_CHECK_TROFF   0x040000
#define MAGIC_NO_CHECK_FORTRAN   0x080000
#define MAGIC_NO_CHECK_TOKENS   0x100000

Typedefs

typedef magic_setmagic_t

Functions

magic_t magic_open (int)
void magic_close (magic_t ms)
const char * magic_file (magic_t ms, const char *inname)
const char * magic_buffer (magic_t ms, const void *, size_t)
const char * magic_error (magic_t ms)
int magic_setflags (magic_t ms, int)
int magic_load (magic_t ms, const char *)
int magic_compile (magic_t ms, const char *)
int magic_check (magic_t ms, const char *)
int magic_errno (magic_t ms)


Define Documentation

#define MAGIC_CHECK   0x000040

Definition at line 39 of file magic.h.

Referenced by apprentice_1(), apprentice_file(), check_cond(), file_signextend(), getvalue(), main(), parse(), rpmfcClassify(), and string_modifier_check().

#define MAGIC_COMPRESS   0x000004

Definition at line 35 of file magic.h.

Referenced by file_zmagic(), and main().

#define MAGIC_CONTINUE   0x000020

Definition at line 38 of file magic.h.

Referenced by main(), and match().

#define MAGIC_DEBUG   0x000001

Definition at line 33 of file magic.h.

Referenced by magiccheck(), main(), and mget().

#define MAGIC_DEVICES   0x000008

Definition at line 36 of file magic.h.

Referenced by file_fsmagic(), and main().

#define MAGIC_ERROR   0x000200

Definition at line 42 of file magic.h.

Referenced by file_fsmagic().

#define MAGIC_MIME   0x000010

Definition at line 37 of file magic.h.

Referenced by file_apprentice(), file_buffer(), file_fsmagic(), file_is_tar(), magic_file(), and main().

#define MAGIC_NO_CHECK_APPTYPE   0x008000

Definition at line 46 of file magic.h.

Referenced by file_buffer(), and main().

#define MAGIC_NO_CHECK_ASCII   0x020000

Definition at line 48 of file magic.h.

Referenced by file_buffer(), and main().

#define MAGIC_NO_CHECK_COMPRESS   0x001000

Definition at line 43 of file magic.h.

Referenced by file_buffer(), and main().

#define MAGIC_NO_CHECK_ELF   0x010000

Definition at line 47 of file magic.h.

Referenced by file_buffer(), and main().

#define MAGIC_NO_CHECK_FORTRAN   0x080000

Definition at line 50 of file magic.h.

Referenced by file_ascmagic(), and main().

#define MAGIC_NO_CHECK_SOFT   0x004000

Definition at line 45 of file magic.h.

Referenced by file_buffer(), and main().

#define MAGIC_NO_CHECK_TAR   0x002000

Definition at line 44 of file magic.h.

Referenced by file_buffer(), and main().

#define MAGIC_NO_CHECK_TOKENS   0x100000

Definition at line 51 of file magic.h.

Referenced by file_ascmagic(), and main().

#define MAGIC_NO_CHECK_TROFF   0x040000

Definition at line 49 of file magic.h.

Referenced by file_ascmagic(), and main().

#define MAGIC_NONE   0x000000

Definition at line 32 of file magic.h.

#define MAGIC_PRESERVE_ATIME   0x000080

Definition at line 40 of file magic.h.

Referenced by close_and_restore(), magic_setflags(), and main().

#define MAGIC_RAW   0x000100

Definition at line 41 of file magic.h.

Referenced by file_getbuffer(), and main().

#define MAGIC_SYMLINK   0x000002

Definition at line 34 of file magic.h.

Referenced by file_fsmagic(), and main().


Typedef Documentation

typedef struct magic_set* magic_t

Definition at line 57 of file magic.h.


Function Documentation

const char* magic_buffer ( magic_t  ms,
const void *  ,
size_t   
)

Definition at line 353 of file magic.c.

References file_buffer(), file_getbuffer(), and file_reset().

int magic_check ( magic_t  ms,
const char *   
)

Definition at line 197 of file magic.c.

References file_apprentice(), FILE_CHECK, and free_mlist().

Referenced by main().

void magic_close ( magic_t  ms  ) 

Definition at line 164 of file magic.c.

References magic_set::out::buf, magic_set::c, free_mlist(), magic_set::cont::li, magic_set::mlist, magic_set::o, and magic_set::out::pbuf.

Referenced by main(), and rpmfcClassify().

int magic_compile ( magic_t  ms,
const char *   
)

Definition at line 189 of file magic.c.

References file_apprentice(), FILE_COMPILE, and free_mlist().

Referenced by main().

int magic_errno ( magic_t  ms  ) 

Definition at line 375 of file magic.c.

References magic_set::error, and magic_set::haderr.

const char* magic_error ( magic_t  ms  ) 

Definition at line 369 of file magic.c.

References magic_set::out::buf, magic_set::haderr, and magic_set::o.

Referenced by load(), main(), process(), and rpmfcClassify().

const char* magic_file ( magic_t  ms,
const char *  inname 
)

Definition at line 240 of file magic.c.

References alloca(), close_and_restore(), errno, file_buffer(), file_error(), file_fsmagic(), file_getbuffer(), file_printf(), file_reset(), magic_set::flags, HOWMANY, info_from_stat(), MAGIC_MIME, O_BINARY, SLOP, sread(), and STDIN_FILENO.

Referenced by file_fsmagic(), process(), and rpmfcClassify().

int magic_load ( magic_t  ms,
const char *   
)

Definition at line 177 of file magic.c.

References file_apprentice(), FILE_LOAD, free_mlist(), and magic_set::mlist.

Referenced by load(), and rpmfcClassify().

magic_t magic_open ( int   )  [read]

Definition at line 90 of file magic.c.

References magic_set::out::buf, magic_set::c, errno, magic_set::error, magic_set::haderr, magic_set::out::left, magic_set::cont::len, magic_set::cont::li, magic_setflags(), magic_set::mlist, magic_set::o, magic_set::out::pbuf, magic_set::out::psize, magic_set::out::ptr, and magic_set::out::size.

Referenced by load(), main(), and rpmfcClassify().

int magic_setflags ( magic_t  ms,
int   
)

Definition at line 381 of file magic.c.

References magic_set::flags, and MAGIC_PRESERVE_ATIME.

Referenced by magic_open().


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