Logo Search packages:      
Sourcecode: daemontools version File versions  Download package

timestamp.c

#include "taia.h"
#include "timestamp.h"

static char hex[16] = "0123456789abcdef";

void timestamp(char s[TIMESTAMP])
{
  struct taia now;
  char nowpack[TAIA_PACK];
  int i;

  taia_now(&now);
  taia_pack(nowpack,&now);

  s[0] = '@';
  for (i = 0;i < 12;++i) {
    s[i * 2 + 1] = hex[(nowpack[i] >> 4) & 15];
    s[i * 2 + 2] = hex[nowpack[i] & 15];
  }
}

Generated by  Doxygen 1.6.0   Back to index