rpmio/rpmmg.c File Reference

#include "system.h"
#include <rpmio.h>
#include <rpmlog.h>
#include <rpmmg.h>
#include "debug.h"

Include dependency graph for rpmmg.c:

Go to the source code of this file.

Defines

#define _RPMMG_INTERNAL

Functions

rpmmg rpmmgFree (rpmmg mg)
 Destroy a magic wrapper.
rpmmg rpmmgNew (const char *fn, int flags)
 Create and load a magic wrapper.
const char * rpmmgFile (rpmmg mg, const char *fn)
 Return magic string for a file.
const char * rpmmgBuffer (rpmmg mg, const char *b, size_t nb)
 Return magic string for a buffer.

Variables

int _rpmmg_debug = 0


Detailed Description

Definition in file rpmmg.c.


Define Documentation

#define _RPMMG_INTERNAL

Definition at line 13 of file rpmmg.c.


Function Documentation

const char* rpmmgBuffer ( rpmmg  mg,
const char *  b,
size_t  nb 
)

Return magic string for a buffer.

Parameters:
mg magic wrapper
b buffer
nb no. bytes in buffer
Returns:
buffer magic string

Definition at line 88 of file rpmmg.c.

References _, _rpmmg_debug, rpmlog(), RPMLOG_ERR, and xstrdup().

const char* rpmmgFile ( rpmmg  mg,
const char *  fn 
)

Return magic string for a file.

Parameters:
mg magic wrapper
fn file path
Returns:
file magic string

Definition at line 66 of file rpmmg.c.

References _, _rpmmg_debug, rpmlog(), RPMLOG_ERR, and xstrdup().

Referenced by doUntar(), and rpmfcClassify().

rpmmg rpmmgFree ( rpmmg  mg  ) 

Destroy a magic wrapper.

Parameters:
mg magic wrapper
Returns:
NULL always

Definition at line 21 of file rpmmg.c.

References _free(), and _rpmmg_debug.

Referenced by doUntar(), rpmfcClassify(), and rpmmgNew().

rpmmg rpmmgNew ( const char *  fn,
int  flags 
)

Create and load a magic wrapper.

Parameters:
fn magic file
flags magic flags
Returns:
new magic wrapper

Definition at line 38 of file rpmmg.c.

References _, _rpmmg_debug, errno, rpmlog(), RPMLOG_ERR, rpmmgFree(), xcalloc(), and xstrdup().

Referenced by doUntar(), and rpmfcClassify().


Generated on Wed Dec 10 00:34:29 2008 for rpm by  doxygen 1.5.6