<commit_before>/*
 * win32test.c : Test basic library functions under Win32
 *
 * This file is a part of the OpenInput library.
 * Copyright (C) 2005  <NAME> <<EMAIL>>.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

/* ******************************************************************** */

// Includes
#include "openinput.h"
#include <windows.h>
#include <stdio.h>

// Platform independent test function
void platform_test();

/* ******************************************************************** */

// Global vars
HINSTANCE instance;
HWND window;

/* ******************************************************************** */

// Window procedure
LRESULT CALLBACK window_proc(HWND hwnd, UINT msg,
                             WPARAM wparam, LPARAM lparam) {
    // We only want the close/destroy message
    if((msg == WM_CLOSE) || (msg == WM_DESTROY)) {
        fprintf(stderr, "win32test: catched close/destroy\n");
        PostQuitMessage(0);
        return 0;
    }

    // Just do default handling
    return DefWindowProc(hwnd, msg, wparam, lparam);
}

/* ******************************************************************** */

// Initialize window class
int init_class(HINSTANCE inst) {
    WNDCLASSEX wcx;

    wcx.cbSize = sizeof(wcx);
    wcx.style = CS_HREDRAW | CS_VREDRAW;
    wcx.lpfnWndProc = window_proc;
    wcx.cbClsExtra = 0;
    wcx.cbWndExtra = 0;
    wcx.hInstance = inst;
    wcx.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wcx.hCursor = LoadCursor(NULL, IDC_ARROW);
    wcx.hbrBackground = GetStockObject(WHITE_BRUSH);
    wcx.lpszMenuName =  "OpenInputMenu";
    wcx.lpszClassName = "OpenInputTest";
    wcx.hIconSm = LoadImage(inst,
                            MAKEINTRESOURCE(5),
                            IMAGE_ICON,
                            GetSystemMetrics(SM_CXSMICON),
                            GetSystemMetrics(SM_CYSMICON),
                            LR_DEFAULTCOLOR);

    return RegisterClassEx(&wcx);<commit_msg>Dont use unicode in win32 demo<commit_after>/*
 * win32test.c : Test basic library functions under Win32
 *
 * This file is a part of the OpenInput library.
 * Copyright (C) 2005  <NAME> <<EMAIL>>.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

/* ******************************************************************** */

// We do not use unicode
#undef UNICODE

// Includes
#include "openinput.h"
#include <windows.h>
#include <stdio.h>

// Platform independent test function
void platform_test();

/* ******************************************************************** */

// Global vars
HINSTANCE instance;
HWND window;

/* ******************************************************************** */

// Window procedure
LRESULT CALLBACK window_proc(HWND hwnd, UINT msg,
                             WPARAM wparam, LPARAM lparam) {
    // We only want the close/destroy message
    if((msg == WM_CLOSE) || (msg == WM_DESTROY)) {
        fprintf(stderr, "win32test: catched close/destroy\n");
        PostQuitMessage(0);
        return 0;
    }

    // Just do default handling
    return DefWindowProc(hwnd, msg, wparam, lparam);
}

/* ******************************************************************** */

// Initialize window class
int init_class(HINSTANCE inst) {
    WNDCLASSEX wcx;

    wcx.cbSize = sizeof(wcx);
    wcx.style = CS_HREDRAW | CS_VREDRAW;
    wcx.lpfnWndProc = window_proc;
    wcx.cbClsExtra = 0;
    wcx.cbWndExtra = 0;
    wcx.hInstance = inst;
    wcx.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wcx.hCursor = LoadCursor(NULL, IDC_ARROW);
    wcx.hbrBackground = GetStockObject(WHITE_BRUSH);
    wcx.lpszMenuName = "OpenInputMenu";
    wcx.lpszClassName = "OpenInputTest";
    wcx.hIconSm = LoadImage(inst,
                            MAKEINTRESOURCE(5),
                            IMAGE_ICON,
                            GetSystemMetrics(SM_CXSMICON),
                            GetSystemMetrics(SM_CYSMICON),
                            LR_DEFAULTCOLOR);

    return RegisterClassEx(&wcx);
{'fraction_non_alphanumeric': 0.18281569648502882, 'fraction_numerical': 0.010786684024549005, 'mean_word_length': 3.0680786686838126, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '6226833', 'n_tokens_mistral': 1555, 'n_tokens_neox': 1480, 'n_words': 485}