alobbs/libhpack — pull request #19 by Akrog (2014-03-02 19:14:50+00:00)
Title: Huff gen

With this the auto generation of the huff_tables.c should be done.

The script is called huffman-gen.py

It uses a template, default is huffman_tables.tpl, to render the final output.

We can choose our source between those already known to the script:
- EC_HTML: Editor's copy in HTML
- EC_XML: Editor's copy in XML
- EC_TXT: Editor's copy in TXT
- WGD_HTML: Less recent, more official Working Group Draft
Or specify our own source file.

It tries not to modify the output file, huffman_tables.c by default, if possible. That way it will not trigger a recompile of the source code.

Tries to do as little work as possible, so if it detects that the source file hasn't changed (etag, date, size in headers) from the last time it will consider the output file to be up to date and stop there. Won't even bother downloading the source file.

If you change sources it will not be able to tell if the file has been updated that way.

If he doesn't think it's up to date it will generate the arrays and compare them with the current contents of the output file. If the arrays are the same he doesn't touch the output file.

Only when they don't match he will write the output file.
Script can be forced to always generate output file.