xref: /petsc/src/sys/classes/viewer/interface/ftn-custom/zviewaf.c (revision 8cc058d9cd56c1ccb3be12a47760ddfc446aaffc)
15c6c1daeSBarry Smith #include <petsc-private/fortranimpl.h>
2665c2dedSJed Brown #include <petscviewer.h>
35c6c1daeSBarry Smith 
45c6c1daeSBarry Smith #if defined(PETSC_HAVE_FORTRAN_CAPS)
55c6c1daeSBarry Smith #define petscviewersetformat_      PETSCVIEWERSETFORMAT
65c6c1daeSBarry Smith #define petscviewersettype_        PETSCVIEWERSETTYPE
75c6c1daeSBarry Smith #define petscviewerpushformat_     PETSCVIEWERPUSHFORMAT
85c6c1daeSBarry Smith #define petscviewerpopformat_      PETSCVIEWERPOPFORMAT
95c6c1daeSBarry Smith #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
105c6c1daeSBarry Smith #define petscviewersetformat_      petscviewersetformat
115c6c1daeSBarry Smith #define petscviewersettype_        petscviewersettype
125c6c1daeSBarry Smith #define petscviewerpushformat_     petscviewerpushformat
135c6c1daeSBarry Smith #define petscviewerpopformat_      petscviewerpopformat
145c6c1daeSBarry Smith #endif
155c6c1daeSBarry Smith 
16*8cc058d9SJed Brown PETSC_EXTERN void PETSC_STDCALL petscviewersettype_(PetscViewer *x,CHAR type_name PETSC_MIXED_LEN(len),PetscErrorCode *ierr PETSC_END_LEN(len))
175c6c1daeSBarry Smith {
185c6c1daeSBarry Smith   char *t;
195c6c1daeSBarry Smith 
205c6c1daeSBarry Smith   FIXCHAR(type_name,len,t);
215c6c1daeSBarry Smith   *ierr = PetscViewerSetType(*x,t);
225c6c1daeSBarry Smith   FREECHAR(type_name,t);
235c6c1daeSBarry Smith }
245c6c1daeSBarry Smith 
25*8cc058d9SJed Brown PETSC_EXTERN void PETSC_STDCALL petscviewersetformat_(PetscViewer *vin,PetscViewerFormat *format,PetscErrorCode *ierr)
265c6c1daeSBarry Smith {
275c6c1daeSBarry Smith   PetscViewer v;
285c6c1daeSBarry Smith   PetscPatchDefaultViewers_Fortran(vin,v);
295c6c1daeSBarry Smith   *ierr = PetscViewerSetFormat(v,*format);
305c6c1daeSBarry Smith }
315c6c1daeSBarry Smith 
32*8cc058d9SJed Brown PETSC_EXTERN void PETSC_STDCALL petscviewerpushformat_(PetscViewer *vin,PetscViewerFormat *format,PetscErrorCode *ierr)
335c6c1daeSBarry Smith {
345c6c1daeSBarry Smith   PetscViewer v;
355c6c1daeSBarry Smith   PetscPatchDefaultViewers_Fortran(vin,v);
365c6c1daeSBarry Smith   *ierr = PetscViewerPushFormat(v,*format);
375c6c1daeSBarry Smith }
385c6c1daeSBarry Smith 
39*8cc058d9SJed Brown PETSC_EXTERN void PETSC_STDCALL petscviewerpopformat_(PetscViewer *vin,PetscErrorCode *ierr)
405c6c1daeSBarry Smith {
415c6c1daeSBarry Smith   PetscViewer v;
425c6c1daeSBarry Smith   PetscPatchDefaultViewers_Fortran(vin,v);
435c6c1daeSBarry Smith   *ierr = PetscViewerPopFormat(v);
445c6c1daeSBarry Smith }
45