<commit_before>/**
 * See Copyright Notice in picrin.h
 */

#ifndef PICRIN_PROC_H__
#define PICRIN_PROC_H__

#if defined(__cplusplus)
extern "C" {
#endif

/* native C function */
struct pic_func {
  pic_func_t f;
  pic_sym name;
};

struct pic_env {
  PIC_OBJECT_HEADER
  pic_value *regs;
  int regc;
  struct pic_env *up;
  pic_value storage[];
};

struct pic_proc {
  PIC_OBJECT_HEADER
  char kind;
  union {
    struct pic_func func;
    struct pic_irep *irep;
  } u;
  struct pic_env *env;
};

#define PIC_PROC_KIND_FUNC 1
#define PIC_PROC_KIND_IREP 2

#define pic_proc_func_p(proc) ((proc)->kind == PIC_PROC_KIND_FUNC)
#define pic_proc_irep_p(proc) ((proc)->kind == PIC_PROC_KIND_IREP)

#define pic_proc_p(o) (pic_type(o) == PIC_TT_PROC)
#define pic_env_p(o) (pic_type(o) == PIC_TT_ENV)

#define pic_proc_ptr(o) ((struct pic_proc *)pic_ptr(o))
#define pic_env_ptr(o) ((struct pic_env *)pic_ptr(o))

struct pic_proc *pic_proc_new(pic_state *, pic_func_t, const char *);<commit_msg>cleanup<commit_after>/**
 * See Copyright Notice in picrin.h
 */

#ifndef PICRIN_PROC_H__
#define PICRIN_PROC_H__

#if defined(__cplusplus)
extern "C" {
#endif

/* native C function */
struct pic_func {
  pic_func_t f;
  pic_sym name;
};

struct pic_env {
  PIC_OBJECT_HEADER
  pic_value *regs;
  int regc;
  struct pic_env *up;
  pic_value storage[];
};

struct pic_proc {
  PIC_OBJECT_HEADER
  char kind;
  union {
    struct pic_func func;
    struct pic_irep *irep;
  } u;
  struct pic_env *env;
};

#define PIC_PROC_KIND_FUNC 1
#define PIC_PROC_KIND_IREP 2

#define pic_proc_func_p(proc) ((proc)->kind == PIC_PROC_KIND_FUNC)
#define pic_proc_irep_p(proc) ((proc)->kind == PIC_PROC_KIND_IREP)

#define pic_proc_p(o) (pic_type(o) == PIC_TT_PROC)
#define pic_proc_ptr(o) ((struct pic_proc *)pic_ptr(o))

#define pic_env_p(o) (pic_type(o) == PIC_TT_ENV)
#define pic_env_ptr(o) ((struct pic_env *)pic_ptr(o))

struct pic_proc *pic_proc_new(pic_state *, pic_func_t, const char *);
{'fraction_non_alphanumeric': 0.12321792260692464, 'fraction_numerical': 0.002036659877800407, 'mean_word_length': 5.15987460815047, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5792417', 'n_tokens_mistral': 843, 'n_tokens_neox': 828, 'n_words': 180}