This file is indexed.

/usr/include/xsd/cxx/tree/xdr-stream-extraction.hxx is in xsdcxx 4.0.0-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
// file      : xsd/cxx/tree/xdr-stream-extraction.hxx
// copyright : Copyright (c) 2005-2014 Code Synthesis Tools CC
// license   : GNU GPL v2 + exceptions; see accompanying LICENSE file

#ifndef XSD_CXX_TREE_XDR_STREAM_EXTRACTION_HXX
#define XSD_CXX_TREE_XDR_STREAM_EXTRACTION_HXX

#include <rpc/types.h>
#include <rpc/xdr.h>

// Of course BSD has to be different and name its functions u_intXX
// instead of uintXX. Plus it does not have XX == 8.
//
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
#  if !defined(XSD_CXX_TREE_ASSUME_SUN_XDR) && !defined(xdr_int8_t)
#    define xdr_int8_t(x, y) xdr_char(x, reinterpret_cast<char*> (y))
#    define xdr_uint8_t(x, y) xdr_u_char(x, reinterpret_cast<unsigned char*> (y))
#    define xdr_uint16_t xdr_u_int16_t
#    define xdr_uint32_t xdr_u_int32_t
#    define xdr_uint64_t xdr_u_int64_t
#  endif
#endif

#include <string>

#include <xsd/cxx/tree/buffer.hxx>
#include <xsd/cxx/tree/istream.hxx>
#include <xsd/cxx/tree/xdr-stream-common.hxx>

namespace xsd
{
  namespace cxx
  {
    namespace tree
    {
      struct xdr_stream_extraction: xdr_stream_operation
      {
        virtual const char*
        what () const throw ()
        {
          return "XDR stream extraction operation failed";
        }
      };


      // as_size
      //
#ifdef XSD_CXX_TREE_USE_64_BIT_SIZE
      template <typename T>
      inline istream<XDR>&
      operator>> (istream<XDR>& s, istream<XDR>::as_size<T>& x)
      {
        uint64_t v;

        if (!xdr_uint64_t (&s.impl (), &v) || v > ~(T (0)))
          throw xdr_stream_extraction ();

        x.x_ = static_cast<T> (v);

        return s;
      }
#else
      template <typename T>
      inline istream<XDR>&
      operator>> (istream<XDR>& s, istream<XDR>::as_size<T>& x)
      {
        uint32_t v;

        if (!xdr_uint32_t (&s.impl (), &v))
          throw xdr_stream_extraction ();

        x.x_ = static_cast<T> (v);

        return s;
      }
#endif


      // 8-bit
      //
      template <typename T>
      inline istream<XDR>&
      operator>> (istream<XDR>& s, istream<XDR>::as_int8<T>& x)
      {
        int8_t v;

        if (!xdr_int8_t (&s.impl (), &v))
          throw xdr_stream_extraction ();

        x.x_ = static_cast<T> (v);

        return s;
      }

      template <typename T>
      inline istream<XDR>&
      operator>> (istream<XDR>& s, istream<XDR>::as_uint8<T>& x)
      {
        uint8_t v;

        if (!xdr_uint8_t (&s.impl (), &v))
          throw xdr_stream_extraction ();

        x.x_ = static_cast<T> (v);

        return s;
      }


      // 16-bit
      //
      template <typename T>
      inline istream<XDR>&
      operator>> (istream<XDR>& s, istream<XDR>::as_int16<T>& x)
      {
        int16_t v;

        if (!xdr_int16_t (&s.impl (), &v))
          throw xdr_stream_extraction ();

        x.x_ = static_cast<T> (v);

        return s;
      }

      template <typename T>
      inline istream<XDR>&
      operator>> (istream<XDR>& s, istream<XDR>::as_uint16<T>& x)
      {
        uint16_t v;

        if (!xdr_uint16_t (&s.impl (), &v))
          throw xdr_stream_extraction ();

        x.x_ = static_cast<T> (v);

        return s;
      }


      // 32-bit
      //
      template <typename T>
      inline istream<XDR>&
      operator>> (istream<XDR>& s, istream<XDR>::as_int32<T>& x)
      {
        int32_t v;

        if (!xdr_int32_t (&s.impl (), &v))
          throw xdr_stream_extraction ();

        x.x_ = static_cast<T> (v);

        return s;
      }

      template <typename T>
      inline istream<XDR>&
      operator>> (istream<XDR>& s, istream<XDR>::as_uint32<T>& x)
      {
        uint32_t v;

        if (!xdr_uint32_t (&s.impl (), &v))
          throw xdr_stream_extraction ();

        x.x_ = static_cast<T> (v);

        return s;
      }


      // 64-bit
      //
      template <typename T>
      inline istream<XDR>&
      operator>> (istream<XDR>& s, istream<XDR>::as_int64<T>& x)
      {
        int64_t v;

        if (!xdr_int64_t (&s.impl (), &v))
          throw xdr_stream_extraction ();

        x.x_ = static_cast<T> (v);

        return s;
      }

      template <typename T>
      inline istream<XDR>&
      operator>> (istream<XDR>& s, istream<XDR>::as_uint64<T>& x)
      {
        uint64_t v;

        if (!xdr_uint64_t (&s.impl (), &v))
          throw xdr_stream_extraction ();

        x.x_ = static_cast<T> (v);

        return s;
      }


      // Boolean
      //
      template <typename T>
      inline istream<XDR>&
      operator>> (istream<XDR>& s, istream<XDR>::as_bool<T>& x)
      {
        bool_t v;

        if (!xdr_bool (&s.impl (), &v))
          throw xdr_stream_extraction ();

        x.x_ = static_cast<T> (v);

        return s;
      }


      // Floating-point
      //
      template <typename T>
      inline istream<XDR>&
      operator>> (istream<XDR>& s, istream<XDR>::as_float32<T>& x)
      {
        float v;

        if (!xdr_float (&s.impl (), &v))
          throw xdr_stream_extraction ();

        x.x_ = static_cast<T> (v);

        return s;
      }

      template <typename T>
      inline istream<XDR>&
      operator>> (istream<XDR>& s, istream<XDR>::as_float64<T>& x)
      {
        double v;

        if (!xdr_double (&s.impl (), &v))
          throw xdr_stream_extraction ();

        x.x_ = static_cast<T> (v);

        return s;
      }

      // Extraction of std::basic_string.
      //

      inline istream<XDR>&
      operator>> (istream<XDR>& s, std::basic_string<char>& x)
      {
        unsigned int n;

        if (!xdr_u_int (&s.impl (), &n))
          throw xdr_stream_extraction ();

        // Dangerous but fast.
        //
	x.clear ();

	if (n != 0)
	{
          x.resize (n);
          char* p (const_cast<char*> (x.c_str ()));

          if (!xdr_opaque (&s.impl (), p, n))
            throw xdr_stream_extraction ();
	}

        return s;
      }

      // Wide strings are not supported by XDR.
      //
      // inline istream<XDR>&
      // operator>> (istream<XDR>& s, std::basic_string<wchar_t>& x)
      // {
      // }


      // Extraction of a binary buffer.
      //
      template <typename C>
      istream<XDR>&
      operator>> (istream<XDR>& s, buffer<C>& x)
      {
        unsigned int n;

        if (!xdr_u_int (&s.impl (), &n))
          throw xdr_stream_extraction ();

        x.size (n);

        if (!xdr_opaque (&s.impl (), x.data (), n))
          throw xdr_stream_extraction ();

        return s;
      }
    }
  }
}

#endif  // XSD_CXX_TREE_XDR_STREAM_EXTRACTION_HXX