Teuchos Package Browser (Single Doxygen Collection)
Version of the Day
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
core
test
CWrapperSupport
someCFunc.cpp
Go to the documentation of this file.
1
// @HEADER
2
// *****************************************************************************
3
// Teuchos: Common Tools Package
4
//
5
// Copyright 2004 NTESS and the Teuchos contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
#include "
Teuchos_CWrapperSupport_Cpp.hpp
"
11
#include "
Teuchos_Assert.hpp
"
12
13
14
extern
"C"
{
15
16
17
int
someCFunc
(
int
input,
int
*ierr)
18
{
19
int
output = -1;
20
TEUCHOS_CWRAPPER_TRY
(ierr) {
21
TEUCHOS_ASSERT_INEQUALITY
(input, >=, 0);
22
if
(input > 10) {
23
TEUCHOS_CWRAPPER_SET_ERROR_CODE
(ierr, -2);
24
}
25
else
{
26
output = input;
27
}
28
}
TEUCHOS_CWRAPPER_CATCH_ERROR_CODE
(ierr);
29
return
output;
30
}
31
32
33
}
// extern "C"
TEUCHOS_CWRAPPER_TRY
#define TEUCHOS_CWRAPPER_TRY(IERR)
Define a try block.
Definition:
Teuchos_CWrapperSupport_Cpp.hpp:65
TEUCHOS_CWRAPPER_SET_ERROR_CODE
#define TEUCHOS_CWRAPPER_SET_ERROR_CODE(IERR, IERR_VALUE)
Set the error code.
Definition:
Teuchos_CWrapperSupport_Cpp.hpp:95
TEUCHOS_CWRAPPER_CATCH_ERROR_CODE
#define TEUCHOS_CWRAPPER_CATCH_ERROR_CODE(IERR)
Define the catch blocks and set the error code.
Definition:
Teuchos_CWrapperSupport_Cpp.hpp:78
TEUCHOS_ASSERT_INEQUALITY
#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...
Definition:
Teuchos_Assert.hpp:94
Teuchos_CWrapperSupport_Cpp.hpp
someCFunc
int someCFunc(int input, int *ierr)
Definition:
someCFunc.cpp:17
Teuchos_Assert.hpp
Generated on Thu Nov 21 2024 09:21:38 for Teuchos Package Browser (Single Doxygen Collection) by
1.8.5