summaryrefslogtreecommitdiff
path: root/src/listplugins.c
blob: ba8e4c429bc155066ea137918ed40fd84ad4afe2 (plain)
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
/* listplugins.c

   Free software by Richard W.E. Furse. Do with as you will. No
   warranty. */

/*****************************************************************************/

#include <dlfcn.h>
#include <math.h>
#include <stdio.h>
#include <string.h>

/*****************************************************************************/

#include "ladspa.h"
#include "utils.h"

/*****************************************************************************/

static void 
describePluginLibrary(const char * pcFullFilename, 
		      void * pvPluginHandle,
		      LADSPA_Descriptor_Function fDescriptorFunction) {

  const LADSPA_Descriptor * psDescriptor;
  long lIndex;

  printf("%s:\n", pcFullFilename);
  for (lIndex = 0;
       (psDescriptor = fDescriptorFunction(lIndex)) != NULL;
       lIndex++) 
    printf("\t%s (%lu/%s)\n", 
	   psDescriptor->Name,
	   psDescriptor->UniqueID,
	   psDescriptor->Label);

  dlclose(pvPluginHandle);
}

/*****************************************************************************/

/* Returns 0 if all goes well, otherwise returns 1. */
static int
listPlugins() {
  LADSPAPluginSearch(describePluginLibrary);
  return(0);
}

/*****************************************************************************/

int 
main(const int iArgc, const char ** ppcArgv) {
  return listPlugins();
}

/*****************************************************************************/

/* EOF */