1 /************************************************************************* 2 * D bindings for ODE * 3 * * 4 * C header port by Daniel "q66" Kolesa <quaker66@gmail.com> * 5 * * 6 * Open Dynamics Engine, Copyright (C) 2001-2003 Russell L. Smith. * 7 * All rights reserved. Email: russ@q12.org Web: www.q12.org * 8 * * 9 * This library is free software; you can redistribute it and/or * 10 * modify it under the terms of EITHER: * 11 * (1) The GNU Lesser General Public License as published by the Free * 12 * Software Foundation; either version 2.1 of the License, or (at * 13 * your option) any later version. The text of the GNU Lesser * 14 * General Public License is included with this library in the * 15 * file LICENSE.TXT. * 16 * (2) The BSD-style license that is included with this library in * 17 * the file LICENSE-BSD.TXT. * 18 * * 19 * This library is distributed in the hope that it will be useful, * 20 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 22 * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 23 * * 24 *************************************************************************/ 25 26 /* this comes from the `reuse' library. copy any changes back to the source */ 27 28 module deimos.ode.error; 29 30 private import deimos.ode.odeconfig; 31 private import core.vararg; 32 33 extern (C): 34 nothrow: 35 36 /* all user defined error functions have this type. error and debug functions 37 * should not return. 38 */ 39 alias void function(int errnum, const(char)* msg, va_list ap) dMessageFunction; 40 41 /* set a new error, debug or warning handler. if fn is 0, the default handlers 42 * are used. 43 */ 44 void dSetErrorHandler(dMessageFunction fn); 45 void dSetDebugHandler(dMessageFunction fn); 46 void dSetMessageHandler(dMessageFunction fn); 47 48 /* return the current error, debug or warning handler. if the return value is 49 * 0, the default handlers are in place. 50 */ 51 dMessageFunction dGetErrorHandler(); 52 dMessageFunction dGetDebugHandler(); 53 dMessageFunction dGetMessageHandler(); 54 55 /* generate a fatal error, debug trap or a message. */ 56 void dError (int num, const(char)* msg, ...); 57 void dDebug (int num, const(char)* msg, ...); 58 void dMessage(int num, const(char)* msg, ...);