1 #include <petsc/private/fortranimpl.h> 2 3 #if defined(PETSC_HAVE_FORTRAN_CAPS) 4 #define petscbinaryopen_ PETSCBINARYOPEN 5 #define petscbinaryread_ PETSCBINARYREAD 6 #define petsctestfile_ PETSCTESTFILE 7 #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) 8 #define petscbinaryopen_ petscbinaryopen 9 #define petscbinaryread_ petscbinaryread 10 #define petsctestfile_ petsctestfile 11 #endif 12 13 PETSC_EXTERN void PETSC_STDCALL petscbinaryopen_(char* name PETSC_MIXED_LEN(len),PetscFileMode *type,int *fd, 14 PetscErrorCode *ierr PETSC_END_LEN(len)) 15 { 16 char *c1; 17 18 FIXCHAR(name,len,c1); 19 *ierr = PetscBinaryOpen(c1,*type,fd);if (*ierr) return; 20 FREECHAR(name,c1); 21 } 22 23 PETSC_EXTERN void PETSC_STDCALL petscbinaryread_(int *fd,void *data,PetscInt *num,PetscInt *count,PetscDataType *type,int *ierr) 24 { 25 CHKFORTRANNULLINTEGER(count); 26 *ierr = PetscBinaryRead(*fd,data,*num,count,*type);if (*ierr) return; 27 } 28 29 PETSC_EXTERN void PETSC_STDCALL petsctestfile_(char* name PETSC_MIXED_LEN(len),char* mode PETSC_MIXED_LEN(len1),PetscBool *flg,PetscErrorCode *ierr PETSC_END_LEN(len) PETSC_END_LEN(len1)) 30 { 31 char *c1; 32 33 FIXCHAR(name,len,c1); 34 *ierr = PetscTestFile(c1,*mode,flg);if (*ierr) return; 35 FREECHAR(name,c1); 36 } 37