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 - download
Index: ┃ T g

⟦8cfa2b8a2⟧ TextFile

    Length: 771 (0x303)
    Types: TextFile
    Names: »gestate.c«

Derivation

└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
    └─ ⟦this⟧ »EUUGD11/euug-87hel/sec8/uutty/gestate.c« 

TextFile

#include "uutty.h"
/* 
** Look up the current state and return its symbolic name.
**
** The state[] array is the list of known states.  Note that 
** we assume that states are non-negative, and use -1 as an 
** end-of-array flag.  Note also that zero is a highly-likely 
** state, and should be included as a distinct state (probably 
** S_INIT).  The order is irrelevant, except for speed; a linear 
** lookup is done.
*/
struct state {int ssval; char *ssnam; } state[] = {
	{S_EXIT,	"EXIT"},
	{S_IDLE,	"IDLE"},
	{S_INIT,	"INIT"},
	{S_LOGIN,	"LOGIN"},
	{S_PASSWD,	"PASSWD"},
	{-1,		"UNKNOWN"}
};
char *
gestate()
{	int i;

	for (i=0; state[i].ssval >= 0; i++)
		if (state[i].ssval == ss)
			return state[i].ssnam;
	return state[i].ssnam;			/* Final "unknown" state */
}