From 90878323300deba21f7394893d4bce2f00755a3b Mon Sep 17 00:00:00 2001 From: Volker Birk Date: Thu, 19 Aug 2021 13:15:44 +0200 Subject: [PATCH] adapt to renaming --- src/map_asn1.c | 63 +++++++++++++++++++++++++------------------------- src/map_asn1.h | 58 +++++++++++++++++++++++----------------------- 2 files changed, 60 insertions(+), 61 deletions(-) diff --git a/src/map_asn1.c b/src/map_asn1.c index d45ec7500..8ea479bd4 100644 --- a/src/map_asn1.c +++ b/src/map_asn1.c @@ -131,7 +131,6 @@ IdentityList_t *IdentityList_from_identity_list( { bool allocated = !result; - assert(list && list->ident); if (!(list && list->ident)) return NULL; @@ -190,9 +189,9 @@ enomem: return NULL; } -StringPair_t *StringPair_from_Struct( +PStringPair_t *PStringPair_from_Struct( const stringpair_t *value, - StringPair_t *result + PStringPair_t *result ) { bool allocated = !result; @@ -202,7 +201,7 @@ StringPair_t *StringPair_from_Struct( return NULL; if (allocated) - result = (StringPair_t *) calloc(1, sizeof(StringPair_t)); + result = (PStringPair_t *) calloc(1, sizeof(PStringPair_t)); assert(result); if (!result) return NULL; @@ -223,11 +222,11 @@ StringPair_t *StringPair_from_Struct( enomem: if (allocated) - ASN_STRUCT_FREE(asn_DEF_StringPair, result); + ASN_STRUCT_FREE(asn_DEF_PStringPair, result); return NULL; } -stringpair_t *StringPair_to_Struct(StringPair_t *value) +stringpair_t *PStringPair_to_Struct(PStringPair_t *value) { assert(value); if (!value) @@ -257,19 +256,19 @@ enomem: return NULL; } -StringPairList_t *StringPairList_from_stringpair_list( +PStringPairList_t *PStringPairList_from_stringpair_list( const stringpair_list_t *list, - StringPairList_t *result + PStringPairList_t *result ) { bool allocated = !result; - assert(list && list->value); + assert(list); if (!(list && list->value)) return NULL; if (allocated) { - result = (StringPairList_t *) calloc(1, sizeof(StringPairList_t)); + result = (PStringPairList_t *) calloc(1, sizeof(PStringPairList_t)); assert(result); if (!result) return NULL; @@ -279,9 +278,9 @@ StringPairList_t *StringPairList_from_stringpair_list( } for (const stringpair_list_t *l = list; l && l->value; l=l->next) { - StringPair_t *value = StringPair_from_Struct(l->value, NULL); + PStringPair_t *value = PStringPair_from_Struct(l->value, NULL); if (ASN_SEQUENCE_ADD(&result->list, value)) { - ASN_STRUCT_FREE(asn_DEF_StringPair, value); + ASN_STRUCT_FREE(asn_DEF_PStringPair, value); goto enomem; } } @@ -290,12 +289,12 @@ StringPairList_t *StringPairList_from_stringpair_list( enomem: if (allocated) - ASN_STRUCT_FREE(asn_DEF_StringPairList, result); + ASN_STRUCT_FREE(asn_DEF_PStringPairList, result); return NULL; } -stringpair_list_t *StringPairList_to_stringpair_list( - StringPairList_t *list, +stringpair_list_t *PStringPairList_to_stringpair_list( + PStringPairList_t *list, stringpair_list_t *result ) { @@ -312,7 +311,7 @@ stringpair_list_t *StringPairList_to_stringpair_list( stringpair_list_t *r = result; for (int i=0; ilist.count; i++) { - stringpair_t *value = StringPair_to_Struct(list->list.array[i]); + stringpair_t *value = PStringPair_to_Struct(list->list.array[i]); r = stringpair_list_add(r, value); if (!r) goto enomem; @@ -333,7 +332,7 @@ PStringList_t *PStringList_from_stringlist( { bool allocated = !result; - assert(list && list->value); + assert(list); if (!(list && list->value)) return NULL; @@ -406,9 +405,9 @@ enomem: return NULL; } -BlobList_t *BlobList_from_bloblist( +PBlobList_t *PBlobList_from_bloblist( bloblist_t *list, - BlobList_t *result, + PBlobList_t *result, bool copy, size_t max_blob_size ) @@ -417,12 +416,12 @@ BlobList_t *BlobList_from_bloblist( if (!max_blob_size) max_blob_size = SIZE_MAX; - assert(list && list->value); + assert(list); if (!(list && list->value)) return NULL; if (allocated) { - result = (BlobList_t *) calloc(1, sizeof(BlobList_t)); + result = (PBlobList_t *) calloc(1, sizeof(PBlobList_t)); assert(result); if (!result) return NULL; @@ -434,7 +433,7 @@ BlobList_t *BlobList_from_bloblist( size_t rest_blob_size = max_blob_size; for (bloblist_t *l = list; l && l->value; l=l->next) { - Blob_t *element = (Blob_t *) calloc(1, sizeof(Blob_t)); + PBlob_t *element = (PBlob_t *) calloc(1, sizeof(PBlob_t)); assert(element); if (!element) goto enomem; @@ -503,7 +502,7 @@ BlobList_t *BlobList_from_bloblist( } if (ASN_SEQUENCE_ADD(&result->list, element)) { - ASN_STRUCT_FREE(asn_DEF_Blob, element); + ASN_STRUCT_FREE(asn_DEF_PBlob, element); goto enomem; } } @@ -512,12 +511,12 @@ BlobList_t *BlobList_from_bloblist( enomem: if (allocated) - ASN_STRUCT_FREE(asn_DEF_BlobList, result); + ASN_STRUCT_FREE(asn_DEF_PBlobList, result); return NULL; } -bloblist_t *BlobList_to_bloblist( - BlobList_t *list, +bloblist_t *PBlobList_to_bloblist( + PBlobList_t *list, bloblist_t *result, bool copy, size_t max_blob_size @@ -659,7 +658,7 @@ ASN1Message_t *ASN1Message_from_message( } if (msg->sent) { - Timestamp_t *ts = asn_time2GT(NULL, msg->sent, 1); + GeneralizedTime_t *ts = asn_time2GT(NULL, msg->sent, 1); if (!ts) goto enomem; @@ -667,7 +666,7 @@ ASN1Message_t *ASN1Message_from_message( } if (msg->recv) { - Timestamp_t *ts = asn_time2GT(NULL, msg->recv, 1); + GeneralizedTime_t *ts = asn_time2GT(NULL, msg->recv, 1); if (!ts) goto enomem; @@ -756,7 +755,7 @@ ASN1Message_t *ASN1Message_from_message( } if (msg->opt_fields && msg->opt_fields->value) { - StringPairList_t *l = StringPairList_from_stringpair_list(msg->opt_fields, NULL); + PStringPairList_t *l = PStringPairList_from_stringpair_list(msg->opt_fields, NULL); if (!l) goto enomem; @@ -844,7 +843,7 @@ ASN1Message_t *ASN1Message_from_message( } if (msg->attachments && msg->attachments->value) { - BlobList_t *bl = BlobList_from_bloblist(msg->attachments, NULL, copy, + PBlobList_t *bl = PBlobList_from_bloblist(msg->attachments, NULL, copy, rest_blob_size); if (!bl) goto enomem; @@ -1000,7 +999,7 @@ message *ASN1Message_to_message( if (msg->opt_fields) { stringpair_list_t *l = - StringPairList_to_stringpair_list(msg->opt_fields, NULL); + PStringPairList_to_stringpair_list(msg->opt_fields, NULL); if (!l) goto enomem; @@ -1073,7 +1072,7 @@ message *ASN1Message_to_message( } if (msg->attachments) { - bloblist_t *a = BlobList_to_bloblist(msg->attachments, NULL, copy, + bloblist_t *a = PBlobList_to_bloblist(msg->attachments, NULL, copy, rest_blob_size); if (!a) goto enomem; diff --git a/src/map_asn1.h b/src/map_asn1.h index 8373b80ae..2ace2f277 100644 --- a/src/map_asn1.h +++ b/src/map_asn1.h @@ -89,12 +89,12 @@ identity_list *IdentityList_to_identity_list(IdentityList_t *list, identity_list /** - * + * * - * @brief Convert stringpair_t into ASN.1 StringPair_t + * @brief Convert stringpair_t into ASN.1 PStringPair_t * * @param value[in] stringpair_t to convert - * @param result[in,out] StringPair_t to update or NULL to alloc a new one + * @param result[in,out] PStringPair_t to update or NULL to alloc a new one * * @retval pointer to updated or allocated result * @@ -102,18 +102,18 @@ identity_list *IdentityList_to_identity_list(IdentityList_t *list, identity_list * */ -StringPair_t *StringPair_from_Struct( +PStringPair_t *PStringPair_from_Struct( const stringpair_t *value, - StringPair_t *result + PStringPair_t *result ); /** - * + * * - * @brief Convert ASN.1 StringPair_t into stringpair_t + * @brief Convert ASN.1 PStringPair_t into stringpair_t * - * @param value[in] StringPair_t to convert + * @param value[in] PStringPair_t to convert * * @retval pointer to updated or allocated result * @@ -121,16 +121,16 @@ StringPair_t *StringPair_from_Struct( * */ -stringpair_t *StringPair_to_Struct(StringPair_t *value); +stringpair_t *PStringPair_to_Struct(PStringPair_t *value); /** - * + * * - * @brief Convert stringpair_list_t into ASN.1 StringPairList_t + * @brief Convert stringpair_list_t into ASN.1 PStringPairList_t * * @param list[in] stringpair_list to convert - * @param result[inout] StringPairList_t to update or NULL to alloc a new one + * @param result[inout] PStringPairList_t to update or NULL to alloc a new one * * @retval pointer to updated or allocated result * @@ -138,17 +138,17 @@ stringpair_t *StringPair_to_Struct(StringPair_t *value); * */ -StringPairList_t *StringPairList_from_stringpair_list( +PStringPairList_t *PStringPairList_from_stringpair_list( const stringpair_list_t *list, - StringPairList_t *result + PStringPairList_t *result ); /** - * + * * - * @brief Convert ASN.1 StringPairList_t to stringpair_list_t + * @brief Convert ASN.1 PStringPairList_t to stringpair_list_t * - * @param list[in] ASN.1 StringPairList_t to convert + * @param list[in] ASN.1 PStringPairList_t to convert * @param result[inout] stringpair_list_t to update or NULL to alloc a new one * * @retval pointer to updated or allocated result @@ -157,8 +157,8 @@ StringPairList_t *StringPairList_from_stringpair_list( * */ -stringpair_list_t *StringPairList_to_stringpair_list( - StringPairList_t *list, +stringpair_list_t *PStringPairList_to_stringpair_list( + PStringPairList_t *list, stringpair_list_t *result ); @@ -199,12 +199,12 @@ stringlist_t *PStringList_to_stringlist(PStringList_t *list); /** - * + * * - * @brief Convert bloblist_t into ASN.1 BlobList_t + * @brief Convert bloblist_t into ASN.1 PBlobList_t * * @param list[in] bloblist to convert - * @param result[inout] BlobList_t to update or NULL to alloc a new one + * @param result[inout] PBlobList_t to update or NULL to alloc a new one * @param copy copy data if true, move data otherwise * @param max_blob_size reject if sum(blob.size) > max_blob_size * to disable set to 0 @@ -215,20 +215,20 @@ stringlist_t *PStringList_to_stringlist(PStringList_t *list); * */ -BlobList_t *BlobList_from_bloblist( +PBlobList_t *PBlobList_from_bloblist( bloblist_t *list, - BlobList_t *result, + PBlobList_t *result, bool copy, size_t max_blob_size ); /** - * + * * - * @brief Convert ASN.1 BlobList_t to bloblist_t + * @brief Convert ASN.1 PBlobList_t to bloblist_t * - * @param list[in] ASN.1 BlobList_t to convert + * @param list[in] ASN.1 PBlobList_t to convert * @param result[inout] bloblist_t to update or NULL to alloc a new one * @param copy copy data if true, move data otherwise * @param max_blob_size reject if sum(blob.size) > max_blob_size @@ -240,8 +240,8 @@ BlobList_t *BlobList_from_bloblist( * */ -bloblist_t *BlobList_to_bloblist( - BlobList_t *list, +bloblist_t *PBlobList_to_bloblist( + PBlobList_t *list, bloblist_t *result, bool copy, size_t max_blob_size