Extending test-client-custom-summary to try e_book_client_get_contacts_uids()
[platform/upstream/evolution-data-server.git] / camel / camel-url-scanner.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  *  Authors: Jeffrey Stedfast <fejj@ximian.com>
4  *
5  *  Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU Lesser General Public License as published by
9  *  the Free Software Foundation; either version 2 of the License, or
10  *  (at your option) any later version.
11  *
12  *  This program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU Lesser General Public License for more details.
16  *
17  *  You should have received a copy of the GNU Lesser General Public License
18  *  along with this program; if not, write to the Free Software
19  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22
23 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
24 #error "Only <camel/camel.h> can be included directly."
25 #endif
26
27 #ifndef CAMEL_URL_SCANNER_H
28 #define CAMEL_URL_SCANNER_H
29
30 #include <glib.h>
31 #include <sys/types.h>
32
33 G_BEGIN_DECLS
34
35 typedef struct {
36         const gchar *pattern;
37         const gchar *prefix;
38         goffset um_so;
39         goffset um_eo;
40 } urlmatch_t;
41
42 typedef gboolean (*CamelUrlScanFunc) (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match);
43
44 /* some default CamelUrlScanFunc's */
45 gboolean camel_url_file_start (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match);
46 gboolean camel_url_file_end (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match);
47 gboolean camel_url_web_start (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match);
48 gboolean camel_url_web_end (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match);
49 gboolean camel_url_addrspec_start (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match);
50 gboolean camel_url_addrspec_end (const gchar *in, const gchar *pos, const gchar *inend, urlmatch_t *match);
51
52 typedef struct {
53         const gchar *pattern;
54         const gchar *prefix;
55         CamelUrlScanFunc start;
56         CamelUrlScanFunc end;
57 } urlpattern_t;
58
59 typedef struct _CamelUrlScanner CamelUrlScanner;
60
61 CamelUrlScanner *camel_url_scanner_new (void);
62 void camel_url_scanner_free (CamelUrlScanner *scanner);
63
64 void camel_url_scanner_add (CamelUrlScanner *scanner, urlpattern_t *pattern);
65
66 gboolean camel_url_scanner_scan (CamelUrlScanner *scanner, const gchar *in, gsize inlen, urlmatch_t *match);
67
68 G_END_DECLS
69
70 #endif /* CAMEL_URL_SCANNER_H */