Actual source code: ztsregf.c

  1: #include <petsc/private/fortranimpl.h>
  2: #include <petscts.h>

  4: #if defined(PETSC_HAVE_FORTRAN_CAPS)
  5:   #define tssettype_ TSSETTYPE
  6:   #define tsgettype_ TSGETTYPE
  7: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
  8:   #define tssettype_ tssettype
  9:   #define tsgettype_ tsgettype
 10: #endif

 12: PETSC_EXTERN void tssettype_(TS *ts, char *type, PetscErrorCode *ierr, PETSC_FORTRAN_CHARLEN_T len)
 13: {
 14:   char *t;

 16:   FIXCHAR(type, len, t);
 17:   *ierr = TSSetType(*ts, t);
 18:   if (*ierr) return;
 19:   FREECHAR(type, t);
 20: }

 22: PETSC_EXTERN void tsgettype_(TS *ts, char *name, PetscErrorCode *ierr, PETSC_FORTRAN_CHARLEN_T len)
 23: {
 24:   const char *tname;

 26:   *ierr = TSGetType(*ts, &tname);
 27:   *ierr = PetscStrncpy(name, tname, len);
 28:   FIXRETURNCHAR(PETSC_TRUE, name, len);
 29: }