|
|
1.1 ! root 1: /* log_tai.c - system tailoring routines */ ! 2: ! 3: #ifndef lint ! 4: static char *rcsid = "$Header: /f/osi/compat/RCS/log_tai.c,v 7.0 89/11/23 21:23:16 mrose Rel $"; ! 5: #endif ! 6: ! 7: /* ! 8: * $Header: /f/osi/compat/RCS/log_tai.c,v 7.0 89/11/23 21:23:16 mrose Rel $ ! 9: * ! 10: * ! 11: * $Log: log_tai.c,v $ ! 12: * Revision 7.0 89/11/23 21:23:16 mrose ! 13: * Release 6.0 ! 14: * ! 15: */ ! 16: ! 17: /* ! 18: * NOTICE ! 19: * ! 20: * Acquisition, use, and distribution of this module and related ! 21: * materials are subject to the restrictions of a license agreement. ! 22: * Consult the Preface in the User's Manual for the full terms of ! 23: * this agreement. ! 24: * ! 25: */ ! 26: ! 27: ! 28: /* LINTLIBRARY */ ! 29: ! 30: #include <stdio.h> ! 31: #include "cmd_srch.h" ! 32: #include "general.h" ! 33: #include "manifest.h" ! 34: #include "logger.h" ! 35: ! 36: /* */ ! 37: ! 38: #define LG_FILE 1 ! 39: #define LG_SFLAGS 2 ! 40: #define LG_DFLAGS 3 ! 41: #define LG_LEVEL 4 ! 42: #define LG_SIZE 5 ! 43: #define LG_DLEVEL 6 ! 44: ! 45: static CMD_TABLE log_tbl[] = { ! 46: "FILE", LG_FILE, ! 47: "SFLAGS", LG_SFLAGS, ! 48: "DFLAGS", LG_DFLAGS, ! 49: "LEVEL", LG_LEVEL, ! 50: "SLEVEL", LG_LEVEL, ! 51: "DLEVEL", LG_DLEVEL, ! 52: "SIZE", LG_SIZE, ! 53: 0, -1, ! 54: }; ! 55: ! 56: static CMD_TABLE log_lvltbl[] = { ! 57: "NONE", LLOG_NONE, ! 58: "FATAL", LLOG_FATAL, ! 59: "EXCEPTIONS", LLOG_EXCEPTIONS, ! 60: "NOTICE", LLOG_NOTICE, ! 61: "TRACE", LLOG_TRACE, ! 62: "DEBUG", LLOG_DEBUG, ! 63: "PDUS", LLOG_PDUS, ! 64: "ALL", LLOG_ALL, ! 65: 0, -1 ! 66: }; ! 67: ! 68: static CMD_TABLE log_flgtbl[] = { ! 69: "CLOSE", LLOGCLS, ! 70: "CREATE", LLOGCRT, ! 71: "ZERO", LLOGZER, ! 72: "TTY", LLOGTTY, ! 73: 0, -1 ! 74: }; ! 75: ! 76: /* */ ! 77: ! 78: log_tai(lgptr, av, ac) /* for now only alter the level - files etc later */ ! 79: LLog *lgptr; ! 80: char **av; ! 81: int ac; ! 82: { ! 83: register int i; ! 84: register char *p; ! 85: int val; ! 86: ! 87: for(i = 0; i < ac; i++) ! 88: { ! 89: if((p = index(av[i], '=')) == NULLCP) ! 90: continue; ! 91: *p++ = NULL; ! 92: switch(cmd_srch(av[i], log_tbl)) ! 93: { ! 94: case LG_LEVEL: ! 95: val = cmd_srch(p,log_lvltbl); ! 96: if (val != -1) ! 97: lgptr->ll_events |= val; ! 98: break; ! 99: case LG_DLEVEL: ! 100: val = cmd_srch(p,log_lvltbl); ! 101: if (val != -1) ! 102: lgptr->ll_events &= ~ val; ! 103: break; ! 104: case LG_FILE: ! 105: lgptr->ll_file = strdup (p); ! 106: break; ! 107: case LG_SFLAGS: ! 108: val = cmd_srch(p,log_flgtbl); ! 109: if (val != -1) ! 110: lgptr->ll_stat |= val; ! 111: break; ! 112: case LG_DFLAGS: ! 113: val = cmd_srch(p,log_flgtbl); ! 114: if (val != -1) ! 115: lgptr->ll_stat &= ~ val; ! 116: break; ! 117: case LG_SIZE: ! 118: lgptr->ll_msize = atoi(p); ! 119: break; ! 120: } ! 121: } ! 122: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.