<commit_before>/*
 Copyright (C) 2008 <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.

 See the file COPYING for the full license text.
*/

#ifndef __KATZE_NET_H__
#define __KATZE_NET_H__

#include "katze-utils.h"

#include <gtk/gtk.h>

G_BEGIN_DECLS

#define KATZE_TYPE_NET \
    (katze_net_get_type ())
#define KATZE_NET(obj) \
    (G_TYPE_CHECK_INSTANCE_CAST ((obj), KATZE_TYPE_NET, KatzeNet))
#define KATZE_NET_CLASS(klass) \
    (G_TYPE_CHECK_CLASS_CAST ((klass), KATZE_TYPE_NET, KatzeNetClass))
#define KATZE_IS_NET(obj) \
    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), KATZE_TYPE_NET))
#define KATZE_IS_NET_CLASS(klass) \
    (G_TYPE_CHECK_CLASS_TYPE ((klass), KATZE_TYPE_NET))
#define KATZE_NET_GET_CLASS(obj) \
    (G_TYPE_INSTANCE_GET_CLASS ((obj), KATZE_TYPE_NET, KatzeNetClass))

typedef struct _KatzeNet                KatzeNet;
typedef struct _KatzeNetClass           KatzeNetClass;

GType
katze_net_get_type                       (void);

KatzeNet*
katze_net_new                            (void);

typedef enum
{
    KATZE_NET_VERIFIED,
    KATZE_NET_MOVED,
    KATZE_NET_NOT_FOUND,
    KATZE_NET_FAILED,
    KATZE_NET_DONE
} KatzeNetStatus;

typedef struct
{
    gchar* uri;
    KatzeNetStatus status;
    gchar* mime_type;
    gchar* data;
    goffset length;
} KatzeNetRequest;

typedef gboolean (*KatzeNetStatusCb)     (KatzeNetRequest*   request,
                                          gpointer           user_data);

typedef void     (*KatzeNetTransferCb)   (KatzeNetRequest*   request,
                                          gpointer           user_data);

void
katze_net_load_uri                       (KatzeNet*          net,
                                          const gchar*       uri,
                                          KatzeNetStatusCb   status_cb,
                                          KatzeNetTransferCb transfer_cb,
                                          gpointer           user_data);

typedef void     (*KatzeNetIconCb)       (GdkPixbuf*         icon,
                                          gpointer           user_data);

GdkPixbuf*<commit_msg>Use gint64 instead of goffset, the latter is too new<commit_after>/*
 Copyright (C) 2008 <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.

 See the file COPYING for the full license text.
*/

#ifndef __KATZE_NET_H__
#define __KATZE_NET_H__

#include "katze-utils.h"

#include <gtk/gtk.h>

G_BEGIN_DECLS

#define KATZE_TYPE_NET \
    (katze_net_get_type ())
#define KATZE_NET(obj) \
    (G_TYPE_CHECK_INSTANCE_CAST ((obj), KATZE_TYPE_NET, KatzeNet))
#define KATZE_NET_CLASS(klass) \
    (G_TYPE_CHECK_CLASS_CAST ((klass), KATZE_TYPE_NET, KatzeNetClass))
#define KATZE_IS_NET(obj) \
    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), KATZE_TYPE_NET))
#define KATZE_IS_NET_CLASS(klass) \
    (G_TYPE_CHECK_CLASS_TYPE ((klass), KATZE_TYPE_NET))
#define KATZE_NET_GET_CLASS(obj) \
    (G_TYPE_INSTANCE_GET_CLASS ((obj), KATZE_TYPE_NET, KatzeNetClass))

typedef struct _KatzeNet                KatzeNet;
typedef struct _KatzeNetClass           KatzeNetClass;

GType
katze_net_get_type                       (void);

KatzeNet*
katze_net_new                            (void);

typedef enum
{
    KATZE_NET_VERIFIED,
    KATZE_NET_MOVED,
    KATZE_NET_NOT_FOUND,
    KATZE_NET_FAILED,
    KATZE_NET_DONE
} KatzeNetStatus;

typedef struct
{
    gchar* uri;
    KatzeNetStatus status;
    gchar* mime_type;
    gchar* data;
    gint64 length;
} KatzeNetRequest;

typedef gboolean (*KatzeNetStatusCb)     (KatzeNetRequest*   request,
                                          gpointer           user_data);

typedef void     (*KatzeNetTransferCb)   (KatzeNetRequest*   request,
                                          gpointer           user_data);

void
katze_net_load_uri                       (KatzeNet*          net,
                                          const gchar*       uri,
                                          KatzeNetStatusCb   status_cb,
                                          KatzeNetTransferCb transfer_cb,
                                          gpointer           user_data);

typedef void     (*KatzeNetIconCb)       (GdkPixbuf*         icon,
                                          gpointer           user_data);

GdkPixbuf*
{'fraction_non_alphanumeric': 0.0689876121315677, 'fraction_numerical': 0.0034173430158052115, 'mean_word_length': 2.06078431372549, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 28, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4180260', 'n_tokens_mistral': 1527, 'n_tokens_neox': 1464, 'n_words': 342}