| 1 |  | 
|---|
| 2 | /* | 
|---|
| 3 | *@@sourcefile apps.h: | 
|---|
| 4 | *      header file for apps.c. See remarks there. | 
|---|
| 5 | * | 
|---|
| 6 | *      Note: Version numbering in this file relates to XWorkplace version | 
|---|
| 7 | *            numbering. | 
|---|
| 8 | * | 
|---|
| 9 | *@@include #define INCL_WINPROGRAMLIST | 
|---|
| 10 | *@@include #include <os2.h> | 
|---|
| 11 | *@@include #include "helpers\apps.h" | 
|---|
| 12 | */ | 
|---|
| 13 |  | 
|---|
| 14 | /*      This file Copyright (C) 1997-2001 Ulrich Mller. | 
|---|
| 15 | *      This file is part of the "XWorkplace helpers" source package. | 
|---|
| 16 | *      This is free software; you can redistribute it and/or modify | 
|---|
| 17 | *      it under the terms of the GNU General Public License as published | 
|---|
| 18 | *      by the Free Software Foundation, in version 2 as it comes in the | 
|---|
| 19 | *      "COPYING" file of the XWorkplace main distribution. | 
|---|
| 20 | *      This program is distributed in the hope that it will be useful, | 
|---|
| 21 | *      but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 22 | *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 23 | *      GNU General Public License for more details. | 
|---|
| 24 | */ | 
|---|
| 25 |  | 
|---|
| 26 | #if __cplusplus | 
|---|
| 27 | extern "C" { | 
|---|
| 28 | #endif | 
|---|
| 29 |  | 
|---|
| 30 | #ifndef APPS_HEADER_INCLUDED | 
|---|
| 31 | #define APPS_HEADER_INCLUDED | 
|---|
| 32 |  | 
|---|
| 33 | /* ****************************************************************** | 
|---|
| 34 | * | 
|---|
| 35 | *   Environment helpers | 
|---|
| 36 | * | 
|---|
| 37 | ********************************************************************/ | 
|---|
| 38 |  | 
|---|
| 39 | ULONG appQueryEnvironmentLen(PCSZ pcszEnvironment); | 
|---|
| 40 |  | 
|---|
| 41 | /* | 
|---|
| 42 | *@@ DOSENVIRONMENT: | 
|---|
| 43 | *      structure holding an array of environment | 
|---|
| 44 | *      variables (papszVars). This is initialized | 
|---|
| 45 | *      appGetEnvironment, | 
|---|
| 46 | * | 
|---|
| 47 | *@@added V0.9.4 (2000-07-19) [umoeller] | 
|---|
| 48 | */ | 
|---|
| 49 |  | 
|---|
| 50 | typedef struct _DOSENVIRONMENT | 
|---|
| 51 | { | 
|---|
| 52 | ULONG       cVars;              // count of vars in papzVars | 
|---|
| 53 | PSZ         *papszVars;         // array of PSZ's to environment strings (VAR=VALUE) | 
|---|
| 54 | } DOSENVIRONMENT, *PDOSENVIRONMENT; | 
|---|
| 55 |  | 
|---|
| 56 | APIRET appParseEnvironment(const char *pcszEnv, | 
|---|
| 57 | PDOSENVIRONMENT pEnv); | 
|---|
| 58 |  | 
|---|
| 59 | APIRET appGetEnvironment(PDOSENVIRONMENT pEnv); | 
|---|
| 60 |  | 
|---|
| 61 | PSZ* appFindEnvironmentVar(PDOSENVIRONMENT pEnv, | 
|---|
| 62 | PCSZ pszVarName); | 
|---|
| 63 |  | 
|---|
| 64 | APIRET appSetEnvironmentVar(PDOSENVIRONMENT pEnv, | 
|---|
| 65 | PCSZ pszNewEnv, | 
|---|
| 66 | BOOL fAddFirst); | 
|---|
| 67 |  | 
|---|
| 68 | APIRET appSetEnvironmentVars(PDOSENVIRONMENT pEnv, | 
|---|
| 69 | PCSZ pcszEnv); | 
|---|
| 70 |  | 
|---|
| 71 | APIRET appConvertEnvironment(PDOSENVIRONMENT pEnv, | 
|---|
| 72 | PSZ *ppszEnv, | 
|---|
| 73 | PULONG pulSize); | 
|---|
| 74 |  | 
|---|
| 75 | APIRET appFreeEnvironment(PDOSENVIRONMENT pEnv); | 
|---|
| 76 |  | 
|---|
| 77 | #ifdef INCL_WINPROGRAMLIST | 
|---|
| 78 | // additional PROG_* flags for appQueryAppType | 
|---|
| 79 | // #define PROG_XWP_DLL            998      // dynamic link library | 
|---|
| 80 | // removed, PROG_DLL exists already | 
|---|
| 81 | // V0.9.16 (2001-10-06) | 
|---|
| 82 |  | 
|---|
| 83 | #define PROG_WIN32              990     // added V0.9.16 (2001-12-08) [umoeller] | 
|---|
| 84 |  | 
|---|
| 85 | APIRET appQueryAppType(const char *pcszExecutable, | 
|---|
| 86 | PULONG pulDosAppType, | 
|---|
| 87 | PULONG pulWinAppType); | 
|---|
| 88 |  | 
|---|
| 89 | PCSZ appDescribeAppType(PROGCATEGORY progc); | 
|---|
| 90 |  | 
|---|
| 91 | ULONG appIsWindowsApp(ULONG ulProgCategory); | 
|---|
| 92 |  | 
|---|
| 93 | /* ****************************************************************** | 
|---|
| 94 | * | 
|---|
| 95 | *   Application start | 
|---|
| 96 | * | 
|---|
| 97 | ********************************************************************/ | 
|---|
| 98 |  | 
|---|
| 99 | APIRET appQueryDefaultWin31Environment(PSZ *ppsz); | 
|---|
| 100 |  | 
|---|
| 101 | #define APP_RUN_FULLSCREEN      0x0001 | 
|---|
| 102 | #define APP_RUN_ENHANCED        0x0002 | 
|---|
| 103 | #define APP_RUN_STANDARD        0x0004 | 
|---|
| 104 | #define APP_RUN_SEPARATE        0x0008 | 
|---|
| 105 |  | 
|---|
| 106 | APIRET appBuildProgDetails(PPROGDETAILS *ppDetails, | 
|---|
| 107 | const PROGDETAILS *pcProgDetails, | 
|---|
| 108 | ULONG ulFlags); | 
|---|
| 109 |  | 
|---|
| 110 | APIRET XWPENTRY appStartApp(HWND hwndNotify, | 
|---|
| 111 | const PROGDETAILS *pcProgDetails, | 
|---|
| 112 | ULONG ulFlags, | 
|---|
| 113 | HAPP *phapp, | 
|---|
| 114 | ULONG cbFailingName, | 
|---|
| 115 | PSZ pszFailingName); | 
|---|
| 116 |  | 
|---|
| 117 | BOOL XWPENTRY appWaitForApp(HWND hwndNotify, | 
|---|
| 118 | HAPP happ, | 
|---|
| 119 | PULONG pulExitCode); | 
|---|
| 120 |  | 
|---|
| 121 | APIRET appQuickStartApp(const char *pcszFile, | 
|---|
| 122 | ULONG ulProgType, | 
|---|
| 123 | const char *pcszArgs, | 
|---|
| 124 | const char *pcszWorkingDir, | 
|---|
| 125 | HAPP *phapp, | 
|---|
| 126 | PULONG pulExitCode); | 
|---|
| 127 |  | 
|---|
| 128 | APIRET appOpenURL(PCSZ pcszURL, | 
|---|
| 129 | PSZ pszAppStarted, | 
|---|
| 130 | ULONG cbAppStarted); | 
|---|
| 131 |  | 
|---|
| 132 | #endif | 
|---|
| 133 |  | 
|---|
| 134 | #endif | 
|---|
| 135 |  | 
|---|
| 136 | #if __cplusplus | 
|---|
| 137 | } | 
|---|
| 138 | #endif | 
|---|
| 139 |  | 
|---|