<commit_before>
#ifndef TURBINE_TCL_UTIL_H
#define TURBINE_TCL_UTIL_H

#include <tcl.h>

#include "src/turbine/turbine.h"

#define EMPTY_FLAG 0

/**
   objc should be equal to count.  If not, fail.
   Note that in TCL, the command name counts as an argument
*/
#define TCL_ARGS(count) {                                       \
    if (objc != count) {                                        \
      char* tmp = Tcl_GetStringFromObj(objv[0], NULL);          \
      printf("command %s requires %i arguments, received %i\n", \
             tmp, count, objc);                                 \
      return TCL_ERROR;                                         \
    }                                                           \
  }

#define TCL_CHECK(code) { if (code != TCL_OK) { return TCL_ERROR; }}

turbine_code turbine_tcl_long_array(Tcl_Interp* interp,
                                    Tcl_Obj* list, int max,
                                    long* output, int* count);

void tcl_condition_failed(Tcl_Interp* interp, Tcl_Obj* command,
                          const char* format, ...)
  __attribute__ ((format (printf, 3, 4)));

#define TCL_CHECK_MSG(code, format, args...)             \
  if (code != TCL_OK) {                                           \
    tcl_condition_failed(interp, objv[0], format, ## args);   \
    return TCL_ERROR;                                         \
  }                                                           \

#define TCL_CONDITION(condition, format, args...)             \
  if (!condition) {                                           \
    tcl_condition_failed(interp, objv[0], format, ## args);   \
    return TCL_ERROR;                                         \
  }                                                           \

#define TCL_RETURN_ERROR(format, args...)                        \
  { tcl_condition_failed(interp, objv[0], format, ## args);      \
    return TCL_ERROR; }

#endif<commit_msg>Clean up<commit_after>
#ifndef TURBINE_TCL_UTIL_H
#define TURBINE_TCL_UTIL_H

#include <tcl.h>

#include "src/turbine/turbine.h"

#define EMPTY_FLAG 0

/**
   Check that the user gave us the correct number of arguments
   objc should be equal to count.  If not, fail.
   Note that in TCL, the command name counts as an argument
*/
#define TCL_ARGS(count) {                                       \
    if (objc != count) {                                        \
      char* tmp = Tcl_GetStringFromObj(objv[0], NULL);          \
      printf("command %s requires %i arguments, received %i\n", \
             tmp, count, objc);                                 \
      return TCL_ERROR;                                         \
    }                                                           \
  }

#define TCL_CHECK(code) { if (code != TCL_OK) { return TCL_ERROR; }}

turbine_code turbine_tcl_long_array(Tcl_Interp* interp,
                                    Tcl_Obj* list, int max,
                                    long* output, int* count);

void tcl_condition_failed(Tcl_Interp* interp, Tcl_Obj* command,
                          const char* format, ...)
  __attribute__ ((format (printf, 3, 4)));

#define TCL_CHECK_MSG(code, format, args...)                      \
  if (code != TCL_OK) {                                           \
    tcl_condition_failed(interp, objv[0], format, ## args);       \
    return TCL_ERROR;                                             \
  }                                                               \

#define TCL_CONDITION(condition, format, args...)             \
  if (!condition) {                                           \
    tcl_condition_failed(interp, objv[0], format, ## args);   \
    return TCL_ERROR;                                         \
  }                                                           \

#define TCL_RETURN_ERROR(format, args...)                        \
  { tcl_condition_failed(interp, objv[0], format, ## args);      \
    return TCL_ERROR; }

#endif
{'fraction_non_alphanumeric': 0.0952619704186513, 'fraction_numerical': 0.0035096515417397845, 'mean_word_length': 1.0792079207920793, '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': 35, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5480879', 'n_tokens_mistral': 1072, 'n_tokens_neox': 1054, 'n_words': 249}