2 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
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.
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.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 #include <boost/thread/mutex.hpp>
27 #include <boost/thread/condition.hpp>
35 class Proc
: public gnash::Network
{
37 DSOEXPORT
Proc (void);
38 DSOEXPORT
~Proc (void);
39 static Proc
& getDefaultInstance();
41 // These flags control whether the stdout of the child process gets displayed
42 bool setOutput (const std::string
&output
, bool outflag
);
43 bool getOutput (const std::string
&output
);
45 // This starts the process running via the usual fork() & exec()
47 bool startCGI (const std::string
&filespec
);
48 bool startCGI (const std::string
&filespec
, boost::uint16_t port
);
49 bool startCGI (const std::string
&filespec
, bool output
);
50 bool startCGI (const std::string
&filespec
, bool output
, boost::uint16_t port
);
52 void setDocroot(const std::string
&path
) { _docroot
= path
; } ;
53 std::string
&getDocroot() { return _docroot
; };
55 // This opens a network connection to the process
56 bool connectCGI (const std::string
&host
, boost::uint16_t port
);
58 // This finds the process
59 int findCGI (const std::string
&filespec
);
61 // This stop the process
63 bool stopCGI (const std::string
&filespec
);
65 std::map
<std::string
, bool> _output
;
66 std::map
<std::string
, int> _pids
;
67 std::map
<std::string
, int> _cons
;
73 } // end of cygnal namespace
75 #endif // end of __PROC_H__
79 // indent-tabs-mode: t