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  

thd_newprefix.c

Go to the documentation of this file.
00001 #include "mrilib.h"
00002 
00003 /*--------------------------------------------------------------------
00004   Attach a suffix to a dataset prefix to make a new one.
00005   Result is malloc()-ed and can be free()-ed if you don't
00006   want it anymore.  -- 16 Feb 2001 -- RWCox
00007 ----------------------------------------------------------------------*/
00008 
00009 char * THD_newprefix( THD_3dim_dataset *dset , char *suffix )
00010 {
00011    char *np ;
00012 
00013 ENTRY("THD_newprefix") ;
00014 
00015    if( !ISVALID_DSET(dset) ){
00016       np = (suffix == NULL || suffix[0] == '\0') ? strdup("none")
00017                                                  : strdup(suffix) ;
00018    } else {
00019       np = (char *) malloc( strlen(DSET_PREFIX(dset)) + strlen(suffix) + 1 ) ;
00020       strcpy(np,DSET_PREFIX(dset)) ; strcat(np,suffix) ;
00021    }
00022 
00023    RETURN(np) ;
00024 }
 

Powered by Plone

This site conforms to the following standards: