home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / nspr30-v.zip / nspr30-v / include / prproces.h < prev    next >
C/C++ Source or Header  |  1998-11-02  |  3KB  |  94 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /*
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  * 
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  * 
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #ifndef prproces_h___
  20. #define prproces_h___
  21.  
  22. #include "prtypes.h"
  23. #include "prio.h"
  24.  
  25. PR_BEGIN_EXTERN_C
  26.  
  27. /************************************************************************/
  28. /*****************************PROCESS OPERATIONS*************************/
  29. /************************************************************************/
  30.  
  31. typedef struct PRProcess PRProcess;
  32. typedef struct PRProcessAttr PRProcessAttr;
  33.  
  34. PR_EXTERN(PRProcessAttr *) PR_NewProcessAttr(void);
  35.  
  36. PR_EXTERN(void) PR_ResetProcessAttr(PRProcessAttr *attr);
  37.  
  38. PR_EXTERN(void) PR_DestroyProcessAttr(PRProcessAttr *attr);
  39.  
  40. PR_EXTERN(void) PR_ProcessAttrSetStdioRedirect(
  41.     PRProcessAttr *attr,
  42.     PRSpecialFD stdioFd,
  43.     PRFileDesc *redirectFd
  44. );
  45.  
  46. /*
  47.  * OBSOLETE -- use PR_ProcessAttrSetStdioRedirect instead.
  48.  */
  49. PR_EXTERN(void) PR_SetStdioRedirect(
  50.     PRProcessAttr *attr,
  51.     PRSpecialFD stdioFd,
  52.     PRFileDesc *redirectFd
  53. );
  54.  
  55. PR_EXTERN(PRStatus) PR_ProcessAttrSetCurrentDirectory(
  56.     PRProcessAttr *attr,
  57.     const char *dir
  58. );
  59.  
  60. /*
  61. ** Create a new process
  62. **
  63. ** Create a new process executing the file specified as 'path' and with
  64. ** the supplied arguments and environment.
  65. **
  66. ** This function may fail because of illegal access (permissions),
  67. ** invalid arguments or insufficient resources.
  68. **
  69. ** A process may be created such that the creator can later synchronize its
  70. ** termination using PR_WaitProcess(). 
  71. */
  72.  
  73. PR_EXTERN(PRProcess*) PR_CreateProcess(
  74.     const char *path,
  75.     char *const *argv,
  76.     char *const *envp,
  77.     const PRProcessAttr *attr);
  78.  
  79. PR_EXTERN(PRStatus) PR_CreateProcessDetached(
  80.     const char *path,
  81.     char *const *argv,
  82.     char *const *envp,
  83.     const PRProcessAttr *attr);
  84.  
  85. PR_EXTERN(PRStatus) PR_DetachProcess(PRProcess *process);
  86.  
  87. PR_EXTERN(PRStatus) PR_WaitProcess(PRProcess *process, PRInt32 *exitCode);
  88.  
  89. PR_EXTERN(PRStatus) PR_KillProcess(PRProcess *process);
  90.  
  91. PR_END_EXTERN_C
  92.  
  93. #endif /* prproces_h___ */
  94.