nam.c revision 3f54fd611f536639ec30dd53c48e5ec1897cc7d9
/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1990-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*
* open cs paths and return to sender
* the requests are
*
* request
*
* <op> <mount> <path> [pwd=<pwd>] [<name>=<value>] ...
*
*/
static const char id[] = "@(#)$Id: cs.nam (AT&T Research) 1996-02-29 $\0\n";
#include <cs.h>
#include <hashkey.h>
#include <ctype.h>
#include <error.h>
#include <tok.h>
typedef struct
{
int active;
int dormant;
} State_t;
static int
{
return(0);
}
/*
* service a request
*/
static int
{
register char* b;
register int n;
int getfd;
int ud;
char* msg;
char* op;
char* logical;
char* path;
char* name;
char* value;
goto drop;
buf[n - 1] = 0;
goto nope;
{
goto nope;
getfd = 1;
break;
goto drop;
if (!b)
goto nope;
n = strlen(b);
b[n++] = '\n';
goto drop;
return(0);
exit(0);
break;
getfd = 0;
break;
default:
goto nope;
}
{
break;
}
if (!getfd)
goto nope;
if (*path)
do
{
n = *--path;
*path = '/';
} while (n);
{
{
goto drop;
}
return(0);
}
nope:
return(0);
drop:
return(-1);
}
/*
* exit if inactive on timeout
*/
static int
svc_timeout(void* handle)
{
{
exit(0);
}
return(0);
}
int
{
exit(1);
}