26 #ifndef _GVMD_GMP_GET_H 27 #define _GVMD_GMP_GET_H 46 #define INIT_GET(type, capital) \ 48 ret = init_get ("get_" G_STRINGIFY (type) "s", \ 49 &get_##type##s_data->get, \ 50 G_STRINGIFY (capital) "s", \ 57 SEND_TO_CLIENT_OR_FAIL (XML_ERROR_SYNTAX ( \ 58 "get_" G_STRINGIFY (type) "s", "Permission denied")); \ 61 internal_error_send_to_client (error); \ 64 get_##type##s_data_reset (get_##type##s_data); \ 65 set_client_state (CLIENT_AUTHENTIC); \ 77 send_get_start (
const char *,
int (*) (
const char *,
void *),
void *);
85 #define SEND_GET_START(type) \ 88 if (send_get_start ( \ 89 type, gmp_parser->client_writer, gmp_parser->client_writer_data)) \ 91 error_send_to_client (error); \ 101 int (*) (
const char *,
void *),
113 #define SEND_GET_COMMON(type, get, iterator) \ 116 if (send_get_common ( \ 117 G_STRINGIFY (type), \ 120 gmp_parser->client_writer, \ 121 gmp_parser->client_writer_data, \ 123 ? trash_##type##_writable (get_iterator_resource (iterator)) \ 124 : type##_writable (get_iterator_resource (iterator)), \ 126 ? trash_##type##_in_use (get_iterator_resource (iterator)) \ 127 : type##_in_use (get_iterator_resource (iterator)))) \ 129 error_send_to_client (error); \ 148 int (*) (
const char *,
void *),
154 int (*) (
const char *,
void *),
163 #define SEND_GET_END(type, get, count, filtered) \ 166 if (send_get_end (type, \ 170 resource_count (type, get), \ 171 gmp_parser->client_writer, \ 172 gmp_parser->client_writer_data)) \ 174 error_send_to_client (error); \ 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:716
A generic SQL iterator structure.
Definition: iterator.h:50
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:320
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:58
Command data for a get command.
Definition: manage.h:316
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:480
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:692
int init_get(gchar *command, get_data_t *get, const gchar *setting_name, int *first)
Init for a GET handler.
Definition: gmp_get.c:108
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:280
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:233