1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  *  Authors: Piotr Klaban <makler@man.torun.pl>
4  *
5  *  Copyright 2003,2004 Piotr Klaban
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU 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 General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with this program; if not, write to the Free Software
19  *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
20  *
21  */
22 
23 
24 #ifndef __GMIME_STREAM_PERLIO_H__
25 #define __GMIME_STREAM_PERLIO_H__
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #pragma }
30 #endif /* __cplusplus */
31 
32 #include <EXTERN.h>
33 #include <perl.h>
34 
35 #include <glib.h>
36 #include <gmime/gmime-stream.h>
37 
38 #define GMIME_TYPE_STREAM_PERLIO            (g_mime_stream_perlio_get_type ())
39 #define GMIME_STREAM_PERLIO(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMIME_TYPE_STREAM_PERLIO, GMimeStreamPerlIO))
40 #define GMIME_STREAM_PERLIO_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMIME_TYPE_STREAM_PERLIO, GMimeStreamPerlIOClass))
41 #define GMIME_IS_STREAM_PERLIO(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMIME_TYPE_STREAM_PERLIO))
42 #define GMIME_IS_STREAM_PERLIO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GMIME_TYPE_STREAM_PERLIO))
43 #define GMIME_STREAM_PERLIO_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GMIME_TYPE_STREAM_PERLIO, GMimeStreamPerlIOClass))
44 
45 typedef struct _GMimeStreamPerlIO GMimeStreamPerlIO;
46 typedef struct _GMimeStreamPerlIOClass GMimeStreamPerlIOClass;
47 
48 struct _GMimeStreamPerlIO {
49 	GMimeStream parent_object;
50 
51 	gboolean owner;
52 	PerlIO *fp;
53 };
54 
55 struct _GMimeStreamPerlIOClass {
56 	GMimeStreamClass parent_class;
57 
58 };
59 
60 
61 GType g_mime_stream_perlio_get_type (void);
62 
63 GMimeStream *g_mime_stream_perlio_new (PerlIO *fp);
64 GMimeStream *g_mime_stream_perlio_new_with_bounds (PerlIO *fp, off_t start, off_t end);
65 
66 void g_mime_stream_perlio_set_owner (GMimeStreamPerlIO *stream, gboolean owner);
67 gboolean g_mime_stream_perlio_get_owner (GMimeStreamPerlIO *stream);
68 
69 #ifdef __cplusplus
70 }
71 #endif /* __cplusplus */
72 
73 #endif /* __GMIME_STREAM_PERLIO_H__ */
74