/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1982-2010 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* alarm [-r] [varname [+]when]
*
* David Korn
* AT&T Labs
*
*/
#include "defs.h"
#include <error.h>
#include <stak.h>
#include "builtins.h"
struct tevent
{
long milli;
int flags;
void *timeout;
};
static void trap_timeout(void*);
/*
* insert timeout item on current given list in sorted order
*/
{
{
}
else
{
}
return(list);
}
/*
* delete timeout item from current given list, delete timer
*/
{
else
{
if(tp)
}
return(list);
}
{
while(tp)
{
{
{
}
else
}
}
}
{
if(sh_isstate(SH_TTYWAIT))
sh_timetraps();
}
void sh_timetraps(void)
{
while(1)
{
{
{
{
}
}
}
break;
}
}
/*
* This trap function catches "alarm" actions only
*/
*fp)
{
if(!event)
{
/* try the next level */
}
else
}
/*
* catch assignments and set alarm traps
*/
{
register double d;
if(val)
{
double now;
#ifdef timeofday
#else
#endif /* timeofday */
if(*val=='+')
{
double x = d + now;
}
else
d -= now;
}
else
{
}
}
{
sizeof(struct tevent),
0,
0,
};
{
register int n,rflag=0;
{
case 'r':
break;
case ':':
break;
case '?':
break;
}
if(error_info.errors)
if(argc==0)
{
return(0);
}
if(argc!=2)
return(0);
}