gbx_c_process.h
上传用户:hz1717
上传日期:2014-12-23
资源大小:7560k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

C/C++

  1. /***************************************************************************
  2.   CProcess.h
  3.   The process management class
  4.   (c) 2000-2004 Beno顃 Minisini <gambas@users.sourceforge.net>
  5.   This program is free software; you can redistribute it and/or modify
  6.   it under the terms of the GNU General Public License as published by
  7.   the Free Software Foundation; either version 1, or (at your option)
  8.   any later version.
  9.   This program is distributed in the hope that it will be useful,
  10.   but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.   GNU General Public License for more details.
  13.   You should have received a copy of the GNU General Public License
  14.   along with this program; if not, write to the Free Software
  15.   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ***************************************************************************/
  17. #ifndef __GBX_C_PROCESS_H
  18. #define __GBX_C_PROCESS_H
  19. #include <sys/types.h>
  20. #include <signal.h>
  21. #include "gambas.h"
  22. #include "gbx_object.h"
  23. #include "gbx_c_file.h"
  24. #ifndef __GBX_C_PROCESS_C
  25. extern GB_DESC NATIVE_Process[];
  26. #else
  27. #define THIS ((CPROCESS *)_object)
  28. #endif
  29. typedef
  30.   struct _CPROCESS {
  31.     CSTREAM ob;
  32.     struct _CPROCESS *prev;
  33.     struct _CPROCESS *next;
  34.     /*char *param[];*/
  35.     /*char *cmd;*/
  36.     pid_t pid;
  37.     int in;
  38.     int out;
  39.     int err;
  40.     int status;
  41.     int watch;
  42.     volatile sig_atomic_t running;
  43.     bool to_string;
  44.     char *result;
  45.   }
  46.   CPROCESS;
  47. enum
  48. {
  49.   PM_READ = 1,
  50.   PM_WRITE = 2,
  51.   PM_SHELL = 4
  52. };
  53. PUBLIC CPROCESS *CPROCESS_create(int mode, void *cmd);
  54. PUBLIC void CPROCESS_wait_for(CPROCESS *process);
  55. #endif