From 52b57d1576e78a57ed48dd23528894146b5dbc2a Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Thu, 4 May 2017 23:50:47 +1000 Subject: [PATCH] Move the definition of the NotifyItem and NotifyList types from struct.h to notify.h This change means that struct.h no longer needs to include alist.h, so it will be indirectly included in a lot fewer other files. As a consequence, server.h needs to include notify.h to get the definitions of those data types. --- include/notify.h | 31 ++++++++++++++++++++++++++++--- include/server.h | 9 ++++----- include/struct.h | 32 +++----------------------------- 3 files changed, 35 insertions(+), 37 deletions(-) diff --git a/include/notify.h b/include/notify.h index b7a8da1..0f8ec2b 100644 --- a/include/notify.h +++ b/include/notify.h @@ -9,9 +9,34 @@ * * @(#)$Id$ */ +#ifndef NOTIFY_H_ +#define NOTIFY_H_ -#ifndef __notify_h_ -#define __notify_h_ +#include "alist.h" + +/* These types pun the Array_item and Array types from alist.h respectively */ +typedef struct notify_stru +{ + char *nick; /* Who are we watching? */ + u_32int_t hash; + char *host; + char *looking; + int times; + time_t lastseen; + time_t period; + time_t added; + int flag; /* Is the person on irc? */ +} NotifyItem; + +typedef struct notify_alist +{ + struct notify_stru **list; + int max; + int max_alloc; + alist_func func; + hash_type hash; + char *ison; +} NotifyList; void show_notify_list (int); BUILT_IN_COMMAND(notify); @@ -34,4 +59,4 @@ extern char *get_notify_nicks (int, int, char *, int); void send_watch (int); char *get_watch_nicks (int, int, char *, int); -#endif /* __notify_h_ */ +#endif /* NOTIFY_H_ */ diff --git a/include/server.h b/include/server.h index 1abb6a6..cf6c492 100644 --- a/include/server.h +++ b/include/server.h @@ -9,15 +9,15 @@ * * @(#)$Id$ */ - -#ifndef __server_h_ -#define __server_h_ +#ifndef SERVER_H_ +#define SERVER_H_ /* for ChannelList */ #include "who.h" #include "names.h" #include "struct.h" #include "ssl.h" +#include "notify.h" /* * type definition to distinguish different @@ -373,7 +373,6 @@ void password_sendline (char *data, char *line); int get_server_local_port (int); struct sockaddr_foobar get_server_local_addr (int); struct sockaddr_foobar get_server_uh_addr (int); -NotifyItem *get_server_notify_list (int); void BX_send_msg_to_nicks (ChannelList *, int, char *); void BX_send_msg_to_channels (int, const char *); int BX_is_server_queue (void); @@ -428,4 +427,4 @@ extern const char *umodes; #define LLOOK_SPLIT 0 #define CHAN_SPLIT 1 -#endif /* __server_h_ */ +#endif /* SERVER_H_ */ diff --git a/include/struct.h b/include/struct.h index 0747428..b8f94b3 100644 --- a/include/struct.h +++ b/include/struct.h @@ -7,15 +7,13 @@ * Copyright(c) 1997 * */ - -#ifndef __struct_h_ -#define __struct_h_ +#ifndef STRUCT_H_ +#define STRUCT_H_ #ifdef WINNT #include #endif -#include "alist.h" #include "hash.h" #include "config.h" #include "ssl.h" @@ -1139,30 +1137,6 @@ typedef struct AliasItemStru ArgList *arglist; } Alias; -typedef struct notify_stru -{ - char *nick; /* Who are we watching? */ - u_32int_t hash; - char *host; - char *looking; - int times; - time_t lastseen; - time_t period; - time_t added; - int flag; /* Is the person on irc? */ -} NotifyItem; - - -typedef struct notify_alist -{ - struct notify_stru **list; - int max; - int max_alloc; - alist_func func; - hash_type hash; - char * ison; -} NotifyList; - typedef Window *(*window_func) (Window *, char **args, char *usage); typedef struct window_ops_T { @@ -1226,4 +1200,4 @@ typedef struct _dcc_struct_type { u_32int_t struct_type; } dcc_struct_type; -#endif /* __struct_h_ */ +#endif /* STRUCT_H_ */