Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Applies to: WG3.x

Editor's note: in WG3.x the .MDF, .MSG, .HTM, .CVT and .DMD files of a project may be #ifdef'd on any define passed to the build (chapter 21, "#ifdef'ing files"); an install script for an add-on is described in chapter 23 (InstallShield). Btrieve .VIR files can be built from the .MAK file (chapter 21, "Creating .VIR files from within .MAK files").

...

For example, here is the .MDF file for the Registry of Users:

Code Block
; GALREG.MDF

Module name: Registry of Users


Developer: Galacticomm

Requires:
Replaces:

Install:

Online user manual: GALREGTM.DOC

DLLs: GALREG
MSGs: GALREGIS

Btrieve page size: 1024
Btrieve files:     1

Cleanup:

Event-1:
Event-2:
Event-3:
Event-4:

Add-On Utility:

I need:

Agent version: 1.01
Client app version: 1.00
Client app EXE: GALRG100.EXE
Client app support files: GALRG100.HLP
Default Icon: GALREG.ICO

Here are some details about what to put in your .MDF file.

...

If your module makes use of dynamic Btrieve files, it should police itself when online, making sure it doesn’t use up more Btrieve file handles than it’s entitled to. Call gnumdb() to get your .MDF file’s current number of dynamic Btrieve files:

Code Block
nbfalw=gnumdb("DDDXXX.MDF");

You’ll need to supply an offline utility to update this line when adding or removing data files used by your module. You can use snumdb() to set this number:

Code Block
snumdb("DDDXXX.MDF",nbfalw);

The server will pick up changes in the .MDF file, and rewrite BBSBTR.BAT as appropriate (combining the count of your module’s core data files with its dynamic ones).

...

If you want an offline utility to appear in the menu from option 8 of the introductory menu, specify the .EXE, .COM or .BAT file and description of the option. For example:

Code Block
Add-On Utility:  DDDANLYZ (analyze color reciprocity)

The file DDDANLYZ.BAT (or DDDANLYZ.EXE, etc.) will be run if the operator picks that option. For aesthetics, we recommend that you fit the name within an 8-character left-justified field, capitalize the entire name, follow it with one space, and append a lower-case description in parentheses. The description can be up to 40 characters long.

...

In addition to the standard Client app support files line you use in your app’s .mdf file, there is now an additional Shared support files line. Unlike the standard support files line where the files are transferred to your app’s directory on the client, shared support files are transferred to the \windows\system directory on the client. This allows certain support files to be shared between apps. Given this, most VB3 apps have something like the following in their .mdf files:

Code Block
Client app EXE: GALXX100.EXE
Client app support files: GALXX100.HLP
Shared support files: GCSPCLI.DLL VBRUN300.DLL GALCBK.VBX SS3D2.VBX
Shared support files: THREED.VBX

Applies to: WG3.x

Header check: the OLDSSFLS list of shared support files lives in GALNSSF.H, which exists only in WG2 (not in WGDEV/INC). The VBX/DLL list printed here is client-side material.

...

To provide such a function, your agent must be declared in the same .mdf file as the start-up app. Add a line to the .mdf file:

Code Block
Startup function: MYFUNC

In this example, myfunc() should be defined in the first (usually the only) .dll referenced in the .mdf file’s DLLs line:

Code Block
BOOL EXPORT
myfunc(void)
{
}

Applies to: v10

v10: EXPORT is __declspec(dllexport) (or empty under USE_DEF_FILE; chapter 29, section 29.5). BOOL comes from the Windows headers under MSVC (v10 headers themselves use it, for example BOOL IsWow64();, OPRLOW.H:147), but the engine's own type is GBOOL, a short (GCTYPDEF.H:135): use GBOOL in anything stored or exchanged with the engine.

Applies to: WG3.x

Header check: BOOL is not defined in WG3.2; write GBOOL (chapter 2 note, GCTYPDEF.H:105). 3.2 module entry points are written VOID EXPORT init__galfil(VOID); (GALFILH.H:614); EXPORT is defined per platform in GCTYPDEF.H:30-58.

...

Here is an example of an .MDF file for the German/RIP Language:

Code Block
; GERMRIP.MDF (language file created by WGSLANG.EXE)
Module Name: German/RIP language
Developer: Sysop
Internal
Unconditional
Language: German/RIP
Language Description: Die deutsche Version von RIPscrip graphics
Language File Extension: .RIP
Language Editor: RIPAINT.DLL %s
Language Yes/No: Ja/Nein

Notice that it does not declare a .DLL file. Most of a language module’s purpose in life is to tell the text-block handling system that each T type CNF option may have a version in this language.

...

There are two cases where an editor is needed: CNF text blocks and Menu Tree customized menus. WGSDRAW is the standard in-memory editor and is specified like this:

Code Block
Language Editor:  WGSDRAW %s

Let’s say you want to use an editor named ZOGEDIT that expects the filename as its parameter and needs the /A switch for ANSI capabilities, you’d specify:

Code Block
Language Editor:  ZOGEDIT %s /A

When it comes time to edit an option or a menu, the %s is replaced with a filename and the above command is executed as a DOS command. We use a system() call on this command line, so DOS will look for ZOGEDIT.COM, ZOGEDIT.EXE, or ZOGEDIT.BAT throughout the path.

...

This line of the language .MDF file tells you what words to use for Yes and No in that language. For example:

Code Block
Language Yes/No: Affirmative/Negative

In this case the letters A or N will be expected in response to a yes-or-no question. Clearly the first letter of each word must be different.

...

Put your initialization code in a routine whose name starts with init__ (see above).In that initialization code, register your module using the register_module() function and a unique module structure. Compile and link your module code into a .DLL file (page 23). Identify the .DLL file in your .MDF file (page 32). For example:

Code Block
statecode=register_module(ptrmodule);   Register a module
int statecode;                          Value of usrptr->state
                                                whenever user will be "in" this module
struct module *ptrmodule;                       Pointer to your module structure

You might use the statecode in some circumstance to determine if the user is “in” your module (by comparing usrptr->state == statecode, for example). Each time you call register_module() you must pass a pointer to a unique module structure.

Here is the data structure for each module, consisting of a description and nine entry points (this comes from MAJORBBS.H):

Code Block
extern
struct module {                       /* module interface block               */
     char descrp[MNMSIZ];             /*    description for main menu         */
     int (*lonrou)();                 /*    user logon supplemental routine   */
     int (*sttrou)();                 /*    input routine if selected         */
     void (*stsrou)();                /*    status-input routine if selected  */
     int (*injrou)();                 /*    "injoth" routine for this module  */
     int (*lofrou)();                 /*    user logoff supplemental routine  */
     void (*huprou)();                /*    hangup (lost carrier) routine     */
     void (*mcurou)();                /*    midnight cleanup routine          */
     void (*dlarou)();                /*    delete-account routine            */
     void (*finrou)();                /*    finish-up (sys shutdown) routine  */
} **module;

Here are some sample pieces of code for initializing a simple module:

Code Block
int colorinp(void);
void clscol(void);

struct module colormod={   /* module interface block            */
     "",                   /* name used to refer to this module */
     NULL,                 /* user logon supplemental routine   */
     colorinp,             /* input routine if selected         */
     dfsthn,               /* 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            */
     clscol                /* finish-up (sys shutdown) routine  */
};

static
int colstt;                /* ANSI color diagnostics, state no. */

void EXPORT
init__colormod()           /* the module initialization routine */
{
     stzcpy(colormod.descrp,gmdnam("DDDCOLOR.MDF"),MNMSIZ);
     colstt=register_module(&colormod);
}

As this example shows, you should leave the description blank (a zero-length string) and read it in from your .MDF file during initialization. This example reads in the module description from the DDDCOLOR.MDF file, such as:

Code Block
Module Name: ANSI color diagnostics

This way, your module name is only in one spot: the .MDF file. If the description in the descrp field disagrees with the one in the .MDF file, then the module won’t be accessible: Menu Tree will call out one name, but the other will be registered online.

...

As you’ll see on page 89, text blocks are identified first by their .MCV file (specified by setmbk()), and second by an integer sequence number defined in the .H file. That integer can be used in calls to prfmsg() to output the text block. For example:

Code Block
        setmbk(colmb);
        prfmsg(PROMPT);

colmb is returned by opnmsg().
PROMPT is from a WGSMSX-generated .H file.

...

We often use the integer sequence number defined in the .H file to remember the last prompt sent to the user:

Code Block
        usrptr-
>substt
>substt=PROMPT;

So his reply can be handled in the proper context:

Code Block
        switch (usrptr-
>substt
>substt) {
             :
        case PROMPT:
             handleit(margc,margv[0]);
             break;
             :
        }

We recommend that, whenever the user types the single letter X followed by enter, that he exit out of whatever he’s doing and return to a previous menu. If your module has its own local menu (many do), then he returns to that menu. If he’s already there, he should return to the parent menu page which originally brought him to your module.

...

If the injrou field of your module structure is NULL, the executive just simulates a cr from the user’s terminal to get the user’s prompt back. If you need to use the condition of an empty input line for some purpose other than for reprompting (such as for default answers) then you can detect the use of injoth() with a test similar to this (this could be an excerpt of your sttrou() routine):

Code Block
        if ((usrptr-
>flags
>flags&INJOIP) == 0) {
             handlecommand();
        }
        else {
             reprompt();
        }

####### Asynchronous message handling method 2

The injrou() entry point, if one exists in your module, is called when an asynchronous message needs to get through to the user. The message is already formatted in the prfbuf buffer and can be transmitted with btuxmn(). You should also resend the latest prompt. For example, here’s an excerpt of a possible injrou() routine:

Code Block
        btuxmn(othusn,prfbuf);
        btuoes(othusn,1);
        user[othusn].flags¦=INJOIP;
        return(1);

In fact, this is exactly the code in dftinj() that gets executed when there is no injrou() entry point, except that dftinj() has no return value — don’t use it as your injrou() routine. There’s little point to having an injrou() routine that’s exactly the above, but you could make little modifications to it. The btuxmn() is used in place of an outprf(othusn), specifically so that a user’s ctrl+O abort of text output doesn’t clobber the message. You may have some other way of displaying the message (e.g. transmitting an ANSI sequence to pop up a window or something). Setting btuoes(othusn,1), and setting the INJOIP flag prepares for a future call to the sttrou() entry point with the INJOIP flag set, asking for a reprompt.

...

The absdtdy() function exists to determine whether or not there’s been an abnormal shutdown (non-catastro() crash) today:

Code Block
        if (absdtdy()) {
            longcup();
        }

If the server locks up, GPs, or otherwise crashes without the system shutdown routines being called, the absdtdy() routine will return TRUE for the remainder of the day. After a successful cleanup, it will begin returning FALSE again.

...

Finally, the finrou() entry point is invoked as the system is shutting down and returning to DOS — this is the place to flush buffers, close files, and so on. In general, you will be undoing whatever was fired up by the corresponding init__xxx() routine that registered your module. This entry point will be called when a catastro() fatal error occurs (see page 73), in an attempt to save whatever can be saved before returning to DOS. This routine should be designed to safely execute in this kind of hostile situation. For example, say your init__xxx() had some code that did this:

Code Block
        if ((localfp=fopen("SOMEFILE.TXT",FOPWA)) == NULL) {
             catastro("Cannot create SOMEFILE.TXT!");
        }

Then your finrou() entry point could do this:

Code Block
        if (localfp != NULL) {
             fclose(localfp);
             localfp=NULL;
        }

That way, the fclose() is guaranteed to execute no more than once, and then only if the file had been opened in the first place.

...

The array channel[] in MAJORBBS.C translates from user number to channel number:

Code Block
        channel[<user number>] == <channel number>

The function usridx(), also in MAJORBBS.C, does the reverse translation (or returns -1 for unassigned channel numbers):

Code Block
        usridx(<channel number>) == <user number>

User number nterms-1 is channel number 00 and is reserved for local Sysop emulation.

...

Applies to: WG3.x

Header check: NGROUPS was removed in WG3.2; the constant is NUMGRPS (#define NUMGRPS 17, MAJORBBS.H:62; WG2 MAJORBBS.H:45: 17 channel groups from WGSMAJOR.MSG).

Code Block
        grpnum[<user number>] == <group number>

You can use this to determine the channel type of a group using the grtype[] array:

Code Block
        grtype[<group number>] == <group type code>

Group Type Codes (from MAJORBBS.H)

Code Block
#define GTMODEM  1       /* group type code:  Modem channels              */
#define GTMLOCK  2       /* group type code:  Locked modem channels       */
#define GTSERIAL 3       /* group type code:  Serial channels             */
#define GTX25    4       /* group type code:  X.25 channels               */
#define GTLAN    5       /* group type code:  LAN channels                */
#define GTOTHER  6       /* group type code:  GCDI channels               */
#define GTNONE   0       /* group type code:  No channels defined         */

Here is an example of testing a channel’s type:

Code Block
        if (grtype[grpnum[usrnum]] == GTLAN) {
             ... LAN channel type ...
        }
        else if (usrptr-
>flags
>flags&ISX25) {
             ... X.25 channel type ...
        }
        else {
             ... other channel type ...
        }

Note that there are two ways to check for an X.25 channel. The flag check (when done by itself) takes less code.

...

Applies to: v10

v10 memory rules: (1) the engine's allocators alcmem/alczer (GCOMM.H:287) and the C runtime heap are not interchangeable; (2) MAXPARSZ is (MAXBLK/sizeof(VOID *)) (GME.H:61), MAXBLK is 65530U (GME.H:57), so a pointer array holds 8191 pointers on x64; (3) structure packing is set by the project, not the headers (no #pragma pack in v10 inc/); beware sizes and member offsets of structs ported from DOS (MBBS10.txt section 3); (4) disk records must not contain pointers, HANDLE, size_t or unsigned __int64. See chapter 29, section 29.3. Ignore the segment/far text of this guide: there are no 64K segments.

...

The task is divided into four sub-tasks using the cycle-mediated method. The following functions would be used for the sttrou() and stsrou() entry points:

Code Block
      STATIC int
      sttexm(void)
      {
           switch (usrptr-
>substt
>substt) {
           case 0:
                prf("line 1\n");
                outprf(usrnum);
                btuinj(usrnum,CYCLE);
                usrptr-
>substt
>substt=1;
                return(1);
           case 4:
                prf("back to menu...\n");
                outprf(usrnum);
                return(0);
           }
           return(1);
      }

      STATIC void
      stsexm(void)
      {
           if (status == CYCLE) {
                switch (usrptr-
>substt
>substt) {
                case 1:
                     prf("line 2\n");
                     usrptr-
>substt
>substt=2;
                     btuinj(usrnum,CYCLE);
                     break;
                case 2:
                     prf("line 3\n");
                     usrptr-
>substt
>substt=3;
                     btuinj(usrnum,CYCLE);
                     break;
                case 3:
                     prf("line 4\n\
nPress
nPress ENTER ");
                     usrptr-
>substt
>substt=4;
                     break;
                default:
                     dfsthn();
                     return;
                }
                outprf(usrnum);
           }
           else {
                dfsthn();
           }
      }

Applies to: WG3.x

Header check: STATIC is not defined in WG3.2 (WG2 GCOMM.H:257); write static (chapter 2 note).

Notes:

    usrptr->substt is used to keep track of the progress of each user that selects this module from a menu. It is always set to zero when a user first selects the module. prf() is like printf(), except that the converted text goes into a buffer. outprf() transmits the contents of that buffer to a specific user. stsexm() calls dfsthn() (the default status handler, in MAJORBBS.C) when stsexm() encounters a status code that it is not expressly designed to deal with. Polling Routine

    ...

    Here is an example of how you would use catastro() to handle the case of a missing file:

    Code Block
    if ((fp=fopen("NEEDTHIS.FIL",FOPRA)) == NULL){
    catastro("Cannot find the file \
    NEEDTHIS
    NEEDTHIS.FIL\!");
    }

    Note that the function for opening Btrieve databases, opnbtv() (page 281), has a built-in catastro() to handle the file-not-found condition (BTRIEVE OPEN ERROR 12).

    ...

    To show users a list of all languages for them to pick:

    Code Block
    prf("\
    rWhich
    rWhich language/protocol would you prefer to use?");
    lnglist(1);
    
    1ngfoot
    1ngfoot(1);

    You’d be better to use prfmsg() (page 89) than prf() of course, but using prf() is a better way to show you what’s going on in this example. The 1 parameter to lnglist() and lngfoot() means offer all languages as options for the user to pick. Use a 0 instead to only offer those languages with the top voting confidence factors (more about that on page 122). Here’s how you might put the user’s choice into effect:

    Code Block
            int ilingo;
            :
            :
            if ((ilingo=cnclng()) != -1) {
                 clingo=extptr-
    >lingo
    >lingo=ilingo;
            }

    Either a number or a language name will satisfy cnclng(). After this, all future prfmsg() output on this channel will be in the new language.

    ...

    If a Sysop exceeds the limit on the number of languages, then WGSMSX would report:

    Code Block
            Too many options (starting at "XXXXXX")
            or too many languages in XXXXXXXX.MSG.

    Creating CNF Options

    CNF options affect many aspects of the operation of the Major BBS. See Sysop’s Guide. CNF options are stored in .MSG files, converted to .MCV files, and read in as needed using a very quick direct indexed scheme. CNF options help in these ways:

    ...

    CNF type TEXT options (text blocks) can be specified in different languages. The first line of an .MSG file defines the languages that may appear throughout the file, in this format:

    Code Block
            LANGUAGE {<language 0>},{<language 1>},{<language 2>} ...

    For example:

    Code Block
            LANGUAGE {English/ANSI},{Spanish/ANSI},{French/ANSI}

    Language 0 is always English/ANSI. Omitting the LANGUAGE{} pseudo-option is equivalent to including the line:

    Code Block
            LANGUAGE {English/ANSI}

    CNF options can be specified at different levels:

    ...

    The .MSG files have the following format:

    Code Block
            LANGUAGE {<language 0>},{<language 1>},{<language 2>} ...
    Code Block
            LEVEL1 {}
            
    <option
    <option 
    specifier>
    specifier>
            
    <option
    <option 
    specifier>
    specifier>
            :
            LEVEL3 {}
            
    <option
    <option 
    specifier>
    specifier>
            
    <option
    <option 
    specifier>
    specifier>
            :
            LEVEL4 {}
            
    <option
    <option 
    specifier>
    specifier>
            
    <option
    <option 
    specifier>
    specifier>
            :
            LEVEL6 {}
            
    <option
    <option 
    specifier>
    specifier>
            
    <option
    <option 
    specifier>
    specifier>
            :

    Each section at any level may contain from zero up to any number of option specifiers. The LEVELn {} may be omitted for any section that contains no option specifiers.

    Each <option specifier> has the following format:

    Code Block
    <help paragraph> <option name> <version list> <hinge> <coding>

    <help paragraph> Up to 12 lines of text describing the CNF option. This message appears on the CNF screen when the operator is in HELP mode. You should only use columns 2 through 60 of these 12 lines to give the paragraph the proper appearance on the CNF screen. For best appearance if you use less than 12 lines, add a blank line before the line with the option name. If you use all 12 lines, use no blank line. The <help paragraph> may be omitted. In that case, leave two blank lines in its place.

    ...

    In a 4-language file, here are the possibilities for encoding the 4 different versions:

    Code Block
                    {
    <version
    <version 
    0>
    0>}
                    {
    <version
    <version 
    0>
    0>},{
    <version
    <version 
    1>
    1>}
                    {
    <version
    <version 
    0>
    0>},{
    <version
    <version 
    1>
    1>},{
    <version
    <version 
    2>
    2>}
                    {
    <version
    <version 
    0>
    0>},,{
    <version
    <version 
    2>
    2>}
                    {
    <version
    <version 
    0>
    0>},{
    <version
    <version 
    1>
    1>},{
    <version
    <version 
    2>
    2>},{
    <version
    <version 
    3>
    3>}
                    {
    <version
    <version 
    0>
    0>},,{
    <version
    <version 
    2>
    2>},{
    <version
    <version 
    3>
    3>}
                    {
    <version
    <version 
    0>
    0>},{
    <version
    <version 
    1>
    1>},,{
    <version
    <version 
    3>
    3>}
                    {
    <version
    <version 
    0>
    0>},,,{
    <version
    <version 
    3>
    3>}

    Notice that empty and missing are not the same thing. An empty option has nothing between the curly braces, but a missing option has no curly braces. See about Dialects (language subsets) in Sysop’s Guide.

    ...

    The format of the <contents> for this type of option is:

    Code Block
            <description> <character>

    Where <character> is a single character, as for a menu selection, and <description> is a short description, for example:

    Code Block
            This is the activation code letter for calibrating uplink #3
    
            UPSEL3 {Select character for uplink 3: G} C
    Type B: Binary Configuration Options

    ...

    Where <description> is a short description, for example:

    Code Block
            Answer YES to this question if you want new users
            to be able to play in the games.  Answer NO to allow
            them to watch, but not play.
    
            NEWGAM {Allow new users to play games? NO} B

    The YES or NO choices show up as softkey selections under CNF.

    ...

    The format of the <contents> for this type of option is:

    Code Block
            <description> <choice>

    Where <choice> is a one-word selection among a small set of possible answers. <description> is a short description. The set of possible answers is enumerated in the <coding>, for example:

    Code Block
            How rough do you want users to be able to play?
    
                    EASY -- nobody loses too much
                    NORMAL -- can lose your shirt
                    ROUGH -- users can cheat
                    BRAWL -- cheaters can be shot
    
            PLALVL {Play difficulty: ROUGH} E EASY NORMAL ROUGH BRAWL

    These four enumerated <choice>s show up as softkey options under CNF.

    ...

    The format of the <contents> for this type of option is:

    Code Block
            <description> <number>

    Where <number> is a 16-bit integer between -32768 and 32767. A smaller set of limits may be specified in the <coding>, for example:

    Code Block
            How many seconds should we
            wait for a user's bet before
            skipping him for the round?
    
            PLWAIT {Wait for how many seconds? 30} N 5 3600

    In this case, 5 and 3600 are the permanent inclusive limits on the value of the <number>. The operator, using CNF, can change the value of this option to something other than 30, but not to something outside of the range 5 to 3600. If you don’t want any particular limits on a option, then you may specify N -32768 32767

    ...

    The format of the <contents> for this type of option is:

    Code Block
            <description> <number>

    just like for type N options, except that this <number> will be stored as a 32-bit integer. Limits are specified in the <coding>, for example:

    Code Block
            How much should we allow a user
            to bet during one round?
    
            MAXBET {Maximum bet: 1000000} L 0 100000000

    In this case, the value of the option is one million. The operator, using CNF, will not be able to make it larger than a hundred million. If you wish to have no particular limit on the option, you may code L -2147483648 2147483647

    ...

    The format of the <contents> for this type of option is:

    Code Block
            <description> <hexadecimal number>

    The <hexadecimal number> is unsigned, and may be between 0 and FFFF. Smaller limitations may be encoded in the <coding>. For example:

    Code Block
            What channel would you like to reserve
            for your satellite uplink?
    
            SATCHN {Channel for satellite uplink: 3F} H 0 3F
    Type S: String Configuration Options

    The <contents> for this type of option are the value of the string. The maximum length and description of the string are encoded in the <coding>. For example:

    Code Block
            This string is the sign-on message for initiating
            uplink using the 227.85-228.05 MHz "APLINK" band,
            including your FCC registration number
    
            UPSIGN {U905 Westar 7::88A,5932-051} S 30 Uplink sign-on command

    This would appear on the CNF screen something like this:

    Code Block
            UPSIGN     Uplink sign-on command ........ U905 Westar 7::88A,5932-051

    If you use 0 as the length of the string, the maximum length will end up being used, as limited by the width of the CNF screen. Note: A longer <description> means a shorter <contents> length.

    ...

    WGSDRAW, the default editor for all /ANSI languages, can edit an image of up to 25 lines of 79 characters each. If you use all 25 lines, then the last line cannot end with a line terminator (i.e. no more than 24 line terminators may be in the <version n>). The <coding> field specifies a short description for the option, for example:

    Code Block
            UPCOMP {
            Uplink established, at 
    %s
    %s on 
    %s
    %s
    
            *** BEGINNING UPLINK TRANSMISSION ***
            } T Uplink established notification

    Type T options are the most numerous. Almost all user prompts and messages are located in Edit Text Blocks (choice 6 on the Introductory Menu), and are type T options.

    ...

    This feature keeps CNF from showing one option based upon the value of a preceding option. For example:

    Code Block
            NEWGAM {Allow new users to play? NO} B
            CHGGAM {Charge new users how much to play? 1000} N 0 32767

    This combination of option settings does not make sense. How can you charge new users for playing if you never allow them to play? If these options were coded like this:

    Code Block
            NEWGAM {Allow new users to play? NO} B
            CHGGAM {Charge new users how much to play? 1000} (NEWGAM=YES) N 0 32767

    then the second option would not even appear on the CNF screen, at least not as long as the value of the NEWGAM option was NO. Change NEWGAM to YES and CHGGAM appears.

    ...

    You can also use the hinge specification to test for a set of values, for example:

    Code Block
            (SATLINK=KBAND,QBAND,ZBAND)

    This hinge will activate an option when the SATLINK option is either KBAND, QBAND, or ZBAND. On the other hand:

    Code Block
            (GEOSYNC#90,105,120)

    will activate an option when option GEOSYNC is neither 90, 105, nor 120.

    ...

    Here’s an example of an option specifier:

    Code Block
            If you want users to be able to change their date of birth,
            answer this question with a YES.  If only you, as the
            Sysop, want to have the option of changing a user's date
            of birth after he or she signs up, answer this question
            with a NO.  You can always change the date of birth from
            the User Account Detail screen.
    
            CHGBDY {Allow users to change their date of birth? NO} (ASKBDY=YES) B

    This option is named CHGBDY. It has six lines to its help message. These appear while CNF is in help mode, per the F1 key. This is a B-type option, which is a YES or NO option. Its current value is NO. It is hinged on the option named ASKBDY. CHGBDY appears only if ASKBDY is set to YES.

    Here’s another example of an option specifier in an .MSG file:

    Code Block
            GREET {Hello},{Hola},{Bonjour} T Greetings for a user

    This GREET{} option has no help text. It has three versions for languages 0, 1 and 2. Here are more examples, with other languages missing:

    ...

    If you’re ever in doubt, here’s how to run WGSMSX in a development environment:

    Code Block
            CD \WGSERV
            WGSMSX <filename> -OSRC

    where <filename>.MSG is the name of your editable .MSG file. This puts the .MCV file into \WGSERV and the .H file in \WGSERV\SRC where it can be used to compile the software that uses the options. Of course, if you’re putting your source code in a separate directory, you’ll need -ODDD or something.

    WGSMSX has these alternative command syntaxes:

    Code Block
            WGSMSX [-O<source directory prefix>]
            WGSMSX @<list file> [-O<source directory prefix>]
            WGSMSX <root filename> [-O<source directory prefix>]
            WGSMSX <MSG file path> <MCV file path> <H file path>

    The last syntax gives you complete control over what the files are named and where they go.

    ...

    A typical usage of rstmbk():

    Code Block
    setmbk(fbkmb);
    prfmsg(AUXBEEP);
    rstmbk();

    Calls to setmbk() and rstmbk() can be nested up to 10 levels deep.

    ...

    Applies to: WG3.x

    Header check: getasc() is CHAR *getasc(INT msgnum) (GCOMM.H:515) and returns a writable pointer into the message buffer; treat the string as read-only (see the const CHAR * hazard note in chapter 28).

    char *bufadr; address of buffer with retrieved text

    ...

    int index; 1=token1, 2=token2, 0=none

    Code Block
    int msgnum; message number (use option name)
    char *token1;
    char *token2;

    :

    This function checks a type E CNF option for one of several possible values. If the last word in the option specified by msgnum matches token1, then tokopt() returns 1, if token2, it returns 2, and so on. If the word matches none in the token list, tokopt() returns 0.

    ...

    If you understand the various roles of the .MSG, .MCV, and .H files you will see that changing the contents of an option without changing the order of the options has no effect on the .H file. This means that you do not need to recompile the Major BBS every time you change a CNF option. The CNF utility never changes option order. If you change the order of CNF options, either by adding, deleting, or just rearranging them, you must remember to regenerate the .H file (CNF does not do this — use your .MAK file or the WGSMSX utility, page 89), and recompile all the source code that #includes this header file.

    ...

    Previous: Major BBS v10: 02 The Major BBS’s Environment  |  Contents  |  Next: Major BBS v10: 04 User Interface