Logon advertisement
Posted: Wed Aug 16, 2006 9:49 pm
Does anyone want to share any snippets of code on how they advertise their modules when the user first logs in?
Archive of original forums to preserve their history
https://www.themajorbbs.com/forumsold/
Code: Select all
GBOOL foologon(VOID);
static INT foostt; /* Foo Module State */
struct module elwfoo={ /* module interface block */
"", /* name used to refer to this module */
foologon, /* user logon supplemental routine */
fooinput, /* input routine if selected */
NULL, /* status-input routine if selected */
NULL, /* "injoth" routine for this module */
NULL, /* user logoff supplemental routine */
NULL, /* hangup (lost carrier) routine */
NULL, /* midnight cleanup routine */
NULL, /* delete-account routine */
fooclose /* finish-up (sys shutdown) routine */
};
GBOOL foologon(VOID) {
setmbk(foomb);
prfmsg(FOOLOGIN);
outprf(usrnum);
return(0);
}
Code: Select all
GBOOL foologon(VOID);
static INT foostt; /* Foo Module State */
struct module elwfoo={ /* module interface block */
name module; /* name used to refer to this module */
type foologon(); /* user logon supplemental routine */
type fooinput(); /* input routine if selected */
type FOOLOGIN; /* status-input routine if selected */
type usernum; /* "injoth" routine for this module */
NULL; /* user logoff supplemental routine */
NULL; /* hangup (lost carrier) routine */
NULL; /* midnight cleanup routine */
NULL; /* delete-account routine */
type fooclose(); /* finish-up (sys shutdown) routine */
};
GBOOL foologon(VOID) {
setmbk(foomb);
prfmsg(FOOLOGIN);
outprf(usrnum);
return(0);
}
Ok, the struct is what threw us off completely in that module. We though you left it like that for us to fill in our types for the structure it's self.Questman wrote:No, the code block I posted above exactly would work.
Of course, it's missing some other necessities, but the definition of the function, the module interface block, and the logon routine are 100% accurate as if they were cut right out of the module "Foo"
in your logon supplement routine put the message to display.The Storm wrote:Ok, the struct is what threw us off completely in that module. We though you left it like that for us to fill in our types for the structure it's self.Questman wrote:No, the code block I posted above exactly would work.
Of course, it's missing some other necessities, but the definition of the function, the module interface block, and the logon routine are 100% accurate as if they were cut right out of the module "Foo"
well the foologon, he was just showing the interface block, you have to set the logon routine in the interface block, in his exampkle foologon.The Storm wrote:Like this in the module??Code: Select all
GBOOL foologon(VOID); static INT foostt; /* Foo Module State */ struct module elwfoo={ /* module interface block */ name module; /* name used to refer to this module */ type foologon(); /* user logon supplemental routine */ type fooinput(); /* input routine if selected */ type FOOLOGIN; /* status-input routine if selected */ type usernum; /* "injoth" routine for this module */ NULL; /* user logoff supplemental routine */ NULL; /* hangup (lost carrier) routine */ NULL; /* midnight cleanup routine */ NULL; /* delete-account routine */ type fooclose(); /* finish-up (sys shutdown) routine */ }; GBOOL foologon(VOID) { setmbk(foomb); prfmsg(FOOLOGIN); outprf(usrnum); return(0); }