Annotation of 43BSDReno/contrib/isode-beta/dsap/common/tai_init.c, revision 1.1.1.1

1.1       root        1: /* tai_init.c - */
                      2: 
                      3: #ifndef lint
                      4: static char *rcsid = "$Header: /f/osi/dsap/common/RCS/tai_init.c,v 7.0 89/11/23 21:47:52 mrose Rel $";
                      5: #endif
                      6: 
                      7: /*
                      8:  * $Header: /f/osi/dsap/common/RCS/tai_init.c,v 7.0 89/11/23 21:47:52 mrose Rel $
                      9:  *
                     10:  *
                     11:  * $Log:       tai_init.c,v $
                     12:  * Revision 7.0  89/11/23  21:47:52  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 "quipu/util.h"
                     31: #include "tailor.h"
                     32: 
                     33: extern LLog * log_dsap;
                     34: extern  char    *tailfile;
                     35: 
                     36: #define MAXTAIARGS      100
                     37: 
                     38: extern  LLog    *log_dsap;
                     39: 
                     40: 
                     41: dsap_tai_init()
                     42: {
                     43:        FILE    *fp;
                     44:        char    *cp;
                     45:        char    buf[BUFSIZ];
                     46: 
                     47:        if(!isstr(tailfile))    /* it's compiled in */
                     48:                return(OK);
                     49: 
                     50:        if( (fp = fopen(cp = isodefile(tailfile, 0), "r")) == (FILE *)NULL) {
                     51:                LLOG (log_dsap,LLOG_FATAL,("can't open tailor file '%s'", cp));
                     52:                fatal (-1, "Cannot open tailor file");
                     53:        }
                     54: 
                     55:        while(fgets(buf, sizeof(buf), fp) != NULLCP)
                     56:                if ( (*buf != '#') && (*buf != '\n') )
                     57:                        /* not a comment or blank */
                     58:                        if (tai_string (buf) == NOTOK) 
                     59:                                LLOG (log_dsap,LLOG_EXCEPTIONS,("tai_string failed %s",buf));
                     60: 
                     61:        
                     62:        (void) fclose(fp);
                     63:        return OK;
                     64: }
                     65: 
                     66: 
                     67: tai_string (str)
                     68: char * str;
                     69: {
                     70:        char    *args[MAXTAIARGS];
                     71:        char    *p, *index();
                     72:        int     ac;
                     73: 
                     74:        if( (p = index(str, '\n')) != NULLCP)
                     75:                *p = '\0';
                     76: 
                     77:        if((ac = sstr2arg(str, MAXTAIARGS, args, " \t,")) == NOTOK) {
                     78:                LLOG(log_dsap,LLOG_EXCEPTIONS,("too many tailor parameters"));
                     79:                return(NOTOK);
                     80:        }
                     81:        if(ac <= 1) {
                     82:                LLOG (log_dsap,LLOG_EXCEPTIONS,("no option set '%s'",str));
                     83:                return (NOTOK);
                     84:        }
                     85:        return (dsap_tai(ac, args));
                     86: 
                     87: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.