+int asn_ulong2INTEGER(INTEGER_t *i, unsigned long l);
+
+/* A version of strtol/strtoimax(3) with nicer error reporting. */
+enum asn_strtox_result_e {
+ ASN_STRTOX_ERROR_RANGE = -3, /* Input outside of supported numeric range */
+ ASN_STRTOX_ERROR_INVAL = -2, /* Invalid data encountered (e.g., "+-") */
+ ASN_STRTOX_EXPECT_MORE = -1, /* More data expected (e.g. "+") */
+ ASN_STRTOX_OK = 0, /* Conversion succeded, number ends at (*end) */
+ ASN_STRTOX_EXTRA_DATA = 1 /* Conversion succeded, but the string has extra stuff */
+};
+enum asn_strtox_result_e asn_strtol_lim(const char *str, const char **end,
+ long *l);
+enum asn_strtox_result_e asn_strtoul_lim(const char *str, const char **end,
+ unsigned long *l);
+enum asn_strtox_result_e asn_strtoimax_lim(const char *str, const char **end,
+ intmax_t *l);
+enum asn_strtox_result_e asn_strtoumax_lim(const char *str, const char **end,
+ uintmax_t *l);