From 6ffc893b6a1788763c6bf9b434ee80f2eef47ebd Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Sun, 17 Jun 2018 10:12:15 +0000 Subject: [PATCH] Update: Move most common types into "icecasttypes.h" --- src/acl.h | 4 +--- src/admin.h | 12 +----------- src/auth.h | 4 +--- src/client.h | 3 +-- src/icecasttypes.h | 32 ++++++++++++++++++++++++++++++++ src/source.h | 3 +-- 6 files changed, 37 insertions(+), 21 deletions(-) diff --git a/src/acl.h b/src/acl.h index 03101a68..5982606d 100644 --- a/src/acl.h +++ b/src/acl.h @@ -18,9 +18,7 @@ #include #include "common/httpp/httpp.h" -struct acl_tag; -typedef struct acl_tag acl_t; - +#include "icecasttypes.h" #include "admin.h" typedef enum acl_policy_tag { diff --git a/src/admin.h b/src/admin.h index d0770414..8b3d92e4 100644 --- a/src/admin.h +++ b/src/admin.h @@ -18,17 +18,7 @@ #include #include -/* Command IDs */ -typedef int32_t admin_command_id_t; - -/* formats */ -typedef enum { - ADMIN_FORMAT_AUTO, - ADMIN_FORMAT_RAW, - ADMIN_FORMAT_TRANSFORMED, - ADMIN_FORMAT_PLAINTEXT -} admin_format_t; - +#include "icecasttypes.h" #include "compat.h" #include "refbuf.h" #include "client.h" diff --git a/src/auth.h b/src/auth.h index f0795ebb..8258b1ca 100644 --- a/src/auth.h +++ b/src/auth.h @@ -18,12 +18,10 @@ #include #endif -struct source_tag; -typedef struct auth_tag auth_t; - #include #include #include +#include "icecasttypes.h" #include "cfgfile.h" #include "client.h" #include "common/thread/thread.h" diff --git a/src/client.h b/src/client.h index c4bab286..a0d9b7d9 100644 --- a/src/client.h +++ b/src/client.h @@ -19,8 +19,7 @@ #ifndef __CLIENT_H__ #define __CLIENT_H__ -typedef struct _client_tag client_t; - +#include "icecasttypes.h" #include "errors.h" #include "connection.h" #include "refbuf.h" diff --git a/src/icecasttypes.h b/src/icecasttypes.h index 6d06ad78..9c23c6c4 100644 --- a/src/icecasttypes.h +++ b/src/icecasttypes.h @@ -9,4 +9,36 @@ #ifndef __ICECASTTYPES_H__ #define __ICECASTTYPES_H__ +#include "compat.h" + +/* ---[ client.[ch] ]--- */ + +typedef struct _client_tag client_t; + +/* ---[ source.[ch] ]--- */ + +typedef struct source_tag source_t; + +/* ---[ admin.[ch] ]--- */ + +/* Command IDs */ +typedef int32_t admin_command_id_t; + +/* formats */ +typedef enum { + ADMIN_FORMAT_AUTO, + ADMIN_FORMAT_RAW, + ADMIN_FORMAT_TRANSFORMED, + ADMIN_FORMAT_PLAINTEXT +} admin_format_t; + +/* ---[ acl.[ch] ]--- */ + +typedef struct acl_tag acl_t; + +/* ---[ auth.[ch] ]--- */ + +typedef struct auth_tag auth_t; + + #endif diff --git a/src/source.h b/src/source.h index c34d99a3..a5103bc6 100644 --- a/src/source.h +++ b/src/source.h @@ -14,8 +14,7 @@ #ifndef __SOURCE_H__ #define __SOURCE_H__ -typedef struct source_tag source_t; - +#include "icecasttypes.h" #include "cfgfile.h" #include "yp.h" #include "util.h"