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 91cb03803SBarry Smith #define petscviewerandformatcreate_ PETSCVIEWERANDFORMATCREATE 101cb03803SBarry 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 161cb03803SBarry Smith #define petscviewerandformatcreate_ petscviewerandformatcreate 171cb03803SBarry Smith #define petscviewerandformatdestroy_ petscviewerandformatdestroy 185c6c1daeSBarry Smith #endif 195c6c1daeSBarry Smith 206a9046bcSBarry Smith PETSC_EXTERN PetscErrorCode PetscViewerSetFormatDeprecated(PetscViewer,PetscViewerFormat); 216a9046bcSBarry Smith 221cb03803SBarry Smith PETSC_EXTERN void PETSC_STDCALL petscviewerandformatcreate_(PetscViewer *vin,PetscViewerFormat *format,PetscViewerAndFormat **vf,PetscErrorCode *ierr) 231cb03803SBarry Smith { 241cb03803SBarry Smith PetscViewer v; 251cb03803SBarry Smith PetscPatchDefaultViewers_Fortran(vin,v); 261cb03803SBarry Smith *ierr = PetscViewerAndFormatCreate(v,*format,vf); 271cb03803SBarry Smith } 281cb03803SBarry Smith 29*732dd666SBarry Smith PETSC_EXTERN void petscviewerandformatdestroy_(PetscViewerAndFormat **vf,PetscErrorCode *ierr) 301cb03803SBarry Smith { 311cb03803SBarry Smith *ierr = PetscViewerAndFormatDestroy(vf); 321cb03803SBarry Smith } 331cb03803SBarry 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