<commit_before>/*  XMMS2 - X Music Multiplexer System
 *  Copyright (C) 2003-2006 XMMS2 Team
 *
 *  PLUGINS ARE NOT CONSIDERED TO BE DERIVED WORK !!!
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 */




#ifndef __XMMS_XFORMPLUGIN_H__
#define __XMMS_XFORMPLUGIN_H__

#include <glib.h>
#include <string.h>



#define XMMS_XFORM_API_VERSION 1

/*
 * Type definitions
 */


#include "xmms/xmms_error.h"
#include "xmms/xmms_plugin.h"
#include "xmms/xmms_sample.h"
#include "xmms/xmms_streamtype.h"


struct xmms_xform_plugin_St;
typedef struct xmms_xform_plugin_St xmms_xform_plugin_t;

#define XMMS_XFORM_PLUGIN(shname, name, ver, desc, setupfunc) XMMS_PLUGIN(XMMS_PLUGIN_TYPE_XFORM, XMMS_XFORM_API_VERSION, shname, name, ver, desc, (gboolean (*)(gpointer))setupfunc)

/* */
#define XMMS_XFORM_DATA_SIZE "size"
#define XMMS_XFORM_DATA_LMOD "lmod"

struct xmms_xform_St;
typedef struct xmms_xform_St xmms_xform_t;

typedef enum xmms_xform_seek_mode_E {
	XMMS_XFORM_SEEK_CUR = 1,
	XMMS_XFORM_SEEK_SET = 2,
	XMMS_XFORM_SEEK_END = 3
} xmms_xform_seek_mode_t;

typedef struct xmms_xform_methods_St {
	gboolean (*init)(xmms_xform_t *);
	void (*destroy)(xmms_xform_t *);
	gint (*read)(xmms_xform_t *, gpointer, gint, xmms_error_t *);
	gint64 (*seek)(xmms_xform_t *, gint64, xmms_xform_seek_mode_t, xmms_error_t *);
} xmms_xform_methods_t;

#define XMMS_XFORM_METHODS_INIT(m) memset (&m, 0, sizeof (xmms_xform_methods_t))



void xmms_xform_plugin_methods_set (xmms_xform_plugin_t *plugin, xmms_xform_methods_t *methods);
void xmms_xform_plugin_indata_add (xmms_xform_plugin_t *plugin, ...);

void xmms_xform_ringbuf_resize (xmms_xform_t *xform, gint size);
gpointer xmms_xform_private_data_get (xmms_xform_t *xform);
void xmms_xform_private_data_set (xmms_xform_t *xform, gpointer data);


void xmms_xform_outdata_type_add (xmms_xform_t *xform, ...);
void xmms_xform_outdata_type_copy (xmms_xform_t *xform);

void xmms_xform_metadata_set_int (xmms_xform_t *xform, const gchar *key, int val);
void xmms_xform_metadata_set_str (xmms_xform_t *xform, const gchar *key, const char *val);

gint xmms_xform_metadata_get_int (xmms_xform_t *xform, const gchar *key);
const gchar *xmms_xform_metadata_get_str (xmms_xform_t *xform, const gchar *key);


const char *xmms_xform_indata_get_str (xmms_xform_t *xform, xmms_stream_type_key_t key);
gint xmms_xform_indata_get_int (xmms_xform_t *xform, xmms_stream_type_key_t key);


gint xmms_xform_peek (xmms_xform_t *xform, gpointer buf, gint siz, xmms_error_t *err);
gint xmms_xform_read (xmms_xform_t *xform, gpointer buf, gint siz, xmms_error_t *err);
gint64 xmms_xform_seek (xmms_xform_t *xform, gint64 offset, xmms_xform_seek_mode_t whence, xmms_error_t *err);

gboolean xmms_magic_add (const gchar *desc, const gchar *mime, ...);


#endif
<commit_msg>OTHER: expose xform_iseos<commit_after>/*  XMMS2 - X Music Multiplexer System
 *  Copyright (C) 2003-2006 XMMS2 Team
 *
 *  PLUGINS ARE NOT CONSIDERED TO BE DERIVED WORK !!!
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 */




#ifndef __XMMS_XFORMPLUGIN_H__
#define __XMMS_XFORMPLUGIN_H__

#include <glib.h>
#include <string.h>



#define XMMS_XFORM_API_VERSION 1

/*
 * Type definitions
 */


#include "xmms/xmms_error.h"
#include "xmms/xmms_plugin.h"
#include "xmms/xmms_sample.h"
#include "xmms/xmms_streamtype.h"


struct xmms_xform_plugin_St;
typedef struct xmms_xform_plugin_St xmms_xform_plugin_t;

#define XMMS_XFORM_PLUGIN(shname, name, ver, desc, setupfunc) XMMS_PLUGIN(XMMS_PLUGIN_TYPE_XFORM, XMMS_XFORM_API_VERSION, shname, name, ver, desc, (gboolean (*)(gpointer))setupfunc)

/* */
#define XMMS_XFORM_DATA_SIZE "size"
#define XMMS_XFORM_DATA_LMOD "lmod"

struct xmms_xform_St;
typedef struct xmms_xform_St xmms_xform_t;

typedef enum xmms_xform_seek_mode_E {
	XMMS_XFORM_SEEK_CUR = 1,
	XMMS_XFORM_SEEK_SET = 2,
	XMMS_XFORM_SEEK_END = 3
} xmms_xform_seek_mode_t;

typedef struct xmms_xform_methods_St {
	gboolean (*init)(xmms_xform_t *);
	void (*destroy)(xmms_xform_t *);
	gint (*read)(xmms_xform_t *, gpointer, gint, xmms_error_t *);
	gint64 (*seek)(xmms_xform_t *, gint64, xmms_xform_seek_mode_t, xmms_error_t *);
} xmms_xform_methods_t;

#define XMMS_XFORM_METHODS_INIT(m) memset (&m, 0, sizeof (xmms_xform_methods_t))



void xmms_xform_plugin_methods_set (xmms_xform_plugin_t *plugin, xmms_xform_methods_t *methods);
void xmms_xform_plugin_indata_add (xmms_xform_plugin_t *plugin, ...);

void xmms_xform_ringbuf_resize (xmms_xform_t *xform, gint size);
gpointer xmms_xform_private_data_get (xmms_xform_t *xform);
void xmms_xform_private_data_set (xmms_xform_t *xform, gpointer data);


void xmms_xform_outdata_type_add (xmms_xform_t *xform, ...);
void xmms_xform_outdata_type_copy (xmms_xform_t *xform);

void xmms_xform_metadata_set_int (xmms_xform_t *xform, const gchar *key, int val);
void xmms_xform_metadata_set_str (xmms_xform_t *xform, const gchar *key, const char *val);

gint xmms_xform_metadata_get_int (xmms_xform_t *xform, const gchar *key);
const gchar *xmms_xform_metadata_get_str (xmms_xform_t *xform, const gchar *key);


const char *xmms_xform_indata_get_str (xmms_xform_t *xform, xmms_stream_type_key_t key);
gint xmms_xform_indata_get_int (xmms_xform_t *xform, xmms_stream_type_key_t key);


gint xmms_xform_peek (xmms_xform_t *xform, gpointer buf, gint siz, xmms_error_t *err);
gint xmms_xform_read (xmms_xform_t *xform, gpointer buf, gint siz, xmms_error_t *err);
gint64 xmms_xform_seek (xmms_xform_t *xform, gint64 offset, xmms_xform_seek_mode_t whence, xmms_error_t *err);
gboolean xmms_xform_iseos (xmms_xform_t *xform);

gboolean xmms_magic_add (const gchar *desc, const gchar *mime, ...);


#endif

{'fraction_non_alphanumeric': 0.08638226810384089, 'fraction_numerical': 0.007590708972218006, 'mean_word_length': 6.328142380422692, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4920760', 'n_tokens_mistral': 2910, 'n_tokens_neox': 2800, 'n_words': 622}