| 1 |
// ---------------------------------------------------------------------------- |
| 2 |
// |
| 3 |
// Copyright (C) 2003-2013 Fons Adriaensen <[email protected]> |
| 4 |
// |
| 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 3 of the License, or |
| 8 |
// (at your option) any later version. |
| 9 |
// |
| 10 |
// This program is distributed in the hope that it will be useful, |
| 11 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
// GNU General Public License for more details. |
| 14 |
// |
| 15 |
// You should have received a copy of the GNU General Public License |
| 16 |
// along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
// |
| 18 |
// ---------------------------------------------------------------------------- |
| 19 |
|
| 20 |
|
| 21 |
#ifndef __EXTPROC_H |
| 22 |
#define __EXTPROC_H |
| 23 |
|
| 24 |
|
| 25 |
#include "shmem.h" |
| 26 |
|
| 27 |
|
| 28 |
class Extproc |
| 29 |
{ |
| 30 |
public: |
| 31 |
|
| 32 |
Extproc (const char *shmname, size_t shmsize); |
| 33 |
~Extproc (void); |
| 34 |
|
| 35 |
const char *shmname (void) const { return _shmname; } |
| 36 |
void *shmdata (void) const { return _shmem->data (); } |
| 37 |
size_t shmsize (void) const { return _shmem->size (); } |
| 38 |
int procid (void) const { return _procid; } |
| 39 |
int procrc (void) const { return _procrc; } |
| 40 |
|
| 41 |
int start (const char *prefix, const char *procfile); |
| 42 |
int kill (void); |
| 43 |
int wait (void); |
| 44 |
|
| 45 |
private: |
| 46 |
|
| 47 |
char _shmname [64]; |
| 48 |
char *_args [4]; |
| 49 |
Shmem *_shmem; |
| 50 |
int _procid; |
| 51 |
int _procrc; |
| 52 |
}; |
| 53 |
|
| 54 |
|
| 55 |
#endif |
| 56 |
|