rpc.cmsd: use TIRPC on Linux
[oweals/cde.git] / cde / programs / nsgmls / SGMLApplication.C
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these libraries and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: SGMLApplication.C /main/1 1996/07/29 17:03:08 cde-hp $ */
24 // Copyright (c) 1995 James Clark
25 // See the file COPYING for copying permission.
26
27 #ifdef __GNUG__
28 #pragma implementation
29 #endif
30
31 #include "splib.h"
32 #include "Boolean.h"
33 #include "SGMLApplication.h"
34
35 SGMLApplication::~SGMLApplication()
36 {
37 }
38
39 void SGMLApplication::appinfo(const AppinfoEvent &)
40 {
41 }
42
43 void SGMLApplication::startDtd(const StartDtdEvent &)
44 {
45 }
46
47 void SGMLApplication::endDtd(const EndDtdEvent &)
48 {
49 }
50
51 void SGMLApplication::endProlog(const EndPrologEvent &)
52 {
53 }
54
55 void SGMLApplication::startElement(const StartElementEvent &)
56 {
57 }
58
59 void SGMLApplication::endElement(const EndElementEvent &)
60 {
61 }
62
63 void SGMLApplication::data(const DataEvent &)
64 {
65 }
66
67 void SGMLApplication::sdata(const SdataEvent &)
68 {
69 }
70
71 void SGMLApplication::pi(const PiEvent &)
72 {
73 }
74
75 void SGMLApplication::externalDataEntityRef(const ExternalDataEntityRefEvent &)
76 {
77 }
78
79 void SGMLApplication::subdocEntityRef(const SubdocEntityRefEvent &)
80 {
81 }
82
83 void SGMLApplication::commentDecl(const CommentDeclEvent &)
84 {
85 }
86
87 void SGMLApplication::markedSectionStart(const MarkedSectionStartEvent &)
88 {
89 }
90
91 void SGMLApplication::markedSectionEnd(const MarkedSectionEndEvent &)
92 {
93 }
94
95 void SGMLApplication::ignoredChars(const IgnoredCharsEvent &)
96 {
97 }
98
99 void SGMLApplication::generalEntity(const GeneralEntityEvent &)
100 {
101 }
102
103 void SGMLApplication::error(const ErrorEvent &)
104 {
105 }
106
107 void SGMLApplication::openEntityChange(const OpenEntityPtr &)
108 {
109 }
110
111
112 SGMLApplication::OpenEntity::OpenEntity()
113 : count_(0)
114 {
115 }
116
117 SGMLApplication::OpenEntity::~OpenEntity()
118 {
119 }
120
121 SGMLApplication::OpenEntityPtr::OpenEntityPtr()
122 : ptr_(0)
123 {
124 }
125
126 SGMLApplication::OpenEntityPtr::OpenEntityPtr(const OpenEntityPtr &ptr)
127 : ptr_(ptr.ptr_)
128 {
129   if (ptr_)
130     ptr_->count_ += 1;
131 }
132
133 SGMLApplication::OpenEntityPtr::~OpenEntityPtr()
134 {
135   if (ptr_) {
136     ptr_->count_ -= 1;
137     if (ptr_->count_ == 0)
138       delete ptr_;
139   }
140 }
141
142 void SGMLApplication::OpenEntityPtr::operator=(OpenEntity *p)
143 {
144   if (p)
145     p->count_ += 1;
146   if (ptr_) {
147     ptr_->count_ -= 1;
148     if (ptr_->count_ == 0)
149       delete ptr_;
150   }
151   ptr_ = p;
152 }
153
154 SGMLApplication::Location::Location()
155 {
156   init();
157 }
158
159 SGMLApplication::Location::Location(const OpenEntityPtr &ptr, Position pos)
160 {
161   if (ptr)
162     *this = ptr->location(pos);
163   else
164     init();
165 }
166
167 void SGMLApplication::Location::init()
168 {
169   entityName.ptr = 0;
170   entityName.len = 0;
171   filename.ptr = 0;
172   filename.len = 0;
173   lineNumber = (unsigned long)-1;
174   columnNumber = (unsigned long)-1;
175   byteOffset = (unsigned long)-1;
176   entityOffset = (unsigned long)-1;
177   other = 0;
178 }