| Midgard2 Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#include <midgard_request_config.h>
MidgardRequestConfig;
MidgardRequestConfigClass;
MidgardRequestConfigPrivate;
MidgardRequestConfig * midgard_request_config_new (const gchar *uri);
gboolean midgard_request_config_set_host (MidgardRequestConfig *self,
GObject *host);
gboolean midgard_request_config_set_style (MidgardRequestConfig *self,
GObject *style);
gboolean midgard_request_config_set_page (MidgardRequestConfig *self,
GObject *page);
gboolean midgard_request_config_set_pages (MidgardRequestConfig *self,
GObject **pages);
gboolean midgard_request_config_set_auth (MidgardRequestConfig *self,
gboolean auth);
gboolean midgard_request_config_set_argv (MidgardRequestConfig *self,
GValueArray *argv);
gboolean midgard_request_config_set_argc (MidgardRequestConfig *self,
guint argc);
GObject * midgard_request_config_get_host (MidgardRequestConfig *self);
GObject * midgard_request_config_get_style (MidgardRequestConfig *self);
GObject * midgard_request_config_get_page (MidgardRequestConfig *self);
const GObject ** midgard_request_config_get_pages (MidgardRequestConfig *self);
gboolean midgard_request_config_get_auth (MidgardRequestConfig *self);
GValueArray * midgard_request_config_get_argv (MidgardRequestConfig *self);
guint midgard_request_config_get_argc (MidgardRequestConfig *self);
const gchar * midgard_request_config_get_uri (MidgardRequestConfig *self);
MidgardRequestConfig holds variables which are valid for a very short time. Real use case is to store http request's data in MidgardRequestConfig configuration.
typedef struct {
GObject parent;
GObject *host;
GObject *page;
GObject *style;
const GObject **pages;
const gchar *uri;
gboolean auth_required;
gboolean is_auth;
GValueArray *argv;
gint argc;
} MidgardRequestConfig;
typedef struct _MidgardRequestConfigPrivate MidgardRequestConfigPrivate;
MidgardRequestConfig * midgard_request_config_new (const gchar *uri);
uri can not be explicitly set to NULL.
Use empty string (not NULL) if there's not need for unique uri.
|
unique uri which identifies request |
Returns : |
new MidgardRequestConfig or NULL otherwise.
|
gboolean midgard_request_config_set_host (MidgardRequestConfig *self, GObject *host);
Host can be set only once. Warning message is thrown if there's attempt to change host. MidgardRequestConfig only holds a pointer to the host. It doesn't allocate or free its memory.
|
MidgardRequestConfig instance |
|
GObject host |
Returns : |
TRUE on success, FALSE otherwise
|
gboolean midgard_request_config_set_style (MidgardRequestConfig *self, GObject *style);
Style can be set only once. Warning message is thrown if there's attempt to change style. MidgardRequestConfig only holds a pointer to the style. It doesn't allocate or free its memory.
|
MidgardRequestConfig instance |
|
GObject style |
Returns : |
TRUE on success, FALSE otherwise
|
gboolean midgard_request_config_set_page (MidgardRequestConfig *self, GObject *page);
Page can be set only once. Warning message is thrown if there's attempt to change page. MidgardRequestConfig only holds a pointer to the page. It doesn't allocate or free its memory.
|
MidgardRequestConfig instance |
|
GObject page |
Returns : |
TRUE on success, FALSE otherwise
|
gboolean midgard_request_config_set_pages (MidgardRequestConfig *self, GObject **pages);
Pages can be set only once per MidgardRequestConfig instance. Warning message is thrown if there's attempt to change pages array.
Given pages array is owned by MidgardRequestConfig and should not be freed.
|
MidgardRequestConfig instance |
|
array of GObject pages |
Returns : |
TRUE on success, FALSE otherwise
|
gboolean midgard_request_config_set_auth (MidgardRequestConfig *self, gboolean auth);
A toggle to switch if request requires authentication. It can be set as many times as needed.
|
MidgardRequestConfig instance |
|
authentication switch |
Returns : |
%TRUE on success, FALSE otherwise
|
gboolean midgard_request_config_set_argv (MidgardRequestConfig *self, GValueArray *argv);
Arguments' array can be set only once. Warning message is thrown if there's attempt to change array.
|
MidgardRequestConfig instance |
|
array of strings |
Returns : |
TRUE on success, FALSE otherwise
|
gboolean midgard_request_config_set_argc (MidgardRequestConfig *self, guint argc);
Sets number of request's arguments. It can be set only once per instance.
|
MidgardRequestConfig instance |
|
number of arguments |
Returns : |
TRUE if argc number has been set, FALSE otherwise
|
GObject * midgard_request_config_get_host (MidgardRequestConfig *self);
|
MidgardRequestConfig instance |
Returns : |
GObject of midgard_host type. NULL on failure.
|
GObject * midgard_request_config_get_style (MidgardRequestConfig *self);
|
MidgardRequestConfig instance |
Returns : |
GObject of midgard_style type. NULL on failure.
|
GObject * midgard_request_config_get_page (MidgardRequestConfig *self);
|
MidgardRequestConfig instance |
Returns : |
GObject of midgard_page type. NULL on failure.
|
const GObject ** midgard_request_config_get_pages (MidgardRequestConfig *self);
Returned array is owned by MidgardRequestConfig, and shouldn't be freed.
|
MidgardRequestConfig instance |
Returns : |
NULL terminated array of GObject objects. |
gboolean midgard_request_config_get_auth (MidgardRequestConfig *self);
GValueArray * midgard_request_config_get_argv (MidgardRequestConfig *self);
|
MidgardRequestConfig instance |
Returns : |
argv array or NULL
|
guint midgard_request_config_get_argc (MidgardRequestConfig *self);
|
MidgardRequestConfig instance |
Returns : |
number of request's arguments |
const gchar * midgard_request_config_get_uri (MidgardRequestConfig *self);
|
MidgardRequestConfig instance |
Returns : |
uri, which MidgardRequestConfig has been initialized for. Or NULL.
|