AlterOffice
AlterOffice 3.4 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
process.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 
3 
4 #ifndef INCLUDED_OSL_PROCESS_H
5 #define INCLUDED_OSL_PROCESS_H
6 
7 #include "sal/config.h"
8 
9 #include "osl/file.h"
10 #include "osl/security.h"
11 #include "osl/time.h"
12 #include "rtl/locale.h"
13 #include "rtl/ustring.h"
14 #include "sal/saldllapi.h"
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 
21 typedef sal_Int32 oslProcessOption;
22 #define osl_Process_WAIT 0x0001 /* wait for completion */
23 #define osl_Process_SEARCHPATH 0x0002 /* search path for executable */
24 #define osl_Process_DETACHED 0x0004 /* run detached */
25 #define osl_Process_NORMAL 0x0000 /* run in normal window */
26 #define osl_Process_HIDDEN 0x0010 /* run hidden */
27 #define osl_Process_MINIMIZED 0x0020 /* run in minimized window */
28 #define osl_Process_MAXIMIZED 0x0040 /* run in maximized window */
29 #define osl_Process_FULLSCREEN 0x0080 /* run in fullscreen window */
30 
31 typedef sal_Int32 oslProcessData;
32 
33 /* defines for osl_getProcessInfo , can be OR'ed */
34 #define osl_Process_IDENTIFIER 0x0001 /* retrieves the process identifier */
35 #define osl_Process_EXITCODE 0x0002 /* retrieves exit code of the process */
36 #define osl_Process_CPUTIMES 0x0004 /* retrieves used cpu time */
37 #define osl_Process_HEAPUSAGE 0x0008 /* retrieves the used size of heap */
38 
39 typedef sal_uInt32 oslProcessIdentifier;
40 typedef sal_uInt32 oslProcessExitCode;
41 
42 typedef enum {
43  osl_Process_E_None, /* no error */
44  osl_Process_E_NotFound, /* image not found */
45  osl_Process_E_TimedOut, /* timeout occurred */
46  osl_Process_E_NoPermission, /* permission denied */
47  osl_Process_E_Unknown, /* unknown error */
48  osl_Process_E_InvalidError, /* unmapped error */
51 
52 #ifdef _WIN32
53 # pragma pack(push, 8)
54 #endif
55 
56 typedef struct {
57  sal_uInt32 Size;
58  oslProcessData Fields;
59  oslProcessIdentifier Ident;
60  oslProcessExitCode Code;
63  sal_uInt32 HeapUsage;
65 
66 #if defined( _WIN32)
67 # pragma pack(pop)
68 #endif
69 
78 typedef void* oslProcess;
79 
134  rtl_uString* ustrImageName,
135  rtl_uString* ustrArguments[],
136  sal_uInt32 nArguments,
137  oslProcessOption Options,
138  oslSecurity Security,
139  rtl_uString* ustrDirectory,
140  rtl_uString* ustrEnvironments[],
141  sal_uInt32 nEnvironmentVars,
142  oslProcess* pProcess);
143 
144 
213  rtl_uString* strImageName,
214  rtl_uString* ustrArguments[],
215  sal_uInt32 nArguments,
216  oslProcessOption Options,
217  oslSecurity Security,
218  rtl_uString* ustrDirectory,
219  rtl_uString* ustrEnvironments[],
220  sal_uInt32 nEnvironmentVars,
221  oslProcess* pProcess,
222  oslFileHandle* pChildInputWrite,
223  oslFileHandle* pChildOutputRead,
224  oslFileHandle* pChildErrorRead);
225 
235  oslProcess Process);
236 
237 
246 SAL_DLLPUBLIC oslProcess SAL_CALL osl_getProcess(
247  oslProcessIdentifier Ident) SAL_COLD;
248 
249 
255  oslProcess Process);
256 
257 
266  oslProcess Process);
267 
282  oslProcess Process, const TimeValue* pTimeout);
283 
301  oslProcess Process, oslProcessData Fields, oslProcessInfo* pInfo);
302 
315  rtl_uString **strFile);
316 
321 SAL_DLLPUBLIC sal_uInt32 SAL_CALL osl_getCommandArgCount(void);
322 
330  sal_uInt32 nArg, rtl_uString **strCommandArg);
331 
345 SAL_DLLPUBLIC void SAL_CALL osl_setCommandArgs (int argc, char **argv);
346 
352  rtl_uString *strVar, rtl_uString **strValue);
353 
361  rtl_uString *strVar, rtl_uString *strValue);
362 
369  rtl_uString *strVar);
370 
378  rtl_uString **pustrWorkingDir );
379 
386  rtl_Locale ** ppLocale );
387 
397  rtl_Locale * pLocale );
398 
399 #ifdef __cplusplus
400 }
401 #endif
402 
403 #endif // INCLUDED_OSL_PROCESS_H
404 
405 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: process.h:43
Time since Jan-01-1970.
Definition: time.h:56
sal_uInt32 oslProcessIdentifier
Definition: process.h:39
oslProcessIdentifier Ident
Definition: process.h:59
SAL_DLLPUBLIC oslProcessError osl_setProcessLocale(rtl_Locale *pLocale)
Change the locale of the process.
void * oslFileHandle
Definition: file.h:610
SAL_DLLPUBLIC oslProcess osl_getProcess(oslProcessIdentifier Ident) SAL_COLD
TimeValue UserTime
Definition: process.h:61
TimeValue SystemTime
Definition: process.h:62
SAL_DLLPUBLIC oslProcessError osl_terminateProcess(oslProcess Process)
Terminate a process.
oslProcessExitCode Code
Definition: process.h:60
Definition: process.h:56
SAL_DLLPUBLIC oslProcessError osl_getEnvironment(rtl_uString *strVar, rtl_uString **strValue)
Get the value of one environment variable.
SAL_DLLPUBLIC oslProcessError osl_clearEnvironment(rtl_uString *strVar)
Unsets the value of one environment variable.
sal_uInt32 HeapUsage
Definition: process.h:63
SAL_DLLPUBLIC oslProcessError osl_executeProcess_WithRedirectedIO(rtl_uString *strImageName, rtl_uString *ustrArguments[], sal_uInt32 nArguments, oslProcessOption Options, oslSecurity Security, rtl_uString *ustrDirectory, rtl_uString *ustrEnvironments[], sal_uInt32 nEnvironmentVars, oslProcess *pProcess, oslFileHandle *pChildInputWrite, oslFileHandle *pChildOutputRead, oslFileHandle *pChildErrorRead)
Execute a process and redirect child process standard IO.
void * oslProcess
Process handle.
Definition: process.h:78
Definition: process.h:46
The implementation structure of a locale.
Definition: locale.h:26
SAL_DLLPUBLIC void osl_freeProcessHandle(oslProcess Process)
Free the specified process-handle.
Definition: process.h:44
Definition: process.h:45
SAL_DLLPUBLIC oslProcessError osl_getProcessInfo(oslProcess Process, oslProcessData Fields, oslProcessInfo *pInfo)
Retrieves information about a Process.
sal_Int32 oslProcessOption
Definition: process.h:21
sal_Int32 oslProcessData
Definition: process.h:31
SAL_DLLPUBLIC void osl_setCommandArgs(int argc, char **argv)
Set the command-line arguments as passed to the main-function of this process.
SAL_DLLPUBLIC oslProcessError osl_executeProcess(rtl_uString *ustrImageName, rtl_uString *ustrArguments[], sal_uInt32 nArguments, oslProcessOption Options, oslSecurity Security, rtl_uString *ustrDirectory, rtl_uString *ustrEnvironments[], sal_uInt32 nEnvironmentVars, oslProcess *pProcess)
Execute a process.
SAL_DLLPUBLIC oslProcessError osl_getCommandArg(sal_uInt32 nArg, rtl_uString **strCommandArg)
Get the nArg-th command-line argument passed to the main-function of this process.
void * oslSecurity
Process handle.
Definition: security.h:29
SAL_DLLPUBLIC oslProcessError osl_joinProcess(oslProcess Process)
Wait for completion of the specified childprocess.
Definition: process.h:49
SAL_DLLPUBLIC oslProcessError osl_joinProcessWithTimeout(oslProcess Process, const TimeValue *pTimeout)
Wait with a timeout for the completion of the specified child process.
oslProcessError
Definition: process.h:42
SAL_DLLPUBLIC oslProcessError osl_getExecutableFile(rtl_uString **strFile)
Get the filename of the executable.
sal_uInt32 Size
Definition: process.h:57
#define SAL_MAX_ENUM
Definition: types.h:185
SAL_DLLPUBLIC oslProcessError osl_getProcessLocale(rtl_Locale **ppLocale)
Get the locale the process is currently running in.
Definition: process.h:48
SAL_DLLPUBLIC oslProcessError osl_setEnvironment(rtl_uString *strVar, rtl_uString *strValue)
Set the value of one environment variable.
sal_uInt32 oslProcessExitCode
Definition: process.h:40
SAL_DLLPUBLIC oslProcessError osl_getProcessWorkingDir(rtl_uString **pustrWorkingDir)
Get the working directory of the current process as a file URL.
SAL_DLLPUBLIC sal_uInt32 osl_getCommandArgCount(void)
oslProcessData Fields
Definition: process.h:58
Definition: process.h:47
#define SAL_DLLPUBLIC
Definition: saldllapi.h:14
Main goals and usage hints.