Alien-SVN
view release on metacpan or search on metacpan
src/subversion/subversion/bindings/javahl/native/JNIUtil.h view on Meta::CPAN
/**
* Set the appropriate global or thread-local flag that an exception
* has been thrown to @a flag.
*/
static void setExceptionThrown(bool flag = true);
/**
* The log level of this module.
*/
static int g_logLevel;
/**
* Global master pool. All other pool are subpools of this pool.
*/
static apr_pool_t *g_pool;
/**
* List of objects finalized, where the C++ peer has not yet be
* deleted.
*/
static std::list<SVNBase*> g_finalizedObjects;
/**
* Mutex to secure the g_finalizedObjects list.
*/
static JNIMutex *g_finalizedObjectsMutex;
/**
* Mutex to secure the access to the log file.
*/
static JNIMutex *g_logMutex;
/**
* Flag, that an exception occurred during our initialization.
*/
static bool g_initException;
/**
* Flag, that one thread is in the init code. Cannot use mutex
* here since apr is not initialized yet.
*/
static bool g_inInit;
/**
* The JNI environment used during initialization.
*/
static JNIEnv *g_initEnv;
/**
* Fuffer the format error messages during initialization.
*/
static char g_initFormatBuffer[formatBufferSize];
/**
* The stream to write log messages to.
*/
static std::ofstream g_logStream;
};
/**
* A statement macro used for checking NULL pointers, in the style of
* SVN_ERR().
*
* Evaluate @a expr. If it equals NULL, throw an NullPointerException with
* the value @a str, and return the @a ret_val. Otherwise, continue.
*
* Note that if the enclosing function returns <tt>void</tt>, @a ret_val may
* be blank.
*/
#define SVN_JNI_NULL_PTR_EX(expr, str, ret_val) \
if ((expr) == NULL) { \
JNIUtil::throwNullPointerException(str); \
return ret_val; \
}
/**
* A statement macro used for checking for errors, in the style of
* SVN_ERR().
*
* Evalute @a expr. If it yields an error, handle the JNI error, and
* return @a ret_val. Otherwise, continue.
*
* Note that if the enclosing function returns <tt>void</tt>, @a ret_val may
* be blank.
*/
#define SVN_JNI_ERR(expr, ret_val) \
do { \
svn_error_t *svn_jni_err__temp = (expr); \
if (svn_jni_err__temp != SVN_NO_ERROR) { \
JNIUtil::handleSVNError(svn_jni_err__temp); \
return ret_val; \
} \
} while (0)
/**
* The initial capacity of a create local reference frame.
*/
#define LOCAL_FRAME_SIZE 16
/**
* A statement macro use to pop the reference frame and return NULL
*/
#define POP_AND_RETURN(ret_val) \
do \
{ \
env->PopLocalFrame(NULL); \
return ret_val; \
} \
while (0)
/**
* A statement macro use to pop the reference frame and return
*/
#define POP_AND_RETURN_NOTHING() \
do \
{ \
env->PopLocalFrame(NULL); \
return; \
} \
while (0)
/**
* A useful macro.
*/
#define POP_AND_RETURN_NULL POP_AND_RETURN(NULL)
#define CPPADDR_NULL_PTR(expr, ret_val) \
do { \
if ((expr) == NULL) { \
JNIUtil::throwError(_("bad C++ this")); \
return ret_val; \
} \
} while (0)
#endif // JNIUTIL_H
( run in 0.796 second using v1.01-cache-2.11-cpan-39bf76dae61 )