1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>daemon_unix.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.15 -->
<center>
<a class="qindex" href="main.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center>
<hr><h1>daemon_unix.h</h1><a href="a00087.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">// Package : omniEvents</font>
00002 <font class="comment">// daemon_unix.h Created : 2004/06/26</font>
00003 <font class="comment">// Author : Alex Tingle</font>
00004 <font class="comment">//</font>
00005 <font class="comment">// Copyright (C) 2004 Alex Tingle.</font>
00006 <font class="comment">//</font>
00007 <font class="comment">// This file is part of the omniEvents application.</font>
00008 <font class="comment">//</font>
00009 <font class="comment">// omniEvents is free software; you can redistribute it and/or</font>
00010 <font class="comment">// modify it under the terms of the GNU Lesser General Public</font>
00011 <font class="comment">// License as published by the Free Software Foundation; either</font>
00012 <font class="comment">// version 2.1 of the License, or (at your option) any later version.</font>
00013 <font class="comment">//</font>
00014 <font class="comment">// omniEvents is distributed in the hope that it will be useful,</font>
00015 <font class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</font>
00016 <font class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font>
00017 <font class="comment">// Lesser General Public License for more details.</font>
00018 <font class="comment">//</font>
00019 <font class="comment">// You should have received a copy of the GNU Lesser General Public</font>
00020 <font class="comment">// License along with this library; if not, write to the Free Software</font>
00021 <font class="comment">// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</font>
00022 <font class="comment">//</font>
00023
00024 <font class="preprocessor">#ifndef OMNIEVENTS__DAEMON_UNIX_H</font>
00025 <font class="preprocessor"></font><font class="preprocessor">#define OMNIEVENTS__DAEMON_UNIX_H</font>
00026 <font class="preprocessor"></font>
00027 <font class="preprocessor">#ifdef __WIN32__</font>
00028 <font class="preprocessor"></font><font class="preprocessor"># error("This file is not intended for Windows.")</font>
00029 <font class="preprocessor"></font><font class="preprocessor">#endif</font>
00030 <font class="preprocessor"></font>
00031 <font class="keyword">namespace </font>OmniEvents {
00032
<a name="l00037"></a><a class="code" href="a00045.html">00037</a> <font class="keyword">class </font><a class="code" href="a00045.html">DaemonImpl</a>
00038 {
00039 <font class="keyword">public</font>:
<a name="l00040"></a><a class="code" href="a00045.html#p0">00040</a> <font class="keyword">static</font> <a class="code" href="a00045.html">DaemonImpl</a> <a class="code" href="a00045.html#p0">_inst</a>;
00041
<a name="l00042"></a><a class="code" href="a00045.html#m0">00042</a> <font class="keywordtype">char</font>* <a class="code" href="a00045.html#m0">_tracefile</a>;
<a name="l00043"></a><a class="code" href="a00045.html#m1">00043</a> <font class="keywordtype">bool</font> <a class="code" href="a00045.html#m1">_foreground</a>;
<a name="l00044"></a><a class="code" href="a00045.html#m2">00044</a> <font class="keywordtype">char</font>* <a class="code" href="a00045.html#m2">_pidfile</a>;
<a name="l00045"></a><a class="code" href="a00045.html#m3">00045</a> <font class="keywordtype">int</font> <a class="code" href="a00045.html#m3">_pipe</a>[2];
<a name="l00046"></a><a class="code" href="a00045.html#m4">00046</a> <font class="keywordtype">bool</font> <a class="code" href="a00045.html#m4">_havePidfile</a>;
<a name="l00047"></a><a class="code" href="a00045.html#m5">00047</a> <font class="keywordtype">bool</font> <a class="code" href="a00045.html#m5">_haveParent</a>;
<a name="l00048"></a><a class="code" href="a00045.html#m6">00048</a> <font class="keywordtype">bool</font> <a class="code" href="a00045.html#m6">_haveSyslog</a>;
00049
00050 <a class="code" href="a00045.html#a0">DaemonImpl</a>();
00051 <a class="code" href="a00045.html#a1">~DaemonImpl</a>();
00052
00053 <font class="keywordtype">void</font> <a class="code" href="a00045.html#a2">tracefile</a>(<font class="keyword">const</font> <font class="keywordtype">char</font>* val);
00054 <font class="keywordtype">void</font> <a class="code" href="a00045.html#a3">pidfile</a>(<font class="keyword">const</font> <font class="keywordtype">char</font>* val);
00055 <font class="keywordtype">void</font> <a class="code" href="a00045.html#a4">foreground</a>(<font class="keywordtype">bool</font> val);
00056
00058 <font class="keywordtype">void</font> <a class="code" href="a00045.html#a5">initialize</a>(<font class="keywordtype">int</font>&,<font class="keywordtype">char</font>**&);
00059
00063 <font class="keywordtype">void</font> <a class="code" href="a00045.html#a6">daemonize</a>();
00064
00069 <font class="keywordtype">void</font> <a class="code" href="a00045.html#a7">runningOk</a>();
00070
00074 <font class="keywordtype">void</font> <a class="code" href="a00045.html#a8">shutdown</a>(<font class="keywordtype">int</font> status);
00075
00081 <font class="keyword">static</font> <font class="keywordtype">void</font> <a class="code" href="a00045.html#d0">log</a>(<font class="keyword">const</font> <font class="keywordtype">char</font>* message);
00082
00083 <font class="keyword">private</font>:
00085 <font class="keywordtype">void</font> <a class="code" href="a00045.html#c0">fork</a>();
00086
00090 <font class="keywordtype">void</font> <a class="code" href="a00045.html#c1">redirectStreamsTo</a>(<font class="keyword">const</font> <font class="keywordtype">char</font>* filename);
00091
00095 <font class="keywordtype">int</font> <a class="code" href="a00045.html#c2">openFileFor</a>(<font class="keywordtype">int</font> fd, <font class="keyword">const</font> <font class="keywordtype">char</font>* filename, <font class="keywordtype">int</font> flags);
00096
00100 <font class="keywordtype">void</font> <a class="code" href="a00045.html#c3">checkPidfileOrShutdown</a>();
00101
00102 <font class="keywordtype">void</font> <a class="code" href="a00045.html#c4">writePidfile</a>();
00103
00108 <font class="keywordtype">int</font> <a class="code" href="a00045.html#c5">waitForChild</a>();
00109
00111 <font class="keywordtype">void</font> <a class="code" href="a00045.html#c6">notifyParent</a>(<font class="keywordtype">int</font> status);
00112 };
00113
00114 } <font class="comment">// end namespace OmniEvents</font>
00115
00116 <font class="preprocessor">#endif // OMNIEVENTS__DAEMON_UNIX_H</font>
</pre></div><hr><address align="right"><small>Generated on Fri Nov 19 17:42:20 2004 for OmniEvents by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0
width=110 height=53></a>1.2.15 </small></address>
</body>
</html>
|