Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

s_copy.c

Go to the documentation of this file.
00001 /* Unless compiled with -DNO_OVERWRITE, this variant of s_copy allows the
00002  * target of an assignment to appear on its right-hand side (contrary
00003  * to the Fortran 77 Standard, but in accordance with Fortran 90),
00004  * as in  a(2:5) = a(4:7) .
00005  */
00006 
00007 #include "f2c.h"
00008 
00009 /* assign strings:  a = b */
00010 
00011 #ifdef KR_headers
00012 VOID s_copy(a, b, la, lb) register char *a, *b; ftnlen la, lb;
00013 #else
00014 void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb)
00015 #endif
00016 {
00017         register char *aend, *bend;
00018 
00019         aend = a + la;
00020 
00021         if(la <= lb)
00022 #ifndef NO_OVERWRITE
00023                 if (a <= b || a >= b + la)
00024 #endif
00025                         while(a < aend)
00026                                 *a++ = *b++;
00027 #ifndef NO_OVERWRITE
00028                 else
00029                         for(b += la; a < aend; )
00030                                 *--aend = *--b;
00031 #endif
00032 
00033         else {
00034                 bend = b + lb;
00035 #ifndef NO_OVERWRITE
00036                 if (a <= b || a >= bend)
00037 #endif
00038                         while(b < bend)
00039                                 *a++ = *b++;
00040 #ifndef NO_OVERWRITE
00041                 else {
00042                         a += lb;
00043                         while(b < bend)
00044                                 *--a = *--bend;
00045                         a += lb;
00046                         }
00047 #endif
00048                 while(a < aend)
00049                         *a++ = ' ';
00050                 }
00051         }
 

Powered by Plone

This site conforms to the following standards: