Extending test-client-custom-summary to try e_book_client_get_contacts_uids()
[platform/upstream/evolution-data-server.git] / camel / camel-mime-filter-yenc.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_MIME_FILTER_YENC_H
28 #define CAMEL_MIME_FILTER_YENC_H
29
30 #include <camel/camel-enums.h>
31 #include <camel/camel-mime-filter.h>
32
33 /* Standard GObject macros */
34 #define CAMEL_TYPE_MIME_FILTER_YENC \
35         (camel_mime_filter_yenc_get_type ())
36 #define CAMEL_MIME_FILTER_YENC(obj) \
37         (G_TYPE_CHECK_INSTANCE_CAST \
38         ((obj), CAMEL_TYPE_MIME_FILTER_YENC, CamelMimeFilterYenc))
39 #define CAMEL_MIME_FILTER_YENC_CLASS(cls) \
40         (G_TYPE_CHECK_CLASS_CAST \
41         ((cls), CAMEL_TYPE_MIME_FILTER_YENC, CamelMimeFilterYencClass))
42 #define CAMEL_IS_MIME_FILTER_YENC(obj) \
43         (G_TYPE_CHECK_INSTANCE_TYPE \
44         ((obj), CAMEL_TYPE_MIME_FILTER_YENC))
45 #define CAMEL_IS_MIME_FILTER_YENC_CLASS(cls) \
46         (G_TYPE_CHECK_CLASS_TYPE \
47         ((cls), CAMEL_TYPE_MIME_FILTER_YENC))
48 #define CAMEL_MIME_FILTER_YENC_GET_CLASS(obj) \
49         (CAMEL_CHECK_GET_CLASS \
50         ((obj), CAMEL_TYPE_MIME_FILTER_YENC, CamelMimeFilterYencClass))
51
52 G_BEGIN_DECLS
53
54 typedef struct _CamelMimeFilterYenc CamelMimeFilterYenc;
55 typedef struct _CamelMimeFilterYencClass CamelMimeFilterYencClass;
56 typedef struct _CamelMimeFilterYencPrivate CamelMimeFilterYencPrivate;
57
58 #define CAMEL_MIME_YDECODE_STATE_INIT     (0)
59 #define CAMEL_MIME_YENCODE_STATE_INIT     (0)
60
61 /* first 8 bits are reserved for saving a byte */
62
63 /* reserved for use only within camel_mime_ydecode_step */
64 #define CAMEL_MIME_YDECODE_STATE_EOLN     (1 << 8)
65 #define CAMEL_MIME_YDECODE_STATE_ESCAPE   (1 << 9)
66
67 /* bits 10 and 11 reserved for later uses? */
68
69 #define CAMEL_MIME_YDECODE_STATE_BEGIN    (1 << 12)
70 #define CAMEL_MIME_YDECODE_STATE_PART     (1 << 13)
71 #define CAMEL_MIME_YDECODE_STATE_DECODE   (1 << 14)
72 #define CAMEL_MIME_YDECODE_STATE_END      (1 << 15)
73
74 #define CAMEL_MIME_YENCODE_CRC_INIT       (~0)
75 #define CAMEL_MIME_YENCODE_CRC_FINAL(crc) (~crc)
76
77 struct _CamelMimeFilterYenc {
78         CamelMimeFilter parent;
79         CamelMimeFilterYencPrivate *priv;
80 };
81
82 struct _CamelMimeFilterYencClass {
83         CamelMimeFilterClass parent_class;
84 };
85
86 GType           camel_mime_filter_yenc_get_type (void);
87 CamelMimeFilter *
88                 camel_mime_filter_yenc_new      (CamelMimeFilterYencDirection direction);
89 void            camel_mime_filter_yenc_set_state (CamelMimeFilterYenc *yenc,
90                                                  gint state);
91 void            camel_mime_filter_yenc_set_crc  (CamelMimeFilterYenc *yenc,
92                                                  guint32 crc);
93 guint32         camel_mime_filter_yenc_get_pcrc (CamelMimeFilterYenc *yenc);
94 guint32         camel_mime_filter_yenc_get_crc  (CamelMimeFilterYenc *yenc);
95
96 gsize           camel_ydecode_step              (const guchar *in,
97                                                  gsize inlen,
98                                                  guchar *out,
99                                                  gint *state,
100                                                  guint32 *pcrc,
101                                                  guint32 *crc);
102 gsize           camel_yencode_step              (const guchar *in,
103                                                  gsize inlen,
104                                                  guchar *out,
105                                                  gint *state,
106                                                  guint32 *pcrc,
107                                                  guint32 *crc);
108 gsize           camel_yencode_close             (const guchar *in,
109                                                  gsize inlen,
110                                                  guchar *out,
111                                                  gint *state,
112                                                  guint32 *pcrc,
113                                                  guint32 *crc);
114
115 G_END_DECLS
116
117 #endif /* CAMEL_MIME_FILTER_YENC_H */