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