Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-tools / libgettextpo / ostream.c
1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2
3 #line 1 "ostream.oo.c"
4 /* Abstract output stream data type.
5    Copyright (C) 2006 Free Software Foundation, Inc.
6    Written by Bruno Haible <bruno@clisp.org>, 2006.
7
8    This program is free software: you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 3 of the License, or
11    (at your option) any later version.
12
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
20
21 #include <config.h>
22
23 /* Specification.  */
24 #include "ostream.h"
25
26 #line 27 "ostream.c"
27 #if !IS_CPLUSPLUS
28 #define ostream_representation any_ostream_representation
29 #endif
30 #include "ostream.priv.h"
31
32 const typeinfo_t ostream_typeinfo = { "ostream" };
33
34 static const typeinfo_t * const ostream_superclasses[] =
35   { ostream_SUPERCLASSES };
36
37 #line 27 "ostream.oo.c"
38
39 #if !HAVE_INLINE
40
41 void
42 ostream_write_str (ostream_t stream, const char *string)
43 {
44   ostream_write_mem (stream, string, strlen (string));
45 }
46
47 #endif
48
49 #line 50 "ostream.c"
50 void ostream__write_mem (ostream_t first_arg, const void *data, size_t len);
51 void
52 ostream__write_mem (ostream_t first_arg, const void *data, size_t len)
53 {
54   /* Abstract (unimplemented) method called.  */
55   abort ();
56   #ifndef __GNUC__
57   ostream__write_mem (first_arg,data,len);
58   #endif
59 }
60
61 void ostream__flush (ostream_t first_arg);
62 void
63 ostream__flush (ostream_t first_arg)
64 {
65   /* Abstract (unimplemented) method called.  */
66   abort ();
67   #ifndef __GNUC__
68   ostream__flush (first_arg);
69   #endif
70 }
71
72 void ostream__free (ostream_t first_arg);
73 void
74 ostream__free (ostream_t first_arg)
75 {
76   /* Abstract (unimplemented) method called.  */
77   abort ();
78   #ifndef __GNUC__
79   ostream__free (first_arg);
80   #endif
81 }
82
83
84 const struct ostream_implementation ostream_vtable =
85 {
86   ostream_superclasses,
87   sizeof (ostream_superclasses) / sizeof (ostream_superclasses[0]),
88   sizeof (struct ostream_representation),
89   ostream__write_mem,
90   ostream__flush,
91   ostream__free,
92 };
93
94 #if !HAVE_INLINE
95
96 /* Define the functions that invoke the methods.  */
97
98 void
99 ostream_write_mem (ostream_t first_arg, const void *data, size_t len)
100 {
101   const struct ostream_implementation *vtable =
102     ((struct ostream_representation_header *) (struct any_ostream_representation *) first_arg)->vtable;
103   vtable->write_mem (first_arg,data,len);
104 }
105
106 void
107 ostream_flush (ostream_t first_arg)
108 {
109   const struct ostream_implementation *vtable =
110     ((struct ostream_representation_header *) (struct any_ostream_representation *) first_arg)->vtable;
111   vtable->flush (first_arg);
112 }
113
114 void
115 ostream_free (ostream_t first_arg)
116 {
117   const struct ostream_implementation *vtable =
118     ((struct ostream_representation_header *) (struct any_ostream_representation *) first_arg)->vtable;
119   vtable->free (first_arg);
120 }
121
122 #endif