MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

[SERVER] question about extension.c/server.c



Hello,

While trying to find a clean way to add new extensions to the server (like
FUP, list utilities, whatever, ...) it occured to me that it would be nice
if at server startup extensions could display messages as they load. (the
question it at the end of the mail :-)
Let's take a little example:

extensions.c:
/* where I put the add on */
#include "bf_register.h"
#include "functions.h"
#include "log.h"
#include "storage.h"
#include "structures.h"
#include "utils.h"

#include "files.c"
/* FUP is cool :-) and much easier to install THAT way :-) */

void
register_extensions()
{
  register_files();
}
/* end of extensions.c */

In the function register_files of files.c, I just added the line:
oklog("          (Using File Utilities Package version 1.8)\n");

Now the startup looks like:

Mar 14 11:15:11:           (Using File Utilities Package version 1.8)
Mar 14 11:15:10: STARTING: Version 1.8.0p1 of the LambdaMOO server
Mar 14 11:15:10:           (Using BSD/TCP protocol)
Mar 14 11:15:11:           (Task timeouts measured in server CPU seconds.)

Not cool... so I moved a line inside server.c

    register_bi_functions();

    oklog("STARTING: Version %s of the LambdaMOO server\n", server_version);
    oklog("          (Using %s protocol)\n", network_protocol_name());
    oklog("          (Task timeouts measured in %s seconds.)\n",
         virtual_timer_available() ? "server CPU" : "wall-clock");

to

    oklog("STARTING: Version %s of the LambdaMOO server\n", server_version);
    oklog("          (Using %s protocol)\n", network_protocol_name());

    register_bi_functions(); /* nicer startup log */

    oklog("          (Task timeouts measured in %s seconds.)\n",
         virtual_timer_available() ? "server CPU" : "wall-clock");

I get a nice startup... like:

Mar 14 11:15:10: STARTING: Version 1.8.0p1 of the LambdaMOO server
Mar 14 11:15:10:           (Using BSD/TCP protocol)
Mar 14 11:15:11:           (Using File Utilities Package version 1.8)
Mar 14 11:15:11:           (Task timeouts measured in server CPU seconds.)

The questions is: is there a problem having network_protocol_name() being
called before register_bi_functions() ?

(My guess is no, but I would love to be sure...)

TIA

Richard




---
"640K ought to be enough for anybody."
    -- Bill Gates, 1981




Follow-Ups:

Home | Subject Index | Thread Index