diff options
author | mudathirmahgoub <mudathirmahgoub@gmail.com> | 2021-05-18 01:18:23 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-18 06:18:23 +0000 |
commit | c781d274fbaf6f4b3e419140c5834511d6b7c7a0 (patch) | |
tree | 66b2a214b02b2a12f988b8b83a9463ee1b9b5a43 /src/api/java/jni/cvc5JavaApi.h | |
parent | 59d935b0210fe20cdddf5de2be91bb26a66d05fb (diff) |
Add Solver.java to the Java API (#6196)
PR changes:
Add Solver.java and relation JNI c files
Update FindJUnit to download JUnit5
Add Java unit tests
Diffstat (limited to 'src/api/java/jni/cvc5JavaApi.h')
-rw-r--r-- | src/api/java/jni/cvc5JavaApi.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/api/java/jni/cvc5JavaApi.h b/src/api/java/jni/cvc5JavaApi.h new file mode 100644 index 000000000..2aa860f40 --- /dev/null +++ b/src/api/java/jni/cvc5JavaApi.h @@ -0,0 +1,38 @@ +/****************************************************************************** + * Top contributors (to current version): + * Mudathir Mohamed + * + * This file is part of the cvc5 project. + * + * Copyright (c) 2009-2021 by the authors listed in the file AUTHORS + * in the top-level source directory and their institutional affiliations. + * All rights reserved. See the file COPYING in the top-level source + * directory for licensing information. + * **************************************************************************** + * + * The cvc5 Java API. + */ + +#ifndef CVC5__JAVA_API_H +#define CVC5__JAVA_API_H + +#define CVC5_JAVA_API_TRY_CATCH_BEGIN \ + try \ + { +#define CVC5_JAVA_API_TRY_CATCH_END(env) \ + } \ + catch (const CVC5ApiRecoverableException& e) \ + { \ + jclass exceptionClass = \ + env->FindClass("cvc5/CVC5ApiRecoverableException"); \ + env->ThrowNew(exceptionClass, e.what()); \ + } \ + catch (const CVC5ApiException& e) \ + { \ + jclass exceptionClass = env->FindClass("cvc5/CVC5ApiException"); \ + env->ThrowNew(exceptionClass, e.what()); \ + } +#define CVC5_JAVA_API_TRY_CATCH_END_RETURN(env, returnValue) \ + CVC5_JAVA_API_TRY_CATCH_END(env) \ + return returnValue; +#endif // CVC5__JAVA_API_H |