1: # include "../ingres.h" 2: # include "../aux.h" 3: # include "../access.h" 4: 5: /* 6: ** CLOSECATALOG -- close system catalog 7: ** 8: ** This routine closes the sysetm relations opened by calls 9: ** to opencatalog. 10: ** 11: ** The 'Desxx' struct defines which relations will be closed 12: ** in this manner and is defined in .../source/aux.h. 13: ** 14: ** The actual desxx structure definition is in the file 15: ** 16: ** catalog_desc.c 17: ** 18: ** which defines which relations can be cached and if any 19: ** alias descriptors exist for the relations. That file 20: ** can be redefined to include various caching. 21: ** 22: ** 23: ** Parameters: 24: ** really - whether to actually close the relations 25: ** or just update and flush them. 26: ** 27: ** Returns: 28: ** none 29: ** 30: ** Side Effects: 31: ** A relation is (may be) closed and its pages flushed 32: ** 33: ** Requires: 34: ** Desxx -- a structure which defines the relations which 35: ** should be closed. A default structure is defined in 36: ** catalog_desc.c 37: ** 38: ** Called By: 39: ** most dbu routines. 40: ** qrymod. 41: ** parser. 42: ** decomp. 43: ** creatdb. 44: ** 45: ** Trace Flags: 46: ** none 47: ** 48: ** Diagnostics: 49: ** none 50: ** 51: ** Syserrs: 52: ** 53: ** History: 54: ** 1/30/79 (rse) -- closecat(really) needed to clear relopn 55: ** 12/12/78 (rse) -- Split from opencatalog.c 56: */ 57: 58: 59: closecatalog(really) 60: int really; 61: { 62: register struct desxx *p; 63: register int r; 64: extern struct desxx Desxx[]; 65: 66: r = really; 67: 68: for (p = Desxx; p->cach_relname; p++) 69: if (r && !p->cach_alias) 70: { 71: if (closer(p->cach_desc) < 0) 72: syserr("closecat %s", p->cach_relname); 73: } 74: else 75: { 76: if (noclose(p->cach_desc) < 0) 77: syserr("closecat %s", p->cach_relname); 78: if (r) 79: p->cach_desc->relopn = 0; 80: } 81: }