This file is indexed.

/usr/include/crystalspace-2.0/ivaria/bugplug.h is in libcrystalspace-dev 2.0+dfsg-1build1.

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
/*
    Copyright (C) 2002 by Jorrit Tyberghein

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 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
    Library General Public License for more details.

    You should have received a copy of the GNU Library General Public
    License along with this library; if not, write to the Free
    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#ifndef __CS_IVARIA_BUGPLUG_H__
#define __CS_IVARIA_BUGPLUG_H__

/**\file
 * BugPlug debugging utility plugin interface
 */

#include "csutil/scf.h"
#include "ivideo/graph3d.h"

struct iBugPlug;
struct iMeshObject;

class csBox3;
class csReversibleTransform;
class csVector2;
class csVector3;

/**
 * An application/module can implement this interface to render something.
 * BugPlug can call the render function when it decides it is time to
 * render the object.
 */
struct iBugPlugRenderObject : public virtual iBase
{
  SCF_INTERFACE(iBugPlugRenderObject, 2,0,0);
  /// Render.
  virtual void Render (iGraphics3D* g3d, iBugPlug* bugplug) = 0;
};


/**
 * Using this interface you can communicate with the BugPlug plugin.
 * This can be useful for specialized debugging operations.
 */
struct iBugPlug : public virtual iBase
{
  SCF_INTERFACE(iBugPlug,2,0,1);
  //=========================================================================

  /**
   * Setup the 'debug sector'. The debug sector is a sector which you
   * can fill with boxes and other objects. BugPlug can then switch
   * the view to that sector so that the objects are rendered. This can
   * be useful for debugging complicated systems in a graphical manner.
   * This function will clear any previously created debug sector.
   */
  virtual void SetupDebugSector () = 0;

  /**
   * Add a colored filled box to the debug sector. If name is not 0 it
   * will be shown in BugPlug when the mouse is over the object. If
   * iMeshObject* is not 0 it will be shown inside the box when the mouse
   * is over the object.
   */
  virtual void DebugSectorBox (const csBox3& box, float r, float g, float b,
  	const char* name = 0, iMeshObject* mesh = 0,
	uint mixmode = CS_FX_COPY) = 0;

  /**
   * Add a transparent filled triangle to the debug sector.
   * The color will be max at s1 and completely black at s2 and s3.
   */
  virtual void DebugSectorTriangle (const csVector3& s1, const csVector3& s2,
  	const csVector3& s3, float r, float g, float b,
	uint mixmode = CS_FX_ADD) = 0;

  /**
   * Switch BugPlug view to the debug sector. The given transform is
   * given to the camera.
   * If clear is false then the 3D view will not be overwritten. In
   * that case the transformation will not be used but the debug sector
   * will follow the 3D view.
   */
  virtual void SwitchDebugSector (const csReversibleTransform& trans,
  	bool clear = true) = 0;

  /**
   * Returns true if the debug sector is currently visible.
   */
  virtual bool CheckDebugSector () const = 0;

  //=========================================================================

  /**
   * Setup the 'debug 2dview'. To this view a plugin or application can
   * add various 2D objects (lines and points for example).
   * This function will clear any previously created debug view.
   */
  virtual void SetupDebugView () = 0;

  /**
   * Add a dragable point. Returns an index that can be used in a line.
   */
  virtual int DebugViewPoint (const csVector2& point) = 0;

  /**
   * Add a line. The two indices are as returned from DebugViewPoint().
   */
  virtual void DebugViewLine (int i1, int i2) = 0;

  /**
   * Add a box. The two indices are as returned from DebugViewPoint().
   */
  virtual void DebugViewBox (int i1, int i2) = 0;

  /**
   * Return the current number of points.
   */
  virtual int DebugViewPointCount () const = 0;

  /**
   * Return a point.
   */
  virtual const csVector2& DebugViewGetPoint (int i) const = 0;

  /**
   * Return the current number of lines.
   */
  virtual int DebugViewLineCount () const = 0;

  /**
   * Return a line.
   */
  virtual void DebugViewGetLine (int i, int& i1, int& i2) const = 0;

  /**
   * Return the current number of boxes.
   */
  virtual int DebugViewBoxCount () const = 0;

  /**
   * Return a box.
   */
  virtual void DebugViewGetBox (int i, int& i1, int& i2) const = 0;

  /**
   * Add some rendering code that will be rendered right before the
   * points and lines are rendered. If 0 the current object will be removed.
   */
  virtual void DebugViewRenderObject (iBugPlugRenderObject* obj) = 0;

  /**
   * Indicate if BugPlug should clear the screen before rendering the
   * debug view. True by default.
   */
  virtual void DebugViewClearScreen (bool cs) = 0;

  /**
   * Switch BugPlug view to the debug view.
   * If clear is false then the 3D view will not be overwritten.
   */
  virtual void SwitchDebugView (bool clear = true) = 0;

  /**
   * Returns true if the debug view is currently visible.
   */
  virtual bool CheckDebugView () const = 0;

  //=========================================================================

  /**
   * Add an amount to a counter. Bugplug will automatically clear this counter
   * every frame and show the last number, the average, the number of frames,
   * and the total for every known counter. You don't have to specficially
   * register a counter. Just by using this function BugPlug will know about
   * the counter.
   */
  virtual void AddCounter (const char* countername, int amount = 1) = 0;

  /**
   * Add an amount to a enum-counter. This is similar to a regular counter
   * except that BugPlug will keep track of how many times every particular
   * value is encountered. Enum-counters are displayed differently.
   * BugPlug will automatically convert a counter to an enum-counter if you
   * use this function on an existing counter and vice versa.
   * BugPlug currently only supports enum values between 0 and 9.
   */
  virtual void AddCounterEnum (const char* countername, int enumval,
  	int amount = 1) = 0;

  /**
   * Reset some counter manually. Normally BugPlug will reset counters
   * every frame but you can also reset it manually. If you reset an
   * enum-counter all enum types are reset at once.
   */
  virtual void ResetCounter (const char* countername, int value = 0) = 0;

  /**
   * Remove a counter. From this point on BugPlug will no longer show this
   * counter (BugPlug will remove the counter internally).
   */
  virtual void RemoveCounter (const char* countername) = 0;

  //=========================================================================
  
  /**
   * Execute a bugplug command. The commands are the same ones you can specify
   * in the <tt>bugplug.key</tt> file.
   * \param command Command to execute.
   * \return Whether the command was executed successfully.
   */
  virtual bool ExecCommand (const char* command) = 0;
};

#endif // __CS_IVARIA_BUGPLUG_H__