int send_create_vert(int i) { send_event(EVENT_CREATE_VERT); send_index(i); return create_vert(i); }
Dllist* create_rd_data_struct() { Dllist* dll_lnk = create_dll(); for(int i=0; i<NB_VERTEX; i++) { int coords[2] = { randn( minX+margin, maxX-margin ), randn( minY+margin, maxY-margin ) }; Vertex *new_vert = create_vert( coords ); add_end_dll( dll_lnk, new_vert, STD ); } dll_lnk->up2date[STD] = 1; return dll_lnk; }
Dllist* create_dll(void) { Dllist *new_dll = (Dllist *) malloc(sizeof(Dllist)); if (new_dll != NULL) { int coords[DIM] = {0}; new_dll->root = create_vert(coords); for(int i=0; i<NBL; i++) { new_dll->root->links[i][BWD] = new_dll->root; new_dll->root->links[i][FWD] = new_dll->root; new_dll->length[i] = 0; new_dll->up2date[i] = 0; } } return new_dll; }
void recv_create_vert(void) { int i = recv_index(); create_vert(i); }