View Issue Details

IDProjectCategoryView StatusLast Update
0003046unrealmodule apipublic2015-04-25 13:46
ReportersyzopAssigned To 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformOSALLOS VersionALL
Product Version3.3-alpha0 
Target VersionFixed in Version3.2.10.5 
Summary0003046: [u33] Add #include "all.h"
DescriptionSimple. Get rid of all 30 lines of #include lines (and corresponding #ifdef's) for each module, and make a simple "all.h" that includes all this shit, so that every module can simply use #include "all.h". Much more cleaner, and super-simple.

Something for u3.3*
TagsNo tags attached.
3rd party modules

Activities

codemastr

2006-09-03 16:17

reporter   ~0012304

Doesn't it kinda defeat the purpose of include files though? Granted, our current way sucks. But isn't it more "include what you need"? If we don't need channel.h, we shouldn't be including it.

syzop

2006-09-03 16:55

administrator   ~0012305

Last edited: 2006-09-03 16:56

While the idea is technically nice, I don't think many people care about it including me. It only adds extra work to find out what's in where and add an include every time you use a certain function. Not to mention if we move a definition from file A to file B "to clean things up" or "improve". This is much easier and cleaner.

So, no, I think it's an excelent idea.

EDIT: Of course, if any 3rd party author wants to do it differently, that's their right, but they shouldn't complain when they have missed 1 of the 20 includes they need, or when they missed an ifdef, or when something got moved from modules.h to struct.h or vice versa, etc........

aquanight

2007-04-06 21:36

reporter   ~0013349

I've attached an all.h I put together, basically just copied out the #include blob from message.c and then included some commented out #includes for all the other headers, since I'm not sure whether or not those needed to be included (some are only used in one or two .c files).

syzop

2007-04-07 05:46

administrator   ~0013351

Many of the ones commented out are included by an include (common.h, struct.h, those two include quite some other includes). Perhaps you could narrow the list down with that info, only very few left then probably (basically just grep at the includename in include/*.h for each file).
One that can be ditched is include/threads.h, since we don't do threads anymore since 3.2beta14 or so. Could consider removing the file as well, but perhaps we shouldn't be ditching threading, perhaps it can be used for something we haven't thought of yet... (noidea, offtopic, just keep the file itself, but not references)

2007-04-07 22:13

 

all.h (1,591 bytes)

aquanight

2007-04-08 01:10

reporter   ~0013354

(updated all.h attached) - was indeed a few that could be taken out, but a few are still left, but I'm not really sure if those are used in more than 1 or 2 places...

Stealth

2008-02-11 21:23

reporter   ~0015107

Added to 3.3, r257

nenolod

2013-05-07 07:13

reporter   ~0017524

I don't really think we should do this. I did this in Atheme, and honestly, I regret doing it.

So, I am closing this.

syzop

2015-04-25 13:46

administrator   ~0018290

Done, added in 3.2.x and 3.4.x. Rather than "all.h" it's called "unrealircd.h".

Modules can now simply:
#include "unrealircd.h"
And they get what they need :)

If something is missing in unrealircd.h (could very well be) then it can be enhanced.

I didn't realize this issue was closed off by someone. Without stating any arguments by said person, as always.

It's just silly to require 3rd party coders to write down like 20-30 includes in a certain order. That's just.. oh I already said.. silly :D.

Issue History

Date Modified Username Field Change
2006-08-31 06:03 syzop New Issue
2006-09-03 16:17 codemastr Note Added: 0012304
2006-09-03 16:55 syzop Note Added: 0012305
2006-09-03 16:56 syzop Note Edited: 0012305
2007-04-06 21:34 aquanight File Added: all.h
2007-04-06 21:36 aquanight Note Added: 0013349
2007-04-07 05:46 syzop Note Added: 0013351
2007-04-07 22:13 aquanight File Deleted: all.h
2007-04-07 22:13 aquanight File Added: all.h
2007-04-08 01:10 aquanight Note Added: 0013354
2007-04-18 05:41 stskeeps Status new => acknowledged
2007-04-19 03:10 stskeeps View Status private => public
2007-04-19 18:35 stskeeps Status acknowledged => confirmed
2008-02-11 21:22 Stealth Status confirmed => assigned
2008-02-11 21:22 Stealth Assigned To => Stealth
2008-02-11 21:23 Stealth QA => No need for QA
2008-02-11 21:23 Stealth U4: Need for upstream patch => No need for upstream InspIRCd patch
2008-02-11 21:23 Stealth Status assigned => resolved
2008-02-11 21:23 Stealth Fixed in Version => 3.3-alpha0
2008-02-11 21:23 Stealth Resolution open => fixed
2008-02-11 21:23 Stealth Note Added: 0015107
2011-07-19 13:57 syzop Assigned To Stealth =>
2011-07-19 13:57 syzop Status resolved => needs re porting
2013-05-07 07:13 nenolod Note Added: 0017524
2013-05-07 07:13 nenolod Status needs re porting => resolved
2013-05-07 07:13 nenolod Fixed in Version 3.3-alpha0 => 3.4-alpha1
2013-05-07 07:13 nenolod Resolution fixed => won't fix
2013-05-07 07:13 nenolod Assigned To => nenolod
2015-04-25 13:46 syzop Note Added: 0018290
2015-04-25 13:46 syzop Assigned To nenolod =>
2015-04-25 13:46 syzop Resolution won't fix => fixed
2015-04-25 13:46 syzop Fixed in Version 3.4-alpha1 => 3.2.10.5
2017-01-06 15:48 syzop Category module => module api