1 | /* ------------------ */ |
---|
2 | /* --- nralloc1.c --- */ |
---|
3 | /* ------------------ */ |
---|
4 | |
---|
5 | /* |
---|
6 | * Copyright (c) 2000-2014, Lionel Lacassagne, All rights reserved |
---|
7 | * Univ Paris Sud XI, CNRS |
---|
8 | */ |
---|
9 | |
---|
10 | #ifndef __NRALLOC1_H__ |
---|
11 | #define __NRALLOC1_H__ |
---|
12 | |
---|
13 | #include <stdint.h> |
---|
14 | |
---|
15 | #include "nrc_os_config.h" |
---|
16 | #include "nrtype.h" |
---|
17 | |
---|
18 | /* |
---|
19 | * -------------- |
---|
20 | * --- vector --- |
---|
21 | * -------------- |
---|
22 | */ |
---|
23 | |
---|
24 | #define type_vector(t) \ |
---|
25 | t * short_name(t,,vector)(int32_t nl, int32_t nh) |
---|
26 | |
---|
27 | type_vector(int8_t); |
---|
28 | type_vector(uint8_t); |
---|
29 | type_vector(int16_t); |
---|
30 | type_vector(uint16_t); |
---|
31 | type_vector(int32_t); |
---|
32 | type_vector(uint32_t); |
---|
33 | type_vector(int64_t); |
---|
34 | type_vector(uint64_t); |
---|
35 | type_vector(float); |
---|
36 | type_vector(double); |
---|
37 | type_vector(rgb8); |
---|
38 | type_vector(rgbx8); |
---|
39 | type_vector(rgb32); |
---|
40 | type_vector(void_p); |
---|
41 | |
---|
42 | |
---|
43 | |
---|
44 | #if TARGET_OS == GIETVM |
---|
45 | #define remote_type_vector(t) \ |
---|
46 | t * short_name(t,remote_,vector)(int32_t nl, int32_t nh, int32_t x, int32_t y) |
---|
47 | |
---|
48 | remote_type_vector(int8_t); |
---|
49 | remote_type_vector(uint8_t); |
---|
50 | remote_type_vector(int16_t); |
---|
51 | remote_type_vector(uint16_t); |
---|
52 | remote_type_vector(int32_t); |
---|
53 | remote_type_vector(uint32_t); |
---|
54 | remote_type_vector(int64_t); |
---|
55 | remote_type_vector(uint64_t); |
---|
56 | remote_type_vector(float); |
---|
57 | remote_type_vector(double); |
---|
58 | remote_type_vector(rgb8); |
---|
59 | remote_type_vector(rgbx8); |
---|
60 | remote_type_vector(rgb32); |
---|
61 | remote_type_vector(void_p); |
---|
62 | |
---|
63 | //void ** remote_vvector(long nl, long nh, int x, int y); |
---|
64 | #endif |
---|
65 | |
---|
66 | #define type_vector0(t) \ |
---|
67 | t * short_name(t,,vector0)(int32_t nl, int32_t nh) |
---|
68 | |
---|
69 | type_vector0(int8_t); |
---|
70 | type_vector0(uint8_t); |
---|
71 | type_vector0(int16_t); |
---|
72 | type_vector0(uint16_t); |
---|
73 | type_vector0(int32_t); |
---|
74 | type_vector0(uint32_t); |
---|
75 | type_vector0(int64_t); |
---|
76 | type_vector0(uint64_t); |
---|
77 | type_vector0(float); |
---|
78 | type_vector0(double); |
---|
79 | type_vector0(rgb8); |
---|
80 | type_vector0(rgbx8); |
---|
81 | type_vector0(rgb32); |
---|
82 | type_vector0(void_p); |
---|
83 | |
---|
84 | #define realloc_type_vector(t) \ |
---|
85 | t * short_name(t,realloc_,vector)(t * v, int32_t nl, int32_t nh) |
---|
86 | |
---|
87 | realloc_type_vector(int8_t); |
---|
88 | realloc_type_vector(uint8_t); |
---|
89 | realloc_type_vector(int16_t); |
---|
90 | realloc_type_vector(uint16_t); |
---|
91 | realloc_type_vector(int32_t); |
---|
92 | realloc_type_vector(uint32_t); |
---|
93 | realloc_type_vector(int64_t); |
---|
94 | realloc_type_vector(uint64_t); |
---|
95 | realloc_type_vector(float); |
---|
96 | realloc_type_vector(double); |
---|
97 | realloc_type_vector(rgb8); |
---|
98 | realloc_type_vector(rgbx8); |
---|
99 | realloc_type_vector(rgb32); |
---|
100 | realloc_type_vector(void_p); |
---|
101 | |
---|
102 | |
---|
103 | #define free_type_vector(t) \ |
---|
104 | void short_name(t,free_,vector)(t * v, long nl, long nh) |
---|
105 | |
---|
106 | free_type_vector(int8_t); |
---|
107 | free_type_vector(uint8_t); |
---|
108 | free_type_vector(int16_t); |
---|
109 | free_type_vector(uint16_t); |
---|
110 | free_type_vector(int32_t); |
---|
111 | free_type_vector(uint32_t); |
---|
112 | free_type_vector(int64_t); |
---|
113 | free_type_vector(uint64_t); |
---|
114 | free_type_vector(float); |
---|
115 | free_type_vector(double); |
---|
116 | free_type_vector(rgb8); |
---|
117 | free_type_vector(rgbx8); |
---|
118 | free_type_vector(rgb32); |
---|
119 | free_type_vector(void_p); |
---|
120 | |
---|
121 | |
---|
122 | |
---|
123 | /* |
---|
124 | void ** vvector(long nl, long nh); |
---|
125 | void ** vvector0(long nl, long nh); |
---|
126 | void ** realloc_vvector(void ** v, long nl, long nh); |
---|
127 | void free_vvector(void ** v, long nl, long nh); |
---|
128 | */ |
---|
129 | |
---|
130 | #endif /* __NRALLOC1_H__ */ |
---|
131 | |
---|