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.
Extension Command Table
                                             Up Contents Index Back
─────PWB Extensions─────────────────────────────────────────────────────────
 
     All extensions must have a command table. The cmdTable array is an
     array of cmdDesc structures. Each element describes a command you
     want to create. The array is terminated with an empty structure of
     all zeros.
 
     The cmdTable array is normally defined as follows:
 
          struct cmdDesc cmdTable[] =
          {
              // name    func   arg  argType
              { "Goto",  Goto,  0,   TEXTARG|KEEPMETA|WINDOWFUNC },
              { "YesNo", YesNo, 0,   TEXTARG|NOWINDOWS|ICONFOCUS },
              // . . .
              { NULL,    NULL,  0,   0 } //Terminator
          }
 
     Each element describes a new PWB function that is implemented by
     your extension. The array is terminated with a structure of zeros.
     You can create an extension that defines no functions, but it still
     requires a command table with only the terminating element.
 
     The cmdDesc structure is defined in EXT.H as:
 
          struct cmdDesc {                     // Function definition
              char far *name;                  // Name of the function
              flagType (pascal EXTERNAL *func) // Pointer to function
                  ( CMDDATA, ARG far *, flagType );
              CMDDATA  arg;                    // Reserved
              unsigned long argType;           // Argument types
              };
          typedef struct cmdDesc far *PCMD;
 
     The argType member determines the types of arguments accepted by
     the function.
     See: Extension Argument Types
 
     A pointer to a cmdDesc structure is defined as the PCMD typedef. A
     PCMD is used by various functions, including NameToFunc, ReadCmd,
     GetListEntry, and ScanList.
 
     The function must have the prototype:
 
     PWBFUNC funcname( unsigned argData, ARG far *pArg, flagType fMeta );
 
     See: Writing Extension Functions
                                    -♦-