Actual source code: zpcsetf.c

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

  4: #if defined(PETSC_HAVE_FORTRAN_CAPS)
  5:   #define pcsettype_ PCSETTYPE
  6:   #define pcgettype_ PCGETTYPE
  7: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
  8:   #define pcsettype_ pcsettype
  9:   #define pcgettype_ pcgettype
 10: #endif

 12: PETSC_EXTERN void pcsettype_(PC *pc, char *type, PetscErrorCode *ierr, PETSC_FORTRAN_CHARLEN_T len)
 13: {
 14:   char *t;

 16:   FIXCHAR(type, len, t);
 17:   *ierr = PCSetType(*pc, t);
 18:   FREECHAR(type, t);
 19: }

 21: PETSC_EXTERN void pcgettype_(PC *pc, char *name, PetscErrorCode *ierr, PETSC_FORTRAN_CHARLEN_T len)
 22: {
 23:   const char *tname;

 25:   *ierr = PCGetType(*pc, &tname);
 26:   *ierr = PetscStrncpy(name, tname, len);
 27:   if (*ierr) return;
 28:   FIXRETURNCHAR(PETSC_TRUE, name, len);
 29: }