rpm 5.3.12
Defines | Functions | Variables
rpmio/rpmmg.c File Reference
#include "system.h"
#include <rpmiotypes.h>
#include <rpmio.h>
#include <rpmlog.h>
#include <rpmurl.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

static void rpmmgFini (void *_mg)
static rpmmg rpmmgGetPool (rpmioPool pool)
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
rpmioPool _rpmmgPool = NULL

Detailed Description

Definition in file rpmmg.c.


Define Documentation

#define _RPMMG_INTERNAL

Definition at line 15 of file rpmmg.c.


Function Documentation

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

Return magic string for a buffer.

Parameters:
mgmagic wrapper
bbuffer
nbno. bytes in buffer
Returns:
buffer magic string

Definition at line 139 of file rpmmg.c.

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

Referenced by rpmmgFile().

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

Return magic string for a file.

Parameters:
mgmagic wrapper
fnfile path
Returns:
file magic string

Definition at line 83 of file rpmmg.c.

References _, _rpmmg_debug, Fclose(), Ferror(), Fopen(), Fread(), rpmlog(), RPMLOG_ERR, rpmmgBuffer(), URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_PATH, URL_IS_UNKNOWN, urlPath(), and xstrdup().

Referenced by doUntar(), and rpmfcClassify().

static void rpmmgFini ( void *  _mg) [static]

Definition at line 24 of file rpmmg.c.

References _free().

Referenced by rpmmgGetPool().

static rpmmg rpmmgGetPool ( rpmioPool  pool) [static]

Definition at line 43 of file rpmmg.c.

References _rpmmg_debug, _rpmmgPool, rpmioGetPool(), rpmioNewPool(), and rpmmgFini().

Referenced by rpmmgNew().

rpmmg rpmmgNew ( const char *  fn,
int  flags 
)

Create and load a magic wrapper.

Parameters:
fnmagic file
flagsmagic flags
Returns:
new magic wrapper

Definition at line 57 of file rpmmg.c.

References _, errno, rpmlog(), RPMLOG_ERR, rpmmgFree(), rpmmgGetPool(), rpmmgLink(), and xstrdup().

Referenced by doUntar(), and rpmfcClassify().


Variable Documentation

Definition at line 41 of file rpmmg.c.

Referenced by rpmioClean(), and rpmmgGetPool().