<commit_before>#pragma once

#include "imgui/imgui.h"
#include "utf8/utf8.h"
#include <string>

#ifdef _WIN32
#include <windows.h>
#define SDLK_ESCAPE VK_ESCAPE
#define SDLK_RETURN VK_RETURN
#define SDL_SCANCODE_LCTRL VK_CONTROL
#define SDL_SCANCODE_RCTRL VK_CONTROL
#define SDL_SCANCODE_KP_0 VK_INSERT
#define SDL_SCANCODE_KP_2 VK_DOWN
#define SDL_SCANCODE_KP_4 VK_LEFT
#define SDL_SCANCODE_KP_5 VK_CLEAR
#define SDL_SCANCODE_KP_6 VK_RIGHT
#define SDL_SCANCODE_KP_8 VK_UP

#define SDLK_a 0x41
#define SDLK_s 0x53
#define SDLK_d 0x44
#define SDLK_w 0x57
#define SDLK_x 0x58

#define SDLK_l 0x4c
#define SDLK_k 0x4b
#define SDLK_c 0x43
#define SDLK_n 0x4e

#define SDLK_r 0x52

#define SDLK_EQUALS VK_OEM_PLUS
#define SDLK_SPACE VK_SPACE
#define SDLK_MINUS VK_OEM_MINUS

//#define SDL_SCANCODE_KP_2 VK_NUMPAD2
//#define SDL_SCANCODE_KP_4 VK_NUMPAD4
//#define SDL_SCANCODE_KP_5 VK_NUMPAD5
//#define SDL_SCANCODE_KP_6 VK_NUMPAD6
//#define SDL_SCANCODE_KP_8 VK_NUMPAD8
#define SDL_SCANCODE_KP_PERIOD VK_DECIMAL
#define SDL_SCANCODE_KP_PLUS VK_ADD
#define SDL_SCANCODE_KP_MINUS VK_SUBTRACT
#endif

#ifdef _MSC_VER // Visual Studio prefixes non-standard C functions with _
#define strdup _strdup
#endif

// Loads an entire file in to memory.  The returned buffer must be later freed by the caller.
char *file_as_buffer(size_t *buffer_size, const char *utf8_filename);

// Shows a file dialog (should hang the current thread) and returns the utf8 filename picked by the
// user or nullptr.  If non-null is returned, it must be later freed by the caller.
char *show_file_picker();

// these mirror the Windows .rc definitions:<commit_msg>Cleanup Win32 key mapping file now that we have worked it out<commit_after>#pragma once

#include "imgui/imgui.h"
#include "utf8/utf8.h"
#include <string>

#ifdef _WIN32
#include <windows.h>
#define SDLK_ESCAPE VK_ESCAPE
#define SDLK_RETURN VK_RETURN
#define SDL_SCANCODE_LCTRL VK_CONTROL
#define SDL_SCANCODE_RCTRL VK_CONTROL
#define SDL_SCANCODE_KP_0 VK_INSERT
#define SDL_SCANCODE_KP_2 VK_DOWN
#define SDL_SCANCODE_KP_4 VK_LEFT
#define SDL_SCANCODE_KP_5 VK_CLEAR
#define SDL_SCANCODE_KP_6 VK_RIGHT
#define SDL_SCANCODE_KP_8 VK_UP

#define SDLK_a 0x41
#define SDLK_s 0x53
#define SDLK_d 0x44
#define SDLK_w 0x57
#define SDLK_x 0x58

#define SDLK_l 0x4c
#define SDLK_k 0x4b
#define SDLK_c 0x43
#define SDLK_n 0x4e

#define SDLK_r 0x52

#define SDLK_EQUALS VK_OEM_PLUS
#define SDLK_SPACE VK_SPACE
#define SDLK_MINUS VK_OEM_MINUS
#define SDL_SCANCODE_KP_PERIOD VK_DECIMAL
#define SDL_SCANCODE_KP_PLUS VK_ADD
#define SDL_SCANCODE_KP_MINUS VK_SUBTRACT
#endif

#ifdef _MSC_VER // Visual Studio prefixes non-standard C functions with _
#define strdup _strdup
#endif

// Loads an entire file in to memory.  The returned buffer must be later freed by the caller.
char *file_as_buffer(size_t *buffer_size, const char *utf8_filename);

// Shows a file dialog (should hang the current thread) and returns the utf8 filename picked by the
// user or nullptr.  If non-null is returned, it must be later freed by the caller.
char *show_file_picker();

// these mirror the Windows .rc definitions:
{'fraction_non_alphanumeric': 0.058804627249357325, 'fraction_numerical': 0.02892030848329049, 'mean_word_length': 5.917777777777777, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3075274', 'n_tokens_mistral': 1339, 'n_tokens_neox': 1252, 'n_words': 359}