15c6c1daeSBarry Smith #include <petsc-private/fortranimpl.h> 2*665c2dedSJed 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 165c6c1daeSBarry Smith EXTERN_C_BEGIN 175c6c1daeSBarry Smith 185c6c1daeSBarry Smith void PETSC_STDCALL petscviewersettype_(PetscViewer *x,CHAR type_name PETSC_MIXED_LEN(len),PetscErrorCode *ierr PETSC_END_LEN(len)) 195c6c1daeSBarry Smith { 205c6c1daeSBarry Smith char *t; 215c6c1daeSBarry Smith 225c6c1daeSBarry Smith FIXCHAR(type_name,len,t); 235c6c1daeSBarry Smith *ierr = PetscViewerSetType(*x,t); 245c6c1daeSBarry Smith FREECHAR(type_name,t); 255c6c1daeSBarry Smith } 265c6c1daeSBarry Smith 275c6c1daeSBarry Smith void PETSC_STDCALL petscviewersetformat_(PetscViewer *vin,PetscViewerFormat *format,PetscErrorCode *ierr) 285c6c1daeSBarry Smith { 295c6c1daeSBarry Smith PetscViewer v; 305c6c1daeSBarry Smith PetscPatchDefaultViewers_Fortran(vin,v); 315c6c1daeSBarry Smith *ierr = PetscViewerSetFormat(v,*format); 325c6c1daeSBarry Smith } 335c6c1daeSBarry Smith 345c6c1daeSBarry Smith void PETSC_STDCALL petscviewerpushformat_(PetscViewer *vin,PetscViewerFormat *format,PetscErrorCode *ierr) 355c6c1daeSBarry Smith { 365c6c1daeSBarry Smith PetscViewer v; 375c6c1daeSBarry Smith PetscPatchDefaultViewers_Fortran(vin,v); 385c6c1daeSBarry Smith *ierr = PetscViewerPushFormat(v,*format); 395c6c1daeSBarry Smith } 405c6c1daeSBarry Smith 415c6c1daeSBarry Smith void PETSC_STDCALL petscviewerpopformat_(PetscViewer *vin,PetscErrorCode *ierr) 425c6c1daeSBarry Smith { 435c6c1daeSBarry Smith PetscViewer v; 445c6c1daeSBarry Smith PetscPatchDefaultViewers_Fortran(vin,v); 455c6c1daeSBarry Smith *ierr = PetscViewerPopFormat(v); 465c6c1daeSBarry Smith } 475c6c1daeSBarry Smith 485c6c1daeSBarry Smith EXTERN_C_END 49