updated verse to version r6p1
[blender.git] / extern / verse / dist / v_gen_pack_g_node.c
1 /*
2 ** This is automatically generated source code -- do not edit.
3 ** Changes are affected either by editing the corresponding protocol
4 ** definition file (v_cmd_def_X.c where X=node type), or by editing
5 ** the code generator itself, in v_cmd_gen.c.
6 */
7
8 #include <stdlib.h>
9 #include <stdio.h>
10
11 #include "v_cmd_gen.h"
12 #if !defined(V_GENERATE_FUNC_MODE)
13 #include "verse.h"
14 #include "v_cmd_buf.h"
15 #include "v_network_out_que.h"
16 #include "v_network.h"
17 #include "v_connection.h"
18 #include "v_util.h"
19
20 void verse_send_g_layer_create(VNodeID node_id, VLayerID layer_id, const char *name, VNGLayerType type, uint32 def_uint, real64 def_real)
21 {
22         uint8 *buf;
23         unsigned int buffer_pos = 0;
24         VCMDBufHead *head;
25         head = v_cmd_buf_allocate(VCMDBS_80);/* Allocating the buffer */
26         buf = ((VCMDBuffer10 *)head)->buf;
27
28         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 48); /* Pack the command. */
29 #if defined V_PRINT_SEND_COMMANDS
30         printf("send: verse_send_g_layer_create(node_id = %u layer_id = %u name = %s type = %u def_uint = %u def_real = %f );\n", node_id, layer_id, name, type, def_uint, def_real);
31 #endif
32         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
33         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
34         buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], name, 16);
35         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)type);
36         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], def_uint);
37         buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], def_real);
38         if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u)
39                 v_cmd_buf_set_unique_address_size(head, 7);
40         else
41                 v_cmd_buf_set_address_size(head, 7);
42         v_cmd_buf_set_size(head, buffer_pos);
43         v_noq_send_buf(v_con_get_network_queue(), head);
44 }
45
46 void verse_send_g_layer_destroy(VNodeID node_id, VLayerID layer_id)
47 {
48         uint8 *buf;
49         unsigned int buffer_pos = 0;
50         VCMDBufHead *head;
51         head = v_cmd_buf_allocate(VCMDBS_80);/* Allocating the buffer */
52         buf = ((VCMDBuffer10 *)head)->buf;
53
54         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 48); /* Pack the command. */
55 #if defined V_PRINT_SEND_COMMANDS
56         printf("send: verse_send_g_layer_destroy(node_id = %u layer_id = %u );\n", node_id, layer_id);
57 #endif
58         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
59         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
60         buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
61         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)-1);
62         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], -1);
63         buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], V_REAL64_MAX);
64         if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u)
65                 v_cmd_buf_set_unique_address_size(head, 7);
66         else
67                 v_cmd_buf_set_address_size(head, 7);
68         v_cmd_buf_set_size(head, buffer_pos);
69         v_noq_send_buf(v_con_get_network_queue(), head);
70 }
71
72 unsigned int v_unpack_g_layer_create(const char *buf, size_t buffer_length)
73 {
74         uint8 enum_temp;
75         unsigned int buffer_pos = 0;
76         void (* func_g_layer_create)(void *user_data, VNodeID node_id, VLayerID layer_id, const char *name, VNGLayerType type, uint32 def_uint, real64 def_real);
77         VNodeID node_id;
78         VLayerID layer_id;
79         char name[16];
80         VNGLayerType type;
81         uint32 def_uint;
82         real64 def_real;
83         
84         func_g_layer_create = v_fs_get_user_func(48);
85         if(buffer_length < 6)
86                 return -1;
87         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
88         buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
89         buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], name, 16, buffer_length - buffer_pos);
90         if(buffer_length < 13 + buffer_pos)
91                 return -1;
92         buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &enum_temp);
93         type = (VNGLayerType)enum_temp;
94         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &def_uint);
95         buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &def_real);
96 #if defined V_PRINT_RECEIVE_COMMANDS
97         if(name[0] == 0)
98                 printf("receive: verse_send_g_layer_destroy(node_id = %u layer_id = %u ); callback = %p\n", node_id, layer_id, v_fs_get_alias_user_func(48));
99         else
100                 printf("receive: verse_send_g_layer_create(node_id = %u layer_id = %u name = %s type = %u def_uint = %u def_real = %f ); callback = %p\n", node_id, layer_id, name, type, def_uint, def_real, v_fs_get_user_func(48));
101 #endif
102         if(name[0] == 0)
103         {
104                 void (* alias_g_layer_destroy)(void *user_data, VNodeID node_id, VLayerID layer_id);
105                 alias_g_layer_destroy = v_fs_get_alias_user_func(48);
106                 if(alias_g_layer_destroy != NULL)
107                         alias_g_layer_destroy(v_fs_get_alias_user_data(48), node_id, layer_id);
108                 return buffer_pos;
109         }
110         if(func_g_layer_create != NULL)
111                 func_g_layer_create(v_fs_get_user_data(48), node_id, layer_id, name, (VNGLayerType) type, def_uint, def_real);
112
113         return buffer_pos;
114 }
115
116 void verse_send_g_layer_subscribe(VNodeID node_id, VLayerID layer_id, VNRealFormat type)
117 {
118         uint8 *buf;
119         unsigned int buffer_pos = 0;
120         VCMDBufHead *head;
121         head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
122         buf = ((VCMDBuffer10 *)head)->buf;
123
124         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 49); /* Pack the command. */
125 #if defined V_PRINT_SEND_COMMANDS
126         printf("send: verse_send_g_layer_subscribe(node_id = %u layer_id = %u type = %u );\n", node_id, layer_id, type);
127 #endif
128         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
129         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
130         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)type);
131         if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u)
132                 v_cmd_buf_set_unique_address_size(head, 7);
133         else
134                 v_cmd_buf_set_address_size(head, 7);
135         v_cmd_buf_set_size(head, buffer_pos);
136         v_noq_send_buf(v_con_get_network_queue(), head);
137 }
138
139 void verse_send_g_layer_unsubscribe(VNodeID node_id, VLayerID layer_id)
140 {
141         uint8 *buf;
142         unsigned int buffer_pos = 0;
143         VCMDBufHead *head;
144         head = v_cmd_buf_allocate(VCMDBS_10);/* Allocating the buffer */
145         buf = ((VCMDBuffer10 *)head)->buf;
146
147         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 49); /* Pack the command. */
148 #if defined V_PRINT_SEND_COMMANDS
149         printf("send: verse_send_g_layer_unsubscribe(node_id = %u layer_id = %u );\n", node_id, layer_id);
150 #endif
151         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
152         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
153         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], (uint8)-1);
154         if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u)
155                 v_cmd_buf_set_unique_address_size(head, 7);
156         else
157                 v_cmd_buf_set_address_size(head, 7);
158         v_cmd_buf_set_size(head, buffer_pos);
159         v_noq_send_buf(v_con_get_network_queue(), head);
160 }
161
162 unsigned int v_unpack_g_layer_subscribe(const char *buf, size_t buffer_length)
163 {
164         uint8 enum_temp;
165         unsigned int buffer_pos = 0;
166         void (* func_g_layer_subscribe)(void *user_data, VNodeID node_id, VLayerID layer_id, VNRealFormat type);
167         VNodeID node_id;
168         VLayerID layer_id;
169         VNRealFormat type;
170         
171         func_g_layer_subscribe = v_fs_get_user_func(49);
172         if(buffer_length < 6)
173                 return -1;
174         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
175         buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
176         buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &enum_temp);
177         type = (VNRealFormat)enum_temp;
178 #if defined V_PRINT_RECEIVE_COMMANDS
179         if(type > VN_FORMAT_REAL64)
180                 printf("receive: verse_send_g_layer_unsubscribe(node_id = %u layer_id = %u ); callback = %p\n", node_id, layer_id, v_fs_get_alias_user_func(49));
181         else
182                 printf("receive: verse_send_g_layer_subscribe(node_id = %u layer_id = %u type = %u ); callback = %p\n", node_id, layer_id, type, v_fs_get_user_func(49));
183 #endif
184         if(type > VN_FORMAT_REAL64)
185         {
186                 void (* alias_g_layer_unsubscribe)(void *user_data, VNodeID node_id, VLayerID layer_id);
187                 alias_g_layer_unsubscribe = v_fs_get_alias_user_func(49);
188                 if(alias_g_layer_unsubscribe != NULL)
189                         alias_g_layer_unsubscribe(v_fs_get_alias_user_data(49), node_id, layer_id);
190                 return buffer_pos;
191         }
192         if(func_g_layer_subscribe != NULL)
193                 func_g_layer_subscribe(v_fs_get_user_data(49), node_id, layer_id, (VNRealFormat) type);
194
195         return buffer_pos;
196 }
197
198 void verse_send_g_vertex_set_xyz_real32(VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real32 x, real32 y, real32 z)
199 {
200         uint8 *buf;
201         unsigned int buffer_pos = 0;
202         VCMDBufHead *head;
203         head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
204         buf = ((VCMDBuffer10 *)head)->buf;
205
206         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 50); /* Pack the command. */
207 #if defined V_PRINT_SEND_COMMANDS
208         printf("send: verse_send_g_vertex_set_xyz_real32(node_id = %u layer_id = %u vertex_id = %u x = %f y = %f z = %f );\n", node_id, layer_id, vertex_id, x, y, z);
209 #endif
210         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
211         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
212         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], vertex_id);
213         buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], x);
214         buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], y);
215         buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], z);
216         if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || vertex_id == (uint32) ~0u)
217                 v_cmd_buf_set_unique_address_size(head, 11);
218         else
219                 v_cmd_buf_set_address_size(head, 11);
220         v_cmd_buf_set_size(head, buffer_pos);
221         v_noq_send_buf(v_con_get_network_queue(), head);
222 }
223
224 void verse_send_g_vertex_delete_real32(VNodeID node_id, uint32 vertex_id)
225 {
226         uint8 *buf;
227         unsigned int buffer_pos = 0;
228         VCMDBufHead *head;
229         head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
230         buf = ((VCMDBuffer10 *)head)->buf;
231
232         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 50); /* Pack the command. */
233 #if defined V_PRINT_SEND_COMMANDS
234         printf("send: verse_send_g_vertex_delete_real32(node_id = %u vertex_id = %u );\n", node_id, vertex_id);
235 #endif
236         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
237         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], 0);
238         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], vertex_id);
239         buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], V_REAL32_MAX);
240         buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], V_REAL32_MAX);
241         buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], V_REAL32_MAX);
242         if(node_id == (uint32) ~0u || vertex_id == (uint32) ~0u)
243                 v_cmd_buf_set_unique_address_size(head, 11);
244         else
245                 v_cmd_buf_set_address_size(head, 11);
246         v_cmd_buf_set_size(head, buffer_pos);
247         v_noq_send_buf(v_con_get_network_queue(), head);
248 }
249
250 unsigned int v_unpack_g_vertex_set_xyz_real32(const char *buf, size_t buffer_length)
251 {
252         unsigned int buffer_pos = 0;
253         void (* func_g_vertex_set_xyz_real32)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real32 x, real32 y, real32 z);
254         VNodeID node_id;
255         VLayerID layer_id;
256         uint32 vertex_id;
257         real32 x;
258         real32 y;
259         real32 z;
260         
261         func_g_vertex_set_xyz_real32 = v_fs_get_user_func(50);
262         if(buffer_length < 10)
263                 return -1;
264         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
265         buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
266         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &vertex_id);
267         buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &x);
268         buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &y);
269         buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &z);
270 #if defined V_PRINT_RECEIVE_COMMANDS
271         if(x == V_REAL32_MAX || y == V_REAL32_MAX || z == V_REAL32_MAX)
272                 printf("receive: verse_send_g_vertex_delete_real32(node_id = %u vertex_id = %u ); callback = %p\n", node_id, vertex_id, v_fs_get_alias_user_func(50));
273         else
274                 printf("receive: verse_send_g_vertex_set_xyz_real32(node_id = %u layer_id = %u vertex_id = %u x = %f y = %f z = %f ); callback = %p\n", node_id, layer_id, vertex_id, x, y, z, v_fs_get_user_func(50));
275 #endif
276         if(x == V_REAL32_MAX || y == V_REAL32_MAX || z == V_REAL32_MAX)
277         {
278                 void (* alias_g_vertex_delete_real32)(void *user_data, VNodeID node_id, uint32 vertex_id);
279                 alias_g_vertex_delete_real32 = v_fs_get_alias_user_func(50);
280                 if(alias_g_vertex_delete_real32 != NULL)
281                         alias_g_vertex_delete_real32(v_fs_get_alias_user_data(50), node_id, vertex_id);
282                 return buffer_pos;
283         }
284         if(func_g_vertex_set_xyz_real32 != NULL)
285                 func_g_vertex_set_xyz_real32(v_fs_get_user_data(50), node_id, layer_id, vertex_id, x, y, z);
286
287         return buffer_pos;
288 }
289
290 void verse_send_g_vertex_set_xyz_real64(VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real64 x, real64 y, real64 z)
291 {
292         uint8 *buf;
293         unsigned int buffer_pos = 0;
294         VCMDBufHead *head;
295         head = v_cmd_buf_allocate(VCMDBS_80);/* Allocating the buffer */
296         buf = ((VCMDBuffer10 *)head)->buf;
297
298         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 51); /* Pack the command. */
299 #if defined V_PRINT_SEND_COMMANDS
300         printf("send: verse_send_g_vertex_set_xyz_real64(node_id = %u layer_id = %u vertex_id = %u x = %f y = %f z = %f );\n", node_id, layer_id, vertex_id, x, y, z);
301 #endif
302         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
303         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
304         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], vertex_id);
305         buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], x);
306         buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], y);
307         buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], z);
308         if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || vertex_id == (uint32) ~0u)
309                 v_cmd_buf_set_unique_address_size(head, 11);
310         else
311                 v_cmd_buf_set_address_size(head, 11);
312         v_cmd_buf_set_size(head, buffer_pos);
313         v_noq_send_buf(v_con_get_network_queue(), head);
314 }
315
316 void verse_send_g_vertex_delete_real64(VNodeID node_id, uint32 vertex_id)
317 {
318         uint8 *buf;
319         unsigned int buffer_pos = 0;
320         VCMDBufHead *head;
321         head = v_cmd_buf_allocate(VCMDBS_80);/* Allocating the buffer */
322         buf = ((VCMDBuffer10 *)head)->buf;
323
324         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 51); /* Pack the command. */
325 #if defined V_PRINT_SEND_COMMANDS
326         printf("send: verse_send_g_vertex_delete_real64(node_id = %u vertex_id = %u );\n", node_id, vertex_id);
327 #endif
328         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
329         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], 0);
330         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], vertex_id);
331         buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], V_REAL64_MAX);
332         buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], V_REAL64_MAX);
333         buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], V_REAL64_MAX);
334         if(node_id == (uint32) ~0u || vertex_id == (uint32) ~0u)
335                 v_cmd_buf_set_unique_address_size(head, 11);
336         else
337                 v_cmd_buf_set_address_size(head, 11);
338         v_cmd_buf_set_size(head, buffer_pos);
339         v_noq_send_buf(v_con_get_network_queue(), head);
340 }
341
342 unsigned int v_unpack_g_vertex_set_xyz_real64(const char *buf, size_t buffer_length)
343 {
344         unsigned int buffer_pos = 0;
345         void (* func_g_vertex_set_xyz_real64)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real64 x, real64 y, real64 z);
346         VNodeID node_id;
347         VLayerID layer_id;
348         uint32 vertex_id;
349         real64 x;
350         real64 y;
351         real64 z;
352         
353         func_g_vertex_set_xyz_real64 = v_fs_get_user_func(51);
354         if(buffer_length < 10)
355                 return -1;
356         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
357         buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
358         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &vertex_id);
359         buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &x);
360         buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &y);
361         buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &z);
362 #if defined V_PRINT_RECEIVE_COMMANDS
363         if(x == V_REAL64_MAX || y == V_REAL64_MAX || z == V_REAL64_MAX)
364                 printf("receive: verse_send_g_vertex_delete_real64(node_id = %u vertex_id = %u ); callback = %p\n", node_id, vertex_id, v_fs_get_alias_user_func(51));
365         else
366                 printf("receive: verse_send_g_vertex_set_xyz_real64(node_id = %u layer_id = %u vertex_id = %u x = %f y = %f z = %f ); callback = %p\n", node_id, layer_id, vertex_id, x, y, z, v_fs_get_user_func(51));
367 #endif
368         if(x == V_REAL64_MAX || y == V_REAL64_MAX || z == V_REAL64_MAX)
369         {
370                 void (* alias_g_vertex_delete_real64)(void *user_data, VNodeID node_id, uint32 vertex_id);
371                 alias_g_vertex_delete_real64 = v_fs_get_alias_user_func(51);
372                 if(alias_g_vertex_delete_real64 != NULL)
373                         alias_g_vertex_delete_real64(v_fs_get_alias_user_data(51), node_id, vertex_id);
374                 return buffer_pos;
375         }
376         if(func_g_vertex_set_xyz_real64 != NULL)
377                 func_g_vertex_set_xyz_real64(v_fs_get_user_data(51), node_id, layer_id, vertex_id, x, y, z);
378
379         return buffer_pos;
380 }
381
382 void verse_send_g_vertex_set_uint32(VNodeID node_id, VLayerID layer_id, uint32 vertex_id, uint32 value)
383 {
384         uint8 *buf;
385         unsigned int buffer_pos = 0;
386         VCMDBufHead *head;
387         head = v_cmd_buf_allocate(VCMDBS_20);/* Allocating the buffer */
388         buf = ((VCMDBuffer10 *)head)->buf;
389
390         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 52); /* Pack the command. */
391 #if defined V_PRINT_SEND_COMMANDS
392         printf("send: verse_send_g_vertex_set_uint32(node_id = %u layer_id = %u vertex_id = %u value = %u );\n", node_id, layer_id, vertex_id, value);
393 #endif
394         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
395         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
396         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], vertex_id);
397         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], value);
398         if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || vertex_id == (uint32) ~0u)
399                 v_cmd_buf_set_unique_address_size(head, 11);
400         else
401                 v_cmd_buf_set_address_size(head, 11);
402         v_cmd_buf_set_size(head, buffer_pos);
403         v_noq_send_buf(v_con_get_network_queue(), head);
404 }
405
406 unsigned int v_unpack_g_vertex_set_uint32(const char *buf, size_t buffer_length)
407 {
408         unsigned int buffer_pos = 0;
409         void (* func_g_vertex_set_uint32)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 vertex_id, uint32 value);
410         VNodeID node_id;
411         VLayerID layer_id;
412         uint32 vertex_id;
413         uint32 value;
414         
415         func_g_vertex_set_uint32 = v_fs_get_user_func(52);
416         if(buffer_length < 10)
417                 return -1;
418         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
419         buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
420         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &vertex_id);
421         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &value);
422 #if defined V_PRINT_RECEIVE_COMMANDS
423         printf("receive: verse_send_g_vertex_set_uint32(node_id = %u layer_id = %u vertex_id = %u value = %u ); callback = %p\n", node_id, layer_id, vertex_id, value, v_fs_get_user_func(52));
424 #endif
425         if(func_g_vertex_set_uint32 != NULL)
426                 func_g_vertex_set_uint32(v_fs_get_user_data(52), node_id, layer_id, vertex_id, value);
427
428         return buffer_pos;
429 }
430
431 void verse_send_g_vertex_set_real64(VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real64 value)
432 {
433         uint8 *buf;
434         unsigned int buffer_pos = 0;
435         VCMDBufHead *head;
436         head = v_cmd_buf_allocate(VCMDBS_20);/* Allocating the buffer */
437         buf = ((VCMDBuffer10 *)head)->buf;
438
439         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 53); /* Pack the command. */
440 #if defined V_PRINT_SEND_COMMANDS
441         printf("send: verse_send_g_vertex_set_real64(node_id = %u layer_id = %u vertex_id = %u value = %f );\n", node_id, layer_id, vertex_id, value);
442 #endif
443         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
444         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
445         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], vertex_id);
446         buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], value);
447         if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || vertex_id == (uint32) ~0u)
448                 v_cmd_buf_set_unique_address_size(head, 11);
449         else
450                 v_cmd_buf_set_address_size(head, 11);
451         v_cmd_buf_set_size(head, buffer_pos);
452         v_noq_send_buf(v_con_get_network_queue(), head);
453 }
454
455 unsigned int v_unpack_g_vertex_set_real64(const char *buf, size_t buffer_length)
456 {
457         unsigned int buffer_pos = 0;
458         void (* func_g_vertex_set_real64)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real64 value);
459         VNodeID node_id;
460         VLayerID layer_id;
461         uint32 vertex_id;
462         real64 value;
463         
464         func_g_vertex_set_real64 = v_fs_get_user_func(53);
465         if(buffer_length < 10)
466                 return -1;
467         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
468         buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
469         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &vertex_id);
470         buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &value);
471 #if defined V_PRINT_RECEIVE_COMMANDS
472         printf("receive: verse_send_g_vertex_set_real64(node_id = %u layer_id = %u vertex_id = %u value = %f ); callback = %p\n", node_id, layer_id, vertex_id, value, v_fs_get_user_func(53));
473 #endif
474         if(func_g_vertex_set_real64 != NULL)
475                 func_g_vertex_set_real64(v_fs_get_user_data(53), node_id, layer_id, vertex_id, value);
476
477         return buffer_pos;
478 }
479
480 void verse_send_g_vertex_set_real32(VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real32 value)
481 {
482         uint8 *buf;
483         unsigned int buffer_pos = 0;
484         VCMDBufHead *head;
485         head = v_cmd_buf_allocate(VCMDBS_20);/* Allocating the buffer */
486         buf = ((VCMDBuffer10 *)head)->buf;
487
488         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 54); /* Pack the command. */
489 #if defined V_PRINT_SEND_COMMANDS
490         printf("send: verse_send_g_vertex_set_real32(node_id = %u layer_id = %u vertex_id = %u value = %f );\n", node_id, layer_id, vertex_id, value);
491 #endif
492         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
493         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
494         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], vertex_id);
495         buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], value);
496         if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || vertex_id == (uint32) ~0u)
497                 v_cmd_buf_set_unique_address_size(head, 11);
498         else
499                 v_cmd_buf_set_address_size(head, 11);
500         v_cmd_buf_set_size(head, buffer_pos);
501         v_noq_send_buf(v_con_get_network_queue(), head);
502 }
503
504 unsigned int v_unpack_g_vertex_set_real32(const char *buf, size_t buffer_length)
505 {
506         unsigned int buffer_pos = 0;
507         void (* func_g_vertex_set_real32)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 vertex_id, real32 value);
508         VNodeID node_id;
509         VLayerID layer_id;
510         uint32 vertex_id;
511         real32 value;
512         
513         func_g_vertex_set_real32 = v_fs_get_user_func(54);
514         if(buffer_length < 10)
515                 return -1;
516         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
517         buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
518         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &vertex_id);
519         buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &value);
520 #if defined V_PRINT_RECEIVE_COMMANDS
521         printf("receive: verse_send_g_vertex_set_real32(node_id = %u layer_id = %u vertex_id = %u value = %f ); callback = %p\n", node_id, layer_id, vertex_id, value, v_fs_get_user_func(54));
522 #endif
523         if(func_g_vertex_set_real32 != NULL)
524                 func_g_vertex_set_real32(v_fs_get_user_data(54), node_id, layer_id, vertex_id, value);
525
526         return buffer_pos;
527 }
528
529 void verse_send_g_polygon_set_corner_uint32(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint32 v0, uint32 v1, uint32 v2, uint32 v3)
530 {
531         uint8 *buf;
532         unsigned int buffer_pos = 0;
533         VCMDBufHead *head;
534         head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
535         buf = ((VCMDBuffer10 *)head)->buf;
536
537         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 55); /* Pack the command. */
538 #if defined V_PRINT_SEND_COMMANDS
539         printf("send: verse_send_g_polygon_set_corner_uint32(node_id = %u layer_id = %u polygon_id = %u v0 = %u v1 = %u v2 = %u v3 = %u );\n", node_id, layer_id, polygon_id, v0, v1, v2, v3);
540 #endif
541         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
542         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
543         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], polygon_id);
544         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], v0);
545         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], v1);
546         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], v2);
547         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], v3);
548         if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || polygon_id == (uint32) ~0u)
549                 v_cmd_buf_set_unique_address_size(head, 11);
550         else
551                 v_cmd_buf_set_address_size(head, 11);
552         v_cmd_buf_set_size(head, buffer_pos);
553         v_noq_send_buf(v_con_get_network_queue(), head);
554 }
555
556 void verse_send_g_polygon_delete(VNodeID node_id, uint32 polygon_id)
557 {
558         uint8 *buf;
559         unsigned int buffer_pos = 0;
560         VCMDBufHead *head;
561         head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
562         buf = ((VCMDBuffer10 *)head)->buf;
563
564         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 55); /* Pack the command. */
565 #if defined V_PRINT_SEND_COMMANDS
566         printf("send: verse_send_g_polygon_delete(node_id = %u polygon_id = %u );\n", node_id, polygon_id);
567 #endif
568         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
569         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], 1);
570         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], polygon_id);
571         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], -1);
572         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], -1);
573         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], -1);
574         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], -1);
575         if(node_id == (uint32) ~0u || polygon_id == (uint32) ~0u)
576                 v_cmd_buf_set_unique_address_size(head, 11);
577         else
578                 v_cmd_buf_set_address_size(head, 11);
579         v_cmd_buf_set_size(head, buffer_pos);
580         v_noq_send_buf(v_con_get_network_queue(), head);
581 }
582
583 unsigned int v_unpack_g_polygon_set_corner_uint32(const char *buf, size_t buffer_length)
584 {
585         unsigned int buffer_pos = 0;
586         void (* func_g_polygon_set_corner_uint32)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint32 v0, uint32 v1, uint32 v2, uint32 v3);
587         VNodeID node_id;
588         VLayerID layer_id;
589         uint32 polygon_id;
590         uint32 v0;
591         uint32 v1;
592         uint32 v2;
593         uint32 v3;
594         
595         func_g_polygon_set_corner_uint32 = v_fs_get_user_func(55);
596         if(buffer_length < 10)
597                 return -1;
598         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
599         buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
600         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &polygon_id);
601         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &v0);
602         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &v1);
603         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &v2);
604         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &v3);
605 #if defined V_PRINT_RECEIVE_COMMANDS
606         if(layer_id == 1 && v0 == ~0u)
607                 printf("receive: verse_send_g_polygon_delete(node_id = %u polygon_id = %u ); callback = %p\n", node_id, polygon_id, v_fs_get_alias_user_func(55));
608         else
609                 printf("receive: verse_send_g_polygon_set_corner_uint32(node_id = %u layer_id = %u polygon_id = %u v0 = %u v1 = %u v2 = %u v3 = %u ); callback = %p\n", node_id, layer_id, polygon_id, v0, v1, v2, v3, v_fs_get_user_func(55));
610 #endif
611         if(layer_id == 1 && v0 == ~0u)
612         {
613                 void (* alias_g_polygon_delete)(void *user_data, VNodeID node_id, uint32 polygon_id);
614                 alias_g_polygon_delete = v_fs_get_alias_user_func(55);
615                 if(alias_g_polygon_delete != NULL)
616                         alias_g_polygon_delete(v_fs_get_alias_user_data(55), node_id, polygon_id);
617                 return buffer_pos;
618         }
619         if(func_g_polygon_set_corner_uint32 != NULL)
620                 func_g_polygon_set_corner_uint32(v_fs_get_user_data(55), node_id, layer_id, polygon_id, v0, v1, v2, v3);
621
622         return buffer_pos;
623 }
624
625 void verse_send_g_polygon_set_corner_real64(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real64 v0, real64 v1, real64 v2, real64 v3)
626 {
627         uint8 *buf;
628         unsigned int buffer_pos = 0;
629         VCMDBufHead *head;
630         head = v_cmd_buf_allocate(VCMDBS_80);/* Allocating the buffer */
631         buf = ((VCMDBuffer10 *)head)->buf;
632
633         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 56); /* Pack the command. */
634 #if defined V_PRINT_SEND_COMMANDS
635         printf("send: verse_send_g_polygon_set_corner_real64(node_id = %u layer_id = %u polygon_id = %u v0 = %f v1 = %f v2 = %f v3 = %f );\n", node_id, layer_id, polygon_id, v0, v1, v2, v3);
636 #endif
637         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
638         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
639         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], polygon_id);
640         buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], v0);
641         buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], v1);
642         buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], v2);
643         buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], v3);
644         if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || polygon_id == (uint32) ~0u)
645                 v_cmd_buf_set_unique_address_size(head, 11);
646         else
647                 v_cmd_buf_set_address_size(head, 11);
648         v_cmd_buf_set_size(head, buffer_pos);
649         v_noq_send_buf(v_con_get_network_queue(), head);
650 }
651
652 unsigned int v_unpack_g_polygon_set_corner_real64(const char *buf, size_t buffer_length)
653 {
654         unsigned int buffer_pos = 0;
655         void (* func_g_polygon_set_corner_real64)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real64 v0, real64 v1, real64 v2, real64 v3);
656         VNodeID node_id;
657         VLayerID layer_id;
658         uint32 polygon_id;
659         real64 v0;
660         real64 v1;
661         real64 v2;
662         real64 v3;
663         
664         func_g_polygon_set_corner_real64 = v_fs_get_user_func(56);
665         if(buffer_length < 10)
666                 return -1;
667         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
668         buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
669         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &polygon_id);
670         buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &v0);
671         buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &v1);
672         buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &v2);
673         buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &v3);
674 #if defined V_PRINT_RECEIVE_COMMANDS
675         printf("receive: verse_send_g_polygon_set_corner_real64(node_id = %u layer_id = %u polygon_id = %u v0 = %f v1 = %f v2 = %f v3 = %f ); callback = %p\n", node_id, layer_id, polygon_id, v0, v1, v2, v3, v_fs_get_user_func(56));
676 #endif
677         if(func_g_polygon_set_corner_real64 != NULL)
678                 func_g_polygon_set_corner_real64(v_fs_get_user_data(56), node_id, layer_id, polygon_id, v0, v1, v2, v3);
679
680         return buffer_pos;
681 }
682
683 void verse_send_g_polygon_set_corner_real32(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real32 v0, real32 v1, real32 v2, real32 v3)
684 {
685         uint8 *buf;
686         unsigned int buffer_pos = 0;
687         VCMDBufHead *head;
688         head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
689         buf = ((VCMDBuffer10 *)head)->buf;
690
691         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 57); /* Pack the command. */
692 #if defined V_PRINT_SEND_COMMANDS
693         printf("send: verse_send_g_polygon_set_corner_real32(node_id = %u layer_id = %u polygon_id = %u v0 = %f v1 = %f v2 = %f v3 = %f );\n", node_id, layer_id, polygon_id, v0, v1, v2, v3);
694 #endif
695         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
696         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
697         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], polygon_id);
698         buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], v0);
699         buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], v1);
700         buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], v2);
701         buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], v3);
702         if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || polygon_id == (uint32) ~0u)
703                 v_cmd_buf_set_unique_address_size(head, 11);
704         else
705                 v_cmd_buf_set_address_size(head, 11);
706         v_cmd_buf_set_size(head, buffer_pos);
707         v_noq_send_buf(v_con_get_network_queue(), head);
708 }
709
710 unsigned int v_unpack_g_polygon_set_corner_real32(const char *buf, size_t buffer_length)
711 {
712         unsigned int buffer_pos = 0;
713         void (* func_g_polygon_set_corner_real32)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real32 v0, real32 v1, real32 v2, real32 v3);
714         VNodeID node_id;
715         VLayerID layer_id;
716         uint32 polygon_id;
717         real32 v0;
718         real32 v1;
719         real32 v2;
720         real32 v3;
721         
722         func_g_polygon_set_corner_real32 = v_fs_get_user_func(57);
723         if(buffer_length < 10)
724                 return -1;
725         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
726         buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
727         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &polygon_id);
728         buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &v0);
729         buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &v1);
730         buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &v2);
731         buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &v3);
732 #if defined V_PRINT_RECEIVE_COMMANDS
733         printf("receive: verse_send_g_polygon_set_corner_real32(node_id = %u layer_id = %u polygon_id = %u v0 = %f v1 = %f v2 = %f v3 = %f ); callback = %p\n", node_id, layer_id, polygon_id, v0, v1, v2, v3, v_fs_get_user_func(57));
734 #endif
735         if(func_g_polygon_set_corner_real32 != NULL)
736                 func_g_polygon_set_corner_real32(v_fs_get_user_data(57), node_id, layer_id, polygon_id, v0, v1, v2, v3);
737
738         return buffer_pos;
739 }
740
741 void verse_send_g_polygon_set_face_uint8(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint8 value)
742 {
743         uint8 *buf;
744         unsigned int buffer_pos = 0;
745         VCMDBufHead *head;
746         head = v_cmd_buf_allocate(VCMDBS_20);/* Allocating the buffer */
747         buf = ((VCMDBuffer10 *)head)->buf;
748
749         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 58); /* Pack the command. */
750 #if defined V_PRINT_SEND_COMMANDS
751         printf("send: verse_send_g_polygon_set_face_uint8(node_id = %u layer_id = %u polygon_id = %u value = %u );\n", node_id, layer_id, polygon_id, value);
752 #endif
753         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
754         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
755         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], polygon_id);
756         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], value);
757         if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || polygon_id == (uint32) ~0u)
758                 v_cmd_buf_set_unique_address_size(head, 11);
759         else
760                 v_cmd_buf_set_address_size(head, 11);
761         v_cmd_buf_set_size(head, buffer_pos);
762         v_noq_send_buf(v_con_get_network_queue(), head);
763 }
764
765 unsigned int v_unpack_g_polygon_set_face_uint8(const char *buf, size_t buffer_length)
766 {
767         unsigned int buffer_pos = 0;
768         void (* func_g_polygon_set_face_uint8)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint8 value);
769         VNodeID node_id;
770         VLayerID layer_id;
771         uint32 polygon_id;
772         uint8 value;
773         
774         func_g_polygon_set_face_uint8 = v_fs_get_user_func(58);
775         if(buffer_length < 10)
776                 return -1;
777         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
778         buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
779         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &polygon_id);
780         buffer_pos += vnp_raw_unpack_uint8(&buf[buffer_pos], &value);
781 #if defined V_PRINT_RECEIVE_COMMANDS
782         printf("receive: verse_send_g_polygon_set_face_uint8(node_id = %u layer_id = %u polygon_id = %u value = %u ); callback = %p\n", node_id, layer_id, polygon_id, value, v_fs_get_user_func(58));
783 #endif
784         if(func_g_polygon_set_face_uint8 != NULL)
785                 func_g_polygon_set_face_uint8(v_fs_get_user_data(58), node_id, layer_id, polygon_id, value);
786
787         return buffer_pos;
788 }
789
790 void verse_send_g_polygon_set_face_uint32(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint32 value)
791 {
792         uint8 *buf;
793         unsigned int buffer_pos = 0;
794         VCMDBufHead *head;
795         head = v_cmd_buf_allocate(VCMDBS_20);/* Allocating the buffer */
796         buf = ((VCMDBuffer10 *)head)->buf;
797
798         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 59); /* Pack the command. */
799 #if defined V_PRINT_SEND_COMMANDS
800         printf("send: verse_send_g_polygon_set_face_uint32(node_id = %u layer_id = %u polygon_id = %u value = %u );\n", node_id, layer_id, polygon_id, value);
801 #endif
802         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
803         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
804         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], polygon_id);
805         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], value);
806         if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || polygon_id == (uint32) ~0u)
807                 v_cmd_buf_set_unique_address_size(head, 11);
808         else
809                 v_cmd_buf_set_address_size(head, 11);
810         v_cmd_buf_set_size(head, buffer_pos);
811         v_noq_send_buf(v_con_get_network_queue(), head);
812 }
813
814 unsigned int v_unpack_g_polygon_set_face_uint32(const char *buf, size_t buffer_length)
815 {
816         unsigned int buffer_pos = 0;
817         void (* func_g_polygon_set_face_uint32)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, uint32 value);
818         VNodeID node_id;
819         VLayerID layer_id;
820         uint32 polygon_id;
821         uint32 value;
822         
823         func_g_polygon_set_face_uint32 = v_fs_get_user_func(59);
824         if(buffer_length < 10)
825                 return -1;
826         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
827         buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
828         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &polygon_id);
829         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &value);
830 #if defined V_PRINT_RECEIVE_COMMANDS
831         printf("receive: verse_send_g_polygon_set_face_uint32(node_id = %u layer_id = %u polygon_id = %u value = %u ); callback = %p\n", node_id, layer_id, polygon_id, value, v_fs_get_user_func(59));
832 #endif
833         if(func_g_polygon_set_face_uint32 != NULL)
834                 func_g_polygon_set_face_uint32(v_fs_get_user_data(59), node_id, layer_id, polygon_id, value);
835
836         return buffer_pos;
837 }
838
839 void verse_send_g_polygon_set_face_real64(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real64 value)
840 {
841         uint8 *buf;
842         unsigned int buffer_pos = 0;
843         VCMDBufHead *head;
844         head = v_cmd_buf_allocate(VCMDBS_20);/* Allocating the buffer */
845         buf = ((VCMDBuffer10 *)head)->buf;
846
847         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 60); /* Pack the command. */
848 #if defined V_PRINT_SEND_COMMANDS
849         printf("send: verse_send_g_polygon_set_face_real64(node_id = %u layer_id = %u polygon_id = %u value = %f );\n", node_id, layer_id, polygon_id, value);
850 #endif
851         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
852         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
853         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], polygon_id);
854         buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], value);
855         if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || polygon_id == (uint32) ~0u)
856                 v_cmd_buf_set_unique_address_size(head, 11);
857         else
858                 v_cmd_buf_set_address_size(head, 11);
859         v_cmd_buf_set_size(head, buffer_pos);
860         v_noq_send_buf(v_con_get_network_queue(), head);
861 }
862
863 unsigned int v_unpack_g_polygon_set_face_real64(const char *buf, size_t buffer_length)
864 {
865         unsigned int buffer_pos = 0;
866         void (* func_g_polygon_set_face_real64)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real64 value);
867         VNodeID node_id;
868         VLayerID layer_id;
869         uint32 polygon_id;
870         real64 value;
871         
872         func_g_polygon_set_face_real64 = v_fs_get_user_func(60);
873         if(buffer_length < 10)
874                 return -1;
875         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
876         buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
877         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &polygon_id);
878         buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &value);
879 #if defined V_PRINT_RECEIVE_COMMANDS
880         printf("receive: verse_send_g_polygon_set_face_real64(node_id = %u layer_id = %u polygon_id = %u value = %f ); callback = %p\n", node_id, layer_id, polygon_id, value, v_fs_get_user_func(60));
881 #endif
882         if(func_g_polygon_set_face_real64 != NULL)
883                 func_g_polygon_set_face_real64(v_fs_get_user_data(60), node_id, layer_id, polygon_id, value);
884
885         return buffer_pos;
886 }
887
888 void verse_send_g_polygon_set_face_real32(VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real32 value)
889 {
890         uint8 *buf;
891         unsigned int buffer_pos = 0;
892         VCMDBufHead *head;
893         head = v_cmd_buf_allocate(VCMDBS_20);/* Allocating the buffer */
894         buf = ((VCMDBuffer10 *)head)->buf;
895
896         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 61); /* Pack the command. */
897 #if defined V_PRINT_SEND_COMMANDS
898         printf("send: verse_send_g_polygon_set_face_real32(node_id = %u layer_id = %u polygon_id = %u value = %f );\n", node_id, layer_id, polygon_id, value);
899 #endif
900         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
901         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], layer_id);
902         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], polygon_id);
903         buffer_pos += vnp_raw_pack_real32(&buf[buffer_pos], value);
904         if(node_id == (uint32) ~0u || layer_id == (uint16) ~0u || polygon_id == (uint32) ~0u)
905                 v_cmd_buf_set_unique_address_size(head, 11);
906         else
907                 v_cmd_buf_set_address_size(head, 11);
908         v_cmd_buf_set_size(head, buffer_pos);
909         v_noq_send_buf(v_con_get_network_queue(), head);
910 }
911
912 unsigned int v_unpack_g_polygon_set_face_real32(const char *buf, size_t buffer_length)
913 {
914         unsigned int buffer_pos = 0;
915         void (* func_g_polygon_set_face_real32)(void *user_data, VNodeID node_id, VLayerID layer_id, uint32 polygon_id, real32 value);
916         VNodeID node_id;
917         VLayerID layer_id;
918         uint32 polygon_id;
919         real32 value;
920         
921         func_g_polygon_set_face_real32 = v_fs_get_user_func(61);
922         if(buffer_length < 10)
923                 return -1;
924         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
925         buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &layer_id);
926         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &polygon_id);
927         buffer_pos += vnp_raw_unpack_real32(&buf[buffer_pos], &value);
928 #if defined V_PRINT_RECEIVE_COMMANDS
929         printf("receive: verse_send_g_polygon_set_face_real32(node_id = %u layer_id = %u polygon_id = %u value = %f ); callback = %p\n", node_id, layer_id, polygon_id, value, v_fs_get_user_func(61));
930 #endif
931         if(func_g_polygon_set_face_real32 != NULL)
932                 func_g_polygon_set_face_real32(v_fs_get_user_data(61), node_id, layer_id, polygon_id, value);
933
934         return buffer_pos;
935 }
936
937 void verse_send_g_crease_set_vertex(VNodeID node_id, const char *layer, uint32 def_crease)
938 {
939         uint8 *buf;
940         unsigned int buffer_pos = 0;
941         VCMDBufHead *head;
942         head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
943         buf = ((VCMDBuffer10 *)head)->buf;
944
945         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 62); /* Pack the command. */
946 #if defined V_PRINT_SEND_COMMANDS
947         printf("send: verse_send_g_crease_set_vertex(node_id = %u layer = %s def_crease = %u );\n", node_id, layer, def_crease);
948 #endif
949         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
950         buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], layer, 16);
951         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], def_crease);
952         if(node_id == (uint32) ~0u)
953                 v_cmd_buf_set_unique_address_size(head, 5);
954         else
955                 v_cmd_buf_set_address_size(head, 5);
956         v_cmd_buf_set_size(head, buffer_pos);
957         v_noq_send_buf(v_con_get_network_queue(), head);
958 }
959
960 unsigned int v_unpack_g_crease_set_vertex(const char *buf, size_t buffer_length)
961 {
962         unsigned int buffer_pos = 0;
963         void (* func_g_crease_set_vertex)(void *user_data, VNodeID node_id, const char *layer, uint32 def_crease);
964         VNodeID node_id;
965         char layer[16];
966         uint32 def_crease;
967         
968         func_g_crease_set_vertex = v_fs_get_user_func(62);
969         if(buffer_length < 4)
970                 return -1;
971         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
972         buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], layer, 16, buffer_length - buffer_pos);
973         if(buffer_length < 4 + buffer_pos)
974                 return -1;
975         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &def_crease);
976 #if defined V_PRINT_RECEIVE_COMMANDS
977         printf("receive: verse_send_g_crease_set_vertex(node_id = %u layer = %s def_crease = %u ); callback = %p\n", node_id, layer, def_crease, v_fs_get_user_func(62));
978 #endif
979         if(func_g_crease_set_vertex != NULL)
980                 func_g_crease_set_vertex(v_fs_get_user_data(62), node_id, layer, def_crease);
981
982         return buffer_pos;
983 }
984
985 void verse_send_g_crease_set_edge(VNodeID node_id, const char *layer, uint32 def_crease)
986 {
987         uint8 *buf;
988         unsigned int buffer_pos = 0;
989         VCMDBufHead *head;
990         head = v_cmd_buf_allocate(VCMDBS_30);/* Allocating the buffer */
991         buf = ((VCMDBuffer10 *)head)->buf;
992
993         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 63); /* Pack the command. */
994 #if defined V_PRINT_SEND_COMMANDS
995         printf("send: verse_send_g_crease_set_edge(node_id = %u layer = %s def_crease = %u );\n", node_id, layer, def_crease);
996 #endif
997         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
998         buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], layer, 16);
999         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], def_crease);
1000         if(node_id == (uint32) ~0u)
1001                 v_cmd_buf_set_unique_address_size(head, 5);
1002         else
1003                 v_cmd_buf_set_address_size(head, 5);
1004         v_cmd_buf_set_size(head, buffer_pos);
1005         v_noq_send_buf(v_con_get_network_queue(), head);
1006 }
1007
1008 unsigned int v_unpack_g_crease_set_edge(const char *buf, size_t buffer_length)
1009 {
1010         unsigned int buffer_pos = 0;
1011         void (* func_g_crease_set_edge)(void *user_data, VNodeID node_id, const char *layer, uint32 def_crease);
1012         VNodeID node_id;
1013         char layer[16];
1014         uint32 def_crease;
1015         
1016         func_g_crease_set_edge = v_fs_get_user_func(63);
1017         if(buffer_length < 4)
1018                 return -1;
1019         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
1020         buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], layer, 16, buffer_length - buffer_pos);
1021         if(buffer_length < 4 + buffer_pos)
1022                 return -1;
1023         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &def_crease);
1024 #if defined V_PRINT_RECEIVE_COMMANDS
1025         printf("receive: verse_send_g_crease_set_edge(node_id = %u layer = %s def_crease = %u ); callback = %p\n", node_id, layer, def_crease, v_fs_get_user_func(63));
1026 #endif
1027         if(func_g_crease_set_edge != NULL)
1028                 func_g_crease_set_edge(v_fs_get_user_data(63), node_id, layer, def_crease);
1029
1030         return buffer_pos;
1031 }
1032
1033 void verse_send_g_bone_create(VNodeID node_id, uint16 bone_id, const char *weight, const char *reference, uint16 parent, real64 pos_x, real64 pos_y, real64 pos_z, const char *position_label, const char *rotation_label, const char *scale_label)
1034 {
1035         uint8 *buf;
1036         unsigned int buffer_pos = 0;
1037         VCMDBufHead *head;
1038         head = v_cmd_buf_allocate(VCMDBS_160);/* Allocating the buffer */
1039         buf = ((VCMDBuffer10 *)head)->buf;
1040
1041         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 64); /* Pack the command. */
1042 #if defined V_PRINT_SEND_COMMANDS
1043         printf("send: verse_send_g_bone_create(node_id = %u bone_id = %u weight = %s reference = %s parent = %u pos_x = %f pos_y = %f pos_z = %f position_label = %s rotation_label = %s scale_label = %s );\n", node_id, bone_id, weight, reference, parent, pos_x, pos_y, pos_z, position_label, rotation_label, scale_label);
1044 #endif
1045         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
1046         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], bone_id);
1047         buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], weight, 16);
1048         buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], reference, 16);
1049         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], parent);
1050         buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], pos_x);
1051         buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], pos_y);
1052         buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], pos_z);
1053         buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], position_label, 16);
1054         buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], rotation_label, 16);
1055         buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], scale_label, 16);
1056         if(node_id == (uint32) ~0u || bone_id == (uint16) ~0u)
1057                 v_cmd_buf_set_unique_address_size(head, 7);
1058         else
1059                 v_cmd_buf_set_address_size(head, 7);
1060         v_cmd_buf_set_size(head, buffer_pos);
1061         v_noq_send_buf(v_con_get_network_queue(), head);
1062 }
1063
1064 void verse_send_g_bone_destroy(VNodeID node_id, uint16 bone_id)
1065 {
1066         uint8 *buf;
1067         unsigned int buffer_pos = 0;
1068         VCMDBufHead *head;
1069         head = v_cmd_buf_allocate(VCMDBS_160);/* Allocating the buffer */
1070         buf = ((VCMDBuffer10 *)head)->buf;
1071
1072         buffer_pos += vnp_raw_pack_uint8(&buf[buffer_pos], 64); /* Pack the command. */
1073 #if defined V_PRINT_SEND_COMMANDS
1074         printf("send: verse_send_g_bone_destroy(node_id = %u bone_id = %u );\n", node_id, bone_id);
1075 #endif
1076         buffer_pos += vnp_raw_pack_uint32(&buf[buffer_pos], node_id);
1077         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], bone_id);
1078         buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
1079         buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
1080         buffer_pos += vnp_raw_pack_uint16(&buf[buffer_pos], -1);
1081         buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], V_REAL64_MAX);
1082         buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], V_REAL64_MAX);
1083         buffer_pos += vnp_raw_pack_real64(&buf[buffer_pos], V_REAL64_MAX);
1084         buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
1085         buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
1086         buffer_pos += vnp_raw_pack_string(&buf[buffer_pos], NULL, 16);
1087         if(node_id == (uint32) ~0u || bone_id == (uint16) ~0u)
1088                 v_cmd_buf_set_unique_address_size(head, 7);
1089         else
1090                 v_cmd_buf_set_address_size(head, 7);
1091         v_cmd_buf_set_size(head, buffer_pos);
1092         v_noq_send_buf(v_con_get_network_queue(), head);
1093 }
1094
1095 unsigned int v_unpack_g_bone_create(const char *buf, size_t buffer_length)
1096 {
1097         unsigned int buffer_pos = 0;
1098         void (* func_g_bone_create)(void *user_data, VNodeID node_id, uint16 bone_id, const char *weight, const char *reference, uint16 parent, real64 pos_x, real64 pos_y, real64 pos_z, const char *position_label, const char *rotation_label, const char *scale_label);
1099         VNodeID node_id;
1100         uint16 bone_id;
1101         char weight[16];
1102         char reference[16];
1103         uint16 parent;
1104         real64 pos_x;
1105         real64 pos_y;
1106         real64 pos_z;
1107         char position_label[16];
1108         char rotation_label[16];
1109         char scale_label[16];
1110         
1111         func_g_bone_create = v_fs_get_user_func(64);
1112         if(buffer_length < 6)
1113                 return -1;
1114         buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &node_id);
1115         buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &bone_id);
1116         buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], weight, 16, buffer_length - buffer_pos);
1117         if(buffer_length < 0 + buffer_pos)
1118                 return -1;
1119         buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], reference, 16, buffer_length - buffer_pos);
1120         if(buffer_length < 26 + buffer_pos)
1121                 return -1;
1122         buffer_pos += vnp_raw_unpack_uint16(&buf[buffer_pos], &parent);
1123         buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &pos_x);
1124         buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &pos_y);
1125         buffer_pos += vnp_raw_unpack_real64(&buf[buffer_pos], &pos_z);
1126         buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], position_label, 16, buffer_length - buffer_pos);
1127         if(buffer_length < 0 + buffer_pos)
1128                 return -1;
1129         buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], rotation_label, 16, buffer_length - buffer_pos);
1130         if(buffer_length < 0 + buffer_pos)
1131                 return -1;
1132         buffer_pos += vnp_raw_unpack_string(&buf[buffer_pos], scale_label, 16, buffer_length - buffer_pos);
1133 #if defined V_PRINT_RECEIVE_COMMANDS
1134         if(weight[0] == 0)
1135                 printf("receive: verse_send_g_bone_destroy(node_id = %u bone_id = %u ); callback = %p\n", node_id, bone_id, v_fs_get_alias_user_func(64));
1136         else
1137                 printf("receive: verse_send_g_bone_create(node_id = %u bone_id = %u weight = %s reference = %s parent = %u pos_x = %f pos_y = %f pos_z = %f position_label = %s rotation_label = %s scale_label = %s ); callback = %p\n", node_id, bone_id, weight, reference, parent, pos_x, pos_y, pos_z, position_label, rotation_label, scale_label, v_fs_get_user_func(64));
1138 #endif
1139         if(weight[0] == 0)
1140         {
1141                 void (* alias_g_bone_destroy)(void *user_data, VNodeID node_id, uint16 bone_id);
1142                 alias_g_bone_destroy = v_fs_get_alias_user_func(64);
1143                 if(alias_g_bone_destroy != NULL)
1144                         alias_g_bone_destroy(v_fs_get_alias_user_data(64), node_id, bone_id);
1145                 return buffer_pos;
1146         }
1147         if(func_g_bone_create != NULL)
1148                 func_g_bone_create(v_fs_get_user_data(64), node_id, bone_id, weight, reference, parent, pos_x, pos_y, pos_z, position_label, rotation_label, scale_label);
1149
1150         return buffer_pos;
1151 }
1152
1153 #endif
1154