Created
April 4, 2023 18:48
-
-
Save flatcap/8eb120833f9b25886ff89beea61cd154 to your computer and use it in GitHub Desktop.
stub to test mutt_date_parse_date()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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