Actual source code: zblockf.c

  1: #include <petsc/private/fortranimpl.h>
  2: #include <petscis.h>

  4: #if defined(PETSC_HAVE_FORTRAN_CAPS)
  5:   #define isblockgetindices_     ISBLOCKGETINDICES
  6:   #define isblockrestoreindices_ ISBLOCKRESTOREINDICES
  7: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
  8:   #define isblockgetindices_     isblockgetindices
  9:   #define isblockrestoreindices_ isblockrestoreindices
 10: #endif

 12: PETSC_EXTERN void isblockgetindices_(IS *x, PetscInt *fa, size_t *ia, PetscErrorCode *ierr)
 13: {
 14:   const PetscInt *lx;

 16:   *ierr = ISBlockGetIndices(*x, &lx);
 17:   if (*ierr) return;
 18:   *ia = PetscIntAddressToFortran(fa, (PetscInt *)lx);
 19: }

 21: PETSC_EXTERN void isblockrestoreindices_(IS *x, PetscInt *fa, size_t *ia, PetscErrorCode *ierr)
 22: {
 23:   const PetscInt *lx = PetscIntAddressFromFortran(fa, *ia);
 24:   *ierr              = ISBlockRestoreIndices(*x, &lx);
 25: }