|
|
1.1 ! root 1: .th OPENR AM 9/13/77 ! 2: .sh NAME ! 3: openr - open a relation ! 4: .sh SYNOPSIS ! 5: .nf ! 6: openr(d, mode, uniqid) ! 7: struct descriptor *d; ! 8: int mode; ! 9: char uniqid[MAXNAME]; ! 10: .fi ! 11: .sh DESCRIPTION ! 12: OPENR is used to open a relation and set up a descriptor ! 13: for the relation. ! 14: The descriptor is used by all of the ! 15: access method functions and contains a template of the relation. ! 16: The parameter UNIQID is the unique relation id which is to ! 17: be opened. ! 18: OPENR will search the relation relation and find the tuple which describes ! 19: the desired relation. ! 20: OPENR will first search for a relation named by UNIQID and ! 21: owned by the current user. ! 22: If tha fails, ! 23: OPENR will search for a relation with the same name ! 24: but owned by the data base administrator. ! 25: The calling program may determine who the relation owner is by ! 26: examining D->RELOWNER in the returned descriptor. ! 27: OPENR will also search the attribute ! 28: relation and gather information necessary to create a template ! 29: of the relation. ! 30: Finally, OPENR will do the UNIX open on the ! 31: file which contains the relation. ! 32: .sp ! 33: If MODE equals 0, the relation will be opened as a read only file, ! 34: if MODE equals 1 or 2, the relation will be opened as a read/write file. ! 35: If MODE is specified as -1 then the relation will be looked ! 36: up in the relation relation and that part ! 37: of the descriptor will be filled in. ! 38: However, the relation will not ! 39: be opened and the attribute template will not be set in the ! 40: descriptor. ! 41: OPENR may be called with MODE set to -2, ! 42: which will fill in the attribute template and open the relation as read only. ! 43: Calling OPENR twice, first with MODE set to -1, the second time ! 44: with MODE set to -2, ! 45: is equivalent to calling OPENR once with MODE set to 0. ! 46: Using mode -3 is the same as mode ! 47: -2 except that the relation is open for writing. ! 48: Modes -4 and -5 both assume the relation has been ! 49: opened previously and the descriptor is complete. ! 50: Mode -4 will reopen the unix file for reading, ! 51: and mode -5 will reopen the unix file for writing. ! 52: .sh DIAGNOSTICS ! 53: .nf ! 54: AMOPNVIEW_ERR -- attempt to open a view for reading or writing. ! 55: AMFIND_ERR -- unidentifiable storage structure for relation or attribute ! 56: relations ! 57: AMNOATTS_ERR -- error in filling attribute template ! 58: AMNOFILE_ERR -- no UNIX file corresponding to relation ! 59: AMWRITE_ERR -- pageflush failure ! 60: AMREAD_ERR -- get_page failure ! 61: 0 -- success ! 62: 1 -- no such relation ! 63: .fi ! 64: .sh "TRACE FLAGS" ! 65: 21.0, 21.4 ! 66: .sh "SEE ALSO" ! 67: closer, get_attuples, get_reltuple, inpcloser, noclose
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.