libextractor  1.11
About: GNU libextractor is a library used to extract meta-data from files of arbitrary type.
  Fossies Dox: libextractor-1.11.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

rpm_extractor.c File Reference

plugin to support RPM files More...

#include "platform.h"
#include "extractor.h"
#include <stdint.h>
#include <rpm/rpmlib.h>
#include <rpm/rpmts.h>
#include <rpm/rpmlog.h>
#include <pthread.h>
#include <sys/types.h>
#include <signal.h>
Include dependency graph for rpm_extractor.c:

Go to the source code of this file.

Data Structures

struct  PipeArgs
struct  Matches


#define BUF_SIZE   (16 * 1024)


static void * pipe_feeder (void *args)
static int discard_log_callback (rpmlogRec rec, void *ctx)
void EXTRACTOR_rpm_extract_method (struct EXTRACTOR_ExtractContext *ec)


static struct Matches tests []

Detailed Description

plugin to support RPM files

Christian Grothoff

Definition in file rpm_extractor.c.

Macro Definition Documentation


#define BUF_SIZE   (16 * 1024)

Size of the buffer we use for reading.

Definition at line 71 of file rpm_extractor.c.

Function Documentation

◆ discard_log_callback()

static int discard_log_callback ( rpmlogRec  rec,
void *  ctx 

LOG callback called by librpm. Does nothing, we just need this to override the default behavior.

Definition at line 132 of file rpm_extractor.c.

Referenced by EXTRACTOR_rpm_extract_method().

◆ EXTRACTOR_rpm_extract_method()

void EXTRACTOR_rpm_extract_method ( struct EXTRACTOR_ExtractContext ec)

Main entry method for the 'application/x-rpm' extraction plugin.

ecextraction context provided to the plugin

Definition at line 250 of file rpm_extractor.c.

References EXTRACTOR_ExtractContext::cls, discard_log_callback(), PipeArgs::ec, EXTRACTOR_METAFORMAT_UTF8, EXTRACTOR_METATYPE_MIMETYPE, PipeArgs::lock, NULL, PipeArgs::pi, pipe_feeder(), EXTRACTOR_ExtractContext::proc, Matches::rtype, PipeArgs::shutdown, Matches::tag, tests, and Matches::type.

◆ pipe_feeder()

static void* pipe_feeder ( void *  args)

Main function of a helper thread that passes the package data to librpm.

argsthe 'struct PipeArgs*'

Definition at line 82 of file rpm_extractor.c.

References BUF_SIZE, EXTRACTOR_ExtractContext::cls, PipeArgs::ec, PipeArgs::lock, NULL, PipeArgs::pi, EXTRACTOR_ExtractContext::read, and PipeArgs::shutdown.

Referenced by EXTRACTOR_rpm_extract_method().

Variable Documentation

◆ tests

struct Matches tests[]

List of mappings from RPM tags to LE types.

Definition at line 132 of file rpm_extractor.c.

Referenced by EXTRACTOR_rpm_extract_method().