PetscErrorCodeFn#

a function typedef that represents abstractly a function that returns a PETSc error code and takes any number of arguments. Since C/C++ has no way to express this concept, it is implemented as void (fn)(void).

Synopsis#

PETSC_EXTERN_TYPEDEF typedef void PetscErrorCodeFn(void);

Notes#

PetscErrorCodeFn * plays the role of void * for function pointers in the PETSc API that return an error code. It is used where a function pointer is needed but it is not possible to use the full prototype of the function, for example VecSetOperation().

PetscVoidFn is similar to PetscErrorCodeFn but should be used when the function does not return a PetscErrorCode.

The deprecated PetscErrorCodeFunction works as a replacement for PetscErrorCodeFn *.

Developer Notes#

This function type is equivalent to PetscVoidFn*.

At the C/C++ syntax level this construct adds nothing of value to the PETSc source code. It provides a way, at the abstract PETSc API level, to indicate specifically functions that return PETSc error codes as opposed to any C/C++ function.

See Also#

PetscVoidFn, PetscObject, PetscObjectDestroy(), VecSetOperation()

Level#

advanced

Location#

include/petscsys.h


Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages