2 This file is part of GNUnet.
3 (C) 2012 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your
8 option) any later version.
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 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file lockmanager/lockmanager_api.c
23 * @brief API implementation of gnunet_lockmanager_service.h
24 * @author Sree Harsha Totakura
28 #include "gnunet_common.h"
29 #include "gnunet_protocols.h"
30 #include "gnunet_client_lib.h"
32 #include "lockmanager.h"
34 #define LOG(kind,...) \
35 GNUNET_log_from (kind, "gnunet-service-lockmanager",__VA_ARGS__)
38 * Handler for the lockmanager service
40 struct GNUNET_LOCKMANAGER_Handle
43 * The client connection to the service
45 struct GNUNET_CLIENT_Connection *conn;
50 * Connect to the lockmanager service
52 * @param cfg the configuration to use
54 * @return upon success the handle to the service; NULL upon error
56 struct GNUNET_LOCKMANAGER_Handle *
57 GNUNET_LOCKMANAGER_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
59 struct GNUNET_LOCKMANAGER_Handle *h;
61 h = GNUNET_malloc (sizeof (struct GNUNET_LOCKMANAGER_Handle));
62 h->conn = GNUNET_CLIENT_connect ("lockmanager", cfg);
72 * Disconnect from the lockmanager service
74 * @param handle the handle to the lockmanager service
77 GNUNET_LOCKMANAGER_disconnect (struct GNUNET_LOCKMANAGER_Handle *handle)