/*
- * Global variables.
+ * Global variables/defines.
*
* Copyright (C) 2011 Simon Ruderich
*
#include <stdio.h>
#include <string.h>
+/* GnuTLS */
+#include <gnutls/gnutls.h>
+
/* Log level constants. */
#define LOG_ERROR 0
#define LOG_DEBUG 2
+/* Macros for shorter error handling. */
+#define GNUTLS_ERROR_EXIT(error, message) \
+ if (GNUTLS_E_SUCCESS != error) { \
+ fprintf(stderr, "%s: %s\n", message, gnutls_strerror(error)); \
+ exit(EXIT_FAILURE); \
+ }
+
+
/* Proxy hostname and port if specified on the command line. */
char *global_proxy_host;
char *global_proxy_port;
/* Log level, command line option. */
int global_log_level;
+/* "Global" GnuTLS data used by all threads, read only. */
+gnutls_priority_t tls_priority_cache;
+gnutls_dh_params_t tls_dh_params;
+
#endif