1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
2 | /* |
3 | * Copyright (C) 2009 Gustavo Noronha Silva. |
4 | */ |
5 | |
6 | #ifndef __SOUP_CONTENT_SNIFFER_H__ |
7 | #define __SOUP_CONTENT_SNIFFER_H__ 1 |
8 | |
9 | #include <libsoup/soup-types.h> |
10 | #include <libsoup/soup-message-body.h> |
11 | |
12 | G_BEGIN_DECLS |
13 | |
14 | #define SOUP_TYPE_CONTENT_SNIFFER (soup_content_sniffer_get_type ()) |
15 | #define SOUP_CONTENT_SNIFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_CONTENT_SNIFFER, SoupContentSniffer)) |
16 | #define SOUP_CONTENT_SNIFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SOUP_TYPE_CONTENT_SNIFFER, SoupContentSnifferClass)) |
17 | #define SOUP_IS_CONTENT_SNIFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SOUP_TYPE_CONTENT_SNIFFER)) |
18 | #define SOUP_IS_CONTENT_SNIFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SOUP_TYPE_CONTENT_SNIFFER)) |
19 | #define SOUP_CONTENT_SNIFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SOUP_TYPE_CONTENT_SNIFFER, SoupContentSnifferClass)) |
20 | |
21 | typedef struct _SoupContentSnifferPrivate SoupContentSnifferPrivate; |
22 | |
23 | typedef struct { |
24 | GObject parent; |
25 | |
26 | SoupContentSnifferPrivate *priv; |
27 | } SoupContentSniffer; |
28 | |
29 | typedef struct { |
30 | GObjectClass parent_class; |
31 | |
32 | char* (*sniff) (SoupContentSniffer *sniffer, |
33 | SoupMessage *msg, |
34 | SoupBuffer *buffer, |
35 | GHashTable **params); |
36 | gsize (*get_buffer_size) (SoupContentSniffer *sniffer); |
37 | |
38 | /* Padding for future expansion */ |
39 | void (*_libsoup_reserved1) (void); |
40 | void (*_libsoup_reserved2) (void); |
41 | void (*_libsoup_reserved3) (void); |
42 | void (*_libsoup_reserved4) (void); |
43 | void (*_libsoup_reserved5) (void); |
44 | } SoupContentSnifferClass; |
45 | |
46 | SOUP_AVAILABLE_IN_2_28 |
47 | GType soup_content_sniffer_get_type (void); |
48 | |
49 | SOUP_AVAILABLE_IN_2_28 |
50 | SoupContentSniffer *soup_content_sniffer_new (void); |
51 | |
52 | SOUP_AVAILABLE_IN_2_28 |
53 | char *soup_content_sniffer_sniff (SoupContentSniffer *sniffer, |
54 | SoupMessage *msg, |
55 | SoupBuffer *buffer, |
56 | GHashTable **params); |
57 | SOUP_AVAILABLE_IN_2_28 |
58 | gsize soup_content_sniffer_get_buffer_size (SoupContentSniffer *sniffer); |
59 | |
60 | G_END_DECLS |
61 | |
62 | #endif /* __SOUP_CONTENT_SNIFFER_H__ */ |
63 | |