19 #ifndef _GVMD_GMP_GET_H
20 #define _GVMD_GMP_GET_H
22 #include "manage_get.h"
37 #define INIT_GET(type, capital) \
39 ret = init_get ("get_" G_STRINGIFY (type) "s", &get_##type##s_data->get, \
40 G_STRINGIFY (capital) "s", &first); \
46 SEND_TO_CLIENT_OR_FAIL (XML_ERROR_SYNTAX ( \
47 "get_" G_STRINGIFY (type) "s", "Permission denied")); \
50 internal_error_send_to_client (error); \
53 get_##type##s_data_reset (get_##type##s_data); \
54 set_client_state (CLIENT_AUTHENTIC); \
63 send_get_start (
const char *,
int (*) (
const char *,
void *),
void *);
71 #define SEND_GET_START(type) \
74 if (send_get_start (type, gmp_parser->client_writer, \
75 gmp_parser->client_writer_data)) \
77 error_send_to_client (error); \
85 int (*) (
const char *,
void *),
void *,
int,
int);
94 #define SEND_GET_COMMON(type, get, iterator) \
97 if (send_get_common ( \
98 G_STRINGIFY (type), get, iterator, gmp_parser->client_writer, \
99 gmp_parser->client_writer_data, \
101 ? trash_##type##_writable (get_iterator_resource (iterator)) \
102 : type##_writable (get_iterator_resource (iterator)), \
104 ? trash_##type##_in_use (get_iterator_resource (iterator)) \
105 : type##_in_use (get_iterator_resource (iterator)))) \
107 error_send_to_client (error); \
122 #define SEND_GET_COMMON_NO_TRASH(type, get, iterator) \
125 if (send_get_common (G_STRINGIFY (type), get, iterator, \
126 gmp_parser->client_writer, \
127 gmp_parser->client_writer_data, \
128 type##_writable (get_iterator_resource (iterator)), \
129 type##_in_use (get_iterator_resource (iterator)))) \
131 error_send_to_client (error); \
139 const char *,
const char *);
143 int (*) (
const char *,
void *),
void *);
147 int (*) (
const char *,
void *),
void *);
155 #define SEND_GET_END(type, get, count, filtered) \
158 if (send_get_end (type, get, count, filtered, \
159 resource_count (type, get), gmp_parser->client_writer, \
160 gmp_parser->client_writer_data)) \
162 error_send_to_client (error); \
int send_get_end(const char *type, get_data_t *get, int count, int filtered, int full, int(*write_to_client)(const char *, void *), void *write_to_client_data)
Send end of GET response.
Definition: gmp_get.c:712
int send_get_common(const char *type, get_data_t *get, iterator_t *iterator, int(*write_to_client)(const char *, void *), void *write_to_client_data, int writable, int in_use)
Send common part of GET response for a single resource.
Definition: gmp_get.c:311
int buffer_get_filter_xml(GString *msg, const char *type, const get_data_t *get, const char *filter_term, const char *extra_xml)
Write data of a GET command filter to a string buffer as XML.
Definition: gmp_get.c:477
int send_get_start(const char *type, int(*write_to_client)(const char *, void *), void *write_to_client_data)
Send start of GET response.
Definition: gmp_get.c:271
int get_next(iterator_t *resources, get_data_t *get, int *first, int *count, int(*init)(iterator_t *, const get_data_t *))
Iterate a GET iterator.
Definition: gmp_get.c:227
int send_get_end_no_counts(const char *type, get_data_t *get, int(*write_to_client)(const char *, void *), void *write_to_client_data)
Send end of GET response, skipping result counts.
Definition: gmp_get.c:732
int init_get(gchar *command, get_data_t *get, const gchar *setting_name, int *first)
Init for a GET handler.
Definition: gmp_get.c:101
void get_data_parse_attributes(get_data_t *data, const gchar *type, const gchar **attribute_names, const gchar **attribute_values)
Parse attributes for a GET command.
Definition: gmp_get.c:48
Command data for a get command.
Definition: manage_get.h:35
A generic SQL iterator structure.
Definition: iterator.h:50