GNUnet  0.11.x
gnunet_friends_lib.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2013 Christian Grothoff
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
20 
31 #ifndef GNUNET_FRIENDS_LIB_H
32 #define GNUNET_FRIENDS_LIB_H
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #if 0 /* keep Emacsens' auto-indent happy */
38 }
39 #endif
40 #endif
41 
42 #include "gnunet_util_lib.h"
43 
44 
51 typedef void (*GNUNET_FRIENDS_Callback)(void *cls,
52  const struct
53  GNUNET_PeerIdentity *friend_id);
54 
55 
64 int
67  void *cb_cls);
68 
69 
74 
75 
83 struct GNUNET_FRIENDS_Writer *
85 
86 
93 int
95 
96 
104 int
106  const struct GNUNET_PeerIdentity *friend_id);
107 
108 
109 #if 0 /* keep Emacsens' auto-indent happy */
110 {
111 #endif
112 #ifdef __cplusplus
113 }
114 #endif
115 
116 #endif
117  /* end of group */
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
void(* GNUNET_FRIENDS_Callback)(void *cls, const struct GNUNET_PeerIdentity *friend_id)
Signature of a function called on each friend found.
int GNUNET_FRIENDS_parse(const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_FRIENDS_Callback cb, void *cb_cls)
Parse the FRIENDS file.
Definition: friends.c:39
struct GNUNET_FRIENDS_Writer * GNUNET_FRIENDS_write_start(const struct GNUNET_CONFIGURATION_Handle *cfg)
Start writing a fresh FRIENDS file.
Definition: friends.c:165
void * cls
Closure for proc and ackp.
Handle for writing a friends file.
Definition: friends.c:148
int GNUNET_FRIENDS_write(struct GNUNET_FRIENDS_Writer *w, const struct GNUNET_PeerIdentity *friend_id)
Add a friend to the friends file.
Definition: friends.c:229
The identity of the host (wraps the signing key of the peer).
int GNUNET_FRIENDS_write_stop(struct GNUNET_FRIENDS_Writer *w)
Finish writing out the friends file.
Definition: friends.c:211
configuration data
Definition: configuration.c:85