📄 confile.c
字号:
/*************************************************************************/
/* */
/* CopyrIght (c) 1993 - 1996 Accelerated Technology, Inc. */
/* */
/* PROPRIETARY RIGHTS of Accelerated Technology are involved in the */
/* subject matter of this material. All manufacturing, reproduction, */
/* use, and sales rights pertaining to this subject matter are governed */
/* by the license agreement. The recipient of this software implicitly */
/* accepts the terms of the license. */
/* */
/*************************************************************************/
/*
*
* Portions of this program were written by: */
/*****************************************************************************
* *
* part of: *
* Network kernel for NCSA Telnet *
* by Tim Krauskopf *
* *
* National Center for Supercomputing Applications *
* 152 Computing Applications Building *
* 605 E. Springfield Ave. *
* Champaign, IL 61820 *
* *
* Revision History:
*
* Initial release - 11/87 TK
* Cleanup for 2.3 release - 6/89 QK
* New for 2.3 release - 1/91 QK
******************************************************************************/
/*************************************************************************/
/* */
/* FILE NAME VERSION */
/* */
/* CONFILE.C NET 3.2 */
/* */
/* */
/* DESCRIPTION */
/* */
/* Reads and stores the appropriate information for the config file.*/
/* */
/* DATA STRUCTURES */
/* */
/* */
/* FUNCTIONS */
/* */
/* ncstrcmp String compare */
/* Scopyfrom Copy another machines entries */
/* Ssetgates Set up the gateway machines */
/* and subnet mask */
/* */
/* DEPENDENCIES */
/* */
/* nucleus.h contains system constants common to both the */
/* application and Nucleus PLUS components. */
/* target.h Defines applicable to a specefic target. */
/* */
/* HISTORY */
/* */
/* NAME DATE REMARKS */
/* */
/* */
/*************************************************************************/
/* Nucelus modified includes */
#include "hostform.h"
#include "externs.h"
#include "confile.h"
#include "target.h"
#ifdef PLUS
#include "nucleus.h"
#else
#include "nu_defs.h" /* added during ATI mods - 10/20/92, bgh */
#include "nu_extr.h"
#endif
#include "tcp_errs.h"
#include "data.h"
/*************************************************************************/
/* */
/* FUNCTION */
/* */
/* ncstrcmp */
/* */
/* DESCRIPTION */
/* */
/* No case string compare. */
/* Only returns 0=match, 1=no match, does not compare greater or less */
/* There is a tiny bit of overlap with the | 32 trick, but shouldn't be*/
/* a problem. It causes some different symbols to match. */
/* */
/* CALLED BY */
/* Shostlook */
/* Sotherhosts */
/* */
/* CALLS */
/* */
/* */
/*************************************************************************/
int16 ncstrcmp(int8 *sa,int8 *sb)
{
while(*sa && *sa<33) /* don't compare leading spaces */
sa++;
while(*sb && *sb<33)
sb++;
while(*sa && *sb) {
if((*sa!=*sb) && ((*sa | 32)!=(*sb | 32)))
return(1);
sa++;
sb++;
} /* end while */
if(!*sa && !*sb) /* if both at end of string */
return(0);
else
return(1);
} /* end ncstrcmp() */
/*************************************************************************/
/* */
/* FUNCTION */
/* */
/* Scopyfrom */
/* */
/* DESCRIPTION */
/* */
/* Look at the Sflags array to determine which elements to copy from */
/* a previous machine's entries. If a machine name as been given as */
/* "default", the state machine will fill in the fields from that */
/* machine's entries. */
/* */
/* If the machine name to copyfrom is not present in the list, set the */
/* program default values for each field. */
/* */
/* CALLED BY */
/* Smadd */
/* */
/* CALLS */
/* */
/* Shostlook */
/* */
/*************************************************************************/
void Scopyfrom(int8 *s)
{
struct machinfo *m;
int16 i;
m=Shostlook(s); /* search list */
for(i=3; i<=NUMSPECS-100; i++) /* through list of parms */
if(!Sflags[i]) {
if(m) /* copy old value */
switch(100+i) {
case CONHOST:
strcpy(Smptr->hname, m->hname);
break;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -