diff --git a/lib/wp/log.h b/lib/wp/log.h index f839ff63..731bcebd 100644 --- a/lib/wp/log.h +++ b/lib/wp/log.h @@ -40,23 +40,30 @@ void wp_log_init (gint flags); WP_API gboolean wp_log_set_level (const gchar *log_level); -typedef struct _WpLogTopic WpLogTopic; -struct _WpLogTopic { +/*! + * \brief WpLogTopic flags + * \ingroup wplog + */ +typedef enum { /*< flags >*/ + /*! the lower 16 bits of the flags are GLogLevelFlags */ + WP_LOG_TOPIC_LEVEL_MASK = 0xFFFF, + /*! the log topic has infinite lifetime (lives on static storage) */ + WP_LOG_TOPIC_FLAG_STATIC = 1u << 30, + /*! the log topic has been initialized */ + WP_LOG_TOPIC_FLAG_INITIALIZED = 1u << 31, +} WpLogTopicFlags; + +/*! + * \brief A structure representing a log topic + * \ingroup wplog + */ +typedef struct { const char *topic_name; + WpLogTopicFlags flags; /*< private >*/ - /* - * lower 16 bits: GLogLevelFlags - * bit 30: static log topic (infinite lifetime) - * bit 31: 1 - initialized, 0 - not initialized - */ - gint flags; WP_PADDING(3) -}; - -#define WP_LOG_TOPIC_FLAG_STATIC (1u << 30) -#define WP_LOG_TOPIC_FLAG_INITIALIZED (1u << 31) -#define WP_LOG_TOPIC_LEVEL_MASK (0xFFFF) +} WpLogTopic; #define WP_LOG_TOPIC_EXTERN(var) \ extern WpLogTopic * var; diff --git a/modules/module-lua-scripting/api/api.c b/modules/module-lua-scripting/api/api.c index 0ab5f934..c2277164 100644 --- a/modules/module-lua-scripting/api/api.c +++ b/modules/module-lua-scripting/api/api.c @@ -309,7 +309,7 @@ static const luaL_Reg core_funcs[] = { /* WpLog */ -typedef struct _WpLogTopic WpLuaLogTopic; +typedef WpLogTopic WpLuaLogTopic; static WpLuaLogTopic * wp_lua_log_topic_new (const char *name)