diff options
author | Lev Walkin <vlm@lionet.info> | 2004-08-11 09:44:13 +0000 |
---|---|---|
committer | Lev Walkin <vlm@lionet.info> | 2004-08-11 09:44:13 +0000 |
commit | ba4e518c0205a565232813b59f35c162e6283929 (patch) | |
tree | 2814a46022d1518c401a5c2d40fc9515d78ae351 | |
parent | 8ee1593e1f4cfd2d3d2e59e9b6a6cd01d12e6d08 (diff) |
portability
-rw-r--r-- | skeletons/BIT_STRING.c | 9 | ||||
-rw-r--r-- | skeletons/GeneralizedTime.c | 3 | ||||
-rw-r--r-- | skeletons/IA5String.c | 6 | ||||
-rw-r--r-- | skeletons/NumericString.c | 6 | ||||
-rw-r--r-- | skeletons/OBJECT_IDENTIFIER.c | 6 | ||||
-rw-r--r-- | skeletons/PrintableString.c | 6 | ||||
-rw-r--r-- | skeletons/UTCTime.c | 3 | ||||
-rw-r--r-- | skeletons/UTF8String.c | 11 | ||||
-rw-r--r-- | skeletons/VisibleString.c | 6 | ||||
-rw-r--r-- | skeletons/constr_CHOICE.c | 6 | ||||
-rw-r--r-- | skeletons/constr_SEQUENCE.c | 3 | ||||
-rw-r--r-- | skeletons/constr_SET.c | 5 | ||||
-rw-r--r-- | skeletons/constr_SET_OF.c | 3 | ||||
-rw-r--r-- | skeletons/constraints.h | 8 |
14 files changed, 52 insertions, 29 deletions
diff --git a/skeletons/BIT_STRING.c b/skeletons/BIT_STRING.c index ef5bd0a2..7e576a1e 100644 --- a/skeletons/BIT_STRING.c +++ b/skeletons/BIT_STRING.c @@ -37,16 +37,19 @@ BIT_STRING_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, 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 9b8c1aa1..586fb4aa 100644 --- a/skeletons/GeneralizedTime.c +++ b/skeletons/GeneralizedTime.c @@ -54,7 +54,8 @@ GeneralizedTime_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, 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 7fcb194d..c520bb29 100644 --- a/skeletons/IA5String.c +++ b/skeletons/IA5String.c @@ -40,7 +40,8 @@ IA5String_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, */ 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 @@ IA5String_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, } } } 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 0bb86db9..a8d4ed8c 100644 --- a/skeletons/NumericString.c +++ b/skeletons/NumericString.c @@ -46,7 +46,8 @@ NumericString_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, 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 @@ NumericString_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, 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 7579349f..89e2e327 100644 --- a/skeletons/OBJECT_IDENTIFIER.c +++ b/skeletons/OBJECT_IDENTIFIER.c @@ -79,12 +79,14 @@ OBJECT_IDENTIFIER_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, 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 5c9a1fb5..f894d82e 100644 --- a/skeletons/PrintableString.c +++ b/skeletons/PrintableString.c @@ -64,7 +64,8 @@ PrintableString_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, */ 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 @@ PrintableString_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, } } } 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 e15cca91..7d971173 100644 --- a/skeletons/UTCTime.c +++ b/skeletons/UTCTime.c @@ -46,7 +46,8 @@ UTCTime_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, 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 6b40b25c..06e1559e 100644 --- a/skeletons/UTF8String.c +++ b/skeletons/UTF8String.c @@ -60,7 +60,8 @@ UTF8String_length(const UTF8String_t *st, const char *opt_type_name, 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 @@ UTF8String_length(const UTF8String_t *st, const char *opt_type_name, 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 @@ UTF8String_length(const UTF8String_t *st, const char *opt_type_name, /* 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 ad0426eb..4033a177 100644 --- a/skeletons/VisibleString.c +++ b/skeletons/VisibleString.c @@ -64,7 +64,8 @@ VisibleString_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, */ 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 @@ VisibleString_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, } } } 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 23303f12..a63d6fba 100644 --- a/skeletons/constr_CHOICE.c +++ b/skeletons/constr_CHOICE.c @@ -480,7 +480,8 @@ CHOICE_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, 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 @@ CHOICE_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, 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 db36f901..fd0f59a1 100644 --- a/skeletons/constr_SEQUENCE.c +++ b/skeletons/constr_SEQUENCE.c @@ -647,7 +647,8 @@ SEQUENCE_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, 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 ec9caf0e..2602b802 100644 --- a/skeletons/constr_SET.c +++ b/skeletons/constr_SET.c @@ -660,7 +660,8 @@ SET_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, 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 @@ SET_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, 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 b3428bf1..53877f3d 100644 --- a/skeletons/constr_SET_OF.c +++ b/skeletons/constr_SET_OF.c @@ -520,7 +520,8 @@ SET_OF_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, 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 d299e735..dfc0759f 100644 --- a/skeletons/constraints.h +++ b/skeletons/constraints.h @@ -46,10 +46,10 @@ asn_constr_check_f asn_generic_unknown_constraint; /* Not fully supported */ * 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 |