Mercurial > hg > vamp-plugin-load-checker
comparison checker/checkcode.h @ 40:40c6936c2fc9 errorcode
Return numerical error codes, so the caller can apply i18n on display; distinguish explicitly the common win32 architecture problems
| author | Chris Cannam | 
|---|---|
| date | Wed, 29 Aug 2018 17:40:22 +0100 | 
| parents | |
| children | 49946b02414e | 
   comparison
  equal
  deleted
  inserted
  replaced
| 38:a43d7a2867d2 | 40:40c6936c2fc9 | 
|---|---|
| 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ | |
| 2 /* | |
| 3 Copyright (c) 2016-2018 Queen Mary, University of London | |
| 4 | |
| 5 Permission is hereby granted, free of charge, to any person | |
| 6 obtaining a copy of this software and associated documentation | |
| 7 files (the "Software"), to deal in the Software without | |
| 8 restriction, including without limitation the rights to use, copy, | |
| 9 modify, merge, publish, distribute, sublicense, and/or sell copies | |
| 10 of the Software, and to permit persons to whom the Software is | |
| 11 furnished to do so, subject to the following conditions: | |
| 12 | |
| 13 The above copyright notice and this permission notice shall be | |
| 14 included in all copies or substantial portions of the Software. | |
| 15 | |
| 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |
| 17 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
| 18 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |
| 19 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY | |
| 20 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | |
| 21 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |
| 22 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |
| 23 | |
| 24 Except as contained in this notice, the names of the Centre for | |
| 25 Digital Music and Queen Mary, University of London shall not be | |
| 26 used in advertising or otherwise to promote the sale, use or other | |
| 27 dealings in this Software without prior written authorization. | |
| 28 */ | |
| 29 | |
| 30 #ifndef CHECK_CODE_H | |
| 31 #define CHECK_CODE_H | |
| 32 | |
| 33 enum class PluginCheckCode { | |
| 34 | |
| 35 SUCCESS = 0, | |
| 36 | |
| 37 /** Plugin library file is not found | |
| 38 */ | |
| 39 FAIL_LIBRARY_NOT_FOUND = 1, | |
| 40 | |
| 41 /** Plugin library does appear to be a library, but its | |
| 42 * architecture differs from that of the checker program, in | |
| 43 * a way that can be distinguished from other loader | |
| 44 * failures. On Windows this may arise from system error 193, | |
| 45 * ERROR_BAD_EXE_FORMAT | |
| 46 */ | |
| 47 FAIL_WRONG_ARCHITECTURE = 2, | |
| 48 | |
| 49 /** Plugin library depends on some other library that cannot | |
| 50 * be loaded. On Windows this may arise from system error 126, | |
| 51 * ERROR_MOD_NOT_FOUND | |
| 52 */ | |
| 53 FAIL_DEPENDENCY_MISSING = 3, | |
| 54 | |
| 55 /** Plugin library cannot be loaded for some other reason | |
| 56 */ | |
| 57 FAIL_NOT_LOADABLE = 4, | |
| 58 | |
| 59 /** Plugin library can be loaded, but the expected plugin | |
| 60 * descriptor symbol is missing | |
| 61 */ | |
| 62 FAIL_DESCRIPTOR_MISSING = 5, | |
| 63 | |
| 64 /** Plugin library can be loaded and descriptor called, but no | |
| 65 * plugins are found in it | |
| 66 */ | |
| 67 FAIL_NO_PLUGINS = 6, | |
| 68 | |
| 69 /** Failure but no meaningful error code provided, or failure | |
| 70 * read from an older helper version that did not support | |
| 71 * error codes | |
| 72 */ | |
| 73 FAIL_OTHER = 7 | |
| 74 }; | |
| 75 | |
| 76 #endif | 
