home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / nsprpub / pr / include / prproces.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.4 KB  |  80 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_SetStdioRedirect(
  41.     PRProcessAttr *attr,
  42.     PRSpecialFD stdioFd,
  43.     PRFileDesc *redirectFd
  44. );
  45.  
  46. /*
  47. ** Create a new process
  48. **
  49. ** Create a new process executing the file specified as 'path' and with
  50. ** the supplied arguments and environment.
  51. **
  52. ** This function may fail because of illegal access (permissions),
  53. ** invalid arguments or insufficient resources.
  54. **
  55. ** A process may be created such that the creator can later synchronize its
  56. ** termination using PR_WaitProcess(). 
  57. */
  58.  
  59. PR_EXTERN(PRProcess*) PR_CreateProcess(
  60.     const char *path,
  61.     char *const *argv,
  62.     char *const *envp,
  63.     const PRProcessAttr *attr);
  64.  
  65. PR_EXTERN(PRStatus) PR_CreateProcessDetached(
  66.     const char *path,
  67.     char *const *argv,
  68.     char *const *envp,
  69.     const PRProcessAttr *attr);
  70.  
  71. PR_EXTERN(PRStatus) PR_DetachProcess(PRProcess *process);
  72.  
  73. PR_EXTERN(PRStatus) PR_WaitProcess(PRProcess *process, PRInt32 *exitCode);
  74.  
  75. PR_EXTERN(PRStatus) PR_KillProcess(PRProcess *process);
  76.  
  77. PR_END_EXTERN_C
  78.  
  79. #endif /* prproces_h___ */
  80.