<commit_before>/*
 * File:   module.h
 * Author: m79lol
 *
 */

#ifndef MODULE_H
#define MODULE_H

typedef int system_value;
typedef double variable_value;

struct ModuleInfo {
  char *uid;
  enum Modes { PROD, SPEC } mode;
  unsigned short version;
  char *digest;
};

struct FunctionData {
  enum ParamTypes { STRING, FLOAT };

  system_value command_index;
  unsigned int count_params;
  ParamTypes *params;
  const char *name;
  FunctionData()
      : command_index(0), count_params(0), params(NULL), name(NULL) {}
  FunctionData(system_value command_index, system_value count_params,
               ParamTypes *params, const char *name)
      : command_index(command_index),
        count_params(count_params),
        params(params),
        name(name) {}
};

struct AxisData {
  system_value axis_index;
  variable_value upper_value;
  variable_value lower_value;
  const char *name;
  AxisData() : axis_index(0), upper_value(0), lower_value(0), name(NULL) {}
  AxisData(system_value axis_index, variable_value upper_value,
           variable_value lower_value, const char *name)
      : axis_index(axis_index),
        upper_value(upper_value),
        lower_value(lower_value),
        name(name) {}
};

class FunctionResult {
 public:
  enum Types { EXCEPTION, VALUE };
 private:
  Types type;
  variable_value result;

 public:
  FunctionResult(Types type) : type(type), result(0.0f) {}
  FunctionResult(Types type, variable_value result)
      : type(type), result(result) {}
  virtual Types getType() { return type; }
  virtual variable_value getResult() { return result; }
  virtual void destroy() { delete this; }
  virtual ~FunctionResult(){};
};

struct ConsoleColor {
  enum colors {
    black = 0,
    dark_blue = 1,
    dark_green = 2,
    dark_aqua = 3,
    dark_red = 4,
    dark_purple = 5,
    dark_yellow = 6,
    dark_white = 7,
    gray = 8,
    blue = 9,
    green = 10,
    aqua = 11,
    red = 12,
    purple = 13,
    yellow = 14,
    white = 15
  };

  colors color_text;
  colors color_back;
  ConsoleColor()
      : color_text(ConsoleColor::white), color_back(ConsoleColor::black){};
  ConsoleColor(colors color_text)
      : color_text(color_text), color_back(ConsoleColor::black){};
  ConsoleColor(colors color_text, colors color_back)
      : color_text(color_text), color_back(color_back){};
};

typedef void(colorPrintfModule_t)(void *, ConsoleColor, const char *, ...);
typedef void(colorPrintfModuleVA_t)(void *, ConsoleColor, const char *,
                                    va_list);

typedef void(colorPrintfRobot_t)(void *, const char *, ConsoleColor,
                                 const char *, ...);
typedef void(colorPrintfRobotVA_t)(void *, const char *, ConsoleColor,
                                   const char *, va_list);

#ifdef _WIN32
#define PREFIX_FUNC_DLL __declspec(dllexport)
#else
#define PREFIX_FUNC_DLL
#endif

typedef unsigned short (*getApiVersion_t)();
#endif /* MODULE_H */
<commit_msg>Add ModuleTypes enum<commit_after>/*
 * File:   module.h
 * Author: m79lol
 *
 */

#ifndef MODULE_H
#define MODULE_H

typedef int system_value;
typedef double variable_value;

enum class ModuleTypes {
	Robot = 0,
	Control = 1,
	Function = 2
};

struct ModuleInfo {
  char *uid;
  enum Modes { PROD, SPEC } mode;
  unsigned short version;
  char *digest;
};

struct FunctionData {
  enum ParamTypes { STRING, FLOAT };

  system_value command_index;
  unsigned int count_params;
  ParamTypes *params;
  const char *name;
  FunctionData()
      : command_index(0), count_params(0), params(NULL), name(NULL) {}
  FunctionData(system_value command_index, system_value count_params,
               ParamTypes *params, const char *name)
      : command_index(command_index),
        count_params(count_params),
        params(params),
        name(name) {}
};

struct AxisData {
  system_value axis_index;
  variable_value upper_value;
  variable_value lower_value;
  const char *name;
  AxisData() : axis_index(0), upper_value(0), lower_value(0), name(NULL) {}
  AxisData(system_value axis_index, variable_value upper_value,
           variable_value lower_value, const char *name)
      : axis_index(axis_index),
        upper_value(upper_value),
        lower_value(lower_value),
        name(name) {}
};

class FunctionResult {
 public:
  enum Types { EXCEPTION, VALUE };
 private:
  Types type;
  variable_value result;

 public:
  FunctionResult(Types type) : type(type), result(0.0f) {}
  FunctionResult(Types type, variable_value result)
      : type(type), result(result) {}
  virtual Types getType() { return type; }
  virtual variable_value getResult() { return result; }
  virtual void destroy() { delete this; }
  virtual ~FunctionResult(){};
};

struct ConsoleColor {
  enum colors {
    black = 0,
    dark_blue = 1,
    dark_green = 2,
    dark_aqua = 3,
    dark_red = 4,
    dark_purple = 5,
    dark_yellow = 6,
    dark_white = 7,
    gray = 8,
    blue = 9,
    green = 10,
    aqua = 11,
    red = 12,
    purple = 13,
    yellow = 14,
    white = 15
  };

  colors color_text;
  colors color_back;
  ConsoleColor()
      : color_text(ConsoleColor::white), color_back(ConsoleColor::black){};
  ConsoleColor(colors color_text)
      : color_text(color_text), color_back(ConsoleColor::black){};
  ConsoleColor(colors color_text, colors color_back)
      : color_text(color_text), color_back(color_back){};
};

typedef void(colorPrintfModule_t)(void *, ConsoleColor, const char *, ...);
typedef void(colorPrintfModuleVA_t)(void *, ConsoleColor, const char *,
                                    va_list);

typedef void(colorPrintfRobot_t)(void *, const char *, ConsoleColor,
                                 const char *, ...);
typedef void(colorPrintfRobotVA_t)(void *, const char *, ConsoleColor,
                                   const char *, va_list);

#ifdef _WIN32
#define PREFIX_FUNC_DLL __declspec(dllexport)
#else
#define PREFIX_FUNC_DLL
#endif

typedef unsigned short (*getApiVersion_t)();
#endif /* MODULE_H */

{'fraction_non_alphanumeric': 0.10973982655103402, 'fraction_numerical': 0.011507671781187459, 'mean_word_length': 3.3174946004319654, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3149765', 'n_tokens_mistral': 1974, 'n_tokens_neox': 1886, 'n_words': 463}