|
|
@@ -25,25 +25,25 @@ gend_files = {} |
|
|
|
def gen_file(name,doc,code,author="Mike Hamburg"): |
|
|
|
is_header = name.endswith(".h") or name.endswith(".hxx") or name.endswith(".h++") |
|
|
|
|
|
|
|
for curve,data in [("Ed448",curve_data["Ed448"])]: #curve_data.iteritems(): |
|
|
|
for curve,data in curve_data.iteritems(): |
|
|
|
ns_name = name % data |
|
|
|
|
|
|
|
_,_,name_base = ns_name.rpartition("/") |
|
|
|
header_guard = "__" + name_base.replace(".","_").upper() + "__" |
|
|
|
|
|
|
|
doc = dedent(doc).strip().rstrip() |
|
|
|
doc = redoc(ns_name, doc % data, author) |
|
|
|
code = code % data |
|
|
|
ret = doc + "\n" |
|
|
|
ns_doc = dedent(doc).strip().rstrip() |
|
|
|
ns_doc = redoc(ns_name, ns_doc % data, author) |
|
|
|
ns_code = code % data |
|
|
|
ret = ns_doc + "\n" |
|
|
|
|
|
|
|
if is_header: |
|
|
|
code = dedent("""\n |
|
|
|
ns_code = dedent("""\n |
|
|
|
#ifndef %(header_guard)s |
|
|
|
#define %(header_guard)s 1 |
|
|
|
%(code)s |
|
|
|
#endif /* %(header_guard)s */ |
|
|
|
""") % { "header_guard" : header_guard, "code": code } |
|
|
|
ret += code[1:-1] |
|
|
|
""") % { "header_guard" : header_guard, "code": ns_code } |
|
|
|
ret += ns_code[1:-1] |
|
|
|
gend_files[ns_name] = ret |
|
|
|
|
|
|
|
if ns_name == name: |
|
|
|