DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T t

⟦18a7e468b⟧ TextFile

    Length: 2150 (0x866)
    Types: TextFile
    Names: »tjoin.y«

Derivation

└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0
    └─⟦dc59850a2⟧ »EurOpenD22/pp5.0/pp-5.tar.Z« 
        └─⟦e5a54fb17⟧ 
            └─⟦this⟧ »pp-5.0/Tools/tables/tjoin/tjoin.y« 

TextFile

%union {
	char *str;
}

%token  <str> STRING

%type	<str>	host
%%
file		:	line
		|       file line
		;

line		:	'\n'
		|	STRING ':' hostlist '\n' {
				/* Direct Connet or AR hosts */
				if (CheckHost ($1) != 0)
					StoreHost ($1);
				    else
					FreeHostInfo (HostList);
				free ($1);
				HostList = NULL;
				}
		|	STRING ':' '(' chanlist ')' '\n' {
				if (CheckChan (ChanList) != 0)
					StoreChans ($1);
				    else
					FreeChanInfo (ChanList);
				free ($1);
				ChanList = NULL;
				}
		|	error '\n' {
				crapline ();
				HostList = NULL;
				ChanList = NULL;
				}
		;

hostlist	:	host {
				StartHostList ($1);
				ChanList = NULL;
				}
		|	hostlist ',' host {
				AddToHostList ($3);
				ChanList = NULL;
				}
		;

host		:	STRING '(' ')' {
				/* This is an Application Relay */
				$$ = $1;
				}
		|	STRING '(' chanlist ')' {
				/* This is a Direct Connect */
				$$ = $1;
				}
		;

chanlist	:	STRING {
				StartChanList ($1);
				}
		|	chanlist ',' STRING {
				AddToChanList ($3);
				}
		;

%%

#include        <stdio.h>
#include	"tjoin.h"

extern  int     yylineno;

int	PrintNode (), CheckARs ();
SBUFF	*InitStringStore ();

char	*av0, *MyName;
HOST	*HostList = NULL;	/* Stores Host info on input line basis */
CHAN	*ChanList = NULL;	/* Stores Chan info on input host basis */
CHAN	*ValidChanList = NULL;
MTA	*MtaTree = NULL;	/* Root of in core database */
SBUFF	*ARStringStore, *HostStringStore;
int	Debug = 0, PrintRoute = 0, DirectFirst = 0, ComplexOutput = 0;

main (argc, argv)
int     argc;
char    *argv [];
{
	register int	i;

	av0 = argv [0];
	MyName = NULL;
	for (i = 1; i < argc; i++) {
		if (*argv [i] == '-')
			DoFlag (&argv [i][1]);
		    else
			if (MyName == NULL)
				MyName = argv [i];
			    else
				DefineChan (argv [i]);
	}
	if (ValidChanList == NULL)
		Usage ();
	ARStringStore = InitStringStore ();
	HostStringStore = InitStringStore ();
	yyparse ();
	WalkTree (MtaTree, CheckARs);
	/*
	 * Now that all AR names point to MTA structs - Zap space used
	 * to store names.
	 */
	FreeStringStore (ARStringStore);
	if (Debug == 2)	DebugTree (MtaTree, 0);
	WalkTree (MtaTree, PrintNode);
	exit (0);
}