dol: initial dol commit
[jump.git] / dol / examples / example1 / src / printarray.c
1 #include <stdio.h>
2
3 #include "printarray.h"
4
5 void printarray_init(DOLProcess *p) {
6     p->local->index = 0;
7 }
8
9 int printarray_fire(DOLProcess *p) {
10
11   int len;
12   int * array;
13   DOL_read((void*)PORT_IN1, &len, sizeof(int), p); 
14   DOL_read((void*)PORT_IN2, array, sizeof(int)*len, p); 
15
16   printf("sorted output\n");
17   for(i=0;i<LENGTH;i++)
18     printf("%d ", array[i]);
19   printf("\n");
20
21   free(array);
22   DOL_detach(p);
23   return -1;
24 }
25