File: a00170.html

package info (click to toggle)
omnievents 2.6.1-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 5,228 kB
  • ctags: 2,538
  • sloc: cpp: 7,346; sh: 2,568; python: 2,171; xml: 2,057; java: 1,407; makefile: 304; ansic: 9
file content (134 lines) | stat: -rw-r--r-- 10,500 bytes parent folder | download
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!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>omniEvents.cc 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> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="namespacemembers.html">Namespace Members</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center>
<hr><h1>omniEvents.cc</h1><a href="a00110.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">//                            Package   : omniEvents</font>
00002 <font class="comment">//  omniEvents.cc             Created   : 1/4/98</font>
00003 <font class="comment">//                            Author    : Paul Nader (pwn)</font>
00004 <font class="comment">//</font>
00005 <font class="comment">//    Copyright (C) 1998 Paul Nader, 2003-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">#include "<a class="code" href="a00111.html">omniEvents.h</a>"</font>
00025 
<a name="l00026"></a><a class="code" href="a00110.html#a0">00026</a> <font class="preprocessor">#define NEED_PACKAGE_INFO</font>
00027 <font class="preprocessor"></font><font class="preprocessor">#ifdef HAVE_CONFIG_H</font>
00028 <font class="preprocessor"></font><font class="preprocessor">#  include "<a class="code" href="a00082.html">config.h</a>"</font>
00029 <font class="preprocessor">#endif</font>
00030 <font class="preprocessor"></font>
00031 <font class="preprocessor">#ifdef HAVE_IOSTREAM</font>
00032 <font class="preprocessor"></font><font class="preprocessor">#  include &lt;iostream&gt;</font>
00033 <font class="preprocessor">#else</font>
00034 <font class="preprocessor"></font><font class="preprocessor">#  include &lt;iostream.h&gt;</font>
00035 <font class="preprocessor">#endif</font>
00036 <font class="preprocessor"></font>
00037 <font class="preprocessor">#ifdef HAVE_STDLIB_H</font>
00038 <font class="preprocessor"></font><font class="preprocessor">#  include &lt;stdlib.h&gt;</font> <font class="comment">// exit()</font>
00039 <font class="preprocessor">#endif</font>
00040 <font class="preprocessor"></font>
00041 <font class="preprocessor">#ifdef HAVE_STD_IOSTREAM</font>
00042 <font class="preprocessor"></font><font class="keyword">using</font> <font class="keyword">namespace </font>std;
00043 <font class="preprocessor">#endif</font>
00044 <font class="preprocessor"></font>
00045 <font class="preprocessor">#include "<a class="code" href="a00090.html">defaults.h</a>"</font>
00046 
00047 <font class="keyword">namespace </font>OmniEvents {
00048 
<a name="l00049"></a><a class="code" href="a00138.html#a5">00049</a> <font class="keywordtype">void</font> <a class="code" href="a00138.html#a5">usage</a>(<font class="keywordtype">int</font> argc, <font class="keywordtype">char</font> **argv)
00050 {
00051   <font class="keyword">const</font> <font class="keywordtype">char</font>* command =(argc?argv[0]:<a class="code" href="a00082.html#a40">PACKAGE_NAME</a>);
00052   cout&lt;&lt;
00053   <font class="stringliteral">"\n"</font>
00054 <font class="preprocessor">#ifdef __WIN32__</font>
00055 <font class="preprocessor"></font>  <font class="stringliteral">"just run it:         "</font>&lt;&lt;command&lt;&lt;<font class="stringliteral">" [OPTIONS]\n"</font>
00056   <font class="stringliteral">"install service:     "</font>&lt;&lt;command&lt;&lt;<font class="stringliteral">" install [OPTIONS]\n"</font>
00057   <font class="stringliteral">"uninstall service:   "</font>&lt;&lt;command&lt;&lt;<font class="stringliteral">" uninstall\n"</font>
00058   <font class="stringliteral">"set service options: "</font>&lt;&lt;command&lt;&lt;<font class="stringliteral">" setoptions [OPTIONS]\n"</font>
00059   <font class="stringliteral">"get service options: "</font>&lt;&lt;command&lt;&lt;<font class="stringliteral">" getoptions\n"</font>
00060 <font class="preprocessor">#else</font>
00061 <font class="preprocessor"></font>  <font class="stringliteral">"Run the "</font> <a class="code" href="a00082.html#a40">PACKAGE_NAME</a> <font class="stringliteral">" daemon.\n"</font>
00062   <font class="stringliteral">"\n"</font>
00063   <font class="stringliteral">"cold start syntax: "</font>&lt;&lt;command&lt;&lt;<font class="stringliteral">" [-pPORT] "</font>
00064 <font class="preprocessor">#  ifdef HAVE_OMNIORB4</font>
00065 <font class="preprocessor"></font>    <font class="stringliteral">"[-aENDPOINT] "</font>
00066 <font class="preprocessor">#  endif</font>
00067 <font class="preprocessor"></font>    <font class="stringliteral">"[OPTIONS]\n"</font>
00068   <font class="stringliteral">"warm start syntax: "</font>&lt;&lt;command&lt;&lt;<font class="stringliteral">" [OPTIONS]\n"</font>
00069 <font class="preprocessor">#endif</font>
00070 <font class="preprocessor"></font>  <font class="stringliteral">"\n"</font>
00071   <font class="stringliteral">"COLD START OPTIONS:\n"</font>
00072   <font class="stringliteral">" -p PORT      configure server port [11169]\n"</font>
00073 <font class="preprocessor">#ifdef HAVE_OMNIORB4</font>
00074 <font class="preprocessor"></font>  <font class="stringliteral">" -a ENDPOINT  set alternate endPoint for failover\n"</font>
00075 <font class="preprocessor">#endif</font>
00076 <font class="preprocessor"></font>  <font class="stringliteral">"\n"</font>
00077   <font class="stringliteral">"OPTIONS:\n"</font>
00078   <font class="stringliteral">" -l PATH      full path to data directory* ["</font> <a class="code" href="a00090.html#a4">OMNIEVENTS_LOG_DEFAULT_LOCATION</a> <font class="stringliteral">"]\n"</font>
00079 <font class="preprocessor">#ifndef __WIN32__</font>
00080 <font class="preprocessor"></font>  <font class="stringliteral">" -P PIDFILE   keep track of running instance in PIDFILE.\n"</font>
00081 <font class="preprocessor">#endif</font>
00082 <font class="preprocessor"></font>  <font class="stringliteral">" -N ID        factory naming service id   [\"EventChannelFactory\"]\n"</font>
00083 <font class="preprocessor">#ifndef __WIN32__</font>
00084 <font class="preprocessor"></font>  <font class="stringliteral">" -f           Stay in the foreground.\n"</font>
00085 <font class="preprocessor">#endif</font>
00086 <font class="preprocessor"></font>  <font class="stringliteral">" -t FILE      Send trace messages to FILE instead of syslog.\n"</font>
00087   <font class="stringliteral">" -v           print the IOR of the new EventChannelFactory.\n"</font>
00088   <font class="stringliteral">" -V           display version\n"</font>
00089   <font class="stringliteral">" -h           display this help text\n"</font>
00090   <font class="stringliteral">"\n"</font>
00091   <font class="stringliteral">"*You can also set the environment variable "</font>&lt;&lt;OMNIEVENTS_LOGDIR_ENV_VAR&lt;&lt;<font class="stringliteral">"\n"</font>
00092   <font class="stringliteral">"to specify the directory where the data files are kept.\n"</font> &lt;&lt; endl;
00093   exit(0);
00094 }
00095 
00096 
<a name="l00097"></a><a class="code" href="a00138.html#a6">00097</a> <font class="keywordtype">void</font> <a class="code" href="a00138.html#a6">version</a>()
00098 {
00099   cout&lt;&lt;<a class="code" href="a00082.html#a41">PACKAGE_STRING</a>&lt;&lt;endl;
00100   cout&lt;&lt;<font class="stringliteral">"Copyright (C) 1998 Paul Nader, 2003-2004 Alex Tingle"</font>&lt;&lt;endl;
00101   exit(0);
00102 }
00103 
00104 
<a name="l00105"></a><a class="code" href="a00138.html#a7">00105</a> <font class="keywordtype">void</font> <a class="code" href="a00138.html#a7">insertArgs</a>(<font class="keywordtype">int</font>&amp; argc, <font class="keywordtype">char</font>**&amp; argv, <font class="keywordtype">int</font> idx, <font class="keywordtype">int</font> nargs)
00106 {
00107   <font class="keywordtype">char</font>** newArgv = <font class="keyword">new</font> <font class="keywordtype">char</font>*[argc+nargs];
00108   <font class="keywordtype">int</font> i;
00109   <font class="keywordflow">for</font> (i = 0; i &lt; idx; i++) {
00110     newArgv[i] = argv[i];
00111   }
00112   <font class="keywordflow">for</font> (i = idx; i &lt; argc; i++) {
00113     newArgv[i+nargs] = argv[i];
00114   }
00115   argv = newArgv;
00116   argc += nargs;
00117 }
00118 
00119 } <font class="comment">// end namespace OmniEvents</font>
00120 
</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>