<commit_before>#include <lauxlib.h>
#include <lua.h>
#include <lualib.h>

#include "sgfx.h"
#include "sgfx_log.h"
#include "sgfx_surface.h"
// https://gist.github.com/bloodstalker/91261e541666f16c3b8315d3ff1085d6

static SGFXSurfaceDescription __checkSGFXSurfaceDescription(lua_State *L,
                                                            int index) {
  SGFXSurfaceDescription desc;

  lua_getfield(L, index, "width");
  desc.width = (int)lua_tonumber(L, index);
  lua_getfield(L, index - 1, "height");
  desc.height = (int)lua_tonumber(L, index);
  lua_getfield(L, index - 2, "color");<commit_msg>lua: create conversion lua table for c struct for rect<commit_after>#include <lauxlib.h>
#include <lua.h>
#include <lualib.h>

#include "sgfx.h"
#include "sgfx_draw.h"
#include "sgfx_log.h"
#include "sgfx_surface.h"
// https://gist.github.com/bloodstalker/91261e541666f16c3b8315d3ff1085d6

static SGFXRect __checkSGFXRect(lua_State *L, int index) {
  SGFXRect rect;

  lua_getfield(L, index, "x");
  rect.x = (int)lua_tonumber(L, index);
  lua_getfield(L, index - 1, "y");
  rect.y = (int)lua_tonumber(L, index);
  lua_getfield(L, index - 2, "w");
  rect.w = (int32_t)lua_tonumber(L, index);
  lua_getfield(L, index - 3, "h");
  rect.h = (SGFXSurfaceType)lua_tonumber(L, index);

  return rect;
}

static SGFXSurfaceDescription __checkSGFXSurfaceDescription(lua_State *L,
                                                            int index) {
  SGFXSurfaceDescription desc;

  lua_getfield(L, index, "width");
  desc.width = (int)lua_tonumber(L, index);
  lua_getfield(L, index - 1, "height");
  desc.height = (int)lua_tonumber(L, index);
  lua_getfield(L, index - 2, "color");
{'fraction_non_alphanumeric': 0.14116251482799524, 'fraction_numerical': 0.033807829181494664, 'mean_word_length': 3.673130193905817, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2806066', 'n_tokens_mistral': 687, 'n_tokens_neox': 641, 'n_words': 123}