xref: /trunk/main/sal/inc/osl/process.h (revision 4b37ad1dfdb632c9569e6bc39c06e6648a12a803)
19eab2a37SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
39eab2a37SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
49eab2a37SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
59eab2a37SAndrew Rist  * distributed with this work for additional information
69eab2a37SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
79eab2a37SAndrew Rist  * to you under the Apache License, Version 2.0 (the
89eab2a37SAndrew Rist  * "License"); you may not use this file except in compliance
99eab2a37SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
119eab2a37SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
139eab2a37SAndrew Rist  * Unless required by applicable law or agreed to in writing,
149eab2a37SAndrew Rist  * software distributed under the License is distributed on an
159eab2a37SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
169eab2a37SAndrew Rist  * KIND, either express or implied.  See the License for the
179eab2a37SAndrew Rist  * specific language governing permissions and limitations
189eab2a37SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
209eab2a37SAndrew Rist  *************************************************************/
219eab2a37SAndrew Rist 
22cdf0e10cSrcweir #ifndef _OSL_PROCESS_H_
23cdf0e10cSrcweir #define _OSL_PROCESS_H_
24cdf0e10cSrcweir 
25cdf0e10cSrcweir #include <rtl/ustring.h>
26cdf0e10cSrcweir #include <rtl/textenc.h>
27cdf0e10cSrcweir #include <rtl/locale.h>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include <osl/time.h>
30cdf0e10cSrcweir #include <osl/file.h>
31cdf0e10cSrcweir #include <osl/pipe.h>
32cdf0e10cSrcweir #include <osl/socket.h>
33cdf0e10cSrcweir #include <osl/security.h>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #ifdef __cplusplus
36cdf0e10cSrcweir extern "C" {
37cdf0e10cSrcweir #endif
38cdf0e10cSrcweir 
39cdf0e10cSrcweir 
40cdf0e10cSrcweir typedef sal_Int32 oslProcessOption;
41cdf0e10cSrcweir #define     osl_Process_WAIT       0x0001    /* wait for completion */
42cdf0e10cSrcweir #define     osl_Process_SEARCHPATH 0x0002    /* search path for executable */
43cdf0e10cSrcweir #define     osl_Process_DETACHED   0x0004    /* run detached */
44cdf0e10cSrcweir #define     osl_Process_NORMAL     0x0000    /* run in normal window */
45cdf0e10cSrcweir #define     osl_Process_HIDDEN     0x0010    /* run hidden */
46cdf0e10cSrcweir #define     osl_Process_MINIMIZED  0x0020    /* run in minimized window */
47cdf0e10cSrcweir #define     osl_Process_MAXIMIZED  0x0040    /* run in maximized window */
48cdf0e10cSrcweir #define     osl_Process_FULLSCREEN 0x0080    /* run in fullscreen window */
49cdf0e10cSrcweir 
50cdf0e10cSrcweir typedef sal_Int32 oslProcessData;
51cdf0e10cSrcweir 
52cdf0e10cSrcweir /* defines for osl_getProcessInfo , can be OR'ed */
53cdf0e10cSrcweir #define     osl_Process_IDENTIFIER  0x0001   /* retrieves the process identifier   */
54cdf0e10cSrcweir #define     osl_Process_EXITCODE    0x0002   /* retrieves exit code of the process */
55cdf0e10cSrcweir #define     osl_Process_CPUTIMES    0x0004   /* retrieves used cpu time            */
56cdf0e10cSrcweir #define     osl_Process_HEAPUSAGE   0x0008   /* retrieves the used size of heap    */
57cdf0e10cSrcweir 
58cdf0e10cSrcweir typedef sal_uInt32 oslProcessIdentifier;
59cdf0e10cSrcweir typedef sal_uInt32 oslProcessExitCode;
60cdf0e10cSrcweir 
61cdf0e10cSrcweir typedef enum {
62cdf0e10cSrcweir     osl_Process_E_None,                 /* no error */
63cdf0e10cSrcweir     osl_Process_E_NotFound,             /* image not found */
64*4b37ad1dSmseidel     osl_Process_E_TimedOut,             /* timeout occurred */
65cdf0e10cSrcweir     osl_Process_E_NoPermission,         /* permission denied */
66cdf0e10cSrcweir     osl_Process_E_Unknown,              /* unknown error */
67cdf0e10cSrcweir     osl_Process_E_InvalidError,         /* unmapped error */
68cdf0e10cSrcweir     osl_Process_E_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
69cdf0e10cSrcweir } oslProcessError;
70cdf0e10cSrcweir 
71cdf0e10cSrcweir typedef enum {
72cdf0e10cSrcweir     osl_Process_TypeNone,       /* no descriptor */
73cdf0e10cSrcweir     osl_Process_TypeSocket,     /* socket */
74cdf0e10cSrcweir     osl_Process_TypeFile,       /* file */
75cdf0e10cSrcweir     osl_Process_TypePipe,       /* pipe */
76cdf0e10cSrcweir     osl_Process_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
77cdf0e10cSrcweir } oslDescriptorType;
78cdf0e10cSrcweir 
79cdf0e10cSrcweir typedef sal_Int32 oslDescriptorFlag;
80cdf0e10cSrcweir #define osl_Process_DFNONE       0x0000
81cdf0e10cSrcweir #define osl_Process_DFWAIT       0x0001
82cdf0e10cSrcweir 
83cdf0e10cSrcweir #ifdef SAL_W32
84cdf0e10cSrcweir #   pragma pack(push, 8)
85cdf0e10cSrcweir #elif defined(SAL_OS2)
86cdf0e10cSrcweir #   pragma pack(push, 4)
87cdf0e10cSrcweir #endif
88cdf0e10cSrcweir 
89cdf0e10cSrcweir typedef struct {
90cdf0e10cSrcweir     sal_uInt32              Size;
91cdf0e10cSrcweir     oslProcessData          Fields;
92cdf0e10cSrcweir     oslProcessIdentifier    Ident;
93cdf0e10cSrcweir     oslProcessExitCode      Code;
94cdf0e10cSrcweir     TimeValue               UserTime;
95cdf0e10cSrcweir     TimeValue               SystemTime;
96cdf0e10cSrcweir     sal_uInt32              HeapUsage;
97cdf0e10cSrcweir } oslProcessInfo;
98cdf0e10cSrcweir 
99cdf0e10cSrcweir #if defined( SAL_W32) ||  defined(SAL_OS2)
100cdf0e10cSrcweir #   pragma pack(pop)
101cdf0e10cSrcweir #endif
102cdf0e10cSrcweir 
103cdf0e10cSrcweir /** Process handle
104cdf0e10cSrcweir 
105cdf0e10cSrcweir     @see osl_executeProcess
106cdf0e10cSrcweir     @see osl_terminateProcess
107cdf0e10cSrcweir     @see osl_freeProcessHandle
108cdf0e10cSrcweir     @see osl_getProcessInfo
109cdf0e10cSrcweir     @see osl_joinProcess
110cdf0e10cSrcweir */
111cdf0e10cSrcweir typedef void* oslProcess;
112cdf0e10cSrcweir 
113cdf0e10cSrcweir /** Execute a process.
114cdf0e10cSrcweir 
115cdf0e10cSrcweir     Executes the program image provided in strImageName in a new process.
116cdf0e10cSrcweir 
117cdf0e10cSrcweir     @param ustrImageName
118cdf0e10cSrcweir     [in] The file URL of the executable to be started.
119cdf0e10cSrcweir     Can be NULL in this case the file URL of the executable must be the first element
120cdf0e10cSrcweir     in ustrArguments.
121cdf0e10cSrcweir 
122cdf0e10cSrcweir     @param ustrArguments
123cdf0e10cSrcweir     [in] An array of argument strings. Can be NULL if strImageName is not NULL.
124cdf0e10cSrcweir     If strImageName is NULL it is expected that the first element contains
125cdf0e10cSrcweir     the file URL of the executable to start.
126cdf0e10cSrcweir 
127cdf0e10cSrcweir     @param nArguments
128cdf0e10cSrcweir     [in] The number of arguments provided. If this number is 0 strArguments will be ignored.
129cdf0e10cSrcweir 
130cdf0e10cSrcweir     @param Options
131cdf0e10cSrcweir     [in] A combination of int-constants to describe the mode of execution.
132cdf0e10cSrcweir 
133cdf0e10cSrcweir     @param Security
134cdf0e10cSrcweir     [in] The user and his rights for which the process is started. May be NULL in which case
135cdf0e10cSrcweir     the process will be started in the context of the current user.
136cdf0e10cSrcweir 
137cdf0e10cSrcweir     @param ustrDirectory
13886e1cf34SPedro Giffuni     [in] The file URL of the working directory of the new process. If the specified directory
139cdf0e10cSrcweir     does not exist or is inaccessible the working directory of the newly created process
140cdf0e10cSrcweir     is undefined. If this parameter is NULL or the caller provides an empty string the
141cdf0e10cSrcweir     new process will have the same current working directory as the calling process.
142cdf0e10cSrcweir 
143cdf0e10cSrcweir     @param ustrEnviroments
144cdf0e10cSrcweir     [in] An array of strings describing environment variables that should be merged into the
145cdf0e10cSrcweir     environment of the new process. Each string has to be in the form "variable=value".
146cdf0e10cSrcweir     This parameter can be NULL in which case the new process gets the same environment
147cdf0e10cSrcweir     as the parent process.
148cdf0e10cSrcweir 
149cdf0e10cSrcweir     @param nEnvironmentVars
150cdf0e10cSrcweir     [in] The number of environment variables to set.
151cdf0e10cSrcweir 
152cdf0e10cSrcweir     @param pProcess
15386e1cf34SPedro Giffuni     [out] Pointer to a oslProcess variable, which receives the handle of the newly created process.
154cdf0e10cSrcweir     This parameter must not be NULL.
155cdf0e10cSrcweir 
156cdf0e10cSrcweir     @return
157cdf0e10cSrcweir     <dl>
158cdf0e10cSrcweir     <dt>osl_Process_E_None</dt>
159cdf0e10cSrcweir     <dd>on success</dd>
160cdf0e10cSrcweir     <dt>osl_Process_E_NotFound</dt>
161cdf0e10cSrcweir     <dd>if the specified executable could not be found</dd>
162cdf0e10cSrcweir     <dt>osl_Process_E_InvalidError</dt>
163cdf0e10cSrcweir     <dd>if invalid parameters will be detected</dd>
164cdf0e10cSrcweir     <dt>osl_Process_E_Unknown</dt>
165cdf0e10cSrcweir     <dd>if arbitrary other errors occur</dd>
166cdf0e10cSrcweir     </dl>
167cdf0e10cSrcweir 
168cdf0e10cSrcweir     @see oslProcessOption
169cdf0e10cSrcweir     @see osl_executeProcess_WithRedirectedIO
170cdf0e10cSrcweir     @see osl_freeProcessHandle
171cdf0e10cSrcweir     @see osl_loginUser
172cdf0e10cSrcweir */
173cdf0e10cSrcweir oslProcessError SAL_CALL osl_executeProcess(
174cdf0e10cSrcweir     rtl_uString* ustrImageName,
175cdf0e10cSrcweir     rtl_uString* ustrArguments[],
176cdf0e10cSrcweir     sal_uInt32  nArguments,
177cdf0e10cSrcweir     oslProcessOption Options,
178cdf0e10cSrcweir     oslSecurity Security,
179cdf0e10cSrcweir     rtl_uString* ustrDirectory,
180cdf0e10cSrcweir     rtl_uString* ustrEnvironments[],
181cdf0e10cSrcweir     sal_uInt32 nEnvironmentVars,
182cdf0e10cSrcweir     oslProcess* pProcess);
183cdf0e10cSrcweir 
184cdf0e10cSrcweir 
185cdf0e10cSrcweir /** Execute a process and redirect child process standard IO.
186cdf0e10cSrcweir 
187cdf0e10cSrcweir     @param ustrImageName
188cdf0e10cSrcweir     [in] The file URL of the executable to be started.
189cdf0e10cSrcweir     Can be NULL in this case the file URL of the executable must be the first element
190cdf0e10cSrcweir     in ustrArguments.
191cdf0e10cSrcweir 
192cdf0e10cSrcweir     @param ustrArguments
193cdf0e10cSrcweir     [in] An array of argument strings. Can be NULL if strImageName is not NULL.
194cdf0e10cSrcweir     If strImageName is NULL it is expected that the first element contains
195cdf0e10cSrcweir     the file URL of the executable to start.
196cdf0e10cSrcweir 
197cdf0e10cSrcweir     @param nArguments
198cdf0e10cSrcweir     [in] The number of arguments provided. If this number is 0 strArguments will be ignored.
199cdf0e10cSrcweir 
200cdf0e10cSrcweir     @param Options
201cdf0e10cSrcweir     [in] A combination of int-constants to describe the mode of execution.
202cdf0e10cSrcweir 
203cdf0e10cSrcweir     @param Security
204cdf0e10cSrcweir     [in] The user and his rights for which the process is started. May be NULL in which case
205cdf0e10cSrcweir     the process will be started in the context of the current user.
206cdf0e10cSrcweir 
207cdf0e10cSrcweir     @param ustrDirectory
20886e1cf34SPedro Giffuni     [in] The file URL of the working directory of the new process. If the specified directory
209cdf0e10cSrcweir     does not exist or is inaccessible the working directory of the newly created process
210cdf0e10cSrcweir     is undefined. If this parameter is NULL or the caller provides an empty string the
211cdf0e10cSrcweir     new process will have the same current working directory as the calling process.
212cdf0e10cSrcweir 
213cdf0e10cSrcweir     @param ustrEnviroments
214cdf0e10cSrcweir     [in] An array of strings describing environment variables that should be merged into the
215cdf0e10cSrcweir     environment of the new process. Each string has to be in the form "variable=value".
216cdf0e10cSrcweir     This parameter can be NULL in which case the new process gets the same environment
217cdf0e10cSrcweir     as the parent process.
218cdf0e10cSrcweir 
219cdf0e10cSrcweir     @param nEnvironmentVars
220cdf0e10cSrcweir     [in] The number of environment variables to set.
221cdf0e10cSrcweir 
222cdf0e10cSrcweir     @param pProcess
22386e1cf34SPedro Giffuni     [out] Pointer to a oslProcess variable, which receives the handle of the newly created process.
224cdf0e10cSrcweir     This parameter must not be NULL.
225cdf0e10cSrcweir 
226cdf0e10cSrcweir     @param pChildInputWrite
227cdf0e10cSrcweir     [in] Pointer to a oslFileHandle variable that receives the handle which can be used to write
228cdf0e10cSrcweir     to the child process standard input device. The returned handle is not random accessible.
229cdf0e10cSrcweir     The handle has to be closed with osl_closeFile if no longer used. This parameter can be NULL.
230cdf0e10cSrcweir 
231cdf0e10cSrcweir     @param pChildOutputRead
232cdf0e10cSrcweir     [in] Pointer to a oslFileHandle variable that receives the handle which can be used to read from
233cdf0e10cSrcweir     the child process standard output device. The returned handle is not random accessible.
234cdf0e10cSrcweir     The Handle has to be closed with osl_closeFile if no longer used. This parameter can be NULL.
235cdf0e10cSrcweir 
236cdf0e10cSrcweir     @param pChildErrorRead
237cdf0e10cSrcweir     [in] Pointer to a oslFileHandle variable that receives the handle which can be used to read from
238cdf0e10cSrcweir     the child process standard error device. The returned handle is not random accessible.
239cdf0e10cSrcweir     The Handle has to be closed with osl_closeFile if no longer used. This parameter can be NULL.
240cdf0e10cSrcweir 
241cdf0e10cSrcweir     @return
242cdf0e10cSrcweir     <dl>
243cdf0e10cSrcweir     <dt>osl_Process_E_None</dt>
244cdf0e10cSrcweir     <dd>on success</dd>
245cdf0e10cSrcweir     <dt>osl_Process_E_NotFound</dt>
246cdf0e10cSrcweir     <dd>if the specified executable could not be found</dd>
247cdf0e10cSrcweir     <dt>osl_Process_E_InvalidError</dt>
248cdf0e10cSrcweir     <dd>if invalid parameters will be detected</dd>
249cdf0e10cSrcweir     <dt>osl_Process_E_Unknown</dt>
250cdf0e10cSrcweir     <dd>if arbitrary other errors occur</dd>
251cdf0e10cSrcweir     </dl>
252cdf0e10cSrcweir 
253cdf0e10cSrcweir     @see oslProcessOption
254cdf0e10cSrcweir     @see osl_executeProcess
255cdf0e10cSrcweir     @see osl_freeProcessHandle
256cdf0e10cSrcweir     @see osl_loginUser
257cdf0e10cSrcweir     @see osl_closeFile
258cdf0e10cSrcweir */
259cdf0e10cSrcweir oslProcessError SAL_CALL osl_executeProcess_WithRedirectedIO(
260cdf0e10cSrcweir     rtl_uString* strImageName,
261cdf0e10cSrcweir     rtl_uString* ustrArguments[],
262cdf0e10cSrcweir     sal_uInt32 nArguments,
263cdf0e10cSrcweir     oslProcessOption Options,
264cdf0e10cSrcweir     oslSecurity Security,
265cdf0e10cSrcweir     rtl_uString* ustrDirectory,
266cdf0e10cSrcweir     rtl_uString* ustrEnvironments[],
267cdf0e10cSrcweir     sal_uInt32 nEnvironmentVars,
268cdf0e10cSrcweir     oslProcess* pProcess,
269cdf0e10cSrcweir     oslFileHandle* pChildInputWrite,
270cdf0e10cSrcweir     oslFileHandle* pChildOutputRead,
271cdf0e10cSrcweir     oslFileHandle* pChildErrorRead);
272cdf0e10cSrcweir 
273cdf0e10cSrcweir /** Terminate a process
274cdf0e10cSrcweir     @param Process [in] the handle of the process to be terminated
275cdf0e10cSrcweir 
276cdf0e10cSrcweir     @see osl_executeProcess
277cdf0e10cSrcweir     @see osl_getProcess
278cdf0e10cSrcweir     @see osl_joinProcess
279cdf0e10cSrcweir  */
280cdf0e10cSrcweir oslProcessError SAL_CALL osl_terminateProcess(oslProcess Process);
281cdf0e10cSrcweir 
282cdf0e10cSrcweir 
283cdf0e10cSrcweir /** @deprecated
284cdf0e10cSrcweir     Retrieve the process handle of a process identifier
285cdf0e10cSrcweir     @param Ident [in] a process identifier
286cdf0e10cSrcweir 
287cdf0e10cSrcweir     @return the process handle on success, NULL in all other cases
288cdf0e10cSrcweir  */
289cdf0e10cSrcweir oslProcess SAL_CALL osl_getProcess(oslProcessIdentifier Ident);
290cdf0e10cSrcweir 
291cdf0e10cSrcweir 
292cdf0e10cSrcweir /** Free the specified proces-handle.
293cdf0e10cSrcweir     @param Process [in]
294cdf0e10cSrcweir */
295cdf0e10cSrcweir void SAL_CALL osl_freeProcessHandle(oslProcess Process);
296cdf0e10cSrcweir 
297cdf0e10cSrcweir 
298*4b37ad1dSmseidel /** Wait for completion of the specified childprocess.
299cdf0e10cSrcweir     @param Process [in]
300cdf0e10cSrcweir     @return ols_Process_E_None
301cdf0e10cSrcweir     @see osl_executeProcess
302cdf0e10cSrcweir */
303cdf0e10cSrcweir oslProcessError SAL_CALL osl_joinProcess(oslProcess Process);
304cdf0e10cSrcweir 
305cdf0e10cSrcweir /** Wait with a timeout for the completion of the specified child
306cdf0e10cSrcweir     process.
307cdf0e10cSrcweir 
308cdf0e10cSrcweir     @param Process [in]
309cdf0e10cSrcweir     A process identifier.
310cdf0e10cSrcweir 
311cdf0e10cSrcweir     @param pTimeout [in]
312cdf0e10cSrcweir     A timeout value or NULL for infinite waiting.
313cdf0e10cSrcweir     The unit of resolution is second.
314cdf0e10cSrcweir 
315cdf0e10cSrcweir     @return
316cdf0e10cSrcweir     osl_Process_E_None on success
317cdf0e10cSrcweir     osl_Process_E_TimedOut waiting for the child process timed out
31886e1cf34SPedro Giffuni     osl_Process_E_Unknown an error occurred or the parameter are invalid
319cdf0e10cSrcweir 
320cdf0e10cSrcweir     @see osl_executeProcess
321cdf0e10cSrcweir */
322cdf0e10cSrcweir oslProcessError SAL_CALL osl_joinProcessWithTimeout(oslProcess Process, const TimeValue* pTimeout);
323cdf0e10cSrcweir 
324cdf0e10cSrcweir /** Retrieves information about a Process
325cdf0e10cSrcweir     @param Process [in] the process handle of the process
326cdf0e10cSrcweir     @param Field   [in] the information which is to be retrieved
327cdf0e10cSrcweir                         this can be one or more of
328cdf0e10cSrcweir                         osl_Process_IDENTIFIER
329cdf0e10cSrcweir                         osl_Process_EXITCODE
330cdf0e10cSrcweir                         osl_Process_CPUTIMES
331cdf0e10cSrcweir                         osl_Process_HEAPUSAGE
332cdf0e10cSrcweir     @param pInfo  [out] a pointer to a vaid oslProcessInfo structure.
333cdf0e10cSrcweir                         the Size field has to be initialized with the size
334cdf0e10cSrcweir                         of the oslProcessInfo structure.
3357950f2afSmseidel                         on success the Field member holds the (or'ed)
336cdf0e10cSrcweir                         retrieved valid information fields.
337cdf0e10cSrcweir     @return osl_Process_E_None on success, osl_Process_E_Unknown on failure.
338cdf0e10cSrcweir  */
339cdf0e10cSrcweir oslProcessError SAL_CALL osl_getProcessInfo(oslProcess Process, oslProcessData Fields,
340cdf0e10cSrcweir                                    oslProcessInfo* pInfo);
341cdf0e10cSrcweir 
342cdf0e10cSrcweir /** Get the filename of the executable.
343cdf0e10cSrcweir     @param strFile [out] the string that receives the executable file path.
344cdf0e10cSrcweir     @return osl_Process_E_None or does not return.
345cdf0e10cSrcweir     @see osl_executeProcess
346cdf0e10cSrcweir */
347cdf0e10cSrcweir oslProcessError SAL_CALL osl_getExecutableFile(rtl_uString **strFile);
348cdf0e10cSrcweir 
349cdf0e10cSrcweir /** @return the number of commandline arguments passed to the main-function of
350cdf0e10cSrcweir     this process
351cdf0e10cSrcweir     @see osl_getCommandArg
352cdf0e10cSrcweir */
353cdf0e10cSrcweir sal_uInt32 SAL_CALL osl_getCommandArgCount(void);
354cdf0e10cSrcweir 
355cdf0e10cSrcweir /** Get the nArg-th command-line argument passed to the main-function of this process.
356cdf0e10cSrcweir     @param nArg [in] The number of the argument to return.
357cdf0e10cSrcweir     @param strCommandArg [out] The string receives the nArg-th command-line argument.
358cdf0e10cSrcweir     @return osl_Process_E_None or does not return.
359cdf0e10cSrcweir     @see osl_executeProcess
360cdf0e10cSrcweir */
361cdf0e10cSrcweir oslProcessError SAL_CALL osl_getCommandArg(sal_uInt32 nArg, rtl_uString **strCommandArg);
362cdf0e10cSrcweir 
363cdf0e10cSrcweir /** Set the command-line arguments as passed to the main-function of this process.
364cdf0e10cSrcweir 
365*4b37ad1dSmseidel     Deprecated: This function is only for internal use. Passing the args from main will
366d41c82aeSJohn Bampton     only work for Unix, on Windows there's no effect, the full command line will automatically
367cdf0e10cSrcweir     be taken. This is due to Windows 9x/ME limitation that don't allow UTF-16 wmain to provide
368cdf0e10cSrcweir     a osl_setCommandArgsU( int argc, sal_Unicode **argv );
369cdf0e10cSrcweir 
370cdf0e10cSrcweir     @param argc [in] The number of elements in the argv array.
371cdf0e10cSrcweir     @param argv [in] The array of command-line arguments.
372cdf0e10cSrcweir     @see osl_getExecutableFile
373cdf0e10cSrcweir     @see osl_getCommandArgCount
374cdf0e10cSrcweir     @see osl_getCommandArg
375cdf0e10cSrcweir */
376cdf0e10cSrcweir void SAL_CALL osl_setCommandArgs (int argc, char **argv);
377cdf0e10cSrcweir 
37886e1cf34SPedro Giffuni /** Get the value of one environment variable.
379cdf0e10cSrcweir     @param strVar [in] denotes the name of the variable to get.
380cdf0e10cSrcweir     @param strValue [out] string that receives the value of environment variable.
381cdf0e10cSrcweir */
382cdf0e10cSrcweir oslProcessError SAL_CALL osl_getEnvironment(rtl_uString *strVar, rtl_uString **strValue);
383cdf0e10cSrcweir 
38486e1cf34SPedro Giffuni /** Set the value of one environment variable.
385cdf0e10cSrcweir     @param strVar [in] denotes the name of the variable to set.
386cdf0e10cSrcweir     @param strValue [in] string of the new value of environment variable.
387cdf0e10cSrcweir 
388cdf0e10cSrcweir     @since UDK 3.2.13
389cdf0e10cSrcweir */
390cdf0e10cSrcweir oslProcessError SAL_CALL osl_setEnvironment(rtl_uString *strVar, rtl_uString *strValue);
391cdf0e10cSrcweir 
39286e1cf34SPedro Giffuni /** Unsets the value of one environment variable.
393cdf0e10cSrcweir     @param strVar [in] denotes the name of the variable to unset.
394cdf0e10cSrcweir 
395cdf0e10cSrcweir     @since UDK 3.2.13
396cdf0e10cSrcweir */
397cdf0e10cSrcweir oslProcessError SAL_CALL osl_clearEnvironment(rtl_uString *strVar);
398cdf0e10cSrcweir 
399cdf0e10cSrcweir /** Get the working directory of the current process as a file URL.
400cdf0e10cSrcweir 
401cdf0e10cSrcweir     The file URL is encoded as common for the OSL file API.
402cdf0e10cSrcweir     @param  pustrWorkingDir [out] string that receives the working directory file URL.
403cdf0e10cSrcweir */
404cdf0e10cSrcweir 
405cdf0e10cSrcweir oslProcessError SAL_CALL osl_getProcessWorkingDir( rtl_uString **pustrWorkingDir );
406cdf0e10cSrcweir 
407cdf0e10cSrcweir /** Get the locale the process is currently running in.
408cdf0e10cSrcweir 
409cdf0e10cSrcweir     The unix implementation caches the value it returns, so if you have to change the locale
410cdf0e10cSrcweir     your are running in, you will have to use osl_setProcessLocale therefor.
411cdf0e10cSrcweir 
412cdf0e10cSrcweir     @param  ppLocale [out] a pointer that receives the currently selected locale structure
413cdf0e10cSrcweir     @see osl_setProcessLocale
414cdf0e10cSrcweir */
415cdf0e10cSrcweir 
416cdf0e10cSrcweir oslProcessError SAL_CALL osl_getProcessLocale( rtl_Locale ** ppLocale );
417cdf0e10cSrcweir 
418cdf0e10cSrcweir /** Change the locale of the process.
419cdf0e10cSrcweir 
420cdf0e10cSrcweir     @param  pLocale [in] a pointer to the locale to be set
421cdf0e10cSrcweir     @see osl_getProcessLocale
422cdf0e10cSrcweir */
423cdf0e10cSrcweir 
424cdf0e10cSrcweir oslProcessError SAL_CALL osl_setProcessLocale( rtl_Locale * pLocale );
425cdf0e10cSrcweir 
426cdf0e10cSrcweir 
427cdf0e10cSrcweir sal_Bool SAL_CALL osl_sendResourcePipe(oslPipe Pipe, oslSocket Socket);
428cdf0e10cSrcweir 
429cdf0e10cSrcweir oslSocket SAL_CALL osl_receiveResourcePipe(oslPipe Pipe);
430cdf0e10cSrcweir 
431cdf0e10cSrcweir #ifdef __cplusplus
432cdf0e10cSrcweir }
433cdf0e10cSrcweir #endif
434cdf0e10cSrcweir 
435cdf0e10cSrcweir #endif /* _OSL_PROCESS_H_ */
436