From 34b10657da46fa8c13070a852251c846961018fc Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Sun, 17 Jun 2018 10:33:10 +0000 Subject: [PATCH] Cleanup: Make use of "icecasttypes.h" --- src/auth.h | 10 +++++----- src/client.h | 8 ++++---- src/slave.h | 3 ++- src/util.c | 2 +- src/util.h | 8 ++++---- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/auth.h b/src/auth.h index 8258b1ca..2e79bb81 100644 --- a/src/auth.h +++ b/src/auth.h @@ -56,7 +56,7 @@ typedef enum typedef struct auth_client_tag { client_t *client; - auth_result (*process)(struct auth_tag *auth, struct auth_client_tag *auth_user); + auth_result (*process)(auth_t *auth, struct auth_client_tag *auth_user); void (*on_no_match)(client_t *client, void (*on_result)(client_t *client, void *userdata, auth_result result), void *userdata); void (*on_result)(client_t *client, void *userdata, auth_result result); void *userdata; @@ -87,11 +87,11 @@ struct auth_tag auth_result (*release_client)(auth_client *auth_user); /* auth state-specific free call */ - void (*free)(struct auth_tag *self); + void (*free)(auth_t *self); - auth_result (*adduser)(struct auth_tag *auth, const char *username, const char *password); - auth_result (*deleteuser)(struct auth_tag *auth, const char *username); - auth_result (*listuser)(struct auth_tag *auth, xmlNodePtr srcnode); + auth_result (*adduser)(auth_t *auth, const char *username, const char *password); + auth_result (*deleteuser)(auth_t *auth, const char *username); + auth_result (*listuser)(auth_t *auth, xmlNodePtr srcnode); mutex_t lock; int running; diff --git a/src/client.h b/src/client.h index a0d9b7d9..4f68cf63 100644 --- a/src/client.h +++ b/src/client.h @@ -95,19 +95,19 @@ struct _client_tag { unsigned int pos; /* auth used for this client */ - struct auth_tag *auth; + auth_t *auth; /* Format-handler-specific data for this client */ void *format_data; /* function to call to release format specific resources */ - void (*free_client_data)(struct _client_tag *client); + void (*free_client_data)(client_t *client); /* write out data associated with client */ - int (*write_to_client)(struct _client_tag *client); + int (*write_to_client)(client_t *client); /* function to check if refbuf needs updating */ - int (*check_buffer)(struct source_tag *source, struct _client_tag *client); + int (*check_buffer)(source_t *source, client_t *client); }; int client_create (client_t **c_ptr, connection_t *con, http_parser_t *parser); diff --git a/src/slave.h b/src/slave.h index d8ff50de..8d2866fb 100644 --- a/src/slave.h +++ b/src/slave.h @@ -14,6 +14,7 @@ #define __SLAVE_H__ #include "common/thread/thread.h" +#include "icecasttypes.h" typedef struct _relay_server { char *server; @@ -23,7 +24,7 @@ typedef struct _relay_server { char *password; char *localmount; char *bind; - struct source_tag *source; + source_t *source; int mp3metadata; int on_demand; int running; diff --git a/src/util.c b/src/util.c index abc2aaad..06aec4e2 100644 --- a/src/util.c +++ b/src/util.c @@ -664,7 +664,7 @@ ssize_t util_http_build_header(char * out, size_t len, ssize_t offset, int status, const char * statusmsg, const char * contenttype, const char * charset, const char * datablock, - struct source_tag * source, struct _client_tag * client) { + source_t * source, client_t * client) { const char * http_version = "1.0"; ice_config_t *config; time_t now; diff --git a/src/util.h b/src/util.h index cdc30fbe..d0720026 100644 --- a/src/util.h +++ b/src/util.h @@ -17,6 +17,8 @@ /* for FILE* */ #include +#include "icecasttypes.h" + #define UNKNOWN_CONTENT 0 #define XSLT_CONTENT 1 #define HTML_CONTENT 2 @@ -78,15 +80,13 @@ char *util_url_escape(const char *src); * If datablock is NULL no end-of-header nor any data is appended. * Returns the number of bytes written or -1 on error. */ -struct source_tag; /* use forward decleration so we do not need to - * include that would cause other conflicts. */ ssize_t util_http_build_header(char * out, size_t len, ssize_t offset, int cache, int status, const char * statusmsg, const char * contenttype, const char * charset, const char * datablock, - struct source_tag * source, - struct _client_tag * client); + source_t * source, + client_t * client); const char *util_http_select_best(const char *input, const char *first, ...);