--- a/hasl/haslcontext.h Mon Oct 16 20:56:53 2023 -0500
+++ b/hasl/haslcontext.h Tue Oct 17 04:50:08 2023 -0500
@@ -21,6 +21,8 @@
+#include <hasl/haslversion.h> #define HASL_CONTEXT_DOMAIN (g_quark_from_static_string("hasl-context"))
@@ -96,6 +98,8 @@
#define HASL_TYPE_CONTEXT (hasl_context_get_type())
G_DECLARE_FINAL_TYPE(HaslContext, hasl_context, HASL, CONTEXT, GObject)
#include <hasl/haslmechanism.h>
@@ -109,6 +113,7 @@
HaslContext *hasl_context_new(void);
@@ -121,6 +126,7 @@
const char *hasl_context_get_allowed_mechanisms(HaslContext *ctx);
@@ -134,6 +140,7 @@
void hasl_context_set_allowed_mechanisms(HaslContext *ctx, const char *allowed_mechanisms);
@@ -147,6 +154,7 @@
const char *hasl_context_get_authzid(HaslContext *ctx);
@@ -159,6 +167,7 @@
void hasl_context_set_authzid(HaslContext *ctx, const char *authzid);
@@ -171,6 +180,7 @@
const char *hasl_context_get_username(HaslContext *ctx);
@@ -182,6 +192,7 @@
void hasl_context_set_username(HaslContext *ctx, const char *username);
@@ -194,6 +205,7 @@
const char *hasl_context_get_password(HaslContext *ctx);
@@ -205,6 +217,7 @@
void hasl_context_set_password(HaslContext *ctx, const char *password);
@@ -219,6 +232,7 @@
gboolean hasl_context_get_tls(HaslContext *ctx);
@@ -230,6 +244,7 @@
void hasl_context_set_tls(HaslContext *ctx, gboolean tls);
@@ -247,6 +262,7 @@
gboolean hasl_context_get_allow_clear_text(HaslContext *ctx);
@@ -263,6 +279,7 @@
void hasl_context_set_allow_clear_text(HaslContext *ctx, gboolean allow_clear_text);
@@ -292,6 +309,7 @@
gboolean hasl_context_add_mechanism(HaslContext *ctx, const char *name, GType type);
@@ -305,6 +323,7 @@
char *hasl_context_get_supported_mechanisms(HaslContext *ctx);
@@ -321,6 +340,7 @@
const char *hasl_context_get_current_mechanism(HaslContext *ctx);
@@ -336,6 +356,7 @@
const char *hasl_context_next(HaslContext *ctx);
@@ -361,6 +382,7 @@
HaslMechanismResult hasl_context_step(HaslContext *ctx, const guint8 *server_in, gsize server_in_length, guint8 **client_out, gsize *client_out_length, GError **error);
--- a/hasl/haslgs2header.h Mon Oct 16 20:56:53 2023 -0500
+++ b/hasl/haslgs2header.h Tue Oct 17 04:50:08 2023 -0500
@@ -21,6 +21,8 @@
+#include <hasl/haslversion.h> @@ -62,6 +64,8 @@
#define HASL_TYPE_GS2_HEADER (hasl_gs2_header_get_type())
G_DECLARE_FINAL_TYPE(HaslGs2Header, hasl_gs2_header, HASL, GS2_HEADER, GObject)
@@ -73,6 +77,7 @@
HaslGs2Header *hasl_gs2_header_new(void);
@@ -86,6 +91,7 @@
char *hasl_gs2_header_to_string(HaslGs2Header *header, GError **error);
@@ -98,6 +104,7 @@
gboolean hasl_gs2_header_get_standard_mechanism(HaslGs2Header *header);
@@ -109,6 +116,7 @@
void hasl_gs2_header_set_standard_mechanism(HaslGs2Header *header, gboolean standard);
@@ -121,6 +129,7 @@
HaslGs2HeaderChannelBinding hasl_gs2_header_get_channel_binding(HaslGs2Header *header);
@@ -132,6 +141,7 @@
void hasl_gs2_header_set_channel_binding(HaslGs2Header *header, HaslGs2HeaderChannelBinding channel_binding);
@@ -144,6 +154,7 @@
const char *hasl_gs2_header_get_channel_binding_name(HaslGs2Header *header);
@@ -155,6 +166,7 @@
void hasl_gs2_header_set_channel_binding_name(HaslGs2Header *header, const char *name);
@@ -167,6 +179,7 @@
const char *hasl_gs2_header_get_authzid(HaslGs2Header *header);
@@ -180,6 +193,7 @@
void hasl_gs2_header_set_authzid(HaslGs2Header *header, const char *authzid);
--- a/hasl/haslmechanism.h Mon Oct 16 20:56:53 2023 -0500
+++ b/hasl/haslmechanism.h Tue Oct 17 04:50:08 2023 -0500
@@ -21,6 +21,8 @@
+#include <hasl/haslversion.h> @@ -35,6 +37,8 @@
#define HASL_TYPE_MECHANISM (hasl_mechanism_get_type())
G_DECLARE_DERIVABLE_TYPE(HaslMechanism, hasl_mechanism, HASL, MECHANISM,
@@ -91,6 +95,7 @@
HaslMechanismResult hasl_mechanism_step(HaslMechanism *mechanism, HaslContext *ctx, const guint8 *server_in, gsize server_in_length, guint8 **client_out, gsize *client_out_length, GError **error);
@@ -115,6 +120,7 @@
* Returns: %TRUE if @mechanism should be attempted otherwise %FALSE with
gboolean hasl_mechanism_possible(HaslMechanism *mechanism, HaslContext *ctx, GError **error);
--- a/hasl/haslmechanismanonymous.h Mon Oct 16 20:56:53 2023 -0500
+++ b/hasl/haslmechanismanonymous.h Tue Oct 17 04:50:08 2023 -0500
@@ -23,6 +23,7 @@
#include <hasl/haslcontext.h>
#include <hasl/haslmechanism.h>
+#include <hasl/haslversion.h> @@ -43,6 +44,8 @@
#define HASL_TYPE_MECHANISM_ANONYMOUS (hasl_mechanism_anonymous_get_type())
G_DECLARE_FINAL_TYPE(HaslMechanismAnonymous, hasl_mechanism_anonymous, HASL,
MECHANISM_ANONYMOUS, HaslMechanism)
--- a/hasl/haslmechanismexternal.h Mon Oct 16 20:56:53 2023 -0500
+++ b/hasl/haslmechanismexternal.h Tue Oct 17 04:50:08 2023 -0500
@@ -23,6 +23,7 @@
#include <hasl/haslcontext.h>
#include <hasl/haslmechanism.h>
+#include <hasl/haslversion.h> @@ -42,6 +43,8 @@
#define HASL_TYPE_MECHANISM_EXTERNAL (hasl_mechanism_external_get_type())
G_DECLARE_FINAL_TYPE(HaslMechanismExternal, hasl_mechanism_external, HASL,
MECHANISM_EXTERNAL, HaslMechanism)
--- a/hasl/haslmechanismplain.h Mon Oct 16 20:56:53 2023 -0500
+++ b/hasl/haslmechanismplain.h Tue Oct 17 04:50:08 2023 -0500
@@ -23,6 +23,7 @@
#include <hasl/haslcontext.h>
#include <hasl/haslmechanism.h>
+#include <hasl/haslversion.h> @@ -45,6 +46,8 @@
#define HASL_TYPE_MECHANISM_PLAIN (hasl_mechanism_plain_get_type())
G_DECLARE_FINAL_TYPE(HaslMechanismPlain, hasl_mechanism_plain, HASL,
MECHANISM_PLAIN, HaslMechanism)
--- a/hasl/haslversion.h Mon Oct 16 20:56:53 2023 -0500
+++ b/hasl/haslversion.h Tue Oct 17 04:50:08 2023 -0500
@@ -22,6 +22,132 @@
#include <hasl/haslversionconsts.h>
+/* clang-format tries to remove the space after 'if', which confuses + * gobject-introspection, so turn it off temporarily. */ +#if (defined(_WIN32) || defined(__CYGWIN__)) && \ + !defined(HASL_STATIC_COMPILATION) +#define _HASL_EXPORT __declspec(dllexport) +#define _HASL_IMPORT __declspec(dllimport) +#define _HASL_EXPORT __attribute__((visibility("default"))) +#define _HASL_API _HASL_EXPORT +#define _HASL_API _HASL_IMPORT +#define _HASL_EXTERN _HASL_API extern +#ifdef HASL_DISABLE_DEPRECATION_WARNINGS +#define HASL_DEPRECATED _HASL_EXTERN +#define HASL_DEPRECATED_FOR(f) _HASL_EXTERN +#define HASL_UNAVAILABLE(maj, min) _HASL_EXTERN +#define HASL_UNAVAILABLE_STATIC_INLINE(maj, min) +#define HASL_UNAVAILABLE_TYPE(maj, min) +#define HASL_DEPRECATED G_DEPRECATED _HASL_EXTERN +#define HASL_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) _HASL_EXTERN +#define HASL_UNAVAILABLE(maj, min) G_UNAVAILABLE(maj, min) _HASL_EXTERN +#define HASL_UNAVAILABLE_STATIC_INLINE(maj, min) G_UNAVAILABLE(maj, min) +#define HASL_UNAVAILABLE_TYPE(maj, min) G_UNAVAILABLE(maj, min) + * HASL_VERSION_CUR_STABLE: + * A macro that evaluates to the current stable version of hasl, in a format + * that can be used by the C pre-processor. +#define HASL_VERSION_CUR_STABLE \ + (G_ENCODE_VERSION(HASL_MAJOR_VERSION, HASL_MINOR_VERSION)) +/* If the package sets HASL_VERSION_MIN_REQUIRED to some future + * HASL_VERSION_X_Y value that we don't know about, it will compare as 0 in +#ifndef HASL_VERSION_MIN_REQUIRED +#define HASL_VERSION_MIN_REQUIRED (HASL_VERSION_CUR_STABLE) +#elif HASL_VERSION_MIN_REQUIRED == 0 +#undef HASL_VERSION_MIN_REQUIRED +#define HASL_VERSION_MIN_REQUIRED (HASL_VERSION_CUR_STABLE + 1) +#endif /* HASL_VERSION_MIN_REQUIRED */ +#if !defined(HASL_VERSION_MAX_ALLOWED) || (HASL_VERSION_MAX_ALLOWED == 0) +#undef HASL_VERSION_MAX_ALLOWED +#define HASL_VERSION_MAX_ALLOWED (HASL_VERSION_CUR_STABLE) +#endif /* HASL_VERSION_MAX_ALLOWED */ +#if HASL_VERSION_MIN_REQUIRED > HASL_VERSION_CUR_STABLE +#error "HASL_VERSION_MIN_REQUIRED must be <= HASL_VERSION_CUR_STABLE" +#if HASL_VERSION_MAX_ALLOWED < HASL_VERSION_MIN_REQUIRED +#error "HASL_VERSION_MAX_ALLOWED must be >= HASL_VERSION_MIN_REQUIRED" +#if HASL_VERSION_MIN_REQUIRED < G_ENCODE_VERSION(0, 1) +#error "HASL_VERSION_MIN_REQUIRED must be >= HASL_VERSION_0_1" +#define HASL_VAR _HASL_EXTERN +#define HASL_AVAILABLE_IN_ALL _HASL_EXTERN + * A macro that evaluates to the 0.1 version of hasl, in a format that can be + * used by the C pre-processor. +#define HASL_VERSION_0_1 (G_ENCODE_VERSION(0, 1)) +#if HASL_VERSION_MAX_ALLOWED < HASL_VERSION_0_1 +#define HASL_AVAILABLE_IN_0_1 HASL_UNAVAILABLE(0, 1) +#define HASL_AVAILABLE_IN_0_1 _HASL_EXTERN + * A macro that evaluates to the 0.2 version of hasl, in a format that can be + * used by the C pre-processor. +#define HASL_VERSION_0_2 (G_ENCODE_VERSION(0, 2)) +#if HASL_VERSION_MAX_ALLOWED < HASL_VERSION_0_2 +#define HASL_AVAILABLE_IN_0_2 HASL_UNAVAILABLE(0, 2) +#define HASL_AVAILABLE_IN_0_2 _HASL_EXTERN + * A macro that evaluates to the 0.3 version of hasl, in a format that can be + * used by the C pre-processor. +#define HASL_VERSION_0_3 (G_ENCODE_VERSION(0, 3)) +#if HASL_VERSION_MAX_ALLOWED < HASL_VERSION_0_3 +#define HASL_AVAILABLE_IN_0_3 HASL_UNAVAILABLE(0, 3) +#define HASL_AVAILABLE_IN_0_3 _HASL_EXTERN @@ -55,6 +181,7 @@
const char *hasl_check_version(guint required_major, guint required_minor, guint required_micro);
@@ -64,7 +191,7 @@
-extern const char *hasl_version;
+HASL_VAR const char *hasl_version; @@ -75,7 +202,7 @@
-extern const guint hasl_major_version;
+HASL_VAR const guint hasl_major_version; @@ -86,7 +213,7 @@
-extern const guint hasl_minor_version;
+HASL_VAR const guint hasl_minor_version; @@ -97,7 +224,7 @@
-extern const guint hasl_micro_version;
+HASL_VAR const guint hasl_micro_version;