/***********************************************************************
* *
* 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 Bell Laboratories
*
* dbm server
*
* keys may not contain {<blank>,<newline>,<null>}
* vals may not contain {<newline>,<null>}
*
* commands
*
* close close
* get key return value for key
* next [``value''] return next key in scan with optional value
* open file [r|w|rw] open [rw] + implicit scan
* put key [value] put [delete] value for key
* scan initialize for scan
*
* replies
*
* I ... information
* W ... warning message
* E ... error message
*
* NOTE: the scans cheat by using dbm_blkptr and dbm_keyptr
*/
#include <ast.h>
#include <error.h>
#include <tok.h>
#if !_lib_ndbm
int
{
}
#else
#include <cs.h>
#include <error.h>
#include <ndbm.h>
typedef struct /* open dbm info */
{
} Db_t;
typedef struct /* connection info */
{
} Con_t;
typedef struct /* server state */
{
} State_t;
/*
* initialize the state
*/
static void*
{
return(handle);
}
/*
* add a new connection
*/
static int
{
return(0);
}
/*
* service a request
*/
static int
{
int n;
char* cmd;
char* s;
nxt[n - 1] = 0;
{
switch (*cmd)
{
case 'c':
break;
case 'g':
{
}
break;
case 'n':
{
}
else
{
}
{
if (n)
{
else
{
{
}
}
}
}
else
{
{
}
}
break;
case 'o':
{
}
if (*s == 'w') break;
{
}
{
{
{
}
}
break;
}
break;
case 'p':
{
break;
}
{
{
}
}
{
}
break;
case 'q':
case 'Q':
break;
case 's':
break;
case 'v':
break;
default:
break;
break;
}
if (*cmd == 'Q')
{
goto drop;
}
}
return(0);
drop:
return(-1);
}
/*
* exit if no open dbm's on timeout
*/
static int
{
{
exit(0);
}
return(0);
}
/*
* close the open dbm's
*/
static int
{
{
}
return(0);
}
int
{
exit(1);
}
#endif