portability
diff --git a/skeletons/BIT_STRING.c b/skeletons/BIT_STRING.c
index ef5bd0a..7e576a1 100644
--- a/skeletons/BIT_STRING.c
+++ b/skeletons/BIT_STRING.c
@@ -37,16 +37,19 @@
if(st && st->buf) {
if(st->size) {
if(st->size == 1 && st->buf[0] != 0) {
- _ASN_ERRLOG("%s: invalid padding byte",
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: invalid padding byte",
td->name);
return -1;
}
} else {
- _ASN_ERRLOG("%s: no padding byte", td->name);
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: no padding byte", td->name);
return -1;
}
} else {
- _ASN_ERRLOG("%s: value not given", td->name);
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: value not given", td->name);
return -1;
}
diff --git a/skeletons/GeneralizedTime.c b/skeletons/GeneralizedTime.c
index 9b8c1aa..586fb4a 100644
--- a/skeletons/GeneralizedTime.c
+++ b/skeletons/GeneralizedTime.c
@@ -54,7 +54,8 @@
errno = EPERM; /* Just an unlikely error code */
tloc = asn_GT2time(st, 0, 0);
if(tloc == -1 && errno != EPERM) {
- _ASN_ERRLOG("%s: Invalid time format: %s",
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: Invalid time format: %s",
td->name, strerror(errno));
return -1;
}
diff --git a/skeletons/IA5String.c b/skeletons/IA5String.c
index 7fcb194..c520bb2 100644
--- a/skeletons/IA5String.c
+++ b/skeletons/IA5String.c
@@ -40,7 +40,8 @@
*/
for(; buf < end; buf++) {
if(*buf > 0x7F) {
- _ASN_ERRLOG("%s: value byte %d out of range: "
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: value byte %d out of range: "
"%d > 127",
td->name,
(buf - st->buf) + 1,
@@ -50,7 +51,8 @@
}
}
} else {
- _ASN_ERRLOG("%s: value not given", td->name);
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: value not given", td->name);
return -1;
}
diff --git a/skeletons/NumericString.c b/skeletons/NumericString.c
index 0bb86db..a8d4ed8 100644
--- a/skeletons/NumericString.c
+++ b/skeletons/NumericString.c
@@ -46,7 +46,8 @@
case 0x35: case 0x36: case 0x37: case 0x38: case 0x39:
continue;
}
- _ASN_ERRLOG("%s: value byte %d "
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: value byte %d "
"not in NumericString alphabet (%d)",
td->name,
(buf - st->buf) + 1,
@@ -55,7 +56,8 @@
return -1;
}
} else {
- _ASN_ERRLOG("%s: value not given", td->name);
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: value not given", td->name);
return -1;
}
diff --git a/skeletons/OBJECT_IDENTIFIER.c b/skeletons/OBJECT_IDENTIFIER.c
index 7579349..89e2e32 100644
--- a/skeletons/OBJECT_IDENTIFIER.c
+++ b/skeletons/OBJECT_IDENTIFIER.c
@@ -79,12 +79,14 @@
if(st && st->buf) {
if(st->size < 1) {
- _ASN_ERRLOG("%s: at least one numerical value expected",
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: at least one numerical value expected",
td->name);
return -1;
}
} else {
- _ASN_ERRLOG("%s: value not given", td->name);
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: value not given", td->name);
return -1;
}
diff --git a/skeletons/PrintableString.c b/skeletons/PrintableString.c
index 5c9a1fb..f894d82 100644
--- a/skeletons/PrintableString.c
+++ b/skeletons/PrintableString.c
@@ -64,7 +64,8 @@
*/
for(; buf < end; buf++) {
if(!_PrintableString_alphabet[*buf]) {
- _ASN_ERRLOG("%s: value byte %d "
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: value byte %d "
"not in PrintableString alphabet (%d)",
td->name,
(buf - st->buf) + 1,
@@ -74,7 +75,8 @@
}
}
} else {
- _ASN_ERRLOG("%s: value not given", td->name);
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: value not given", td->name);
return -1;
}
diff --git a/skeletons/UTCTime.c b/skeletons/UTCTime.c
index e15cca9..7d97117 100644
--- a/skeletons/UTCTime.c
+++ b/skeletons/UTCTime.c
@@ -46,7 +46,8 @@
errno = EPERM; /* Just an unlikely error code */
tloc = asn_UT2time(st, 0, 0);
if(tloc == -1 && errno != EPERM) {
- _ASN_ERRLOG("%s: Invalid time format: %s",
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: Invalid time format: %s",
td->name, strerror(errno));
return -1;
}
diff --git a/skeletons/UTF8String.c b/skeletons/UTF8String.c
index 6b40b25..06e1559 100644
--- a/skeletons/UTF8String.c
+++ b/skeletons/UTF8String.c
@@ -60,7 +60,8 @@
int w = _UTF8String_h1[ch >> 4];
if(want) { /* Continuation expected */
if(w) {
- _ASN_ERRLOG("%s: UTF-8 expectation "
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: UTF-8 expectation "
"failed at byte %d",
opt_type_name,
(buf - st->buf) + 1);
@@ -75,7 +76,7 @@
break;
/* Fall through */
case 0:
- _ASN_ERRLOG(
+ _ASN_ERRLOG(app_errlog, app_key,
"%s: UTF-8 expectation"
"failed at byte %d",
opt_type_name,
@@ -89,14 +90,16 @@
/* If still want something, then something is wrong */
if(want) {
- _ASN_ERRLOG("%s: truncated UTF-8 sequence",
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: truncated UTF-8 sequence",
opt_type_name);
return -1;
}
return length;
} else {
- _ASN_ERRLOG("%s: value not given", opt_type_name);
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: value not given", opt_type_name);
return -1;
}
}
diff --git a/skeletons/VisibleString.c b/skeletons/VisibleString.c
index ad0426e..4033a17 100644
--- a/skeletons/VisibleString.c
+++ b/skeletons/VisibleString.c
@@ -64,7 +64,8 @@
*/
for(; buf < end; buf++) {
if(!_VisibleString_alphabet[*buf]) {
- _ASN_ERRLOG("%s: value byte %d "
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: value byte %d "
"not in VisibleString alphabet (%d)",
td->name,
(buf - st->buf) + 1,
@@ -74,7 +75,8 @@
}
}
} else {
- _ASN_ERRLOG("%s: value not given", td->name);
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: value not given", td->name);
return -1;
}
diff --git a/skeletons/constr_CHOICE.c b/skeletons/constr_CHOICE.c
index 23303f1..a63d6fb 100644
--- a/skeletons/constr_CHOICE.c
+++ b/skeletons/constr_CHOICE.c
@@ -480,7 +480,8 @@
int present;
if(!sptr) {
- _ASN_ERRLOG("%s: value not given", td->name);
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: value not given", td->name);
return -1;
}
@@ -502,7 +503,8 @@
return elm->type->check_constraints(elm->type, memb_ptr,
app_errlog, app_key);
} else {
- _ASN_ERRLOG("%s: no CHOICE element given", td->name);
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: no CHOICE element given", td->name);
return -1;
}
}
diff --git a/skeletons/constr_SEQUENCE.c b/skeletons/constr_SEQUENCE.c
index db36f90..fd0f59a 100644
--- a/skeletons/constr_SEQUENCE.c
+++ b/skeletons/constr_SEQUENCE.c
@@ -647,7 +647,8 @@
int edx;
if(!sptr) {
- _ASN_ERRLOG("%s: value not given", td->name);
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: value not given", td->name);
return -1;
}
diff --git a/skeletons/constr_SET.c b/skeletons/constr_SET.c
index ec9caf0..2602b80 100644
--- a/skeletons/constr_SET.c
+++ b/skeletons/constr_SET.c
@@ -660,7 +660,8 @@
int edx;
if(!sptr) {
- _ASN_ERRLOG("%s: value not given", td->name);
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: value not given", td->name);
return -1;
}
@@ -676,7 +677,7 @@
if(!memb_ptr) {
if(ASN_SET_ISPRESENT2(
&(specs->_mandatory_elements), edx)) {
- _ASN_ERRLOG(
+ _ASN_ERRLOG(app_errlog, app_key,
"%s: mandatory element "
"%s absent",
td->name, elm->name);
diff --git a/skeletons/constr_SET_OF.c b/skeletons/constr_SET_OF.c
index b3428bf..53877f3 100644
--- a/skeletons/constr_SET_OF.c
+++ b/skeletons/constr_SET_OF.c
@@ -520,7 +520,8 @@
int i;
if(!sptr) {
- _ASN_ERRLOG("%s: value not given", td->name);
+ _ASN_ERRLOG(app_errlog, app_key,
+ "%s: value not given", td->name);
return -1;
}
diff --git a/skeletons/constraints.h b/skeletons/constraints.h
index d299e73..dfc0759 100644
--- a/skeletons/constraints.h
+++ b/skeletons/constraints.h
@@ -46,10 +46,10 @@
* Invoke the callback with a complete error message.
*/
#ifdef __GNUC__
-#define _ASN_ERRLOG(fmt, args...) do { \
- if(app_errlog) \
- _asn_i_log_error(app_errlog, \
- app_key, fmt, ##args); \
+#define _ASN_ERRLOG(app_errlog, app_key, fmt, args...) do { \
+ if(app_errlog) \
+ _asn_i_log_error(app_errlog, \
+ app_key, fmt, ##args); \
} while(0);
#else /* Preprocessor does not support variable args macros */
#define _ASN_ERRLOG if(app_errlog) _asn_i_log_error