c@427: /* Unless compiled with -DNO_OVERWRITE, this variant of s_copy allows the c@427: * target of an assignment to appear on its right-hand side (contrary c@427: * to the Fortran 77 Standard, but in accordance with Fortran 90), c@427: * as in a(2:5) = a(4:7) . c@427: */ c@427: c@427: #include "f2c.h" c@427: #ifdef __cplusplus c@427: extern "C" { c@427: #endif c@427: c@427: /* assign strings: a = b */ c@427: c@427: #ifdef KR_headers c@427: VOID s_copy(a, b, la, lb) register char *a, *b; ftnlen la, lb; c@427: #else c@427: void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb) c@427: #endif c@427: { c@427: register char *aend, *bend; c@427: c@427: aend = a + la; c@427: c@427: if(la <= lb) c@427: #ifndef NO_OVERWRITE c@427: if (a <= b || a >= b + la) c@427: #endif c@427: while(a < aend) c@427: *a++ = *b++; c@427: #ifndef NO_OVERWRITE c@427: else c@427: for(b += la; a < aend; ) c@427: *--aend = *--b; c@427: #endif c@427: c@427: else { c@427: bend = b + lb; c@427: #ifndef NO_OVERWRITE c@427: if (a <= b || a >= bend) c@427: #endif c@427: while(b < bend) c@427: *a++ = *b++; c@427: #ifndef NO_OVERWRITE c@427: else { c@427: a += lb; c@427: while(b < bend) c@427: *--a = *--bend; c@427: a += lb; c@427: } c@427: #endif c@427: while(a < aend) c@427: *a++ = ' '; c@427: } c@427: } c@427: #ifdef __cplusplus c@427: } c@427: #endif