XMMS2
Macros | Typedefs | Enumerations | Functions | Variables
magic.c File Reference
#include <glib.h>
#include <glib/gprintf.h>
#include <string.h>
#include <stdlib.h>
#include <xmms/xmms_log.h>
#include <xmmspriv/xmms_xform.h>

Macros

#define SWAP16(v, endian)
 
#define SWAP32(v, endian)
 
#define CMP(v1, entry, v2)
 

Typedefs

typedef enum
xmms_magic_entry_type_St 
xmms_magic_entry_type_t
 
typedef enum
xmms_magic_entry_operator_St 
xmms_magic_entry_operator_t
 
typedef struct xmms_magic_entry_St xmms_magic_entry_t
 
typedef struct
xmms_magic_checker_St 
xmms_magic_checker_t
 
typedef struct
xmms_magic_ext_data_St 
xmms_magic_ext_data_t
 

Enumerations

enum  xmms_magic_entry_type_St {
  XMMS_MAGIC_ENTRY_TYPE_UNKNOWN = 0, XMMS_MAGIC_ENTRY_TYPE_BYTE, XMMS_MAGIC_ENTRY_TYPE_INT16, XMMS_MAGIC_ENTRY_TYPE_INT32,
  XMMS_MAGIC_ENTRY_TYPE_STRING, XMMS_MAGIC_ENTRY_TYPE_STRINGC
}
 
enum  xmms_magic_entry_operator_St {
  XMMS_MAGIC_ENTRY_OPERATOR_EQUAL = 0, XMMS_MAGIC_ENTRY_OPERATOR_LESS_THAN, XMMS_MAGIC_ENTRY_OPERATOR_GREATER_THAN, XMMS_MAGIC_ENTRY_OPERATOR_AND,
  XMMS_MAGIC_ENTRY_OPERATOR_NAND
}
 

Functions

gboolean xmms_magic_extension_add (const gchar *mime, const gchar *ext)
 
gboolean xmms_magic_add (const gchar *desc, const gchar *mime,...)
 

Variables

const xmms_plugin_desc_t xmms_builtin_magic = { XMMS_PLUGIN_TYPE_XFORM , 7 , G_STRINGIFY( magic ), "Magic file identifier" , XMMS_VERSION , "Magic file identifier" , (gboolean (*)(gpointer)) xmms_magic_plugin_setup }
 

Macro Definition Documentation

#define CMP (   v1,
  entry,
  v2 
)
Value:
if (entry->pre_test_and_op) { \
v1 &= entry->pre_test_and_op; \
} \
\
switch (entry->oper) { \
return v1 == v2; \
return v1 < v2; \
return v1 > v2; \
return (v1 & v2) == v2; \
return (v1 & v2) != v2; \
} \
#define SWAP16 (   v,
  endian 
)
Value:
if (endian == G_LITTLE_ENDIAN) { \
v = GUINT16_TO_LE (v); \
} else if (endian == G_BIG_ENDIAN) { \
v = GUINT16_TO_BE (v); \
}
#define SWAP32 (   v,
  endian 
)
Value:
if (endian == G_LITTLE_ENDIAN) { \
v = GUINT32_TO_LE (v); \
} else if (endian == G_BIG_ENDIAN) { \
v = GUINT32_TO_BE (v); \
}

Typedef Documentation

typedef struct xmms_magic_checker_St xmms_magic_checker_t
typedef struct xmms_magic_entry_St xmms_magic_entry_t
typedef struct xmms_magic_ext_data_St xmms_magic_ext_data_t

Enumeration Type Documentation

Enumerator
XMMS_MAGIC_ENTRY_OPERATOR_EQUAL 
XMMS_MAGIC_ENTRY_OPERATOR_LESS_THAN 
XMMS_MAGIC_ENTRY_OPERATOR_GREATER_THAN 
XMMS_MAGIC_ENTRY_OPERATOR_AND 
XMMS_MAGIC_ENTRY_OPERATOR_NAND 
Enumerator
XMMS_MAGIC_ENTRY_TYPE_UNKNOWN 
XMMS_MAGIC_ENTRY_TYPE_BYTE 
XMMS_MAGIC_ENTRY_TYPE_INT16 
XMMS_MAGIC_ENTRY_TYPE_INT32 
XMMS_MAGIC_ENTRY_TYPE_STRING 
XMMS_MAGIC_ENTRY_TYPE_STRINGC 

Variable Documentation

const xmms_plugin_desc_t xmms_builtin_magic = { XMMS_PLUGIN_TYPE_XFORM , 7 , G_STRINGIFY( magic ), "Magic file identifier" , XMMS_VERSION , "Magic file identifier" , (gboolean (*)(gpointer)) xmms_magic_plugin_setup }