This file is indexed.

/usr/include/slv2/plugin.h is in libslv2-dev 0.6.6+dfsg1-2.

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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
/* SLV2
 * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
 *
 * This library 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 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 General Public License
 * for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#ifndef __SLV2_PLUGIN_H__
#define __SLV2_PLUGIN_H__

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>
#include <stdbool.h>
#include "slv2/types.h"
#include "slv2/port.h"
#include "slv2/collections.h"

/** \defgroup slv2_data Plugin data access
 *
 * These functions work exclusively with the plugin's RDF data,
 * they do not access the plugin's shared library in any way.
 *
 * An SLV2Plugin contains an in-memory cache of the plugin data, loaded
 * on demand.  Duplicating plugins should be avoided when possible for
 * performance reasons.
 *
 * @{
 */


/** Check if this plugin is valid.
 *
 * This is used by plugin lists to avoid loading plugins that are not valid
 * and will not work with libslv2 (eg plugins missing required fields, or
 * having multiple values for mandatory single-valued fields, etc.
 *
 * Note that normal hosts do NOT need to use this - slv2 does not
 * load invalid plugins into plugin lists.  This is included for plugin
 * testing utilities, etc.
 *
 * \return true if \a plugin is valid.
 *
 * Time = Query
 */
bool
slv2_plugin_verify(SLV2Plugin plugin);


/** Get the URI of \a plugin.
 *
 * Any serialization that refers to plugins should refer to them by this.
 * Hosts SHOULD NOT save any filesystem paths, plugin indexes, etc. in saved
 * files; save only the URI.
 *
 * The URI is a globally unique identifier for one specific plugin.  Two
 * plugins with the same URI are compatible in port signature, and should
 * be guaranteed to work in a compatible and consistent way.  If a plugin
 * is upgraded in an incompatible way (eg if it has different ports), it
 * MUST have a different URI than it's predecessor.
 *
 * \return a shared string which must not be modified or free()'d.
 *
 * Time = O(1)
 */
SLV2Value
slv2_plugin_get_uri(SLV2Plugin plugin);


/** Get the (resolvable) URI of the plugins "main" bundle.
 *
 * This returns the URI of the bundle where the plugin itself was found.
 * Note that the data for a plugin may be spread over many bundles, that is,
 * slv2_plugin_get_data_uris may returns URIs which are not below this one.
 *
 * Typical hosts should not need to use this function.
 *
 * Note this always returns a fully qualified URI.  If you want a local
 * filesystem path, use slv2_uri_to_path.
 *
 * \return a shared string which must not be modified or freed.
 *
 * Time = O(1)
 */
SLV2Value
slv2_plugin_get_bundle_uri(SLV2Plugin plugin);


/** Get the (resolvable) URIs of the RDF data files that define a plugin.
 *
 * Typical hosts should not need to use this function.
 *
 * Note this always returns fully qualified URIs.  If you want local
 * filesystem paths, use slv2_uri_to_path.
 *
 * \return a list of complete URLs eg. "file:///foo/ABundle.lv2/aplug.ttl",
 * which is shared and must not be modified or freed.
 *
 * Time = O(1)
 */
SLV2Values
slv2_plugin_get_data_uris(SLV2Plugin plugin);


/** Get the (resolvable) URI of the shared library for \a plugin.
 *
 * Note this always returns a fully qualified URI.  If you want a local
 * filesystem path, use slv2_uri_to_path.
 *
 * \return a shared string which must not be modified or freed.
 *
 * Time = O(1)
 */
SLV2Value
slv2_plugin_get_library_uri(SLV2Plugin plugin);


/** Get the name of \a plugin.
 *
 * This is guaranteed to return the untranslated name (the doap:name in the
 * data file without a language tag).  Returned value must be freed by
 * the caller.
 *
 * Time = Query
 */
SLV2Value
slv2_plugin_get_name(SLV2Plugin plugin);


/** Get the class this plugin belongs to (ie Filters).
 */
SLV2PluginClass
slv2_plugin_get_class(SLV2Plugin plugin);


/** Get a value associated with the plugin in a plugin's data files.
 *
 * Returns the ?object of all triples found of the form:
 *
 * <code>&lt;plugin-uri&gt; predicate ?object</code>
 *
 * May return NULL if the property was not found, or if object(s) is not
 * sensibly represented as an SLV2Values (e.g. blank nodes).
 *
 * Return value must be freed by caller with slv2_values_free.
 *
 * \a predicate must be either a URI or a QName.
 * See SLV2URIType documentation for examples.
 *
 * Time = Query
 */
SLV2Values
slv2_plugin_get_value(SLV2Plugin p,
                      SLV2Value  predicate);


/** Get a value associated with the plugin in a plugin's data files.
 *
 * This function is identical to slv2_plugin_get_value, but takes a QName
 * string parameter for a predicate instead of an SLV2Value, which may be
 * more convenient.
 */
SLV2Values
slv2_plugin_get_value_by_qname(SLV2Plugin  p,
                               const char* predicate);


/** Get a translated value associated with the plugin in a plugin's data files.
 *
 * This function is identical to slv2_plugin_get_value, but takes a QName
 * string parameter for a predicate instead of an SLV2Value, which may be
 * more convenient. It returns the value translated to the current language
 * if possible.
 */
SLV2Values
slv2_plugin_get_value_by_qname_i18n(SLV2Plugin  p,
                                    const char* predicate);


/** Get a value associated with some subject in a plugin's data files.
 *
 * Returns the ?object of all triples found of the form:
 *
 * <code>subject predicate ?object</code>
 *
 * This can be used to investigate URIs returned by slv2_plugin_get_value
 * (if information about it is contained in the plugin's data files).
 *
 * May return NULL if the property was not found, or if object is not
 * sensibly represented as an SLV2Values (e.g. blank nodes).
 *
 * \a predicate must be either a URI or a QName.
 * See SLV2URIType documentation for examples.
 *
 * Return value must be freed by caller with slv2_values_free.
 *
 * Time = Query
 */
SLV2Values
slv2_plugin_get_value_for_subject(SLV2Plugin p,
                                  SLV2Value  subject_uri,
                                  SLV2Value  predicate_uri);


/** Return whether a feature is supported by a plugin.
 *
 * This will return true if the feature is an optional or required feature
 * of the plugin.
 *
 * Time = Query
 */
bool
slv2_plugin_has_feature(SLV2Plugin p,
                        SLV2Value  feature_uri);


/** Get the LV2 Features supported (required or optionally) by a plugin.
 *
 * A feature is "supported" by a plugin if it is required OR optional.
 *
 * Since required features have special rules the host must obey, this function
 * probably shouldn't be used by normal hosts.  Using slv2_plugin_get_optional_features
 * and slv2_plugin_get_required_features separately is best in most cases.
 *
 * Returned value must be freed by caller with slv2_values_free.
 *
 * Time = Query
 */
SLV2Values
slv2_plugin_get_supported_features(SLV2Plugin p);


/** Get the LV2 Features required by a plugin.
 *
 * If a feature is required by a plugin, hosts MUST NOT use the plugin if they do not
 * understand (or are unable to support) that feature.
 *
 * All values returned here MUST be passed to the plugin's instantiate method
 * (along with data, if necessary, as defined by the feature specification)
 * or plugin instantiation will fail.
 *
 * Return value must be freed by caller with slv2_values_free.
 *
 * Time = Query
 */
SLV2Values
slv2_plugin_get_required_features(SLV2Plugin p);


/** Get the LV2 Features optionally supported by a plugin.
 *
 * Hosts MAY ignore optional plugin features for whatever reasons.  Plugins
 * MUST operate (at least somewhat) if they are instantiated without being
 * passed optional features.
 *
 * Return value must be freed by caller with slv2_values_free.
 *
 * Time = Query
 */
SLV2Values
slv2_plugin_get_optional_features(SLV2Plugin p);


/** Get the number of ports on this plugin.
 *
 * Time = O(1)
 */
uint32_t
slv2_plugin_get_num_ports(SLV2Plugin p);


/** Get the port ranges (minimum, maximum and default values) for all ports.
 *
 * \a min_values, \a max_values and \a def_values must either point to an array
 * of N floats, where N is the value returned by slv2_plugin_get_num_ports()
 * for this plugin, or NULL.  The elements of the array will be set to the
 * the minimum, maximum and default values of the ports on this plugin,
 * with array index corresponding to port index.  If a port doesn't have a
 * minimum, maximum or default value, or the port's type is not float, the
 * corresponding array element will be set to NAN.
 *
 * This is a convenience method for the common case of getting the range of
 * all float ports on a plugin, and may be significantly faster than
 * repeated calls to slv2_port_get_range.
 */
void
slv2_plugin_get_port_ranges_float(SLV2Plugin p,
                                  float*     min_values,
                                  float*     max_values,
                                  float*     def_values);

/** Get the number of ports on this plugin that are members of some class(es).
 *
 * Note that this is a varargs function so ports fitting any type 'profile'
 * desired can be found quickly.  REMEMBER TO TERMINATE THE PARAMETER LIST
 * OF THIS FUNCTION WITH NULL OR VERY NASTY THINGS WILL HAPPEN.
 *
 * Time = O(1)
 */
uint32_t
slv2_plugin_get_num_ports_of_class(SLV2Plugin p,
                                   SLV2Value  class_1, ...);

/** Return whether or not the plugin introduces (and reports) latency.
 *
 * The index of the latency port can be found with slv2_plugin_get_latency_port
 * ONLY if this function returns true.
 *
 * Time = Query
 */
bool
slv2_plugin_has_latency(SLV2Plugin p);


/** Return the index of the plugin's latency port.
 *
 * It is a fatal error to call this on a plugin without checking if the port
 * exists by first calling slv2_plugin_has_latency.
 *
 * Any plugin that introduces unwanted latency that should be compensated for
 * (by hosts with the ability/need) MUST provide this port, which is a control
 * rate output port that reports the latency for each cycle in frames.
 *
 * Time = Query
 */
uint32_t
slv2_plugin_get_latency_port_index(SLV2Plugin p);


/** Query a plugin for a single variable (i.e. SELECT a single ?value).
 *
 * \param plugin The plugin to query.
 * \param sparql_str A SPARQL SELECT query.
 * \param variable The index of the variable to return results for
 *        (e.g. with "<code>SELECT ?foo ?bar</code>" foo=0, bar=1).
 * \return All matches for \a variable.
 *
 * Time = Query
 */
SLV2Values
slv2_plugin_query_variable(SLV2Plugin  plugin,
                           const char* sparql_str,
                           unsigned    variable);


/** Query a plugin and return the number of results found.
 *
 * Note that this function will work, but is mostly meaningless for queries
 * that are not SELECT DISTINCT.
 *
 * \param plugin The plugin to query.
 * \param sparql_str A SPARQL SELECT DISTINCT query.
 *
 * Time = Query
 */
unsigned
slv2_plugin_query_count(SLV2Plugin  plugin,
                        const char* sparql_str);


/** Get a port on this plugin by \a index.
 *
 * To perform multiple calls on a port, the returned value should
 * be cached and used repeatedly.
 *
 * Time = O(1)
 */
SLV2Port
slv2_plugin_get_port_by_index(SLV2Plugin plugin,
                              uint32_t   index);


/** Get a port on this plugin by \a symbol.
 *
 * To perform multiple calls on a port, the returned value should
 * be cached and used repeatedly.  Note this function is slower
 * than slv2_plugin_get_port_by_index, especially on plugins
 * with a very large number of ports.
 *
 * Time = O(n)
 */
SLV2Port
slv2_plugin_get_port_by_symbol(SLV2Plugin plugin,
                               SLV2Value  symbol);


/** Get a list of all UIs available for this plugin.
 *
 * Note this returns the URI of the UI, and not the path/URI to its shared
 * library, use slv2_ui_get_library_uri with the values returned
 * here for that.
 *
 * Returned value must be freed by caller using slv2_uis_free.
 *
 * \param plugin The plugin to get the UIs for.
 *
 * Time = Query
 */
SLV2UIs
slv2_plugin_get_uis(SLV2Plugin plugin);


/** Get the full name of the plugin's author.
 *
 * Returns NULL if author name is not present.
 * Returned value must be freed by caller.
 *
 * Time = Query
 */
SLV2Value
slv2_plugin_get_author_name(SLV2Plugin plugin);


/** Get the email address of the plugin's author.
 *
 * Returns NULL if author email address is not present.
 * Returned value must be freed by caller.
 *
 * Time = Query
 */
SLV2Value
slv2_plugin_get_author_email(SLV2Plugin plugin);


/** Get the email address of the plugin's author.
 *
 * Returns NULL if author homepage is not present.
 * Returned value must be freed by caller.
 *
 * Time = Query
 */
SLV2Value
slv2_plugin_get_author_homepage(SLV2Plugin plugin);


/** @} */

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* __SLV2_PLUGIN_H__ */