<commit_before>#include "cache.h"
#include "commit.h"

#include "pull.h"

#include <curl/curl.h>
#include <curl/easy.h>

static CURL *curl;

static char *base;

static SHA_CTX c;
static z_stream stream;

static int local;
static int zret;

static int curl_ssl_verify;

struct buffer
{
        size_t posn;
        size_t size;
        void *buffer;
};

static size_t fwrite_buffer(void *ptr, size_t eltsize, size_t nmemb,
                            struct buffer *buffer) {
        size_t size = eltsize * nmemb;
        if (size > buffer->size - buffer->posn)
                size = buffer->size - buffer->posn;
        memcpy(buffer->buffer + buffer->posn, ptr, size);
        buffer->posn += size;
        return size;
}<commit_msg>[PATCH] support older versions of libcurl<commit_after>#include "cache.h"
#include "commit.h"

#include "pull.h"

#include <curl/curl.h>
#include <curl/easy.h>

#if LIBCURL_VERSION_NUM < 0x070704
#define curl_global_cleanup() do { /* nothing */ } while(0)
#endif
#if LIBCURL_VERSION_NUM < 0x070800
#define curl_global_init(a) do { /* nothing */ } while(0)
#endif
#if LIBCURL_VERSION_NUM < 0x070907
#define curl_easy_setopt(a, b, c) do { /* nothing */ } while(0)
#endif

static CURL *curl;

static char *base;

static SHA_CTX c;
static z_stream stream;

static int local;
static int zret;

static int curl_ssl_verify;

struct buffer
{
        size_t posn;
        size_t size;
        void *buffer;
};

static size_t fwrite_buffer(void *ptr, size_t eltsize, size_t nmemb,
                            struct buffer *buffer) {
        size_t size = eltsize * nmemb;
        if (size > buffer->size - buffer->posn)
                size = buffer->size - buffer->posn;
        memcpy(buffer->buffer + buffer->posn, ptr, size);
        buffer->posn += size;
        return size;
}
{'fraction_non_alphanumeric': 0.11829740187949143, 'fraction_numerical': 0.013266998341625208, 'mean_word_length': 2.7474120082815734, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 23, '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': '3651225', 'n_tokens_mistral': 656, 'n_tokens_neox': 622, 'n_words': 172}