src/map_asn1.h
author Lars Rohwedder <roker@pep-project.org>
Tue, 07 Jun 2016 23:29:46 +0200
changeset 723 be101850681e
parent 672 f7bcbc1db9bf
child 940 5f0a9d0f0ecd
permissions -rw-r--r--
compiler shows with -Wall some warnings about unused code etc.
roker@723
     1
#pragma once
vb@639
     2
vb@639
     3
#include "pEpEngine.h"
vb@639
     4
#include "stringlist.h"
vb@639
     5
#include "../asn.1/Identity.h"
vb@645
     6
#include "../asn.1/KeyList.h"
vb@645
     7
vb@645
     8
#ifdef __cplusplus
vb@645
     9
extern "C" {
vb@645
    10
#endif
vb@639
    11
vb@667
    12
vb@667
    13
// Identity_from_Struct() - convert pEp_identity into ASN.1 Identity_t
vb@667
    14
//
vb@667
    15
//  params:
vb@667
    16
//      ident (in)          pEp_identity to convert
vb@667
    17
//      result (inout)      Identity_t to update or NULL to alloc a new one
vb@667
    18
//
vb@667
    19
//  return value:
vb@667
    20
//      pointer to updated or allocated result
vb@672
    21
//
vb@672
    22
//  caveat:
vb@672
    23
//      if a new struct is allocated, the ownership goes to the caller
vb@667
    24
vb@667
    25
Identity_t *Identity_from_Struct(
vb@667
    26
        const pEp_identity *ident,
vb@667
    27
        Identity_t *result
vb@667
    28
    );
vb@667
    29
vb@667
    30
vb@667
    31
// Identity_to_Struct() - convert ASN.1 Identity_t into pEp_identity
vb@667
    32
//
vb@667
    33
//  params:
vb@667
    34
//      ident (in)          Identity_t to convert
vb@667
    35
//      result (inout)      pEp_identity to update or NULL to alloc a new one
vb@667
    36
//
vb@667
    37
//  return value:
vb@667
    38
//      pointer to updated or allocated result
vb@672
    39
//
vb@672
    40
//  caveat:
vb@672
    41
//      if a new struct is allocated, the ownership goes to the caller
vb@667
    42
vb@654
    43
pEp_identity *Identity_to_Struct(Identity_t *ident, pEp_identity *result);
vb@667
    44
vb@667
    45
vb@667
    46
// KeyList_from_stringlist() - convert stringlist_t into ASN.1 KeyList_t
vb@667
    47
//
vb@667
    48
//  params:
vb@667
    49
//      list (in)           stringlist_t to convert
vb@667
    50
//      result (inout)      KeyList_t to update or NULL to alloc a new one
vb@667
    51
//
vb@667
    52
//  return value:
vb@667
    53
//      pointer to updated or allocated result
vb@672
    54
//
vb@672
    55
//  caveat:
vb@672
    56
//      if a new struct is allocated, the ownership goes to the caller
vb@667
    57
vb@667
    58
KeyList_t *KeyList_from_stringlist(
vb@667
    59
        const stringlist_t *list,
vb@667
    60
        KeyList_t *result
vb@667
    61
    );
vb@667
    62
vb@667
    63
// KeyList_to_stringlist() - convert ASN.1 KeyList_t to stringlist_t
vb@667
    64
//
vb@667
    65
//  params:
vb@667
    66
//      list (in)           ASN.1 KeyList_t to convert
vb@667
    67
//      result (inout)      stringlist_t to update or NULL to alloc a new one
vb@667
    68
//
vb@667
    69
//  return value:
vb@667
    70
//      pointer to updated or allocated result
vb@672
    71
//
vb@672
    72
//  caveat:
vb@672
    73
//      if a new struct is allocated, the ownership goes to the caller
vb@667
    74
vb@654
    75
stringlist_t *KeyList_to_stringlist(KeyList_t *list, stringlist_t *result);
vb@645
    76
vb@667
    77
vb@645
    78
#ifdef __cplusplus
vb@645
    79
}
vb@645
    80
#endif
vb@645
    81