source: CIVL/include/headers/bundle.cvh@ 1aaefd4

main test-branch
Last change on this file since 1aaefd4 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: 1.7 KB
RevLine 
[aad342c]1/* This header file contains the data types and function prototypes for bundle.
2 */
3
4#ifndef _BUNDLE_
5#define _BUNDLE_
6
7/* includes civlc.cvh because this library references $operation */
8#include<op.h>
9#pragma CIVL ACSL
10/* *********************** Types *********************** */
11
12/* A system type for bundling any slice of memory into
13 * a single value. */
14typedef struct _bundle $bundle;
15
16/* *********************** Functions *********************** */
17
18/* Returns the size of the given bundle b. */
19/*@ depends_on \nothing;
20 @ executes_when \true;
21 @*/
22$system int $bundle_size($bundle b);
23
24/* Creates a bundle from the memory region specified by
25 * ptr and size, copying the data into the new bundle */
26/*@ depends_on \access(ptr);
27 @ executes_when \true;
28 @*/
29$system $bundle $bundle_pack(const void *ptr, int size);
30
31/* Copies the data out of the bundle into the region specified */
32/*@ depends_on \access(ptr);
33 @ executes_when \true;
34 @*/
35$system void $bundle_unpack($bundle bundle, void *ptr);
36
37/* Unpacks the bundle and applies the specified operation on the content of the bundle.
38 * For every binary operation defined in &operation, the content of the bundle will be used as the left operand
39 * and buf will be used as the right operand. The result of the operation is stored in result once is it is done.
40 *
41 * Requires buf and result are pointers-to-T;
42 * the bundle--data contains sizeof(T) * count amount of objects;
43 * \valid(buf + (0 .. count-1) && \valid(result + (0 .. count-1);
44 * \separate(buf, result);
45 */
46/*@ depends_on \access(buf);
47 @ depends_on \access(result);
48 @ executes_when \true;
49 @*/
50$atomic_f void $bundle_unpack_apply($bundle data, void *buf, $operation op, int count, void *result);
51
52#endif
Note: See TracBrowser for help on using the repository browser.