Doxygen Source Code Documentation
afni_vcheck.c File Reference
#include "afni.h"Go to the source code of this file.
Defines | |
| #define | VERSION_URL "http://afni.nimh.nih.gov/afni/AFNI.version" |
| #define | VERSION_FILE "/Volumes/afni/var/www/html/pub/dist/AFNI.version" |
Functions | |
| int | main (int argc, char *argv[]) |
Define Documentation
|
|
Definition at line 11 of file afni_vcheck.c. Referenced by main(). |
|
|
Definition at line 9 of file afni_vcheck.c. Referenced by main(). |
Function Documentation
|
||||||||||||
|
convert DTIStudio fiber format data to SUMA segment data Definition at line 18 of file afni_vcheck.c. References argc, EXIT, machdep(), read_URL(), VERSION_FILE, and VERSION_URL.
00019 {
00020 int nbuf ;
00021 char *vbuf=NULL ,
00022 vv[128]="none" ;
00023
00024 /*-- for my use only: write out the new version file --*/
00025
00026 if( argc == 2 && strcmp(argv[1],"-write") == 0 ){
00027 FILE *fp = fopen(VERSION_FILE,"w") ;
00028 if( fp == NULL ){
00029 fprintf(stderr,"** Failed to open %s!\n",VERSION_FILE); EXIT(1);
00030 }
00031 fprintf( fp , "%s\n%s\n" , VERSION , "no date given" ) ;
00032 fclose(fp) ;
00033 fprintf(stderr,"Wrote out %s\n",VERSION_FILE) ;
00034 exit(0) ;
00035 }
00036
00037 machdep() ;
00038
00039 /*-- otherwise, any options means the user needs help --*/
00040
00041 if( argc > 1 ){
00042 printf("Usage: afni_version\n"
00043 " Prints out the AFNI version with which it was compiled,\n"
00044 " and checks across the Web for the latest version available.\n"
00045 "N.B.: Doing the check across the Web will mean that your\n"
00046 " computer's access to our server will be logged here.\n"
00047 " If you don't want this, don't use this program!\n" ) ;
00048 exit(0) ;
00049 }
00050
00051 /*-- internal information --*/
00052
00053 printf("This program was compiled with the following settings:\n"
00054 " Version ID = %s\n" , VERSION ) ;
00055
00056 fprintf(stderr,"++ now fetching %s",VERSION_URL) ;
00057
00058 /*-- get information from the master computer --*/
00059
00060 nbuf = read_URL( VERSION_URL , &vbuf ) ; /* see thd_http.c */
00061 fprintf(stderr,"\n") ;
00062
00063 if( nbuf <= 0 || vbuf == NULL || vbuf[0] == '\0' ){
00064 fprintf(stderr,"** Error in fetch!\n"); EXIT(1);
00065 }
00066
00067 sscanf( vbuf , "%127s" , vv ) ;
00068
00069 printf("Latest version listed at AFNI web site:\n"
00070 " Version ID = %s\n" , vv ) ;
00071
00072 exit(0) ;
00073 }
|