diff --git a/README.md b/README.md index 5e2e637..164d72f 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,10 @@ library | lastest version | category | LoC | description **stb.h** | 2.24 | misc | 14086 | helper functions for C, mostly redundant in C++; basically author's personal stuff **stb_leakcheck.h** | 0.1 | misc | 117 | quick-and-dirty malloc/free leak-checking +Total libraries: 18 +Total lines of C code: 45214 + + FAQ --- diff --git a/tools/make_readme.c b/tools/make_readme.c index eb949a6..03c9060 100644 --- a/tools/make_readme.c +++ b/tools/make_readme.c @@ -4,7 +4,7 @@ int main(int argc, char **argv) { int i; - int hlen, flen, listlen; + int hlen, flen, listlen, total_lines = 0; char *header = stb_file("README.header.md", &hlen); // stb_file - read file into malloc()ed buffer char *footer = stb_file("README.footer.md", &flen); // stb_file - read file into malloc()ed buffer char **list = stb_stringfile("README.list", &listlen); // stb_stringfile - read file lines into malloced array of strings @@ -42,11 +42,16 @@ int main(int argc, char **argv) fprintf(f, " | %s", s2); free(s2); fprintf(f, " | %d", num_lines); + total_lines += num_lines; for (j=2; j < num; ++j) fprintf(f, " | %s", tokens[j]); fprintf(f, "\n"); } + fprintf(f, "\n"); + fprintf(f, "Total libraries: %d \n", listlen); + fprintf(f, "Total lines of C code: %d\n\n", total_lines); + fwrite(footer, 1, flen, f); fclose(f);