1af0996ceSBarry 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 9*1cb03803SBarry Smith #define petscviewerandformatcreate_ PETSCVIEWERANDFORMATCREATE 10*1cb03803SBarry Smith #define petscviewerandformatdestroy_ PETSCVIEWERANDFORMATDESTROY 115c6c1daeSBarry Smith #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) 125c6c1daeSBarry Smith #define petscviewersetformat_ petscviewersetformat 135c6c1daeSBarry Smith #define petscviewersettype_ petscviewersettype 145c6c1daeSBarry Smith #define petscviewerpushformat_ petscviewerpushformat 155c6c1daeSBarry Smith #define petscviewerpopformat_ petscviewerpopformat 16*1cb03803SBarry Smith #define petscviewerandformatcreate_ petscviewerandformatcreate 17*1cb03803SBarry Smith #define petscviewerandformatdestroy_ petscviewerandformatdestroy 185c6c1daeSBarry Smith #endif 195c6c1daeSBarry Smith 206a9046bcSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerSetFormatDeprecated(PetscViewer,PetscViewerFormat); 216a9046bcSBarry Smith 22*1cb03803SBarry Smith PETSC_EXTERN void PETSC_STDCALL petscviewerandformatcreate_(PetscViewer *vin,PetscViewerFormat *format,PetscViewerAndFormat **vf,PetscErrorCode *ierr) 23*1cb03803SBarry Smith { 24*1cb03803SBarry Smith PetscViewer v; 25*1cb03803SBarry Smith PetscPatchDefaultViewers_Fortran(vin,v); 26*1cb03803SBarry Smith *ierr = PetscViewerAndFormatCreate(v,*format,vf); 27*1cb03803SBarry Smith } 28*1cb03803SBarry Smith 29*1cb03803SBarry Smith PETSC_EXTERN void PETSC_STDCALL petscviewerandformatdestroy_(PetscViewerAndFormat **vf,PetscErrorCode *ierr) 30*1cb03803SBarry Smith { 31*1cb03803SBarry Smith *ierr = PetscViewerAndFormatDestroy(vf); 32*1cb03803SBarry Smith } 33*1cb03803SBarry Smith 346a9046bcSBarry Smith PETSC_EXTERN void PETSC_STDCALL petscviewersetformat_(PetscViewer *vin,PetscViewerFormat *format,PetscErrorCode *ierr) 356a9046bcSBarry Smith { 366a9046bcSBarry Smith PetscViewer v; 376a9046bcSBarry Smith PetscPatchDefaultViewers_Fortran(vin,v); 386a9046bcSBarry Smith *ierr = PetscViewerSetFormatDeprecated(v,*format); 396a9046bcSBarry Smith } 406a9046bcSBarry Smith 418cc058d9SJed Brown PETSC_EXTERN void PETSC_STDCALL petscviewersettype_(PetscViewer *x,CHAR type_name PETSC_MIXED_LEN(len),PetscErrorCode *ierr PETSC_END_LEN(len)) 425c6c1daeSBarry Smith { 435c6c1daeSBarry Smith char *t; 445c6c1daeSBarry Smith 455c6c1daeSBarry Smith FIXCHAR(type_name,len,t); 465c6c1daeSBarry Smith *ierr = PetscViewerSetType(*x,t); 475c6c1daeSBarry Smith FREECHAR(type_name,t); 485c6c1daeSBarry Smith } 495c6c1daeSBarry Smith 506a9046bcSBarry Smith 515c6c1daeSBarry Smith 528cc058d9SJed Brown PETSC_EXTERN void PETSC_STDCALL petscviewerpushformat_(PetscViewer *vin,PetscViewerFormat *format,PetscErrorCode *ierr) 535c6c1daeSBarry Smith { 545c6c1daeSBarry Smith PetscViewer v; 555c6c1daeSBarry Smith PetscPatchDefaultViewers_Fortran(vin,v); 565c6c1daeSBarry Smith *ierr = PetscViewerPushFormat(v,*format); 575c6c1daeSBarry Smith } 585c6c1daeSBarry Smith 598cc058d9SJed Brown PETSC_EXTERN void PETSC_STDCALL petscviewerpopformat_(PetscViewer *vin,PetscErrorCode *ierr) 605c6c1daeSBarry Smith { 615c6c1daeSBarry Smith PetscViewer v; 625c6c1daeSBarry Smith PetscPatchDefaultViewers_Fortran(vin,v); 635c6c1daeSBarry Smith *ierr = PetscViewerPopFormat(v); 645c6c1daeSBarry Smith } 65