add GET_LAST_ERROR macro
[mech_eap.orig] / mech_eap / util.h
index 905916b..5f0bc9d 100644 (file)
@@ -776,6 +776,8 @@ verifyTokenHeader(OM_uint32 *minor,
 
 #include <winbase.h>
 
+#define GSSEAP_GET_LAST_ERROR()                (GetLastError())
+
 #define GSSEAP_MUTEX                    CRITICAL_SECTION
 
 #define GSSEAP_MUTEX_INIT(m)            (InitializeCriticalSection((m)), 0)
@@ -785,10 +787,16 @@ verifyTokenHeader(OM_uint32 *minor,
 
 /* XXX yet to implement thread-local wrappers */
 
+#define GSSEAP_THREAD_ONCE              INIT_ONCE
+#define GSSEAP_ONCE(o, i)               InitOnceExecuteOnce((o), (i))
+#define GSSEAP_ONCE_INITIALIZER         INIT_ONCE_STATIC_INIT
+
 #else
 
 #include <pthread.h>
 
+#define GSSEAP_GET_LAST_ERROR()                (errno)
+
 #define GSSEAP_MUTEX                    pthread_mutex_t
 
 #define GSSEAP_MUTEX_INIT(m)            pthread_mutex_init((m), NULL)
@@ -956,6 +964,23 @@ gssBufferToKrbData(gss_buffer_t buffer, krb5_data *data)
     data->length = buffer->length;
 }
 
+/* util_tld.c */
+struct gss_eap_status_info;
+
+struct gss_eap_thread_local_data {
+    krb5_context krbContext;
+    struct gss_eap_status_info *statusInfo;
+};
+
+struct gss_eap_thread_local_data *
+gssEapGetThreadLocalData(void);
+
+void
+gssEapDestroyStatusInfo(struct gss_eap_status_info *status);
+
+void
+gssEapDestroyKrbContext(krb5_context context);
+
 #ifdef __cplusplus
 }
 #endif