|
|
1.1 ! root 1: #include "parms.h" ! 2: #include "structs.h" ! 3: ! 4: #ifdef RCSIDENT ! 5: static char rcsid[] = "$Header: permit.c,v 1.7 85/01/18 15:34:30 notes Rel $"; ! 6: #endif RCSIDENT ! 7: ! 8: ! 9: /* ! 10: * this package contains routines which tell whether a person is ! 11: * allowed various priviledges in the current notefile. ! 12: * ! 13: * It is assumed that the notefile descriptor in the notefile base ! 14: * is up-to-date. No disk I/O is performed to get a more recent copy ! 15: * of the descriptor. ! 16: * ! 17: * original author : Ray Essick may 29, 1981 ! 18: * Modified: Ray Essick November 17, 1981 ! 19: * Modified: Ray Essick January 1982 ! 20: * ! 21: */ ! 22: ! 23: allow (io, mode) ! 24: struct io_f *io; ! 25: { ! 26: switch (mode) ! 27: { ! 28: case RESPOK: ! 29: return io -> access & (RESPOK + WRITOK + DRCTOK); ! 30: break; ! 31: case READOK: ! 32: return io -> access & (READOK + DRCTOK); ! 33: break; ! 34: case WRITOK: ! 35: return io -> access & (WRITOK + DRCTOK); ! 36: break; ! 37: case DRCTOK: ! 38: return io -> access & (DRCTOK); ! 39: break; ! 40: default: ! 41: x (1, "permit: bad mode"); ! 42: } ! 43: return 0; /* to please lint */ ! 44: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.