Revision b9e7dd7b src/CloudSupport/cloud_helper_delegate.c

View differences:

src/CloudSupport/cloud_helper_delegate.c
14 14

  
15 15
struct delegate_iface {
16 16
  void* (*cloud_helper_init)(struct nodeID *local, const char *config);
17
  int (*get_from_cloud)(void *context, char *key, uint8_t *header_ptr, int header_size);
18
  int (*put_on_cloud)(void *context, char *key, uint8_t *buffer_ptr, int buffer_size);
17

  
18
  int (*get_from_cloud)(void *context, const char *key, uint8_t *header_ptr,
19
                        int header_size, int free_header);
20

  
21
  int (*put_on_cloud)(void *context, const char *key, uint8_t *buffer_ptr,
22
                      int buffer_size, int free_buffer);
23

  
19 24
  struct nodeID* (*get_cloud_node)(void *context, uint8_t variant);
25

  
20 26
  time_t (*timestamp_cloud)(void *context);
27

  
21 28
  int (*is_cloud_node)(void *context, struct nodeID* node);
29

  
22 30
  int (*wait4cloud)(void *context, struct timeval *tout);
31

  
23 32
  int (*recv_from_cloud)(void *context, uint8_t *buffer_ptr, int buffer_size);
24 33
};
25 34

  
......
28 37
  void *delegate_context;
29 38
};
30 39

  
31
static struct cloud_helper_impl_context* delegate_cloud_init(struct nodeID *local, const char *config)
40
static struct cloud_helper_impl_context*
41
delegate_cloud_init(struct nodeID *local, const char *config)
32 42
{
33 43
  struct cloud_helper_impl_context *ctx;
34 44
  struct tag *cfg_tags;
......
60 70
  return ctx;
61 71
}
62 72

  
63
static int delegate_cloud_get_from_cloud(struct cloud_helper_impl_context *context, char *key, uint8_t *header_ptr, int header_size)
73
static int
74
delegate_cloud_get_from_cloud(struct cloud_helper_impl_context *context,
75
                              const char *key, uint8_t *header_ptr,
76
                              int header_size, int free_header)
64 77
{
65
  return context->delegate->get_from_cloud(context->delegate_context, key, header_ptr, header_size);
78
  return context->delegate->get_from_cloud(context->delegate_context, key,
79
                                           header_ptr, header_size,
80
                                           free_header);
66 81
}
67 82

  
68
static int delegate_cloud_put_on_cloud(struct cloud_helper_impl_context *context, char *key, uint8_t *buffer_ptr, int buffer_size)
83
static int
84
delegate_cloud_put_on_cloud(struct cloud_helper_impl_context *context,
85
                            const char *key, uint8_t *buffer_ptr,
86
                            int buffer_size, int free_buffer)
69 87
{
70
  return context->delegate->put_on_cloud(context->delegate_context, key, buffer_ptr, buffer_size);
88
  return context->delegate->put_on_cloud(context->delegate_context, key,
89
                                         buffer_ptr, buffer_size, free_buffer);
71 90
}
72

  
73
static struct nodeID* delegate_cloud_get_cloud_node(struct cloud_helper_impl_context *context, uint8_t variant)
91
static struct nodeID*
92
delegate_cloud_get_cloud_node(struct cloud_helper_impl_context *context,
93
                              uint8_t variant)
74 94
{
75 95
  return context->delegate->get_cloud_node(context->delegate_context, variant);
76 96
}
77 97

  
78
static time_t delegate_timestamp_cloud(struct cloud_helper_impl_context *context)
98
static time_t
99
delegate_timestamp_cloud(struct cloud_helper_impl_context *context)
79 100
{
80 101
  return context->delegate->timestamp_cloud(context->delegate_context);
81 102
}
82 103

  
83
int delegate_is_cloud_node(struct cloud_helper_impl_context *context, struct nodeID* node)
104
int delegate_is_cloud_node(struct cloud_helper_impl_context *context,
105
                           struct nodeID* node)
84 106
{
85 107
  return context->delegate->is_cloud_node(context->delegate_context, node);
86 108
}
87 109

  
88
static int delegate_cloud_wait4cloud(struct cloud_helper_impl_context *context, struct timeval *tout)
110
static int delegate_cloud_wait4cloud(struct cloud_helper_impl_context *context,
111
                                     struct timeval *tout)
89 112
{
90 113
  return context->delegate->wait4cloud(context->delegate_context, tout);
91 114
}
92 115

  
93
static int delegate_cloud_recv_from_cloud(struct cloud_helper_impl_context *context, uint8_t *buffer_ptr, int buffer_size)
116
static int
117
delegate_cloud_recv_from_cloud(struct cloud_helper_impl_context *context,
118
                               uint8_t *buffer_ptr, int buffer_size)
94 119
{
95
  return context->delegate->recv_from_cloud(context->delegate_context, buffer_ptr, buffer_size);
120
  return context->delegate->recv_from_cloud(context->delegate_context,
121
                                            buffer_ptr, buffer_size);
96 122
}
97 123

  
98 124
struct cloud_helper_iface delegate = {

Also available in: Unified diff