<commit_before>#include <soundpipe.h>
#include "sporth.h"

/* implement macros */
#define SPORTH_UGEN(key, func, macro)  macro,
enum {
SP_DUMMY = SPORTH_FOFFSET - 1,
#include "ugens.h"
SPORTH_LAST
};
#undef SPORTH_UGEN

/* ---- */

enum {
PLUMBER_CREATE,
PLUMBER_INIT,
PLUMBER_COMPUTE,
PLUMBER_DESTROY,
PLUMBER_OK,
PLUMBER_NOTOK,
PLUMBER_PANIC
};

enum {
DRIVER_FILE,
DRIVER_RAW
};

typedef struct plumber_ftbl {
    sp_ftbl *ft;
    char *name;
    char to_delete;
    struct plumber_ftbl *next;
} plumber_ftbl;

typedef struct {
    uint32_t nftbl;
    plumber_ftbl root;
    plumber_ftbl *last;
} plumber_ftentry;

typedef struct plumber_pipe {
    uint32_t type;
    size_t size;
    void *ud;
    struct plumber_pipe *next;
} plumber_pipe;

typedef struct {
    int (*fun)(sporth_stack *, void *);
    void *ud;
} sporth_func_d;

typedef struct {
    uint32_t npipes;
    plumber_pipe root;
    plumber_pipe *last;
} plumbing;

typedef struct plumber_data {
    int nchan;
    int mode;
    int seed;
    sp_data *sp;
    FILE *fp;
    char *filename;
    sporth_data sporth;
    //uint32_t npipes;
    //plumber_pipe root;
    //plumber_pipe *last;
    plumbing *pipes;
    /* for add_module function */
    plumbing *tmp;
    int current_pipe;
    plumbing main, alt;

    plumber_ftentry *ftmap;
    plumber_ftentry *ftnew, *ftold;
    plumber_ftentry ft1[256];
    plumber_ftentry ft2[256];
    char delete_ft;

    SPFLOAT p[16];
    int (*f[16])(sporth_stack *, void *);
    void *ud;
    plumber_pipe *last;
} plumber_data;

int plumber_init(plumber_data *plumb);
int plumber_register(plumber_data *plumb);
int plumber_clean(plumber_data *plumb);
int plumber_add_float(plumber_data *plumb, plumbing *pipes, float num);
int plumber_add_string(plumber_data *plumb, plumbing *pipes, const char *str);
int plumber_add_ugen(plumber_data *plumb, uint32_t id, void *ud);
int plumber_compute(plumber_data *plumb, int mode);
int plumber_parse(plumber_data *plumb);
int plumber_parse_string(plumber_data *plumb, char *str);
int plumber_recompile(plumber_data *plumb);
int plumber_gettype(plumber_data *plumb, char *str, int mode);
int plumber_show_pipes(plumber_data *plumb);
//int plumber_pipes_destroy(plumber_data *plumb);
int plumber_error(plumber_data *plumb, const char *str);
int plumber_ftmap_init(plumber_data *plumb);
int plumber_ftmap_add(plumber_data *plumb, const char *str, sp_ftbl *ft);
int plumber_ftmap_search(plumber_data *plumb, const char *str, sp_ftbl **ft);
int plumber_ftmap_destroy(plumber_data *plumb);
int plumber_ftmap_delete(plumber_data *plumb, char mode);
void sporth_run(plumber_data *pd, int argc, char *argv[],
    void *ud, void (*process)(sp_data *, void *));<commit_msg>removed some old code<commit_after>#include <soundpipe.h>
#include "sporth.h"

/* implement macros */
#define SPORTH_UGEN(key, func, macro)  macro,
enum {
SP_DUMMY = SPORTH_FOFFSET - 1,
#include "ugens.h"
SPORTH_LAST
};
#undef SPORTH_UGEN

/* ---- */

enum {
PLUMBER_CREATE,
PLUMBER_INIT,
PLUMBER_COMPUTE,
PLUMBER_DESTROY,
PLUMBER_OK,
PLUMBER_NOTOK,
PLUMBER_PANIC
};

enum {
DRIVER_FILE,
DRIVER_RAW
};

typedef struct plumber_ftbl {
    sp_ftbl *ft;
    char *name;
    char to_delete;
    struct plumber_ftbl *next;
} plumber_ftbl;

typedef struct {
    uint32_t nftbl;
    plumber_ftbl root;
    plumber_ftbl *last;
} plumber_ftentry;

typedef struct plumber_pipe {
    uint32_t type;
    size_t size;
    void *ud;
    struct plumber_pipe *next;
} plumber_pipe;

typedef struct {
    int (*fun)(sporth_stack *, void *);
    void *ud;
} sporth_func_d;

typedef struct {
    uint32_t npipes;
    plumber_pipe root;
    plumber_pipe *last;
} plumbing;

typedef struct plumber_data {
    int nchan;
    int mode;
    int seed;
    sp_data *sp;
    FILE *fp;
    char *filename;
    sporth_data sporth;
    plumbing *pipes;
    /* for add_module function */
    plumbing *tmp;
    int current_pipe;
    plumbing main, alt;

    plumber_ftentry *ftmap;
    plumber_ftentry *ftnew, *ftold;
    plumber_ftentry ft1[256];
    plumber_ftentry ft2[256];
    char delete_ft;

    SPFLOAT p[16];
    int (*f[16])(sporth_stack *, void *);
    void *ud;
    plumber_pipe *last;
} plumber_data;

int plumber_init(plumber_data *plumb);
int plumber_register(plumber_data *plumb);
int plumber_clean(plumber_data *plumb);
int plumber_add_float(plumber_data *plumb, plumbing *pipes, float num);
int plumber_add_string(plumber_data *plumb, plumbing *pipes, const char *str);
int plumber_add_ugen(plumber_data *plumb, uint32_t id, void *ud);
int plumber_compute(plumber_data *plumb, int mode);
int plumber_parse(plumber_data *plumb);
int plumber_parse_string(plumber_data *plumb, char *str);
int plumber_recompile(plumber_data *plumb);
int plumber_gettype(plumber_data *plumb, char *str, int mode);
int plumber_show_pipes(plumber_data *plumb);
int plumber_error(plumber_data *plumb, const char *str);
int plumber_ftmap_init(plumber_data *plumb);
int plumber_ftmap_add(plumber_data *plumb, const char *str, sp_ftbl *ft);
int plumber_ftmap_search(plumber_data *plumb, const char *str, sp_ftbl **ft);
int plumber_ftmap_destroy(plumber_data *plumb);
int plumber_ftmap_delete(plumber_data *plumb, char mode);
void sporth_run(plumber_data *pd, int argc, char *argv[],
    void *ud, void (*process)(sp_data *, void *));
{'fraction_non_alphanumeric': 0.10679245283018868, 'fraction_numerical': 0.00830188679245283, 'mean_word_length': 4.718446601941747, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5949787', 'n_tokens_mistral': 2113, 'n_tokens_neox': 2042, 'n_words': 482}