1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2000-2003, Ximian, Inc.
6 #ifndef __SOUP_MISC_H__
7 #define __SOUP_MISC_H__ 1
9 #include <libsoup/soup-types.h>
13 /* Non-default-GMainContext operations */
15 GSource *soup_add_io_watch (GMainContext *async_context,
17 GIOCondition condition,
21 GSource *soup_add_idle (GMainContext *async_context,
24 SOUP_AVAILABLE_IN_2_24
25 GSource *soup_add_completion (GMainContext *async_context,
29 GSource *soup_add_timeout (GMainContext *async_context,
37 guint soup_str_case_hash (gconstpointer key);
39 gboolean soup_str_case_equal (gconstpointer v1,
42 #define _SOUP_ATOMIC_INTERN_STRING(variable, value) ((const char *)(g_atomic_pointer_get (&(variable)) ? (variable) : (g_atomic_pointer_set (&(variable), (gpointer)g_intern_static_string (value)), (variable))))
44 /* character classes */
47 const char soup_char_attributes[];
48 #define SOUP_CHAR_URI_PERCENT_ENCODED 0x01
49 #define SOUP_CHAR_URI_GEN_DELIMS 0x02
50 #define SOUP_CHAR_URI_SUB_DELIMS 0x04
51 #define SOUP_CHAR_HTTP_SEPARATOR 0x08
52 #define SOUP_CHAR_HTTP_CTL 0x10
54 #define soup_char_is_uri_percent_encoded(ch) (soup_char_attributes[(guchar)ch] & SOUP_CHAR_URI_PERCENT_ENCODED)
55 #define soup_char_is_uri_gen_delims(ch) (soup_char_attributes[(guchar)ch] & SOUP_CHAR_URI_GEN_DELIMS)
56 #define soup_char_is_uri_sub_delims(ch) (soup_char_attributes[(guchar)ch] & SOUP_CHAR_URI_SUB_DELIMS)
57 #define soup_char_is_uri_unreserved(ch) (!(soup_char_attributes[(guchar)ch] & (SOUP_CHAR_URI_PERCENT_ENCODED | SOUP_CHAR_URI_GEN_DELIMS | SOUP_CHAR_URI_SUB_DELIMS)))
58 #define soup_char_is_token(ch) (!(soup_char_attributes[(guchar)ch] & (SOUP_CHAR_HTTP_SEPARATOR | SOUP_CHAR_HTTP_CTL)))
62 const gboolean soup_ssl_supported;
64 /* Part of a debugging API */
68 SOUP_CONNECTION_CONNECTING,
70 SOUP_CONNECTION_IN_USE,
71 SOUP_CONNECTION_REMOTE_DISCONNECTED,
72 SOUP_CONNECTION_DISCONNECTED
73 } SoupConnectionState;
77 #endif /* __SOUP_MISC_H__ */