src/identity_list.h
author Edouard Tisserant
Thu, 09 Jun 2016 16:51:44 +0200
branchimport_own_key
changeset 730 de7942336904
parent 230 5b36a2663539
child 1513 e7f7e42385b5
permissions -rw-r--r--
Moved identity_list typedef
vb@98
     1
#pragma once
vb@98
     2
vb@105
     3
#include "pEpEngine.h"
vb@98
     4
vb@98
     5
#ifdef __cplusplus
vb@98
     6
extern "C" {
vb@98
     7
#endif
vb@98
     8
vb@98
     9
vb@98
    10
// new_identity_list() - allocate a new identity list
vb@98
    11
//
vb@98
    12
//  parameters:
vb@98
    13
//      ident (in)          identity to move for first element
vb@98
    14
//
vb@98
    15
//  return value:
vb@98
    16
//      new identity_list or NULL if out of memory
vb@98
    17
//
vb@98
    18
//  caveat:
vb@98
    19
//      ident is being moved if the function succeeds, the caller loses
vb@98
    20
//      ownership
vb@98
    21
vb@98
    22
DYNAMIC_API identity_list *new_identity_list(pEp_identity *ident);
vb@98
    23
vb@98
    24
vb@98
    25
// identity_list_dup() - duplicate identity_list (deep copy)
vb@98
    26
//
vb@98
    27
//  parameters:
vb@98
    28
//      id_list (in)        identity_list to copy
vb@98
    29
//
vb@98
    30
//  return value:
vb@98
    31
//      new identity_list or NULL if out of memory
vb@98
    32
vb@98
    33
DYNAMIC_API identity_list *identity_list_dup(const identity_list *src);
vb@98
    34
vb@98
    35
vb@98
    36
// free_identity_list() - free memory allocated by identity_list
vb@98
    37
//
vb@98
    38
//  parameters:
vb@98
    39
//      id_list (in)        identity_list to free
vb@98
    40
//
vb@98
    41
//  caveat:
vb@98
    42
//      this function frees all identities in the list additional to the
vb@98
    43
//      identity_list itself
vb@98
    44
vb@98
    45
DYNAMIC_API void free_identity_list(identity_list *id_list);
vb@98
    46
vb@98
    47
vb@98
    48
// identity_list_add - add identity to an identity_list
vb@98
    49
//
vb@98
    50
//  parameters:
vb@98
    51
//      id_list (in)        identity_list to add to
vb@98
    52
//      ident (in)          identity being added
vb@98
    53
//
vb@98
    54
//  return value:
vb@98
    55
//      pointer to the last element in identity_list or NULL if out of memory
vb@98
    56
//
vb@98
    57
//  caveat:
vb@98
    58
//      ident is being moved, the caller loses ownership if the function is
vb@98
    59
//      successful
vb@98
    60
vb@98
    61
DYNAMIC_API identity_list *identity_list_add(identity_list *id_list, pEp_identity *ident);
vb@98
    62
vb@98
    63
vb@230
    64
// identity_list_length() - get length of identity_list
vb@230
    65
//
vb@230
    66
//  parameters:
vb@230
    67
//      id_list (in)        identity_list struct to determine length of
vb@230
    68
//
vb@230
    69
//  return value:
vb@230
    70
//      length of identity_list in number of elements
vb@230
    71
vb@230
    72
DYNAMIC_API int identity_list_length(const identity_list *id_list);
vb@230
    73
vb@230
    74
vb@98
    75
#ifdef __cplusplus
vb@98
    76
}
vb@98
    77
#endif
vb@98
    78