diff --git a/include/import/wurfl.h b/include/import/wurfl.h deleted file mode 100644 index c59da34dd..000000000 --- a/include/import/wurfl.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _IMPORT_WURFL_H -#define _IMPORT_WURFL_H - -#include - -int ha_wurfl_init(void); -void ha_wurfl_deinit(void); - -typedef char *(*PROP_CALLBACK_FUNC)(wurfl_handle wHandle, wurfl_device_handle dHandle); - -enum wurfl_data_type { - HA_WURFL_DATA_TYPE_UNKNOWN = 0, - HA_WURFL_DATA_TYPE_CAP = 100, - HA_WURFL_DATA_TYPE_VCAP = 200, - HA_WURFL_DATA_TYPE_PROPERTY = 300 -}; - -typedef struct { - char *name; - enum wurfl_data_type type; - PROP_CALLBACK_FUNC func_callback; - struct ebmb_node nd; -} wurfl_data_t; - -#endif diff --git a/include/proto/wurfl.h b/include/proto/wurfl.h new file mode 100644 index 000000000..a23818447 --- /dev/null +++ b/include/proto/wurfl.h @@ -0,0 +1,7 @@ +#ifndef _PROTO_WURFL_H +#define _PROTO_WURFL_H + +int ha_wurfl_init(void); +void ha_wurfl_deinit(void); + +#endif diff --git a/include/types/global.h b/include/types/global.h index 1e8cabaa7..9f069ad25 100644 --- a/include/types/global.h +++ b/include/types/global.h @@ -36,10 +36,6 @@ #include #endif -#ifdef USE_WURFL -#include -#endif - #ifndef UNIX_MAX_PATH #define UNIX_MAX_PATH 108 #endif @@ -222,7 +218,7 @@ struct global { struct list patch_file_list; /* the list of WURFL patch file to use */ char information_list_separator; /* the separator used in request to separate values */ struct list information_list; /* the list of WURFL data to return into request */ - wurfl_handle handle; /* the handle to WURFL engine */ + void *handle; /* the handle to WURFL engine */ struct eb_root btree; /* btree containing info (name/type) on WURFL data to return */ } wurfl; #endif diff --git a/src/haproxy.c b/src/haproxy.c index 222ee20a5..80d503086 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -114,6 +114,10 @@ #include #endif +#ifdef USE_WURFL +#include +#endif + #ifdef USE_DEVICEATLAS #include #endif @@ -122,10 +126,6 @@ #include #endif -#ifdef USE_WURFL -#include -#endif - /*********************************************************************/ extern const struct comp_algo comp_algos[]; diff --git a/src/wurfl.c b/src/wurfl.c index 0f5ce2d7f..18723a6b1 100644 --- a/src/wurfl.c +++ b/src/wurfl.c @@ -8,9 +8,11 @@ #include #include #include +#include #include #include -#include + +#include #ifdef WURFL_DEBUG @@ -32,6 +34,22 @@ inline static void ha_wurfl_log(char * message, ...) #define HA_WURFL_MAX_HEADER_LENGTH 1024 +typedef char *(*PROP_CALLBACK_FUNC)(wurfl_handle wHandle, wurfl_device_handle dHandle); + +enum wurfl_data_type { + HA_WURFL_DATA_TYPE_UNKNOWN = 0, + HA_WURFL_DATA_TYPE_CAP = 100, + HA_WURFL_DATA_TYPE_VCAP = 200, + HA_WURFL_DATA_TYPE_PROPERTY = 300 +}; + +typedef struct { + char *name; + enum wurfl_data_type type; + PROP_CALLBACK_FUNC func_callback; + struct ebmb_node nd; +} wurfl_data_t; + static const char HA_WURFL_MODULE_VERSION[] = "1.0"; static const char HA_WURFL_ISDEVROOT_FALSE[] = "FALSE"; static const char HA_WURFL_ISDEVROOT_TRUE[] = "TRUE";