* refactored vtable implementation. Its much simpler now.
[panda.git] / goo / st-float.h
blob848abdc159e1e9b6c3153eea01fac57d793e54ad
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; indent-offset: 4 -*- */
2 /*
3 * st-float.h
5 * Copyright (C) 2008 Vincent Geddes <vgeddes@gnome.org>
7 * This library is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation, either
10 * version 3 of the License, or (at your option) any later version.
12 * This library 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.
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef _ST_FLOAT_H__
22 #define _ST_FLOAT_H__
24 #include <st-types.h>
25 #include <st-heap-object.h>
27 typedef struct
29 st_header_t header;
31 double value;
33 } st_float_t;
36 st_oop_t st_float_new (double value);
38 INLINE double st_float_value (st_oop_t f);
40 INLINE void st_float_set_value (st_oop_t f, double value);
42 const st_vtable_t *st_float_vtable (void);
45 /* inline definitions */
46 #define ST_FLOAT(oop) ((st_float_t *) ST_POINTER (oop))
48 INLINE double
49 st_float_value (st_oop_t f)
51 return ST_FLOAT (f)->value;
54 INLINE void
55 st_float_set_value (st_oop_t f, double value)
57 ST_FLOAT (f)->value = value;
60 #endif /* _ST_FLOAT_H__ */