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)  

mime_extractor.c File Reference

plugin to determine mime types using libmagic (from 'file') More...

#include "platform.h"
#include "extractor.h"
#include <magic.h>
Include dependency graph for mime_extractor.c:

Go to the source code of this file.

Functions

void EXTRACTOR_mime_extract_method (struct EXTRACTOR_ExtractContext *ec)
 
void mime_ltdl_init ()
 
void mime_ltdl_fini ()
 

Variables

static magic_t magic
 
static char * magic_path
 

Detailed Description

plugin to determine mime types using libmagic (from 'file')

Author
Christian Grothoff

Definition in file mime_extractor.c.

Function Documentation

◆ EXTRACTOR_mime_extract_method()

void EXTRACTOR_mime_extract_method ( struct EXTRACTOR_ExtractContext ec)

Main entry method for the 'application/ogg' extraction plugin. The 'config' of the context can be used to specify an alternative magic path. If config is not given, the default magic path will be used.

Parameters
ecextraction context provided to the plugin

Definition at line 50 of file mime_extractor.c.

References EXTRACTOR_ExtractContext::cls, EXTRACTOR_ExtractContext::config, EXTRACTOR_METAFORMAT_UTF8, EXTRACTOR_METATYPE_MIMETYPE, magic, magic_path, NULL, EXTRACTOR_ExtractContext::proc, and EXTRACTOR_ExtractContext::read.

◆ mime_ltdl_fini()

void mime_ltdl_fini ( )

Destructor for the library, cleans up.

Definition at line 113 of file mime_extractor.c.

References magic, magic_path, and NULL.

◆ mime_ltdl_init()

void mime_ltdl_init ( )

Constructor for the library. Loads the magic file.

Definition at line 99 of file mime_extractor.c.

References magic, and magic_path.

Variable Documentation

◆ magic

magic_t magic
static

Global handle to MAGIC data.

Definition at line 33 of file mime_extractor.c.

Referenced by EXTRACTOR_mime_extract_method(), mime_ltdl_fini(), and mime_ltdl_init().

◆ magic_path

char* magic_path
static

Path we used for loading magic data, NULL is used for 'default'.

Definition at line 38 of file mime_extractor.c.

Referenced by EXTRACTOR_mime_extract_method(), mime_ltdl_fini(), and mime_ltdl_init().