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  

parseSchedule.c File Reference

#include <stdio.h>

Go to the source code of this file.


Functions

int main (int argc, char **argv)

Function Documentation

int main int    argc,
char **    argv
 

Definition at line 13 of file parseSchedule.c.

References argc.

00014 {
00015     register int index;
00016     char input[256];
00017     long    IOtimes[256];
00018     int machineNum;
00019     int frameStart, frameEnd;
00020     long timeStart, timeEnd;
00021     long    minTime = 0x7fffffff;
00022     FILE    *filePtr;
00023     long    IOtime;
00024 
00025     for ( index = 0; index < 256; index++ )
00026         IOtimes[index] = 0;
00027 
00028     filePtr = fopen(argv[1], "r");
00029 
00030     while ( fgets(input, 256, filePtr) != NULL )
00031     {
00032         sscanf(input, "SCHEDULE:  MACHINE %d FRAMES %d-%d TIME %ld-%ld IOTIME %ld",
00033                &machineNum, &frameStart, &frameEnd, &timeStart, &timeEnd,
00034                &IOtime);
00035 
00036         if ( timeStart < minTime )
00037             minTime = timeStart;
00038     }
00039 
00040     fclose(filePtr);
00041 
00042     filePtr = fopen(argv[1], "r");
00043 
00044     while ( fgets(input, 256, filePtr) != NULL )
00045     {
00046         sscanf(input, "SCHEDULE:  MACHINE %d FRAMES %d-%d TIME %ld-%ld IOTIME %ld",
00047                &machineNum, &frameStart, &frameEnd, &timeStart, &timeEnd,
00048                &IOtime);
00049 
00050         fprintf(stdout, "SCHEDULE:  MACHINE %2d FRAMES %2d-%2d TIME %3d-%3d IOTIME %2d F/T/I %2d/%2d/%2d\n",
00051                 machineNum, frameStart, frameEnd,
00052                 timeStart-minTime, timeEnd-minTime,
00053                 IOtime-IOtimes[machineNum],
00054                 frameEnd-frameStart+1,
00055                 timeEnd-timeStart,
00056                 IOtime-IOtimes[machineNum]);
00057 
00058         IOtimes[machineNum] = IOtime;
00059     }
00060 
00061     fclose(filePtr);
00062 
00063     return 0;
00064 }
 

Powered by Plone

This site conforms to the following standards: