Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / camel / camel-stream-fs.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-stream-fs.h :stream based on unix filesystem */
3
4 /*
5  * Author:
6  *  Bertrand Guiheneuf <bertrand@helixcode.com>
7  *
8  * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com)
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of version 2 of the GNU Lesser General Public
12  * License as published by the Free Software Foundation.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
22  * USA
23  */
24
25
26 #ifndef CAMEL_STREAM_FS_H
27 #define CAMEL_STREAM_FS_H 1
28
29 /* for open flags */
30 #include <sys/types.h>
31 #include <sys/stat.h>
32 #include <fcntl.h>
33
34 #include <camel/camel-seekable-stream.h>
35
36 #define CAMEL_STREAM_FS_TYPE     (camel_stream_fs_get_type ())
37 #define CAMEL_STREAM_FS(obj)     (CAMEL_CHECK_CAST((obj), CAMEL_STREAM_FS_TYPE, CamelStreamFs))
38 #define CAMEL_STREAM_FS_CLASS(k) (CAMEL_CHECK_CLASS_CAST ((k), CAMEL_STREAM_FS_TYPE, CamelStreamFsClass))
39 #define CAMEL_IS_STREAM_FS(o)    (CAMEL_CHECK_TYPE((o), CAMEL_STREAM_FS_TYPE))
40
41 G_BEGIN_DECLS
42
43 struct _CamelStreamFs {
44         CamelSeekableStream parent_object;
45
46         int fd;             /* file descriptor on the underlying file */
47 };
48
49 typedef struct {
50         CamelSeekableStreamClass parent_class;
51
52 } CamelStreamFsClass;
53
54 /* Standard Camel function */
55 CamelType camel_stream_fs_get_type (void);
56
57 /* public methods */
58 CamelStream * camel_stream_fs_new_with_name            (const char *name, int flags, mode_t mode);
59 CamelStream * camel_stream_fs_new_with_name_and_bounds (const char *name, int flags, mode_t mode,
60                                                         off_t start, off_t end);
61
62 CamelStream * camel_stream_fs_new_with_fd              (int fd);
63 CamelStream * camel_stream_fs_new_with_fd_and_bounds   (int fd, off_t start, off_t end);
64
65 G_END_DECLS
66
67 #endif /* CAMEL_STREAM_FS_H */