This commit was manufactured by cvs2svn to create tag 'buildscript'.
[IRC.git] / Robust / src / Runtime / DSTM / interface / plookup.c
diff --git a/Robust/src/Runtime/DSTM/interface/plookup.c b/Robust/src/Runtime/DSTM/interface/plookup.c
deleted file mode 100644 (file)
index 07a19fd..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-#include "plookup.h"
-extern int classsize[];
-
-plistnode_t *pCreate(int objects) {
-       plistnode_t *pile;
-       
-       //Create main structure
-       if((pile = calloc(1, sizeof(plistnode_t))) == NULL) {
-               printf("Calloc error %s %d\n", __FILE__, __LINE__);
-               return NULL;
-       }       
-       pile->next = NULL;
-       if ((pile->oidmod = calloc(objects, sizeof(unsigned int))) == NULL) {
-               printf("Calloc error %s %d\n", __FILE__, __LINE__);
-               return NULL;
-       }
-       if ((pile->oidread = calloc(objects, sizeof(unsigned int))) == NULL) {
-               printf("Calloc error %s %d\n", __FILE__, __LINE__);
-               return NULL;
-       }
-       pile->nummod = pile->numread = pile->sum_bytes = 0;
-       if ((pile->objread = calloc(objects, sizeof(int) + sizeof(short))) == NULL) {
-               printf("Calloc error %s %d\n", __FILE__, __LINE__);
-               return NULL;
-       }
-       pile->objmodified = NULL;
-       pile->nummod = pile->numread = pile->sum_bytes = 0;
-
-       return pile;
-}
-
-plistnode_t *pInsert(plistnode_t *pile, objheader_t *headeraddr, unsigned int mid, int num_objs) {
-       plistnode_t *ptr, *tmp;
-       int found = 0, offset;
-
-       tmp = pile;
-       //Add oid into a machine that is a part of the pile linked list structure
-       while(tmp != NULL) {
-               if (tmp->mid == mid) {
-                       if (STATUS(headeraddr) & DIRTY) {
-                               tmp->oidmod[tmp->nummod] = OID(headeraddr);
-                               tmp->nummod = tmp->nummod + 1;
-                               tmp->sum_bytes += sizeof(objheader_t) + classsize[TYPE(headeraddr)];
-                       } else {
-                               tmp->oidread[tmp->numread] = OID(headeraddr);
-                               offset = (sizeof(unsigned int) + sizeof(short)) * tmp->numread;
-                               *((unsigned int *)(tmp->objread + offset))=OID(headeraddr);
-                               offset += sizeof(unsigned int);
-                               memcpy(tmp->objread + offset, &headeraddr->version, sizeof(short));
-                               tmp->numread = tmp->numread + 1;
-                       //      printf("DEBUG->pInsert() No of obj read = %d\n", tmp->numread);
-                       }
-                       found = 1;
-                       break;
-               }
-               tmp = tmp->next;
-       }
-       //Add oid for any new machine 
-       if (!found) {
-               if((ptr = pCreate(num_objs)) == NULL) {
-                       return NULL;
-               }
-               ptr->mid = mid;
-               if (STATUS(headeraddr) & DIRTY) {
-                       ptr->oidmod[ptr->nummod] = OID(headeraddr);
-                       ptr->nummod = ptr->nummod + 1;
-                       ptr->sum_bytes += sizeof(objheader_t) + classsize[TYPE(headeraddr)];
-               } else {
-                       ptr->oidread[ptr->numread] = OID(headeraddr);
-                       *((unsigned int *)ptr->objread)=OID(headeraddr);
-                       memcpy(ptr->objread + sizeof(unsigned int), &headeraddr->version, sizeof(short));
-                       ptr->numread = ptr->numread + 1;
-               }
-               ptr->next = pile;
-               pile = ptr;
-       }
-
-       return pile;
-}
-
-//Count the number of machine groups
-int pCount(plistnode_t *pile) {
-       plistnode_t *tmp;
-       int pcount = 0;
-       tmp = pile;
-       while(tmp != NULL) {
-               pcount++;
-               tmp = tmp->next;
-       }
-       return pcount;
-}
-
-//Make a list of mid's for each machine group
-int pListMid(plistnode_t *pile, unsigned int *list) {
-        int i = 0;
-       plistnode_t *tmp;
-       tmp = pile;
-       while (tmp != NULL) {
-               list[i] = tmp->mid;
-               i++;
-               tmp = tmp->next;
-       }
-       return 0;
-}
-
-//Delete the entire pile
-void pDelete(plistnode_t *pile) {
-       plistnode_t *next, *tmp;
-       tmp = pile;
-       while(tmp != NULL) {
-               next = tmp->next;
-               free(tmp->oidmod);
-               free(tmp->oidread);
-               free(tmp->objread);
-               free(tmp);
-               tmp = next;
-       }
-       return;
-}