# PetscObjectSetFortranCallback
set fortran callback function pointer and context 
## Synopsis
```
#include "petscsys.h"    
PetscErrorCode PetscObjectSetFortranCallback(PetscObject obj, PetscFortranCallbackType cbtype, PetscFortranCallbackId *cid, void (*func)(void), void *ctx)
```
Logically Collective


## Input Parameters

- ***obj -*** object on which to set callback
- ***cbtype -*** callback type (class or subtype)
- ***cid -*** address of callback Id, updated if not yet initialized (zero)
- ***func -*** Fortran function
- ***ctx -*** Fortran context





## Note
This is used to help manage user callback functions that were provided in Fortran


## See Also
 `PetscObjectGetFortranCallback()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/objects/inherit.c.html#PetscObjectSetFortranCallback">src/sys/objects/inherit.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/objects/inherit.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
