home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’96 / Roaster-Java-WA-HTTP-CGI hack / cgi WA plugin / Interfaces / Module.r.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-22  |  3.9 KB  |  119 lines  |  [TEXT/MPS ]

  1. #ifndef MODULE_R_H
  2. #define MODULE_R_H
  3.  
  4. /* This file defines the types and contents of various resources found
  5.  * in a plugin-module file.  It is designed to be included from both Rez
  6.  * and C/C++ source files.
  7.  */
  8.  
  9.  
  10. // Resource type for module definition resources.
  11. #define ModuleDefType 'MDdf'
  12.  
  13. // Resource type for module code resources.
  14. #define ModuleCodeType 'MDcd'
  15.  
  16. // Resource type for inter-module dependency info.
  17. #define ModuleDepType 'MDdp'
  18.  
  19. // Types for an entry in a dependency list.
  20. #define dEqual                1 // Precise module version must be present
  21. #define dGreaterOrEqual 2 // Module of greater or equal version must be present
  22. #define dLessOrEqual        3 // Module of smaller or equal version must be present
  23.  
  24.  
  25. #ifndef REZ
  26. // This enum defines the bits in the flags field of a ModuleDef record.
  27. enum ModuleFlags
  28.     {
  29.     mfLoadAtBoot = 1, // Set if the module should be loaded (and its root
  30.                             // function called) when the module file is opened,
  31.                             // typically at application boot time.  NOTE: this
  32.                             // flag is not currently supported; Arrange 2.0 will
  33.                             // always load the module at boot time, even if the
  34.                             // flag is not set.
  35.     mfKeepLocked = 2  // Set if the module's code resources should be kept
  36.                             // locked in memory whenever the module is open.  This
  37.                             // should be set for modules which are called often (e.g.
  38.                             // any module with an AboutToMenu or Tick hook).
  39.     }; // ModuleFlags
  40.  
  41.  
  42. // This struct defines the structure of a module definition resource ('MDdf').
  43. struct ModuleDef
  44.     {
  45.     unsigned char vers;          // Record version number (currently 1).
  46.     unsigned char modFormatVers;// Module format version number (currently 2).
  47.     unsigned short flags;       // ModuleFlags values (set unused bits to zero).
  48.     char name[32];                   // Unique name (0-terminated) for this module.
  49.     unsigned long id;         // Unique ID (registered with CKI) for this module.
  50.     unsigned long modVers;    // Module version.
  51.     unsigned long modDate;    // Compile/link date for this version.
  52.     unsigned long targetApp;  // Application to which this module is targeted; 0
  53.                                      // if module can load in any application.
  54.     unsigned long minSysVers; // Minimum system version (from Gestalt) to load module.
  55.     unsigned long minAppVers; // Minimum application version to load module.
  56.     short rootCodeID;             // ID of the root code resource ('MDcd') for this
  57.                                       // module (code resource containing the module's boot
  58.                                       // function); value is relative to the ID of the 'MDdf'
  59.                                       // resource.  -1 if module has no boot function.
  60.     }; // ModuleDef
  61.  
  62.  
  63. // This struct defines an entry in an inter-module dependency list.
  64. struct ModuleDepEntry
  65.     {
  66.     unsigned long type;          // Dependency type (see constants above).
  67.     unsigned long targetID;      // 'id' field of target module's ModuleDef.
  68.     unsigned long targetVers; // 'vers' field of target module's ModuleDef.
  69.     }; // ModuleDepEntry
  70.  
  71.  
  72. // This struct defines the structure of a module dependency-info resource ('MDdp').
  73. struct ModuleDepInfo
  74.     {
  75.     unsigned char  vers;            // Record version number (currently 1).
  76.     unsigned char  pad;            // Unused (set to zero).
  77.     short               count;        // Number of dependency entries.
  78.     ModuleDepEntry entries[1]; // Array of dependency records.
  79.     }; // ModuleDepInfo
  80.  
  81.  
  82. #else // else REZ is defined
  83.  
  84. type ModuleDefType
  85.     {
  86.     byte = 1;                // vers
  87.     byte = 2;                // modFormatVers
  88.     bitstring[14] = 0;    // unused bits in flags word
  89.     boolean dontKeepLocked,keepLocked;
  90.     boolean dontLoadAtBoot,loadAtBoot;
  91.     pstring[31];            // name
  92.     unsigned longint;        // id
  93.     unsigned longint;     // modVers
  94.     unsigned longint;     // modDate
  95.     unsigned longint;     // targetApp
  96.     unsigned longint;     // minSysVers
  97.     unsigned longint;     // minAppVers
  98.     integer;              // rootCodeID
  99.     };
  100.  
  101.  
  102. type ModuleDepType
  103.     {
  104.     byte = 1;                // vers
  105.     byte = 0;                // pad
  106.     integer = $$Countof(DepArray); // count
  107.     wide array DepArray
  108.         {
  109.         unsigned longint; // type
  110.         unsigned longint; // targetID
  111.         unsigned longint; // targetVers
  112.         };
  113.     };
  114.  
  115.  
  116. #endif // else REZ is defined
  117.  
  118. #endif // ifndef MODULE_R_H
  119.