remove unneeded include in data.c
[ssp.git] / data / generate.awk
blob06c60cc9659ec50369a948ebfb9cf8357057dbc3
1 BEGIN {
2 # $1 Book name
3 # $2 Book abbreviation
4 # $3 Book number
5 # $4 Chapter number
6 # $5 Verse number
7 # $6 Verse
8 FS = "\t"
10 print "/* This file is automatically generated. DO NOT EDIT. */"
11 print ""
12 print "#include \"data.h\""
13 print ""
14 print "kjv_verse kjv_verses[] = {"
16 book_count = 0
20 printf(" {%d, %d, %d, \"%s\"},\n", $3, $4, $5, $6)
21 if (!($3 in book_names)) {
22 book_names[$3] = $1
23 book_abbrs[$3] = $2
24 book_count++
28 END {
29 print "};"
30 print ""
31 printf("int kjv_verses_length = %d;\n", NR)
32 print ""
34 print "kjv_book kjv_books[] = {"
35 for (i = 1; i <= book_count; i++) {
36 printf(" {%d, \"%s\", \"%s\"},\n", i, book_names[i], book_abbrs[i])
38 print "};"
40 print ""
41 printf("int kjv_books_length = %d;\n", book_count)