diff options
-rw-r--r-- | rest/Rest-1.0.metadata | 31 | ||||
-rw-r--r-- | rest/meson.build | 7 | ||||
-rw-r--r-- | rest/rest-oauth2-proxy-call.c | 1 | ||||
-rw-r--r-- | rest/rest-oauth2-proxy-call.h | 3 | ||||
-rw-r--r-- | rest/rest-oauth2-proxy.h | 4 | ||||
-rw-r--r-- | rest/rest-params.c | 26 | ||||
-rw-r--r-- | rest/rest.h | 17 |
7 files changed, 69 insertions, 20 deletions
diff --git a/rest/Rest-1.0.metadata b/rest/Rest-1.0.metadata new file mode 100644 index 0000000..ed5d476 --- /dev/null +++ b/rest/Rest-1.0.metadata @@ -0,0 +1,31 @@ +OAuth2Proxy cprefix="oauth2_proxy_" +OAuth2ProxyCall cprefix="oauth2_proxy_call_" +Proxy + .new_call skip=false + .bind skip=false +ProxyCall + .get_params skip=false + .get_response_headers skip=false + .add_headers skip=false + .add_params skip=false + .continuous skip=false + .upload skip=false + .cancel skip=false +XmlNode + .ref skip=false + .unref skip=false + +ProxyCallAsyncCallback + .error nullable=true + .weak_object nullable=true + .userdata closure=3 +ProxyCallContinuousCallback + .error nullable=true + .weak_object nullable=true + .userdata closure=5 +ProxyCallUploadCallback + .error nullable=true + .weak_object nullable=true + .userdata closure=5 + +*.ref unowned
\ No newline at end of file diff --git a/rest/meson.build b/rest/meson.build index 0a16c36..8e69a86 100644 --- a/rest/meson.build +++ b/rest/meson.build @@ -79,19 +79,15 @@ endif if get_option('introspection') librest_gir_extra_args = [ '--accept-unprefixed', - '--c-include=rest/rest-enum-types.h', ] - foreach header : librest_headers - librest_gir_extra_args += '--c-include=rest/@0@'.format(header) - endforeach - librest_gir = gnome.generate_gir(librest_lib, sources: librest_sources + librest_headers + librest_enums, nsversion: librest_api_version, namespace: 'Rest', symbol_prefix: 'rest', identifier_prefix: 'Rest', + header: 'rest/rest.h', export_packages: librest_pkg_string, includes: [ 'GObject-2.0', 'Gio-2.0', 'Soup-@0@'.format(libsoup_api_version) ], extra_args: librest_gir_extra_args, @@ -103,6 +99,7 @@ if get_option('introspection') librest_vapi = gnome.generate_vapi(librest_pkg_string, sources: librest_gir [0], packages: [ 'glib-2.0', 'libsoup-@0@'.format(libsoup_api_version) ], + metadata_dirs : meson.current_source_dir(), install: true, ) endif diff --git a/rest/rest-oauth2-proxy-call.c b/rest/rest-oauth2-proxy-call.c index 88840b3..cfed247 100644 --- a/rest/rest-oauth2-proxy-call.c +++ b/rest/rest-oauth2-proxy-call.c @@ -17,6 +17,7 @@ */ #include "rest-oauth2-proxy-call.h" +#include "rest-oauth2-proxy.h" G_DEFINE_TYPE (RestOAuth2ProxyCall, rest_oauth2_proxy_call, REST_TYPE_PROXY_CALL) diff --git a/rest/rest-oauth2-proxy-call.h b/rest/rest-oauth2-proxy-call.h index 799157d..3da126d 100644 --- a/rest/rest-oauth2-proxy-call.h +++ b/rest/rest-oauth2-proxy-call.h @@ -18,7 +18,8 @@ #pragma once -#include <rest/rest.h> +#include <glib-object.h> +#include <rest/rest-proxy-call.h> G_BEGIN_DECLS diff --git a/rest/rest-oauth2-proxy.h b/rest/rest-oauth2-proxy.h index dd4148e..c63d33e 100644 --- a/rest/rest-oauth2-proxy.h +++ b/rest/rest-oauth2-proxy.h @@ -37,10 +37,10 @@ struct _RestOAuth2ProxyClass gpointer padding[8]; }; -enum { +typedef enum { REST_OAUTH2_ERROR_NO_REFRESH_TOKEN, REST_OAUTH2_ERROR_ACCESS_TOKEN_EXPIRED, -}; +} RestOAuth2Error; #define REST_OAUTH2_ERROR rest_oauth2_error_quark () GQuark rest_oauth2_error_quark (); diff --git a/rest/rest-params.c b/rest/rest-params.c index f2ac286..bddd3c1 100644 --- a/rest/rest-params.c +++ b/rest/rest-params.c @@ -281,12 +281,14 @@ rest_params_iter_init (RestParamsIter *iter, /** * rest_params_iter_next: * @iter: an initialized #RestParamsIter - * @name: (out) (optional): a location to store the name, or %NULL - * @param: (out) (optional): a location to store the #RestParam, or %NULL + * @name: (out) (optional) (nullable) (transfer none): a location to store the name, + * or %NULL + * @param: (out) (optional) (nullable) (transfer none): a location to store the + * #RestParam, or %NULL * * Advances @iter and retrieves the name and/or parameter that are now pointed - * at as a result of this advancement. If FALSE is returned, @name and @param - * are not set and the iterator becomes invalid. + * at as a result of this advancement. If %FALSE is returned, @name and @param + * are set to %NULL and the iterator becomes invalid. * * Returns: %FALSE if the end of the #RestParams has been reached, %TRUE otherwise. **/ @@ -302,10 +304,20 @@ rest_params_iter_next (RestParamsIter *iter, iter->position++; cur = g_list_nth (iter->params->params, iter->position); - if (cur == NULL) return FALSE; + if (cur == NULL) + { + if (param) + *param = NULL; + if (name) + *name = NULL; + return FALSE; + } + + if (param) + *param = cur->data; + if (name) + *name = rest_param_get_name (*param); - *param = cur->data; - *name = rest_param_get_name (*param); return TRUE; } diff --git a/rest/rest.h b/rest/rest.h index 0c4afbb..4dbd135 100644 --- a/rest/rest.h +++ b/rest/rest.h @@ -25,11 +25,18 @@ G_BEGIN_DECLS #define REST_INSIDE -# include "rest-proxy.h" -# include "rest-proxy-call.h" -# include "rest-oauth2-proxy.h" -# include "rest-utils.h" -# include "rest-pkce-code-challenge.h" +# include <rest/rest-oauth2-proxy.h> +# include <rest/rest-oauth2-proxy-call.h> +# include <rest/rest-param.h> +# include <rest/rest-params.h> +# include <rest/rest-pkce-code-challenge.h> +# include <rest/rest-pkce-code-challenge.h> +# include <rest/rest-proxy.h> +# include <rest/rest-proxy-auth.h> +# include <rest/rest-proxy-call.h> +# include <rest/rest-utils.h> +# include <rest/rest-xml-node.h> +# include <rest/rest-xml-parser.h> #undef REST_INSIDE G_END_DECLS |