source: CIVL/include/impls/bundle.cvl@ 4e993a9

main test-branch
Last change on this file since 4e993a9 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 795 bytes
Line 
1/* This file completes the definitions of some types and functions
2 * for bundle, which are declared in bundle.cvh.
3 */
4
5#ifndef __CIVLC_BUNDLE__
6#define __CIVLC_BUNDLE__
7#include<bundle.cvh>
8#include<pointer.cvh>
9
10$atomic_f void $bundle_unpack_apply($bundle data, void *buf, $operation op, int count, void *result) {
11 $assert(buf != result, "Input pointer %p and output pointer %p shall not point to the same memory "
12 "location.", buf, result);
13 if (count > 0) {
14 size_t type_size;
15 type_size = $bundle_size(data) / count;
16
17 $bundle_unpack(data, result);
18 for (int i = 0; i < count; i++) {
19 void * oprand0 = $pointer_add(result, i, type_size);
20 void * oprand1 = $pointer_add(buf, i, type_size);
21
22 $apply(oprand0, op, oprand1, oprand0);
23 }
24 }
25}
26
27#endif
Note: See TracBrowser for help on using the repository browser.