rpmmg.c File Reference
RPMIO.
`#include "system.h"`
`#include <rpmiotypes.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.

## Macros

#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. More...
const char * | rpmmgFile (rpmmg mg, const char *fn)
| Return magic string for a file. More...
const char * | rpmmgBuffer (rpmmg mg, const char *b, size_t nb)
| Return magic string for a buffer. More...

## Variables

int | _rpmmg_debug = 0
rpmioPool | _rpmmgPool = NULL

## Macro Definition Documentation

#define _RPMMG_INTERNAL

Definition at line 14 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 107 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 82 of file rpmmg.c.

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

Referenced by doUntar(), and rpmfcClassify().

static void rpmmgFini | ( | void * | _mg | ) |

static

Definition at line 23 of file rpmmg.c.

References _free().

Referenced by rpmmgGetPool().

static rpmmg rpmmgGetPool | ( | rpmioPool | pool | ) |

static

Definition at line 42 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

  fn | magic file
  flags | magic flags

Returns
  new magic wrapper

Definition at line 56 of file rpmmg.c.

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

Referenced by doUntar(), and rpmfcClassify().

## Variable Documentation

rpmioPool _rpmmgPool = NULL

Definition at line 40 of file rpmmg.c.

Referenced by rpmioClean(), and rpmmgGetPool().