trusteddomainproject / OpenDKIM

Other
97 stars 52 forks source link

libopendkim: Expose dkim_code_to_name() and dkim_name_to_code() with tables #207

Open futatuki opened 8 months ago

futatuki commented 8 months ago

Before OpenDKIM 1.2.0, dkim_code_to_name() , dim_name_to_code() and nametables for conversion had been hidden from outside of the library as a part of global name consolidation.

However as a result of it, users of the libopendkim must maintain their own conversion tables if it is needed. Actually opendkim milter itself has its own conversion table for dkim_alg_tand dkim_canon_t. I think it is very waistful.

And when I've extended opendkim-testkey utility for supporting new KeyTable format, it also got need a conversion from name to dkim_alg_t.

So I want those conversion functions and nametables, at least those nametables for the constants which is already exposed in dkim.h, to expose outside of library.

For enable to change the structure of nametable without changing API, the structure of nametable itself is not exposed. However, as there is some use case that need enumerating all items in the table, functions for iteration on the tables are also added.