2017-04-09 Niels Möller <nisse@lysator.liu.se>
- * nettle-meta.h (nettle_ciphers, nettle_aeads): New macros,
- analogous to below change to nettle_hashes.
+ * nettle-meta.h (nettle_ciphers, nettle_aeads, nettle_armors): New
+ macros, analogous to below change to nettle_hashes.
* nettle-meta-ciphers.c (_nettle_ciphers): Renamed array, from...
(nettle_ciphers: ... old name.
(nettle_aeads: ... old name.
(nettle_get_aeads): New function.
+ * nettle-meta-armors.c (_nettle_armors): Renamed array, from...
+ (nettle_armors: ... old name.
+ (nettle_get_armors): New function.
+
2017-01-12 Niels Möller <nisse@lysator.liu.se>
* tools/nettle-hash.c (find_algorithm): Deleted function.
#include <stddef.h>
#include "nettle-meta.h"
-const struct nettle_armor * const nettle_armors[] = {
+const struct nettle_armor * const _nettle_armors[] = {
&nettle_base64,
&nettle_base64url,
&nettle_base16,
NULL
};
+
+const struct nettle_armor * const *
+nettle_get_armors (void)
+{
+ return _nettle_armors;
+}
}
/* null-terminated list of armor schemes implemented by this version of nettle */
-extern const struct nettle_armor * const nettle_armors[];
+extern const struct nettle_armor * const _nettle_armors[];
+
+const struct nettle_armor * const *
+#ifdef __GNUC__
+__attribute__((pure))
+#endif
+nettle_get_armors (void);
+
+#define nettle_armors (nettle_get_armors())
extern const struct nettle_armor nettle_base64;
extern const struct nettle_armor nettle_base64url;