home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / detk45he.zip / dmiapi.h < prev    next >
Text File  |  1999-03-15  |  6KB  |  147 lines

  1. /**********************************************************************
  2.     Filename: dmiapi.h
  3.  
  4.     Copyright (c) 1992,1993,1994, Intel Corporation.  All rights reserved.
  5.     Copyright (c) 1993 - 1996, International Business Machines, Corporation. All rights reserved.
  6.  
  7.     Description: Header for DMI procedural library
  8.  
  9.  
  10. **********************************************************************/
  11.  
  12. #ifndef DMILIB_H_FILE
  13. #define DMILIB_H_FILE
  14.  
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18.  
  19. /************************ INCLUDES ***********************************/
  20.  
  21. #include "os_dmi.h"
  22.  
  23. /*********************************************************************/
  24.  
  25. /************************ DEFINES ************************************/
  26.  
  27. #define DMILIB_ERROR                              0x100
  28. #define FILE_ERROR                                0x200
  29. #define SL_ERROR                                  0x300
  30. #define SYSTEM_ERROR                              0x400
  31.  
  32. #define DmiLibDirInstallNoError                   1
  33. #define DmiLibSlInstallNoError                    2
  34.  
  35. #define DmiLibIllegalFileType                     DMILIB_ERROR + 1
  36.  
  37. #define DmiLibCannotCloseDestinationFile          FILE_ERROR   + 1
  38. #define DmiLibCannotCreateDestinationFile         FILE_ERROR   + 2
  39. #define DmiLibCannotCreateDirectory               FILE_ERROR   + 3
  40. #define DmiLibCannotOpenSourceFile                FILE_ERROR   + 4
  41. #define DmiLibCannotReadSourceFile                FILE_ERROR   + 5
  42. #define DmiLibCannotWriteDestinationFile          FILE_ERROR   + 6
  43.  
  44. #define DmiLibCannotExecuteInstallCommand         SL_ERROR     + 1
  45. #define DmiLibCannotRunServiceLayer               SL_ERROR     + 2
  46.  
  47. #define DmiLibCannotAllocateMemory                SYSTEM_ERROR + 1
  48. #define DmiLibCannotSetDmiDirEnvironmentVariable  SYSTEM_ERROR + 2
  49. #define DmiLibDmiDirEnvironmentVariableNotDefined SYSTEM_ERROR + 3
  50.  
  51. /*********************************************************************/
  52.  
  53. /************************ TYPEDEFS ***********************************/
  54.  
  55. typedef enum {MifFileName = 2, MifFilePointer} DmiLibFileType_t;
  56. typedef enum {DmiLibFalse, DmiLibTrue} DmiLibBoolean_t;
  57.  
  58. typedef struct {
  59.     DMI_UNSIGNED    iFileType;
  60.     DMI_STRING _FAR *pFileData;
  61. } DmiLibFileData_t;
  62.  
  63. typedef struct {
  64.     DMI_UNSIGNED iComponentId;
  65.     DMI_UNSIGNED iDmiLibStatus;
  66.     DMI_UNSIGNED iSlStatus;
  67. } DmiLibInstallData_t;
  68.  
  69. /*
  70.     The DmiCiAttribute_t structure is used as a communication vehicle between
  71.     DmiCiProcess(), and the user-provided attribute access routines (CiSkel.c).
  72.     An array of DmiCiAttribute_t structures is used to contain a key list, and  a single
  73.     DmiCiAttribute_t object is used to pass attribute values  from the user-provided
  74.     attribute access routines back to DmiCiProcess().
  75. */
  76.  
  77. typedef struct {
  78.     DMI_UNSIGNED iAttributeId;
  79.     DMI_UNSIGNED iAttributeType;
  80.     void _FAR *pAttributeValue;
  81. } DmiCiAttribute_t;
  82.  
  83. enum CiBoolean {CiFalse, CiTrue};
  84.  
  85. typedef DmiCiAttribute_t *(_FAR DMI_FUNC_ENTRY _CI_FUNC_IN1)(DMI_UNSIGNED,DMI_UNSIGNED,DMI_UNSIGNED,DMI_UNSIGNED,DmiCiAttribute_t const _FAR *const);
  86. typedef _CI_FUNC_IN1 *CI_FUNC_IN1;
  87. typedef enum CiBoolean (_FAR DMI_FUNC_ENTRY _CI_FUNC_IN2)(DMI_UNSIGNED,DMI_UNSIGNED,DMI_UNSIGNED,DMI_UNSIGNED,DmiCiAttribute_t const _FAR *const,void const _FAR *const);
  88. typedef _CI_FUNC_IN2 *CI_FUNC_IN2;
  89.  
  90. typedef struct {
  91.     union {
  92.         struct DmiMgmtCommand     dmiMgmtCommand;
  93.         struct DmiGetAttributeReq dmiGetAttributeReq;
  94.         struct DmiSetAttributeReq dmiSetAttributeReq;
  95.         struct DmiGetRowReq       dmiGetRowReq;
  96.         char                      requestBuffer[1];
  97.     } _FAR                *pRequestBuffer;   /* this commands request buffer */
  98.     union {
  99.         struct DmiGetAttributeCnf dmiGetAttributeCnf[1];
  100.         struct DmiGetRowCnf       dmiGetRowCnf;
  101.         char                      confirmBuffer[1];
  102.     } _FAR                *pConfirmBuffer;   /* this commands confirm buffer */
  103.     DMI_FUNC3_OUT          DmiConfirmFunc;   /* this commands confirm entry point */
  104.     enum CiBoolean        ciCancelFlag;      /* this flag is set when the SL requests that this command be conceled */
  105.     struct DmiConfirm     dmiConfirm;        /* confirm data block used for this command */
  106.     DmiCiAttribute_t _FAR *ciKeyList;        /* CISKEL.C will fill this in */
  107.     DMI_UNSIGNED          MaxKeyCount;       /* maximum number of keys allowed in this component */
  108.     CI_FUNC_IN1           CiGetAttribute;
  109.     CI_FUNC_IN1           CiGetNextAttribute;
  110.     CI_FUNC_IN2           CiReleaseAttribute;
  111.     CI_FUNC_IN2           CiReserveAttribute;
  112.     CI_FUNC_IN2           CiSetAttribute;
  113. } DmiCiControl_t;
  114.  
  115. /*********************************************************************/
  116.  
  117. /************************ PUBLIC *************************************/
  118.  
  119. /* MI Invoke entry point. */
  120. DMI_UNSIGNED DMI_FUNC_ENTRY DmiInvoke(void _FAR *dmiCommand);
  121.  
  122. /* CI Indication call entry point. */
  123. DMI_UNSIGNED DMI_FUNC_ENTRY DmiIndicate(DMI_Indicate_t _FAR *dmiIndication);
  124.  
  125. /* CI instrumentation code entry points. */
  126. DMI_UNSIGNED DMI_FUNC_ENTRY DmiCiInvoke(void _FAR *dmiCommand);
  127. DMI_UNSIGNED DMI_FUNC_ENTRY DmiCiCancel(void);
  128.  
  129. /* DMIAPI.LIB library function prototypes. */
  130. DmiLibInstallData_t _FAR * DMI_FUNC_ENTRY DmiInstall(DMI_UNSIGNED iFileCount,
  131.                                                       DmiLibFileData_t _FAR *dmiLibFileList,
  132.                                                       DMI_STRING _FAR *pDmiDir,
  133.                                                       DmiLibBoolean_t iDefineDmiDir,
  134.                                                       DMI_FUNC_OUT StatusCall);
  135. /* StatusCall is a callback entry point that the SL will call with the MIF compiler messages. */
  136. /* the prototype is DMI_UNSIGNED DMI_FUNC_CALLBACK StatusCall(void _FAR *message) */
  137. /* where "message" is a null terminated string                            */
  138.  
  139. DMI_UNSIGNED DMI_FUNC_ENTRY DmiCiProcess(DmiCiControl_t _FAR *Command, void _FAR *dmiCommand);
  140.  
  141. /****************************************************************************/
  142. #ifdef __cplusplus
  143. }
  144. #endif
  145.  
  146. #endif
  147.