b_time.c

untermud/U/b_time.c · 569 B

From the archive untermud-2.4-r22.tar.gz

Download the archive   « Back to the archive contents

#include    "config.h"
#include    "mud.h"
#include    "u.h"
#include    "y.tab.h"

extern char *ctime ();

int ub_time (char *who, char *aswho, int ac, Nod * av[], Nod * retnode)
{
  retnode->rv.t = NUM;
  retnode->rv.iv = time ((time_t *) 0);
  return (UERR_NONE);
}



int ub_ctime (char *who, char *aswho, int ac, Nod * av[], Nod * retnode)
{
  time_t tval;
  if (ac == 0)
    tval = time ((time_t *) 0);
  else
    tval = eval_castint (av[0]);

  retnode->rv.t = STR;
  retnode->rv.cv = tmpstr (ctime (&tval));
  retnode->rv.cv[24] = '\0';
  return (UERR_NONE);
}

Site Stats

Snippets: 1791
Codebases: 571