soup-auth-manager: add soup_auth_manager_use_auth()
[platform/upstream/libsoup.git] / libsoup / soup-content-processor.c
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2012 Igalia, S.L.
4  */
5
6
7 #ifdef HAVE_CONFIG_H
8 #include <config.h>
9 #endif
10
11 #include "soup-content-processor.h"
12 #include "soup.h"
13
14 static void soup_content_processor_default_init (SoupContentProcessorInterface *interface);
15
16 G_DEFINE_INTERFACE (SoupContentProcessor, soup_content_processor, G_TYPE_OBJECT)
17
18 static GInputStream *
19 soup_content_processor_real_wrap_input (SoupContentProcessor *processor,
20                                         GInputStream *base_stream,
21                                         SoupMessage *msg,
22                                         GError **error)
23 {
24         g_return_val_if_reached (NULL);
25 }
26
27 static void
28 soup_content_processor_default_init (SoupContentProcessorInterface *interface)
29 {
30         interface->processing_stage = SOUP_STAGE_INVALID;
31         interface->wrap_input = soup_content_processor_real_wrap_input;
32 }
33
34 GInputStream *
35 soup_content_processor_wrap_input (SoupContentProcessor *processor,
36                                    GInputStream *base_stream,
37                                    SoupMessage *msg,
38                                    GError **error)
39 {
40         g_return_val_if_fail (SOUP_IS_CONTENT_PROCESSOR (processor), NULL);
41
42         return SOUP_CONTENT_PROCESSOR_GET_INTERFACE (processor)->wrap_input (processor, base_stream, msg, error);
43 }
44
45 SoupProcessingStage
46 soup_content_processor_get_processing_stage (SoupContentProcessor *processor)
47 {
48         g_return_val_if_fail (SOUP_IS_CONTENT_PROCESSOR (processor), SOUP_STAGE_INVALID);
49
50         return SOUP_CONTENT_PROCESSOR_GET_INTERFACE (processor)->processing_stage;
51 }