Open rezalas opened 1 year ago
Yes, it's the extern CMud RS;
statement that is the magic sauce. The extern
keyword instructs the compiler to add a reference to CMud
for the linker to later resolve. When the linker gets invoked, it takes that reference and replaces it with calls to the CMud
class.
We should definitely combine all the CMud
functions into one file like you mentioned though. It would follow modern practices as well as be easier to maintain.
While analyzing the bootup sequence to combine the config files into a single file I noticed that
CMud::
declarations are being performed in multiple files:bootup.c / bootup.h
: Performs core startup loads of area files, GSNs, time, greeting display, and some core options likegame_port
,base_directory
, andplayer_dir
.mud.c / mud.h
: the actual declaration for the CMud class along with the primary startup sequence for the mud. This calls the functions declared by thebootup.h
but never actually referencesbootup.h
.I'm wondering if we should migrate these into a single class declaration. I'm honestly not sure how it's working given that there is no direct reference anywhere. As far as I can find, nothing references
bootup.h
beyondbootup.c
. I did however find that insidemud.h
there is a call toextern CMud RS;
which may be the reason the seemingly lack of any tie-in it works.