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