3 #define ASSERT( a, message ) if( !(a) ) { fprintf( stderr, "ASSERTION FAILED\n" ); PyErr_SetString( PyExc_AssertionError, message ); return NULL; }
5 #define DECLARE_MODULE( module ) PyMODINIT_FUNC init##module( void ) { \
6 Py_InitModule( #module, module##_methods ); \
9 #define ASSERT_NOEXCEPTION if( libvlc_exception_raised( &exception ) ) { \
10 if( libvlc_exception_get_message( &exception ) ) PyErr_SetString( PyExc_AssertionError, libvlc_exception_get_message( &exception ) ); \
11 else PyErr_SetString( PyExc_AssertionError, "Exception raised" ); return NULL; }
13 #define ASSERT_EXCEPTION if( !libvlc_exception_raised( &exception ) ) { \
14 if( libvlc_exception_get_message( &exception ) ) PyErr_SetString( PyExc_AssertionError, libvlc_exception_get_message( &exception ) ); \
15 else PyErr_SetString( PyExc_AssertionError, "Exception not raised" ); return NULL; }
19 #define DEF_METHOD( method, desc ) { #method, method, METH_VARARGS, desc},