⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 s_copy.c

📁 DTMK软件开发包,此为开源软件,是一款很好的医学图像开发资源.
💻 C
字号:
/* Unless compiled with -DNO_OVERWRITE, this variant of s_copy allows the
 * target of an assignment to appear on its right-hand side (contrary
 * to the Fortran 77 Standard, but in accordance with Fortran 90),
 * as in  a(2:5) = a(4:7) .
 */

#include "v3p_f2c.h"
#ifdef __cplusplus
extern "C" {
#endif

/* assign strings:  a = b */

#ifdef KR_headers
int s_copy(a, b, la, lb) char *a, *b; ftnlen la, lb;
#else
int s_copy(char *a, char *b, ftnlen la, ftnlen lb)
#endif
{
        register char *aend, *bend;

        aend = a + la;

        if(la <= lb)
#ifndef NO_OVERWRITE
                if (a <= b || a >= b + la)
#endif
                        while(a < aend)
                                *a++ = *b++;
#ifndef NO_OVERWRITE
                else
                        for(b += la; a < aend; )
                                *--aend = *--b;
#endif

        else {
                bend = b + lb;
#ifndef NO_OVERWRITE
                if (a <= b || a >= bend)
#endif
                        while(b < bend)
                                *a++ = *b++;
#ifndef NO_OVERWRITE
                else {
                        a += lb;
                        while(b < bend)
                                *--a = *--bend;
                        a += lb;
                        }
#endif
                while(a < aend)
                        *a++ = ' ';
                }
        return 0;
        }
#ifdef __cplusplus
}
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -