-lockmanager build skeleton
[oweals/gnunet.git] / src / lockmanager / lockmanager_api.c
1 /*
2      This file is part of GNUnet.
3      (C) 2012 Christian Grothoff (and other contributing authors)
4
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.
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      General Public License for more details.
14
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.
19 */
20
21 /**
22  * @file lockmanager/lockmanager_api.c
23  * @brief API implementation of gnunet_lockmanager_service.h
24  * @author Sree Harsha Totakura
25  */
26
27 #include "platform.h"
28 #include "gnunet_common.h"
29 #include "gnunet_protocols.h"
30 #include "gnunet_client_lib.h"
31
32 #include "lockmanager.h"
33
34 #define LOG(kind,...) \
35   GNUNET_log_from (kind, "gnunet-service-lockmanager",__VA_ARGS__)
36
37 /**
38  * Handler for the lockmanager service
39  */
40 struct GNUNET_LOCKMANAGER_Handle
41 {
42   /**
43    * The client connection to the service
44    */
45   struct GNUNET_CLIENT_Connection *conn;
46 };
47
48
49 /**
50  * Connect to the lockmanager service
51  *
52  * @param cfg the configuration to use
53  *
54  * @return upon success the handle to the service; NULL upon error
55  */
56 struct GNUNET_LOCKMANAGER_Handle *
57 GNUNET_LOCKMANAGER_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
58 {
59   struct GNUNET_LOCKMANAGER_Handle *h;
60
61   h = GNUNET_malloc (sizeof (struct GNUNET_LOCKMANAGER_Handle));
62   h->conn = GNUNET_CLIENT_connect ("lockmanager", cfg);
63   if (NULL == h->conn)
64     {
65       GNUNET_free (h);
66       return NULL;
67     }
68   return NULL;
69 }
70
71 /**
72  * Disconnect from the lockmanager service
73  *
74  * @param handle the handle to the lockmanager service
75  */
76 void
77 GNUNET_LOCKMANAGER_disconnect (struct GNUNET_LOCKMANAGER_Handle *handle)
78 {
79   
80 }