Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
someCFunc.cpp
Go to the documentation of this file.
2 #include "Teuchos_Assert.hpp"
3 
4 
5 extern "C" {
6 
7 
8 int someCFunc(int input, int *ierr)
9 {
10  int output = -1;
11  TEUCHOS_CWRAPPER_TRY(ierr) {
12  TEUCHOS_ASSERT_INEQUALITY(input, >=, 0);
13  if (input > 10) {
15  }
16  else {
17  output = input;
18  }
20  return output;
21 }
22 
23 
24 } // extern "C"
#define TEUCHOS_CWRAPPER_TRY(IERR)
Define a try block.
#define TEUCHOS_CWRAPPER_SET_ERROR_CODE(IERR, IERR_VALUE)
Set the error code.
#define TEUCHOS_CWRAPPER_CATCH_ERROR_CODE(IERR)
Define the catch blocks and set the error code.
#define TEUCHOS_ASSERT_INEQUALITY(val1, comp, val2)
This macro is checks that an inequality between two numbers is satisified and if not then throws a go...
int someCFunc(int input, int *ierr)
Definition: someCFunc.cpp:8