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