home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / OS2 / LNVREM.ZIP / LNREMSRC.EXE / LNREMLCH.IH < prev    next >
Text File  |  1993-11-08  |  11KB  |  372 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: lnremlch.ih.
  5.  * Generated using:
  6.  *     SOM Precompiler spc: 1.22
  7.  *     SOM Emitter emitih: 1.59
  8.  */
  9.  
  10. /*
  11.  *  lnremlch.csc
  12.  *  Copyright (c) International Business Machines Corporation
  13.  *  1993
  14.  */
  15.  
  16.  
  17. #ifndef lnremlch_ih
  18. #define lnremlch_ih
  19.  
  20.  
  21. #include <lnremlch.h>
  22.  
  23. /*
  24.  * Set the scope of methods functions
  25.  */
  26. #ifndef SOM_Scope
  27. #define SOM_Scope static
  28. #endif
  29.  
  30. #ifndef SOM_CurrentClass
  31. #define SOM_CurrentClass LNRemoteLaunchCClassData.parentMtab
  32. #endif
  33.  
  34. #define LNRemoteLaunch_MaxNoMethods 3
  35.  
  36. /*
  37.  * Instance data
  38.  */
  39. typedef struct {
  40.     HMODULE ModHandle;
  41. } LNRemoteLaunchData;
  42.  
  43. /*
  44.  * Instance variable access macros
  45.  */
  46. #define _ModHandle (somThis->ModHandle)
  47.  
  48. /*
  49.  * Getdata macro
  50.  */
  51. #define LNRemoteLaunchGetData(somSelf) \
  52.     ((LNRemoteLaunchData *) \
  53.         SOM_DataResolve(somSelf, LNRemoteLaunchCClassData.instanceDataToken))
  54.  
  55. /*
  56.  * Trace/Debug macro
  57.  */
  58. #ifndef LNRemoteLaunchMethodDebug
  59. #define LNRemoteLaunchMethodDebug(c,m) SOMMethodDebug(c,m)
  60. #endif
  61.  
  62. /*
  63.  * Begin stuff that only goes in the primary file
  64.  */
  65. #ifdef LNRemoteLaunch_Class_Source
  66.  
  67. /*
  68.  * Current class macros for Instance and Meta classes.
  69.  */
  70. #undef SOMMeta
  71. #define SOMMeta M_LNRemoteLaunchCClassData.parentMtab
  72. #undef SOMInstance
  73. #define SOMInstance LNRemoteLaunchCClassData.parentMtab
  74.  
  75. #ifndef M_LNRemoteLaunch_Class_Source
  76. #define M_LNRemoteLaunch_Class_Source
  77. #endif    /* M_LNRemoteLaunch_Class_Source */
  78.  
  79. /*
  80.  * Generate the Apply Stubs.
  81.  */
  82. #pragma linkage(somAP_RemoteExecPgm, system)
  83. static int   SOMLINK somAP_RemoteExecPgm(LNRemoteLaunch *somSelf,
  84.         somId __id,
  85.         somId __desc,
  86.         va_list __ap)
  87. {
  88.     STRING_ARRAY_OBJ *pHier = va_arg(__ap, STRING_ARRAY_OBJ*);
  89.     SOMAny *pModel = va_arg(__ap, SOMAny*);
  90.     PVOID pAppParm = va_arg(__ap, PVOID);
  91.     SOMAny *pSelected = va_arg(__ap, SOMAny*);
  92.     __ap; __id; __desc;           /* Referenced to prevent warning msg */
  93.  
  94.     return (LNRemoteLaunch_RemoteExecPgm(somSelf,pHier,pModel,pAppParm,pSelected));
  95. }
  96.  
  97. #pragma linkage(somAP_RemoteCall, system)
  98. static int   SOMLINK somAP_RemoteCall(LNRemoteLaunch *somSelf,
  99.         somId __id,
  100.         somId __desc,
  101.         va_list __ap)
  102. {
  103.     PSZ LongName = va_arg(__ap, PSZ);
  104.     PSZ CmdBuf = va_arg(__ap, PSZ);
  105.     PSZ CmdTail = va_arg(__ap, PSZ);
  106.     STARTDATA *pStartData = va_arg(__ap, STARTDATA*);
  107.     BOOL32 VerboseSwitch = va_arg(__ap, BOOL32);
  108.     __ap; __id; __desc;           /* Referenced to prevent warning msg */
  109.  
  110.     return (LNRemoteLaunch_RemoteCall(somSelf,LongName,CmdBuf,CmdTail,pStartData,VerboseSwitch));
  111. }
  112.  
  113. #pragma linkage(somAP_ErrorMessage, system)
  114. static VOID   SOMLINK somAP_ErrorMessage(LNRemoteLaunch *somSelf,
  115.         somId __id,
  116.         somId __desc,
  117.         va_list __ap)
  118. {
  119.     ULONG ErrorCode = va_arg(__ap, ULONG);
  120.     PSZ LongName = va_arg(__ap, PSZ);
  121.     BOOL32 VerboseSwitch = va_arg(__ap, BOOL32);
  122.     __ap; __id; __desc;           /* Referenced to prevent warning msg */
  123.  
  124.     LNRemoteLaunch_ErrorMessage(somSelf,ErrorCode,LongName,VerboseSwitch);
  125. }
  126.  
  127.  
  128. /*
  129.  * Overridden method: somInit
  130.  */
  131. #pragma linkage(somInit, system)
  132. SOM_Scope void   SOMLINK somInit(LNRemoteLaunch *somSelf);
  133. #ifndef parent_somInit
  134. static char *somMN_somInit = "somInit";
  135. static somId somId_somInit = &somMN_somInit;
  136. #define parent_somInit(somSelf) \
  137.     ((SOM_ParentResolveE(SOMObject, SOM_CurrentClass, somInit)) \
  138.      (somSelf))
  139. #endif
  140. #define LNRemoteLaunchParent_somInit parent_somInit
  141.  
  142. /*
  143.  * Overridden method: somUninit
  144.  */
  145. #pragma linkage(somUninit, system)
  146. SOM_Scope void   SOMLINK somUninit(LNRemoteLaunch *somSelf);
  147. #ifndef parent_somUninit
  148. static char *somMN_somUninit = "somUninit";
  149. static somId somId_somUninit = &somMN_somUninit;
  150. #define parent_somUninit(somSelf) \
  151.     ((SOM_ParentResolveE(SOMObject, SOM_CurrentClass, somUninit)) \
  152.      (somSelf))
  153. #endif
  154. #define LNRemoteLaunchParent_somUninit parent_somUninit
  155.  
  156. /*
  157.  * Temporary class data structure used only in class creation
  158.  */
  159. static somClassDataStructure LNRemoteLaunchtempClassData;
  160.  
  161. /*
  162.  * Initialize the class data structure
  163.  */
  164. struct LNRemoteLaunchClassDataStructure LNRemoteLaunchClassData = {(SOMAny *) NULL};
  165.  
  166. /*
  167.  * Define the C class data structure
  168.  */
  169. struct LNRemoteLaunchCClassDataStructure LNRemoteLaunchCClassData = {(somMethodTab *) NULL};
  170.  
  171. /*
  172.  * New Method: RemoteExecPgm
  173.  */
  174. #pragma linkage(RemoteExecPgm, system)
  175. SOM_Scope int   SOMLINK RemoteExecPgm(LNRemoteLaunch *somSelf,
  176.         STRING_ARRAY_OBJ *pHier,
  177.         SOMAny *pModel,
  178.         PVOID pAppParm,
  179.         SOMAny *pSelected);
  180. static char *somMN_RemoteExecPgm = "RemoteExecPgm";
  181. static somId somId_RemoteExecPgm = &somMN_RemoteExecPgm;
  182. static char *somDS_RemoteExecPgm = somMD_LNRemoteLaunch_RemoteExecPgm;
  183. static somId somDI_RemoteExecPgm = &somDS_RemoteExecPgm;
  184. #pragma linkage(somRD_RemoteExecPgm, system)
  185. static int   SOMLINK somRD_RemoteExecPgm(LNRemoteLaunch *somSelf,
  186.         STRING_ARRAY_OBJ *pHier,
  187.         SOMAny *pModel,
  188.         PVOID pAppParm,
  189.         SOMAny *pSelected)
  190. {
  191.     return ((int) va_somDispatchL(somSelf, somId_RemoteExecPgm,
  192.         _somGetMethodDescriptor(SOM_GetClass(somSelf),somId_RemoteExecPgm),pHier,pModel,pAppParm,pSelected));
  193. }
  194.  
  195. /*
  196.  * New Method: RemoteCall
  197.  */
  198. #pragma linkage(RemoteCall, system)
  199. SOM_Scope int   SOMLINK RemoteCall(LNRemoteLaunch *somSelf,
  200.         PSZ LongName,
  201.         PSZ CmdBuf,
  202.         PSZ CmdTail,
  203.         STARTDATA *pStartData,
  204.         BOOL32 VerboseSwitch);
  205. static char *somMN_RemoteCall = "RemoteCall";
  206. static somId somId_RemoteCall = &somMN_RemoteCall;
  207. static char *somDS_RemoteCall = somMD_LNRemoteLaunch_RemoteCall;
  208. static somId somDI_RemoteCall = &somDS_RemoteCall;
  209. #pragma linkage(somRD_RemoteCall, system)
  210. static int   SOMLINK somRD_RemoteCall(LNRemoteLaunch *somSelf,
  211.         PSZ LongName,
  212.         PSZ CmdBuf,
  213.         PSZ CmdTail,
  214.         STARTDATA *pStartData,
  215.         BOOL32 VerboseSwitch)
  216. {
  217.     return ((int) va_somDispatchL(somSelf, somId_RemoteCall,
  218.         _somGetMethodDescriptor(SOM_GetClass(somSelf),somId_RemoteCall),LongName,CmdBuf,CmdTail,pStartData,VerboseSwitch));
  219. }
  220.  
  221. /*
  222.  * New Method: ErrorMessage
  223.  */
  224. #pragma linkage(ErrorMessage, system)
  225. SOM_Scope VOID   SOMLINK ErrorMessage(LNRemoteLaunch *somSelf,
  226.         ULONG ErrorCode,
  227.         PSZ LongName,
  228.         BOOL32 VerboseSwitch);
  229. static char *somMN_ErrorMessage = "ErrorMessage";
  230. static somId somId_ErrorMessage = &somMN_ErrorMessage;
  231. static char *somDS_ErrorMessage = somMD_LNRemoteLaunch_ErrorMessage;
  232. static somId somDI_ErrorMessage = &somDS_ErrorMessage;
  233. #pragma linkage(somRD_ErrorMessage, system)
  234. static VOID   SOMLINK somRD_ErrorMessage(LNRemoteLaunch *somSelf,
  235.         ULONG ErrorCode,
  236.         PSZ LongName,
  237.         BOOL32 VerboseSwitch)
  238. {
  239.     va_somDispatchV(somSelf, somId_ErrorMessage,
  240.         _somGetMethodDescriptor(SOM_GetClass(somSelf),somId_ErrorMessage),ErrorCode,LongName,VerboseSwitch);
  241. }
  242.  
  243. /*
  244.  * Routines to create the class object
  245.  */
  246.  
  247. /*
  248.  * Declare the Static Methods table.
  249.  */
  250. static somStaticMethod_t LNRemoteLaunchSM[] = {
  251.     {    &LNRemoteLaunchClassData.RemoteExecPgm,
  252.          &somId_RemoteExecPgm,
  253.          &somDI_RemoteExecPgm,
  254.          (somMethodProc *) RemoteExecPgm,
  255.          (somMethodProc *) somRD_RemoteExecPgm,
  256.          (somMethodProc *) somAP_RemoteExecPgm    },
  257.     {    &LNRemoteLaunchClassData.RemoteCall,
  258.          &somId_RemoteCall,
  259.          &somDI_RemoteCall,
  260.          (somMethodProc *) RemoteCall,
  261.          (somMethodProc *) somRD_RemoteCall,
  262.          (somMethodProc *) somAP_RemoteCall    },
  263.     {    &LNRemoteLaunchClassData.ErrorMessage,
  264.          &somId_ErrorMessage,
  265.          &somDI_ErrorMessage,
  266.          (somMethodProc *) ErrorMessage,
  267.          (somMethodProc *) somRD_ErrorMessage,
  268.          (somMethodProc *) somAP_ErrorMessage    },
  269. };
  270.  
  271.  
  272. /*
  273.  * Declare the Override Methods table.
  274.  */
  275. static somOverrideMethod_t LNRemoteLaunchOM[] = {
  276.     {    &somId_somInit,
  277.          (somMethodProc *) somInit    },
  278.     {    &somId_somUninit,
  279.          (somMethodProc *) somUninit    },
  280. };
  281.  
  282. static void LNRemoteLaunchsomInitializeClass ()
  283. {
  284.     int i;
  285.     somStaticMethod_t *smp;
  286.     somOverrideMethod_t *omp;
  287.  
  288. /*
  289.  * Add the Static Methods.
  290.  */
  291.     for (smp = LNRemoteLaunchSM, i = 0; i < 3; smp++, i++)
  292.         *(smp->classData) =
  293.             _somAddStaticMethod (LNRemoteLaunchtempClassData.classObject,
  294.                 *(smp->methodId), *(smp->methodDescriptor),
  295.                 smp->method, smp->redispatchStub,
  296.                 smp->applyStub);
  297.  
  298.  
  299. /*
  300.  * Override methods.
  301.  */
  302.     for (omp = LNRemoteLaunchOM, i = 0; i < 2; omp++, i++)
  303.         _somOverrideSMethod (LNRemoteLaunchtempClassData.classObject,
  304.             *(omp->methodId), omp->method);
  305.  
  306. }
  307.  
  308. #pragma linkage(LNRemoteLaunchsomCreateClass, system)
  309. static void SOMLINK LNRemoteLaunchsomCreateClass(SOMClass *pClsObj,
  310.                            SOMClass *mClsObj)
  311. {
  312.     LNRemoteLaunchtempClassData.classObject = _somNew (mClsObj);
  313.     _somInitClass (LNRemoteLaunchtempClassData.classObject,
  314.         "LNRemoteLaunch",
  315.         pClsObj,
  316.         sizeof(LNRemoteLaunchData),
  317.         LNRemoteLaunch_MaxNoMethods,
  318.         LNRemoteLaunch_MajorVersion,
  319.         LNRemoteLaunch_MinorVersion);
  320.     LNRemoteLaunchCClassData.instanceDataToken = 
  321.     _somGetInstanceToken(LNRemoteLaunchtempClassData.classObject);
  322.     LNRemoteLaunchsomInitializeClass();
  323.     LNRemoteLaunchCClassData.parentMtab =
  324.     _somGetPClsMtab(LNRemoteLaunchtempClassData.classObject);
  325.     _somSetClassData(LNRemoteLaunchtempClassData.classObject, (somClassDataStructure *)&LNRemoteLaunchClassData);
  326.     _somClassReady(LNRemoteLaunchtempClassData.classObject);
  327.     /* make newly created class object visible */
  328.     LNRemoteLaunchClassData.classObject = LNRemoteLaunchtempClassData.classObject;
  329. }
  330.  
  331. LNRemoteLaunch * SOMLINK LNRemoteLaunchNewClass (integer4 scemajorVersion,
  332.         integer4 sceminorVersion)
  333. {
  334.     SOMClass *pClsObj;
  335.     SOMClass *mClsObj;
  336.  
  337.     /* Check the version numbers */
  338.     if (((scemajorVersion != 0) && 
  339.          (scemajorVersion != LNRemoteLaunch_MajorVersion)) ||
  340.         ((sceminorVersion != 0) && 
  341.          (sceminorVersion > LNRemoteLaunch_MinorVersion))) {
  342.     somPrintf("LNRemoteLaunchNewClass: Error, bad version numbers.\n");
  343.     SOM_Error(SOMERROR_BadVersion);
  344.     }
  345.     /* Don't do anything if class object is already created. */
  346.     if (LNRemoteLaunchClassData.classObject != (SOMAny *) NULL)
  347.     return(LNRemoteLaunchClassData.classObject);
  348.  
  349.     /* Make sure the environment is initialized. */
  350.     if (SOMClassMgrObject == (SOMAny *) NULL) somEnvironmentNew();
  351.     if (SOMClassMgrObject == (SOMAny *) NULL)
  352.     SOM_Error(SOMERROR_CouldNotStartup);
  353.  
  354.     /* Get the parent class object. */
  355.     DLSAppNewClass(0,0);    /* static reference */
  356.     pClsObj = _somFindClass(SOMClassMgrObject,
  357.         SOM_IdFromString("DLSApp"), 0, 0);
  358.     if (pClsObj == (SOMClass *) NULL)
  359.     SOM_Error(SOMERROR_NoParentClass);
  360.  
  361.     /* Use parent's metaclass */ 
  362.     mClsObj = SOM_GetClass(pClsObj);
  363.  
  364.     somConstructClass(LNRemoteLaunchsomCreateClass, pClsObj, mClsObj,
  365.              &LNRemoteLaunchtempClassData);
  366.     return (LNRemoteLaunchClassData.classObject);
  367. }
  368.  
  369. #endif                   /* LNRemoteLaunch_Class_Source */
  370.  
  371. #endif       /* lnremlch_ih */
  372.