File:  [CSRG BSD Unix] / 43BSDReno / contrib / isode-beta / dsap / common / tai_init.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:56 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

/* tai_init.c - */

#ifndef lint
static char *rcsid = "$Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/dsap/common/tai_init.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $";
#endif

/*
 * $Header: /var/lib/cvsd/repos/CSRG/43BSDReno/contrib/isode-beta/dsap/common/tai_init.c,v 1.1.1.1 2018/04/24 16:12:56 root Exp $
 *
 *
 * $Log: tai_init.c,v $
 * Revision 1.1.1.1  2018/04/24 16:12:56  root
 * BSD 4.3reno
 *
 * Revision 7.0  89/11/23  21:47:52  mrose
 * Release 6.0
 * 
 */

/*
 *                                NOTICE
 *
 *    Acquisition, use, and distribution of this module and related
 *    materials are subject to the restrictions of a license agreement.
 *    Consult the Preface in the User's Manual for the full terms of
 *    this agreement.
 *
 */


/* LINTLIBRARY */

#include "quipu/util.h"
#include "tailor.h"

extern LLog * log_dsap;
extern  char    *tailfile;

#define MAXTAIARGS      100

extern  LLog    *log_dsap;


dsap_tai_init()
{
	FILE    *fp;
	char    *cp;
	char    buf[BUFSIZ];

	if(!isstr(tailfile))    /* it's compiled in */
		return(OK);

	if( (fp = fopen(cp = isodefile(tailfile, 0), "r")) == (FILE *)NULL) {
		LLOG (log_dsap,LLOG_FATAL,("can't open tailor file '%s'", cp));
		fatal (-1, "Cannot open tailor file");
	}

	while(fgets(buf, sizeof(buf), fp) != NULLCP)
		if ( (*buf != '#') && (*buf != '\n') )
			/* not a comment or blank */
			if (tai_string (buf) == NOTOK) 
				LLOG (log_dsap,LLOG_EXCEPTIONS,("tai_string failed %s",buf));

	
	(void) fclose(fp);
	return OK;
}


tai_string (str)
char * str;
{
	char    *args[MAXTAIARGS];
	char    *p, *index();
	int     ac;

	if( (p = index(str, '\n')) != NULLCP)
		*p = '\0';

	if((ac = sstr2arg(str, MAXTAIARGS, args, " \t,")) == NOTOK) {
		LLOG(log_dsap,LLOG_EXCEPTIONS,("too many tailor parameters"));
		return(NOTOK);
	}
	if(ac <= 1) {
		LLOG (log_dsap,LLOG_EXCEPTIONS,("no option set '%s'",str));
		return (NOTOK);
	}
	return (dsap_tai(ac, args));

}

unix.superglobalmegacorp.com

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