This file is indexed.

/usr/include/Inventor/SbTime.h is in inventor-dev 2.1.5-10-18.

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
308
309
310
311
312
313
/*
 *
 *  Copyright (C) 2000 Silicon Graphics, Inc.  All Rights Reserved. 
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  Further, this software is distributed without any warranty that it is
 *  free of the rightful claim of any third person regarding infringement
 *  or the like.  Any license provided herein, whether implied or
 *  otherwise, applies only to this software file.  Patent licenses, if
 *  any, provided herein do not apply to combinations of this program with
 *  other software, or any other product whatsoever.
 * 
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 *  Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
 *  Mountain View, CA  94043, or:
 * 
 *  http://www.sgi.com 
 * 
 *  For further information regarding this notice, see: 
 * 
 *  http://oss.sgi.com/projects/GenInfo/NoticeExplan/
 *
 */

//  -*- C++ -*-

/*
 * Copyright (C) 1990,91   Silicon Graphics, Inc.
 *
 _______________________________________________________________________
 ______________  S I L I C O N   G R A P H I C S   I N C .  ____________
 |
 |   $Revision: 1.3 $
 |
 |   Description:
 |	This file defines the SbTime class for manipulating times
 |
 |   Classes:
 |	SbTime
 |
 |   Author(s)		: Nick Thompson
 |
 ______________  S I L I C O N   G R A P H I C S   I N C .  ____________
 _______________________________________________________________________
 */

#ifndef _SB_TIME_
#define _SB_TIME_

#include <sys/time.h>
#include <math.h>
#include <limits.h>
#include <Inventor/SbBasic.h>
#include <Inventor/SbString.h>

// C-api: end
#ifdef _CRAY
#define trunc(x) x
#endif /* _CRAY */

// C-api: begin

//////////////////////////////////////////////////////////////////////////////
//
//  Class: SbTime
//
//  Representation of a time.  Some parts are not adequately debugged:
//  for example, it is not clear when it is legal to have negative
//  values.
//
//////////////////////////////////////////////////////////////////////////////

class SbTime {
  public:

    // Default constructor
    SbTime()					{}

    // Constructor taking a double (in seconds)
    // C-api: name=CreateSec
    SbTime(double sec);

    // Constructor taking seconds + microseconds
    // C-api: name=CreateSecUSec
    SbTime(time_t sec, long usec)		// System long from <sys/time.h>
	{ t.tv_sec = sec; t.tv_usec = usec; }

  private:
    // Constructor taking milliseconds
    //
    // NOTE! This constructor has been removed.  Change existing uses of
    // 		SbTime(msec)
    // to
    //		time_t secs = msec / 1000;
    //		SbTime(secs, 1000 * (msec - 1000 * sec))
    // The constructor was removed because it led to unexpected results --
    // while SbTime(1.0) results in 1 second, SbTime(1) resulted in 1
    // MILLIsecond).  Its declaration has been kept, as "private", so that 
    // existing code using it will get compilation errors; if it was removed
    // completely, an existing use of SbTime(1) would silently cast to
    // SbTime(1.0) resulting in hard-to-find bugs.  This declaration
    // will be removed entirely in a future release, so that SbTime(1)
    // will be equivalent to SbTime(1.0).
    SbTime(uint32_t msec);
  public:

    // Constructor taking struct timeval
    // C-api: name=CreateTimeval
    SbTime(const struct timeval *tv)
	{ t.tv_sec = tv->tv_sec; t.tv_usec = tv->tv_usec; }

    // Destructors for C
    // C-api.h: void	SbTimeDelete(SbTime *);
    // C-api.c++: void	SbTimeDelete(SbTime *_this)
    // C-api.c++: { delete _this; }

    // Get the current time (seconds since Jan 1, 1970)
    static SbTime		getTimeOfDay();

    // Set to the current time (seconds since Jan 1, 1970)
    void			setToTimeOfDay();

    // Get a zero time
    static SbTime		zero()
	{ return SbTime(0, 0); }

#ifndef INT32_MAX
#define INT32_MAX INT_MAX
#endif // !INT32_MAX

    // Get a time far, far into the future
    static SbTime		max()
	{ return SbTime(INT32_MAX, 999999); }

    // Set time from a double (in seconds)
    // C-api: name=setSec
    void		setValue(double sec)
#ifdef __sgi
	{ t.tv_sec = time_t(trunc(sec)); 
#else
	{ t.tv_sec = time_t(int(sec)); 
#endif // __sgi
	  t.tv_usec = long((sec - t.tv_sec) * 1000000.0); }

    // Set time from seconds + microseconds
    // C-api: name=setSecUSec
    void		setValue(time_t sec, long usec)  	// System long
	{ t.tv_sec = sec; t.tv_usec = usec; }

    // Set time from a struct timeval
    // C-api: name=setTimeval
    void		setValue(const struct timeval *tv)
	{ t.tv_sec = tv->tv_sec; t.tv_usec = tv->tv_usec; }

    // Set time from milliseconds
    // C-api: name=setMSec
    void		setMsecValue(unsigned long msec)  	// System long
	{ t.tv_sec = time_t(msec/1000); 
	  t.tv_usec = long(1000 * (msec % 1000)); }

    // Get time in seconds as a double
    // C-api: name=getSec
    double		getValue() const
	{ return (double) t.tv_sec + (double) t.tv_usec / 1000000.0; }

    // Get time in seconds & microseconds
    // C-api: name=getSecUSec
    void		getValue(time_t &sec, long &usec) const  // System long
	{ sec = t.tv_sec; usec = t.tv_usec; }

    // Get time in a struct timeval
    // C-api: name=getTimeval
    void		getValue(struct timeval *tv) const
	{ tv->tv_sec = t.tv_sec; tv->tv_usec = t.tv_usec; }

    // Get time in milliseconds (for Xt)
    // C-api: name=getMSec
    unsigned long	getMsecValue() const			// System long
	{ return t.tv_sec * 1000 + t.tv_usec / 1000; }

    // Convert to a string.  The default format is seconds with
    // 3 digits of fraction precision.  See the SbTime man page for
    // explanation of the format string.
    SbString			format(const char *fmt = "%S.%i") const;

    // Convert to a date string, interpreting the time as seconds since
    // Jan 1, 1970.  The default format gives "Tuesday, 01/26/93 11:23:41 AM".
    // See the 'cftime()' man page for explanation of the format string.
    SbString			formatDate(const char *fmt = "%A, %D %r") const;

    // Addition
    friend SbTime		operator +(const SbTime &t0, const SbTime &t1);

    // Subtraction
    friend SbTime		operator -(const SbTime &t0, const SbTime &t1);

    // Destructive addition
    SbTime &			operator +=(const SbTime &tm)
	{ return (*this = *this + tm); }

    // Destructive subtraction
    SbTime &			operator -=(const SbTime &tm)
	{ return (*this = *this - tm); }

    // Unary negation
    // C-api: name=negate
    SbTime			operator -() const
	{ return (t.tv_usec == 0) ? SbTime(- t.tv_sec, 0)
	      : SbTime(- t.tv_sec - 1, 1000000 - t.tv_usec); }

    // multiplication by scalar
    friend SbTime		operator *(const SbTime &tm, double s);
// C-api: end

    friend SbTime		operator *(double s, const SbTime &tm)
	{ return tm * s; }

// C-api: begin
    // destructive multiplication by scalar
    SbTime &			operator *=(double s)
	{ *this = *this * s; return *this; }

    // division by scalar
    friend SbTime		operator /(const SbTime &tm, double s);

    // destructive division by scalar
    SbTime &			operator /=(double s)
	{ return (*this = *this / s); }

    // division by another time
    // C-api: name=DivByTime
    double			operator /(const SbTime &tm) const
	{ return getValue() / tm.getValue(); }

    // modulus for two times
    SbTime			operator %(const SbTime &tm) const
	{ return *this - tm * floor(*this / tm); }

    // equality operators
    int				operator ==(const SbTime &tm) const
	{ return (t.tv_sec == tm.t.tv_sec) && (t.tv_usec == tm.t.tv_usec); }

    int				operator !=(const SbTime &tm) const
	{ return ! (*this == tm); }

    // relational operators
    inline SbBool		operator <(const SbTime &tm) const;
    inline SbBool		operator >(const SbTime &tm) const;
    inline SbBool		operator <=(const SbTime &tm) const;
    inline SbBool		operator >=(const SbTime &tm) const;

  private:
    struct timeval		t;
};


// C-api: end

inline SbBool
SbTime::operator <(const SbTime &tm) const
{
    if ((t.tv_sec < tm.t.tv_sec) ||
	(t.tv_sec == tm.t.tv_sec && t.tv_usec < tm.t.tv_usec))
	return TRUE;
    else
	return FALSE;
}

inline SbBool
SbTime::operator >(const SbTime &tm) const
{
    if ((t.tv_sec > tm.t.tv_sec) ||
	(t.tv_sec == tm.t.tv_sec && t.tv_usec > tm.t.tv_usec))
	return TRUE;
    else
	return FALSE;
}

inline SbBool
SbTime::operator <=(const SbTime &tm) const
{
    if ((t.tv_sec < tm.t.tv_sec) ||
	(t.tv_sec == tm.t.tv_sec && t.tv_usec <= tm.t.tv_usec))
	return TRUE;
    else
	return FALSE;
}

inline SbBool
SbTime::operator >=(const SbTime &tm) const
{
    if ((t.tv_sec > tm.t.tv_sec) ||
	(t.tv_sec == tm.t.tv_sec && t.tv_usec >= tm.t.tv_usec))
	return TRUE;
    else
	return FALSE;
}

// C-api: begin

#endif /* _SB_TIME_ */