|
|
C source code exampleThis is a simple Ara agent written in the C programming language. It will migrate to a place named thor (simply a machine name here) and print a message there:
#include <stdio.h>
#include <araMace.h>
int
main(int argc, char* argv[])
{
char homeString[ARA_PLACENAME_SPACE];
Ara_PlaceName home = Ara_Here(), destination = Ara_PlaceNameCreate("thor");
Ara_Go(ARA_ID_NONE, destination, ARA_ALLOWANCE_NONE, ARA_ALLOWANCE_NONE);
Ara_PlaceNamePrint(home, homeString);
printf("Hello at thor, I've come from %s!\n", homeString);
Ara_PlaceNameDelete(home);
Ara_PlaceNameDelete(destination);
Ara_Exit(0);
/* Never reached */
return -1;
}
copyright © 1997 The University of Kaiserslautern. Holger Peine |