Actual source code: zaof.c

  1: #include <petsc/private/fortranimpl.h>
  2: #include <petscao.h>
  3: #include <petscviewer.h>

  5: #if defined(PETSC_HAVE_FORTRAN_CAPS)
  6:   #define aoview_            AOVIEW
  7:   #define aosettype_         AOSETTYPE
  8:   #define aoviewfromoptions_ AOVIEWFROMOPTIONS
  9: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
 10:   #define aoview_            aoview
 11:   #define aosettype_         aosettype
 12:   #define aoviewfromoptions_ aoviewfromoptions
 13: #endif

 15: PETSC_EXTERN void aoview_(AO *ao, PetscViewer *viewer, PetscErrorCode *ierr)
 16: {
 17:   PetscViewer v;
 18:   PetscPatchDefaultViewers_Fortran(viewer, v);
 19:   *ierr = AOView(*ao, v);
 20: }

 22: PETSC_EXTERN void aosettype_(AO *ao, char *type, PetscErrorCode *ierr, PETSC_FORTRAN_CHARLEN_T len)
 23: {
 24:   char *t;

 26:   FIXCHAR(type, len, t);
 27:   *ierr = AOSetType(*ao, t);
 28:   if (*ierr) return;
 29:   FREECHAR(type, t);
 30: }

 32: PETSC_EXTERN void aoviewfromoptions_(AO *ao, PetscObject obj, char *type, PetscErrorCode *ierr, PETSC_FORTRAN_CHARLEN_T len)
 33: {
 34:   char *t;

 36:   FIXCHAR(type, len, t);
 37:   CHKFORTRANNULLOBJECT(obj);
 38:   *ierr = AOViewFromOptions(*ao, obj, t);
 39:   if (*ierr) return;
 40:   FREECHAR(type, t);
 41: }