1#!/bin/sh23cat <<EOF4#include <stdlib.h>5#include <string.h>6#include <time.h>78#include "../libc.h"910`11awk '{12 zones[$1] = 113 if (length($1) > max)14 max = length($1)15 nr++16}17END {18 printf("#define MAX %d\n", max+1);19 printf("#define NR %d\n", nr);20 print("static char tzones[NR][MAX] = {");21 for (z in zones)22 printf("\t\\"%s\\",\n", z) | "sort"23 close("sort")24 print "};\n"25}' "$@"`2627static int28cmp(const void *ps1, const void *ps2)29{30 const char *s1 = ps1, *s2 = ps2;3132 return strcmp(s1, s2);33}3435char *36_gmtoff(char *tz)37{38 return bsearch(tz, tzones, NR, MAX, cmp);39}40EOF