This file is indexed.

/usr/include/polymake/Main.h is in polymake 3.0r2-2+b1.

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
/* Copyright (c) 1997-2015
   Ewgenij Gawrilow, Michael Joswig (Technische Universitaet Berlin, Germany)
   http://www.polymake.org

   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 2, or (at your option) any
   later version: http://www.gnu.org/licenses/gpl.txt.

   This program 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 General Public License for more details.
--------------------------------------------------------------------------------
*/

#ifndef POLYMAKE_MAIN_H
#define POLYMAKE_MAIN_H

#ifdef POLYMAKE_APPNAME
#error polymake::Main cannot be used in clients
#endif

#ifndef POLYMAKE_DEBUG
#define POLYMAKE_DEBUG 0
#endif

// for classes defined in external application code
#define POLYMAKE_APPNAME unknown

#include "polymake/client.h"
#include <string>

namespace pm { namespace perl {

class Scope;

class Main {
private:
   static void set_application(const char* appname, size_t ll);
   static void add_extension(const char* path, size_t ll);
   static SV* lookup_extension(const char* path, size_t ll); // currently unused
   static void call_app_method(const char* method, const char *arg, size_t argl);

   static void _set_custom(const char* name, size_t ll, const char* key, size_t kl, Value& x);
   static void _reset_custom(const char* name, size_t ll, const char* key, size_t kl);
public:
   explicit Main(const std::string& user_opts="user",
                 const std::string& install_top="",
                 const std::string& install_arch="");

   std::string greeting(int verbose=2);

   void set_application(const std::string& appname)
   {
      set_application(appname.c_str(), appname.size());
   }

   template <size_t ll>
   void set_application(const char (&appname)[ll])
   {
      set_application(appname, ll-1);
   }

   void set_application_of(const Object& x);

   void add_extension(const std::string& path)
   {
      add_extension(path.c_str(), path.size());
   }

   template <size_t ll>
   void add_extension(const char (&path)[ll])
   {
      add_extension(path, ll-1);
   }

   template <size_t pl>
   void include(const char (&path)[pl]) 
   {
      call_app_method("include_rules", path, pl-1); 
   }

   void include(const std::string& path) 
   {
      call_app_method("include_rules", path.c_str(), path.size()); 
   }

   template <size_t ll>
   void set_preference(const char (&label_exp)[ll])
   { 
      call_app_method("set_preference", label_exp, ll-1); 
   }
   void set_preference(const std::string& label_exp)
   { 
      call_app_method("set_preference", label_exp.c_str(), label_exp.size()); 
   }

   template <size_t ll>
   void reset_preference(const char (&label_exp)[ll])
   { 
      call_app_method("reset_preference", label_exp, ll-1); 
   }
   void reset_preference(const std::string& label_exp)
   { 
      call_app_method("reset_preference", label_exp.c_str(), label_exp.size()); 
   }

   template <size_t ll, typename T>
   void set_custom(const char (&name)[ll], const T& value)
   {
      Value x;
      x << value;
      _set_custom(name, ll-1, NULL, 0, x);
   }
   template <typename T>
   void set_custom(const std::string& name, const T& value)
   {
      Value x;
      x << value;
      _set_custom(name.c_str(), name.size(), NULL, 0, x);
   }

   template <size_t ll, typename T>
   void set_custom(const char (&name)[ll], const std::string& key, const T& value)
   {
      Value x;
      x << value;
      _set_custom(name, ll-1, key.c_str(), key.size(), x);
   }
   template <typename T>
   void set_custom(const std::string& name, const std::string& key, const T& value)
   {
      Value x;
      x << value;
      _set_custom(name.c_str(), name.size(), key.c_str(), key.size(), x);
   }

   template <size_t ll>
   void reset_custom(const char (&name)[ll])
   {
      _reset_custom(name, ll-1, NULL, 0);
   }
   void reset_custom(const std::string& name)
   {
      _reset_custom(name.c_str(), name.size(), NULL, 0);
   }
   template <size_t ll>
   void reset_custom(const char (&name)[ll], const std::string& key)
   {
      _reset_custom(name, ll-1, key.c_str(), key.size());
   }
   void reset_custom(const std::string& name, const std::string& key)
   {
      _reset_custom(name.c_str(), name.size(), key.c_str(), key.size());
   }

   Scope newScope();

   friend class Scope;
};

class Scope {
   friend class Main;
private:
   static unsigned int depth;
   mutable SV *saved;
   unsigned int id;
   Scope(SV *sv) : saved(sv), id(++depth) {}

   // inhibited
   Scope& operator= (const Scope&);

   static void _set_custom(const char* name, size_t ll, const char* key, size_t kl, Value& x);

public:
   Scope(const Scope& s) : saved(s.saved), id(s.id) { s.saved=NULL; }

   ~Scope();

   void prefer_now(const std::string& labels) const
   {
      Main::call_app_method("prefer_now", labels.c_str(), labels.size());
   }
   template <size_t ll>
   void prefer_now(const char (&labels)[ll]) const
   {
      Main::call_app_method("prefer_now", labels, ll-1);
   }

   template <size_t ll, typename T>
   void set_custom(const char (&name)[ll], const T& value)
   {
      Value x;
      x << value;
      _set_custom(name, ll-1, NULL, 0, x);
   }
   template <typename T>
   void set_custom(const std::string& name, const T& value)
   {
      Value x;
      x << value;
      _set_custom(name.c_str(), name.size(), NULL, 0, x);
   }

   template <size_t ll, typename T>
   void set_custom(const char (&name)[ll], const std::string& key, const T& value)
   {
      Value x;
      x << value;
      _set_custom(name, ll-1, key.c_str(), key.size(), x);
   }
   template <typename T>
   void set_custom(const std::string& name, const std::string& key, const T& value)
   {
      Value x;
      x << value;
      _set_custom(name.c_str(), name.size(), key.c_str(), key.size(), x);
   }
};

} }

namespace polymake {

using pm::perl::Main;

namespace perl {

using pm::perl::Scope;

} }

#endif // POLYMAKE_MAIN_H

// Local Variables:
// mode:C++
// c-basic-offset:3
// indent-tabs-mode:nil
// End: