Skip to content

Instantly share code, notes, and snippets.

@flatcap
Created April 4, 2023 18:48
Show Gist options
  • Save flatcap/8eb120833f9b25886ff89beea61cd154 to your computer and use it in GitHub Desktop.
Save flatcap/8eb120833f9b25886ff89beea61cd154 to your computer and use it in GitHub Desktop.
stub to test mutt_date_parse_date()
#include <stdio.h>
#include "mutt/lib.h"
int main(int argc, char *argv[])
{
if (argc != 2)
return 1;
FILE *fp = fopen(argv[1], "r");
if (!fp)
return 1;
char buf[1024];
while (fgets(buf, sizeof(buf), fp))
{
struct Tz tz = { 0 };
size_t len = strlen(buf);
buf[len - 1] = '\0';
time_t t = mutt_date_parse_date(buf, &tz);
printf("%ld %s\n", t, buf);
}
fclose(fp);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment