comparison src/helper.cpp @ 28:7a20698b4c29

Add checker README; rename plugin-checker-helper binary (back) to vamp-plugin-load-checker -- I decided it was more useful to have a distinctive name for the installed binary than it was important to show that it was plugin-agnostic
author Chris Cannam
date Mon, 09 Jan 2017 10:14:59 +0000
parents 62a0cda8b099
children 146d42909e71
comparison
equal deleted inserted replaced
27:62a0cda8b099 28:7a20698b4c29
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 2
3 /** 3 /**
4 * Plugin Load Checker Helper 4 * [Vamp] Plugin Load Checker
5 * 5 *
6 * This program accepts the name of a descriptor symbol as its only 6 * This program accepts the name of a descriptor symbol as its only
7 * command-line argument. It then reads a list of plugin library paths 7 * command-line argument. It then reads a list of plugin library paths
8 * from stdin, one per line. For each path read, it attempts to load 8 * from stdin, one per line. For each path read, it attempts to load
9 * that library and retrieve the named descriptor symbol, printing a 9 * that library and retrieve the named descriptor symbol, printing a
19 * SUCCESS|/path/to/libname.so| 19 * SUCCESS|/path/to/libname.so|
20 * 20 *
21 * Output line for failed load of library libname.so: 21 * Output line for failed load of library libname.so:
22 * FAILURE|/path/to/libname.so|Reason for failure if available 22 * FAILURE|/path/to/libname.so|Reason for failure if available
23 * 23 *
24 * Although this program was written for use with Vamp audio analysis
25 * plugins, it also works with other plugin formats. The program has
26 * some hardcoded knowledge of Vamp, LADSPA, and DSSI plugins, but it
27 * can be used with any plugins that involve loading DLLs and looking
28 * up descriptor functions from them.
29 *
24 * Sometimes plugins will crash completely on load, bringing down this 30 * Sometimes plugins will crash completely on load, bringing down this
25 * program with them. If the program exits before all listed plugins 31 * program with them. If the program exits before all listed plugins
26 * have been checked, this means that the plugin following the last 32 * have been checked, this means that the plugin following the last
27 * reported one has crashed. Typically the caller may want to run it 33 * reported one has crashed. Typically the caller may want to run it
28 * again, omitting that plugin. 34 * again, omitting that plugin.
29 */ 35 */
30 36
31 /* 37 /*
32 Copyright (c) 2016 Queen Mary, University of London 38 Copyright (c) 2016-2017 Queen Mary, University of London
33 39
34 Permission is hereby granted, free of charge, to any person 40 Permission is hereby granted, free of charge, to any person
35 obtaining a copy of this software and associated documentation 41 obtaining a copy of this software and associated documentation
36 files (the "Software"), to deal in the Software without 42 files (the "Software"), to deal in the Software without
37 restriction, including without limitation the rights to use, copy, 43 restriction, including without limitation the rights to use, copy,
55 used in advertising or otherwise to promote the sale, use or other 61 used in advertising or otherwise to promote the sale, use or other
56 dealings in this Software without prior written authorization. 62 dealings in this Software without prior written authorization.
57 */ 63 */
58 64
59 #include "../version.h" 65 #include "../version.h"
66
67 static const char programName[] = "vamp-plugin-load-checker";
60 68
61 #ifdef _WIN32 69 #ifdef _WIN32
62 #include <windows.h> 70 #include <windows.h>
63 #include <process.h> 71 #include <process.h>
64 #include <string> 72 #include <string>
207 } 215 }
208 } 216 }
209 217
210 if (argc != 2 || showUsage) { 218 if (argc != 2 || showUsage) {
211 cerr << endl; 219 cerr << endl;
212 cerr << "plugin-checker-helper: Test shared library objects for plugins to be" << endl; 220 cerr << programName << ": Test shared library objects for plugins to be" << endl;
213 cerr << "loaded via descriptor functions." << endl; 221 cerr << "loaded via descriptor functions." << endl;
214 cerr << "\n Usage: plugin-checker-helper <descriptorname>\n" 222 cerr << "\n Usage: " << programName << " <descriptorname>\n"
215 "\nwhere descriptorname is the name of a plugin descriptor symbol to be sought\n" 223 "\nwhere descriptorname is the name of a plugin descriptor symbol to be sought\n"
216 "in each library (e.g. vampGetPluginDescriptor for Vamp plugins). The list of\n" 224 "in each library (e.g. vampGetPluginDescriptor for Vamp plugins). The list of\n"
217 "candidate plugin library filenames is read from stdin.\n" << endl; 225 "candidate plugin library filenames is read from stdin.\n" << endl;
218 return 2; 226 return 2;
219 } 227 }