rpm 5.3.7
Defines | Typedefs | Functions | Variables

rpmio/rpmmg.h File Reference

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

Go to the source code of this file.

Defines

#define rpmmgUnlink(_mg)   ((rpmmg)rpmioUnlinkPoolItem((rpmioItem)(_mg), __FUNCTION__, __FILE__, __LINE__))
#define rpmmgLink(_mg)   ((rpmmg)rpmioLinkPoolItem((rpmioItem)(_mg), __FUNCTION__, __FILE__, __LINE__))
#define rpmmgFree(_mg)   ((rpmmg)rpmioFreePoolItem((rpmioItem)(_mg), __FUNCTION__, __FILE__, __LINE__))

Typedefs

typedef struct rpmmg_s * rpmmg

Functions

rpmmg rpmmgUnlink (rpmmg mg)
 Unreference a magic wrapper instance.
rpmmg rpmmgLink (rpmmg mg)
 Reference a magic wrapper instance.
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

Detailed Description

Definition in file rpmmg.h.


Define Documentation

#define rpmmgFree (   _mg)    ((rpmmg)rpmioFreePoolItem((rpmioItem)(_mg), __FUNCTION__, __FILE__, __LINE__))

Definition at line 68 of file rpmmg.h.

#define rpmmgLink (   _mg)    ((rpmmg)rpmioLinkPoolItem((rpmioItem)(_mg), __FUNCTION__, __FILE__, __LINE__))

Definition at line 56 of file rpmmg.h.

#define rpmmgUnlink (   _mg)    ((rpmmg)rpmioUnlinkPoolItem((rpmioItem)(_mg), __FUNCTION__, __FILE__, __LINE__))

Definition at line 45 of file rpmmg.h.


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().

rpmmg rpmmgFree ( rpmmg  mg)

Destroy a magic wrapper.

Parameters:
mgmagic wrapper
Returns:
NULL on last dereference

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

rpmmg rpmmgLink ( rpmmg  mg)

Reference a magic wrapper instance.

Parameters:
mgmagic wrapper
Returns:
new magic wrapper reference

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().

rpmmg rpmmgUnlink ( rpmmg  mg)

Unreference a magic wrapper instance.

Parameters:
mgmagic wrapper
Returns:
NULL on last dereference