src/identity_list.h
author Krista Bennett <krista@pep-project.org>
Tue, 14 Aug 2018 13:45:34 +0200
branchENGINE-451
changeset 2826 07c080d73a63
parent 1513 e7f7e42385b5
child 3889 20e17006f286
permissions -rw-r--r--
ENGINE-451: abandoning branch - config files to be dealt with using gpgme (and hotfix will be external to engine
vb@1513
     1
// This file is under GNU General Public License 3.0
vb@1513
     2
// see LICENSE.txt
vb@1513
     3
vb@98
     4
#pragma once
vb@98
     5
vb@105
     6
#include "pEpEngine.h"
vb@98
     7
vb@98
     8
#ifdef __cplusplus
vb@98
     9
extern "C" {
vb@98
    10
#endif
vb@98
    11
vb@98
    12
vb@98
    13
// new_identity_list() - allocate a new identity list
vb@98
    14
//
vb@98
    15
//  parameters:
vb@98
    16
//      ident (in)          identity to move for first element
vb@98
    17
//
vb@98
    18
//  return value:
vb@98
    19
//      new identity_list or NULL if out of memory
vb@98
    20
//
vb@98
    21
//  caveat:
vb@98
    22
//      ident is being moved if the function succeeds, the caller loses
vb@98
    23
//      ownership
vb@98
    24
vb@98
    25
DYNAMIC_API identity_list *new_identity_list(pEp_identity *ident);
vb@98
    26
vb@98
    27
vb@98
    28
// identity_list_dup() - duplicate identity_list (deep copy)
vb@98
    29
//
vb@98
    30
//  parameters:
vb@98
    31
//      id_list (in)        identity_list to copy
vb@98
    32
//
vb@98
    33
//  return value:
vb@98
    34
//      new identity_list or NULL if out of memory
vb@98
    35
vb@98
    36
DYNAMIC_API identity_list *identity_list_dup(const identity_list *src);
vb@98
    37
vb@98
    38
vb@98
    39
// free_identity_list() - free memory allocated by identity_list
vb@98
    40
//
vb@98
    41
//  parameters:
vb@98
    42
//      id_list (in)        identity_list to free
vb@98
    43
//
vb@98
    44
//  caveat:
vb@98
    45
//      this function frees all identities in the list additional to the
vb@98
    46
//      identity_list itself
vb@98
    47
vb@98
    48
DYNAMIC_API void free_identity_list(identity_list *id_list);
vb@98
    49
vb@98
    50
vb@98
    51
// identity_list_add - add identity to an identity_list
vb@98
    52
//
vb@98
    53
//  parameters:
vb@98
    54
//      id_list (in)        identity_list to add to
vb@98
    55
//      ident (in)          identity being added
vb@98
    56
//
vb@98
    57
//  return value:
vb@98
    58
//      pointer to the last element in identity_list or NULL if out of memory
vb@98
    59
//
vb@98
    60
//  caveat:
vb@98
    61
//      ident is being moved, the caller loses ownership if the function is
vb@98
    62
//      successful
vb@98
    63
vb@98
    64
DYNAMIC_API identity_list *identity_list_add(identity_list *id_list, pEp_identity *ident);
vb@98
    65
vb@98
    66
vb@230
    67
// identity_list_length() - get length of identity_list
vb@230
    68
//
vb@230
    69
//  parameters:
vb@230
    70
//      id_list (in)        identity_list struct to determine length of
vb@230
    71
//
vb@230
    72
//  return value:
vb@230
    73
//      length of identity_list in number of elements
vb@230
    74
vb@230
    75
DYNAMIC_API int identity_list_length(const identity_list *id_list);
vb@230
    76
vb@230
    77
vb@98
    78
#ifdef __cplusplus
vb@98
    79
}
vb@98
    80
#endif
vb@98
    81