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  

mri_add_name.c

Go to the documentation of this file.
00001 /*****************************************************************************
00002    Major portions of this software are copyrighted by the Medical College
00003    of Wisconsin, 1994-2000, and are released under the Gnu General Public
00004    License, Version 2.  See the file README.Copyright for details.
00005 ******************************************************************************/
00006 
00007 #include "mrilib.h"
00008 #include <string.h>
00009 
00010 /*** 7D SAFE ***/
00011 
00012 /*** Copy a string into the image structure;
00013      The usual use is to remember the input filename ***/
00014 
00015 void mri_add_name( char *str , MRI_IMAGE *im )
00016 {
00017    int ll ;
00018 
00019 ENTRY("mri_add_name") ;
00020    if( im == NULL ) EXRETURN ;  /* 29 Mar 2002 */
00021 
00022    if( im->name != NULL ){ free( im->name ) ; im->name = NULL ; }
00023 
00024    if( str == NULL ) EXRETURN ;
00025 
00026    ll = strlen(str) ; if( ll <= 0 ) EXRETURN ;
00027 
00028    im->name = (char *) malloc( ll+1 ) ;
00029    strcpy( im->name , str ) ;
00030    EXRETURN ;
00031 }
00032 
00033 #ifdef USE_MRI_DELAY
00034 void mri_add_fname_delay( char *str , MRI_IMAGE *im )
00035 {
00036    int ll ;
00037 
00038 ENTRY("mri_add_fname_delay") ;
00039 
00040    if( im == NULL ) EXRETURN ;  /* 29 Mar 2002 */
00041 
00042    if( im->fname != NULL ){ free( im->fname ) ; im->fname = NULL ; }
00043 
00044    if( str == NULL ) EXRETURN ;
00045 
00046    ll = strlen(str) ; if( ll <= 0 ) EXRETURN ;
00047 
00048    im->fname = (char *) malloc( ll+1 ) ;
00049    strcpy( im->fname , str ) ;
00050    EXRETURN ;
00051 }
00052 #endif
 

Powered by Plone

This site conforms to the following standards: