Skip to content

Commit

Permalink
Tab->spc 1_XXX
Browse files Browse the repository at this point in the history
  • Loading branch information
billkarsh committed Oct 4, 2016
1 parent fbeaf88 commit 80328da
Show file tree
Hide file tree
Showing 130 changed files with 19,232 additions and 19,232 deletions.
98 changes: 49 additions & 49 deletions 1_CpyFMs/CpyFMs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
class CArgs_ldir {

public:
const char *infile,
*outdir;
const char *infile,
*outdir;

public:
CArgs_ldir() : infile(NULL), outdir("NoSuch") {};
CArgs_ldir() : infile(NULL), outdir("NoSuch") {};

void SetCmdLine( int argc, char* argv[] );
void SetCmdLine( int argc, char* argv[] );
};

/* --------------------------------------------------------------- */
Expand All @@ -53,45 +53,45 @@ void CArgs_ldir::SetCmdLine( int argc, char* argv[] )
{
// start log

flog = FileOpenOrDie( "CpyFMs.log", "w" );
flog = FileOpenOrDie( "CpyFMs.log", "w" );

// log start time

time_t t0 = time( NULL );
char atime[32];
time_t t0 = time( NULL );
char atime[32];

strcpy( atime, ctime( &t0 ) );
atime[24] = '\0'; // remove the newline
strcpy( atime, ctime( &t0 ) );
atime[24] = '\0'; // remove the newline

fprintf( flog, "Start: %s ", atime );
fprintf( flog, "Start: %s ", atime );

// parse command line args

if( argc < 3 ) {
printf( "Usage: CpyFMs <txt-file> -d=<workdir>.\n" );
exit( 42 );
}
if( argc < 3 ) {
printf( "Usage: CpyFMs <txt-file> -d=<workdir>.\n" );
exit( 42 );
}

for( int i = 1; i < argc; ++i ) {
for( int i = 1; i < argc; ++i ) {

// echo to log
fprintf( flog, "%s ", argv[i] );
// echo to log
fprintf( flog, "%s ", argv[i] );

if( argv[i][0] != '-' )
infile = argv[i];
else if( GetArgStr( outdir, "-d=", argv[i] ) )
;
else {
printf( "Did not understand option '%s'.\n", argv[i] );
exit( 42 );
}
}
if( argv[i][0] != '-' )
infile = argv[i];
else if( GetArgStr( outdir, "-d=", argv[i] ) )
;
else {
printf( "Did not understand option '%s'.\n", argv[i] );
exit( 42 );
}
}

fprintf( flog, "\n\n" );
fflush( flog );
fprintf( flog, "\n\n" );
fflush( flog );

freopen( "CpyFMs.log", "a", stdout );
freopen( "CpyFMs.log", "a", stderr );
freopen( "CpyFMs.log", "a", stdout );
freopen( "CpyFMs.log", "a", stderr );
}

/* --------------------------------------------------------------- */
Expand All @@ -100,28 +100,28 @@ void CArgs_ldir::SetCmdLine( int argc, char* argv[] )

static void Process()
{
FILE *f = FileOpenOrDie( gArgs.infile, "r", flog );
CLineScan LS;
FILE *f = FileOpenOrDie( gArgs.infile, "r", flog );
CLineScan LS;

for(;;) {
for(;;) {

char path[2048], cmd[2048];
int z, id;
char path[2048], cmd[2048];
int z, id;

if( LS.Get( f ) <= 0 )
break;
if( LS.Get( f ) <= 0 )
break;

sscanf( LS.line, "%d;%d;%[^;]", &z, &id, path );
sscanf( LS.line, "%d;%d;%[^;]", &z, &id, path );

sprintf( cmd, "cp '%s' '%s/%d/%d/fm.tif'",
path, gArgs.outdir, z, id );
sprintf( cmd, "cp '%s' '%s/%d/%d/fm.tif'",
path, gArgs.outdir, z, id );

fprintf( flog, "%s\n", cmd );
fprintf( flog, "%s\n", cmd );

system( cmd );
}
system( cmd );
}

fclose( f );
fclose( f );
}

/* --------------------------------------------------------------- */
Expand All @@ -134,22 +134,22 @@ int main( int argc, char* argv[] )
/* Parse command line */
/* ------------------ */

gArgs.SetCmdLine( argc, argv );
gArgs.SetCmdLine( argc, argv );

/* ------- */
/* Process */
/* ------- */

Process();
Process();

/* ---- */
/* Done */
/* ---- */

fprintf( flog, "\n" );
fclose( flog );
fprintf( flog, "\n" );
fclose( flog );

return 0;
return 0;
}


4 changes: 2 additions & 2 deletions 1_CpyFMs/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ objs = ${files:.cpp=.o}
all : $(appname)

clean :
rm -f *.o
rm -f *.o

$(appname) : .CHECK_GENLIB ${objs}
$(CC) $(LFLAGS) ${objs} $(LINKS_STD) $(OUTPUT)
$(CC) $(LFLAGS) ${objs} $(LINKS_STD) $(OUTPUT)

28 changes: 14 additions & 14 deletions 1_Cross_CarveBlocks/countdowndirs.sht
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ export MRC_TRIM=12

if (($# == 1))
then
last=$1
last=$1
else
last=$2
last=$2
fi

cd ..
Expand All @@ -21,17 +21,17 @@ cnt=0

for lyr in $(seq $1 $last)
do
if [ -d "$lyr" ]
then
cd $lyr

for jb in $(ls -d * | grep -E 'D[0-9]{1,}_[0-9]{1,}')
do
cnt=$(($cnt+1))
done

echo z= $lyr cum= $cnt
cd ..
fi
if [ -d "$lyr" ]
then
cd $lyr

for jb in $(ls -d * | grep -E 'D[0-9]{1,}_[0-9]{1,}')
do
cnt=$(($cnt+1))
done

echo z= $lyr cum= $cnt
cd ..
fi
done

Loading

0 comments on commit 80328da

Please sign in to comment.