libhmd-c

C human-readable date string library
git clone https://git.sinitax.com/sinitax/libhmd-c
Log | Files | Refs | Submodules | LICENSE | sfeed.txt

test.c (283B)


      1#include "hmd.h"
      2
      3#include <err.h>
      4#include <stdio.h>
      5
      6int
      7main(int argc, char **argv)
      8{
      9	struct hmd_date date;
     10	char **arg;
     11
     12	for (arg = argv + 1; *arg; arg++) {
     13		if (hmd_date_parse(&date, *arg))
     14			err(1, "invalid date '%s'", *arg);
     15		printf("%lu %lu\n", date.ts, date.spn);
     16	}
     17}