Removed the notion of a "large" context. For simplicity, all contexts
[panda.git] / src / st-float-array.h
blobcaac2206ab81007fc1e63c8d209a6b9ddd02b62d
1 /*
2 * st-float-array.h
4 * Copyright (C) 2008 Vincent Geddes
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE.
25 #ifndef __ST_FLOAT_ARRAY_H__
26 #define __ST_FLOAT_ARRAY_H__
28 #include <st-object.h>
29 #include <st-types.h>
30 #include <st-descriptor.h>
32 #define ST_FLOAT_ARRAY(oop) ((struct st_float_array *) ST_POINTER (oop))
34 struct st_float_array
36 struct st_arrayed_object header;
38 double elements[];
41 st_descriptor *st_float_array_descriptor (void);
43 static inline double *
44 st_float_array_elements (st_oop array)
46 return ST_FLOAT_ARRAY (array)->elements;
49 static inline double
50 st_float_array_at (st_oop array, st_smi i)
52 return ST_FLOAT_ARRAY (array)->elements[i - 1];
55 static inline void
56 st_float_array_at_put (st_oop array, st_smi i, double value)
58 ST_FLOAT_ARRAY (array)->elements[i - 1] = value;
64 #endif /* __ST_FLOAT_ARRAY_H__ */