Date: 2025-03-29T05:58:46+00:00

Actual source code: zstrf.c

      1: #include <petsc/private/ftnimpl.h>

      3: #if defined(PETSC_HAVE_FORTRAN_CAPS)
      4:   #define petscstrncpy_ PETSCSTRNCPY
      5: #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
      6:   #define petscstrncpy_ petscstrncpy
      7: #endif

      9: PETSC_EXTERN void petscstrncpy_(char *s1, char *s2, int *n, PetscErrorCode *ierr, PETSC_FORTRAN_CHARLEN_T len1, PETSC_FORTRAN_CHARLEN_T len2)
     10: {
     11:   char                   *t1, *t2;
     12:   PETSC_FORTRAN_CHARLEN_T m;

     14:   t1 = s1;
     15:   t2 = s2;
     16:   m  = (PETSC_FORTRAN_CHARLEN_T)*n;
     17:   if (len1 < m) m = len1;
     18:   if (len2 < m) m = len2;
     19:   *ierr = PetscStrncpy(t1, t2, m);
     20: }