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.

## Typedefs
typedef struct rpmmg_s * | rpmmg
## 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

## Detailed Description

Definition in file rpmmg.h.

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