PWB Extensions Help (ext.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Switch Table (Description)
                                             Up Contents Index Back
─────PWB Extensions─────────────────────────────────────────────────────────
 
     All extensions must have a switch table. The swiTable array is an
     array of swiDesc structures. Each element describes a switch you
     want to create. The array is terminated with an empty structure of
     all zeros.
 
     Th swiTable array is normally defined as follows:
 
          struct swiDesc swiTable[] =
          {
              // Name   Variable     Type
              { "Bool", toPIF(bool), SWI_BOOLEAN },
              { "Num",  toPIF(num),  SWI_NUMERIC | RADIX_10 },
              // . . .
              { NULL, NULL, 0 }    //Table terminator
          };
 
     Many extensions do not need to define any switches. The switch
     table for a switchless extension contains only the terminating
     element.
 
     The switch structure is defined in EXT.H as:
 
          struct swiDesc {      // switch definition entry
              char far *name;   // - name of switch
              union swiAct act; // - pointer to value or fcn
              int type;         // - flags defining switch type
              };
          typedef struct swiDesc far *PSWI;
 
     The type member determines the kind of values the switch takes and
     how the switch is initialized.
     See: Switch Table Entries
 
     NOTE: To avoid compiler warnings, declare pointers for the act
           member with the toPIF macro (from EXT.H).
                                    -♦-