MCPcopy Create free account
hub / github.com/eggert/tz / showtrans

Function showtrans

zdump.c:1085–1105  ·  view source on GitHub ↗

Show a time transition. */

Source from the content-addressed store, hash-verified

1083
1084/* Show a time transition. */
1085static void
1086showtrans(char const *time_fmt, struct tm const *tm, time_t t, char const *ab,
1087 char const *zone_name)
1088{
1089 if (!tm) {
1090 printf(tformat(), t);
1091 putchar('\n');
1092 } else {
1093 char stackbuf[1000];
1094 ptrdiff_t size = sizeof stackbuf;
1095 char *buf = stackbuf;
1096 char *bufalloc = NULL;
1097 while (! istrftime(buf, size, time_fmt, tm, t, ab, zone_name)) {
1098 size = sumsize(size, size);
1099 free(bufalloc);
1100 buf = bufalloc = xmalloc(size);
1101 }
1102 puts(buf);
1103 free(bufalloc);
1104 }
1105}
1106
1107static char const *
1108abbr(struct tm const *tmp)

Callers 1

mainFunction · 0.85

Calls 4

tformatFunction · 0.85
istrftimeFunction · 0.85
sumsizeFunction · 0.85
xmallocFunction · 0.70

Tested by

no test coverage detected