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