/* File pazhsp.c The paz HSP-demo */ #include #include #include "pazpl5.h" extern int deal_with( int * client, int me, int total ); extern int replying, view_id, total_views; #define use_up(type, name) { \ int i; \ for (i=0; 1; i++) { \ if(malloc(sizeof(type))==NULL) \ printf ( "Failed to malloc %d'th %s, size %d\n", i, name, sizeof(type)); \ } \ } int main ( int argc, char *argv[]) { int client=0; int me, total; dN_mynode (&me); dN_nodes ( &total); view_id=me-2; total_views=total-2; replying=(me==2); /* use_up(VERTEX, "VERTEX") ; */ while (1) { client=0; if (deal_with ( &client, me, total )) ack_host(); } }