<commit_before>/* ext-helper.h
**
** Author:  <NAME> <<EMAIL>>
**
** Created: 1999/09/01
** Revised: $Date: 2000/05/29 14:59:25 $
**
*/

#ifndef EXT_HELPER_H
#define EXT_HELPER_H

#include "ruby.h"
#include <time.h>

#ifdef NEW_NAMING
#define cObject    rb_cObject
#define TRUE       Qtrue
#define FALSE      Qfalse
#define time_new   rb_time_new
#define str_new    rb_str_new
#define str_new2   rb_str_new2
#define ary_new    rb_ary_new
#define ary_new2   rb_ary_new2
#define ary_new3   rb_ary_new3
#define ary_push   rb_ary_push
#define ary_shift  rb_ary_shift
#define obj_call_init rb_obj_call_init
#define Fail(x)    rb_raise(rb_eRuntimeError, x)
#define TypeError(x)  rb_raise(rb_eTypeError, x)
#endif

#if 0
#  define dprintf(x)  printf x
#else
#  define dprintf(x)
#endif

#define ARRAY_LEN(x)     (sizeof(x)/sizeof(x[0]))

/****************************************************************/
/**********  set C values to ruby object     ********************/
/****************************************************************/

#define iv_set1(obj, fmt, name)     cp_set1(obj, fmt, #name, &(name))
#define iv_set2(obj, fmt, name, n)  cp_set2(obj, fmt, #name, name, n)

#define ar_set1(ary, fmt, name)     cp_set1(ary, fmt, NULL, &(name))
#define ar_set2(ary, fmt, name, n)  cp_set2(ary, fmt, NULL, name, n)<commit_msg>Fix format not a string literal<commit_after>/* ext-helper.h
**
** Author:  <NAME> <<EMAIL>>
**
** Created: 1999/09/01
** Revised: $Date: 2000/05/29 14:59:25 $
**
*/

#ifndef EXT_HELPER_H
#define EXT_HELPER_H

#include "ruby.h"
#include <time.h>

#ifdef NEW_NAMING
#define cObject    rb_cObject
#define TRUE       Qtrue
#define FALSE      Qfalse
#define time_new   rb_time_new
#define str_new    rb_str_new
#define str_new2   rb_str_new2
#define ary_new    rb_ary_new
#define ary_new2   rb_ary_new2
#define ary_new3   rb_ary_new3
#define ary_push   rb_ary_push
#define ary_shift  rb_ary_shift
#define obj_call_init rb_obj_call_init
#define Fail(x)    rb_raise(rb_eRuntimeError, "%s", x)
#define TypeError(x)  rb_raise(rb_eTypeError, "%s", x)
#endif

#if 0
#  define dprintf(x)  printf x
#else
#  define dprintf(x)
#endif

#define ARRAY_LEN(x)     (sizeof(x)/sizeof(x[0]))

/****************************************************************/
/**********  set C values to ruby object     ********************/
/****************************************************************/

#define iv_set1(obj, fmt, name)     cp_set1(obj, fmt, #name, &(name))
#define iv_set2(obj, fmt, name, n)  cp_set2(obj, fmt, #name, name, n)

#define ar_set1(ary, fmt, name)     cp_set1(ary, fmt, NULL, &(name))
#define ar_set2(ary, fmt, name, n)  cp_set2(ary, fmt, NULL, name, n)
{'fraction_non_alphanumeric': 0.23617339312406577, 'fraction_numerical': 0.028400597907324365, 'mean_word_length': 5.0565610859728505, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6573787', 'n_tokens_mistral': 1074, 'n_tokens_neox': 1020, 'n_words': 248}