00001 /* /home/jim/cvs/PROTO/src/SUM/sum_init.c 00002 */ 00003 /* This function is called by sum_svc whenever it starts up. 00004 * This initializes the PART, PEUID and PADATA structures from their 00005 * corresponding database tables. 00006 * Returns non-0 on error. 00007 */ 00008 #include <SUM.h> 00009 #include <sum_rpc.h> 00010 00011 /* Must decl functions */ 00012 int DS_PavailRequest2(); 00013 00014 int SUM_Init(char *dbname) 00015 { 00016 00017 DS_ConnectDB(dbname); /* connect to DB for init */ 00018 if(DS_PallocClean()) /* delete old DARW & DARO in sum_partn_alloc */ 00019 return(1); /* also deletes all entries in sum_open */ 00020 if(DS_PavailRequest2()) 00021 return(1); 00022 /************* OLD stuff now obsolete **** 00023 if(DS_PavailRequest()) 00024 return(1); 00025 if(DS_OpenPeRequest()) 00026 return(1); 00027 if(DS_PallocRequest()) 00028 return(1); 00029 *************/ 00030 return(0); 00031 } 00032