<commit_before>#include "img.hpp"
#include "opengl.hpp"
#include "debug.hpp"

#ifdef BUILD_WITH_IMAGEIO
#include <png.h>
#include <jpeglib.h>
#include <jerror.h>
#endif

#include <stdint.h>
#include <unistd.h>
#include <cstdio>
#include <iostream>
#include <unordered_map>
#include <functional>

#define TEXTURE_LOAD_ERROR 0

namespace image_io {
    using Loader = std::function<bool(const char *, GLuint)>;
    using Writer = std::function<void(const char *name, uint8_t *pixels, ulong, ulong)>;
    namespace {
        std::unordered_map<std::string, Loader> loaders;
        std::unordered_map<std::string, Writer> writers;
    }

#ifdef BUILD_WITH_IMAGEIO
    /* All backend functions are taken from the internet.
     * If you want to be credited, contact me */
    bool texture_from_png(const char *filename, GLuint target)
    {
        FILE *fp = fopen(filename, "rb");<commit_msg>src/core/img.cpp: pass unsigned long instead of ulong<commit_after>#include "img.hpp"
#include "opengl.hpp"
#include "debug.hpp"

#ifdef BUILD_WITH_IMAGEIO
#include <png.h>
#include <jpeglib.h>
#include <jerror.h>
#endif

#include <stdint.h>
#include <unistd.h>
#include <cstdio>
#include <iostream>
#include <unordered_map>
#include <functional>

#define TEXTURE_LOAD_ERROR 0

namespace image_io {
    using Loader = std::function<bool(const char *, GLuint)>;
    using Writer = std::function<void(const char *name, uint8_t *pixels, unsigned long, unsigned long)>;
    namespace {
        std::unordered_map<std::string, Loader> loaders;
        std::unordered_map<std::string, Writer> writers;
    }

#ifdef BUILD_WITH_IMAGEIO
    /* All backend functions are taken from the internet.
     * If you want to be credited, contact me */
    bool texture_from_png(const char *filename, GLuint target)
    {
        FILE *fp = fopen(filename, "rb");
{'fraction_non_alphanumeric': 0.12527233115468409, 'fraction_numerical': 0.002178649237472767, 'mean_word_length': 4.402941176470589, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '6110404', 'n_tokens_mistral': 635, 'n_tokens_neox': 626, 'n_words': 169}