Include program counter on action limit notification log
[gnash.git] / cygnal / proc.h
blob1d3df3f5aa0e7162d7ea06774fcdd526b2bec55b
1 //
2 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
3 // Foundation, Inc
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.
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
20 #ifndef __PROC_H__
21 #define __PROC_H__ 1
23 #include <string>
24 #include <map>
26 #include <boost/thread/mutex.hpp>
27 #include <boost/thread/condition.hpp>
29 #include "network.h"
30 #include "dsodefs.h"
32 namespace cygnal
35 class Proc : public gnash::Network {
36 public:
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()
46 bool startCGI (void);
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
62 bool stopCGI (void);
63 bool stopCGI (const std::string &filespec);
64 private:
65 std::map<std::string, bool> _output;
66 std::map<std::string, int> _pids;
67 std::map<std::string, int> _cons;
68 std::string _docroot;
70 boost::mutex _mutex;
73 } // end of cygnal namespace
75 #endif // end of __PROC_H__
77 // Local Variables:
78 // mode: C++
79 // indent-tabs-mode: t
80 // End: