scandsp/src/optparser.cxx
// ==========================================================================
// Track the block of code which begins at the 1536th byte of a .opt file.
// This contains a list of project name/file name pairs.  All that's really
// used out of this is the count.  1536=384*4.
//
Track the block of code which begins at the 1536th byte of a .opt file.
This contains a list of project name/file name pairs.  All that's really
used out of this is the count.
Track the block of code which begins at the 1536th byte of a . opt file . This contains a list of project name / file name pairs . All that ' s really used out of this is the count .
void OptParser::track384(char ch)
{
    bool starting_project = false;
    bool starting_file = false;
    if (t384.counting >= 0) {
	if (t384.counting == 4) {
	    t384.project.start(ch);
            starting_project = true;
	    t384.counting = -1;
	}
	else {
            t384.counting += 1;
	}
    }
    else if (t384.project.atEnd()) {
	t384.file.start(ch);
        starting_file = true;
    }
    else if (t384.file.atEnd()) {
	t384.projsCount += 1;
	if (t384.projsCount < nProjs) {
	    t384.counting = 1;
	}
    }
    else if (circle.trackCount() == 384*4+4) {
	if (bufAt(circle, "\x00\x00\x00\x00", 4)) {
	}
	else if (bufAt(circle, "\x01\x00\x05\x00", 4)) {
	    t384.need_proj_count = true;
	}
	else {
	    noteWarning("Unexpected data at 384*4");
	}
    }
    else if (t384.need_proj_count && circle.trackCount() == 384*4+8) {
	nProjs = getBufShort(circle, -2);
        t384.projsCount = 0;
	if (nProjs > 0) {
	    t384.project.start(ch);
            starting_project = true;
	}
    }
    if (!starting_project) {
        t384.project.track(ch);
    }
    if (!starting_file) {
        t384.file.track(ch);
    }
}
void OptParser :: track384 ( char ch ) { bool starting_project = false ; bool starting_file = false ; if ( t384 . counting >= 0 ) { if ( t384 . counting == 4 ) { t384 . project . start ( ch ) ; starting_project = true ; t384 . counting = -1 ; } else { t384 . counting += 1 ; } } else if ( t384 . project . atEnd ( ) ) { t384 . file . start ( ch ) ; starting_file = true ; } else if ( t384 . file . atEnd ( ) ) { t384 . projsCount += 1 ; if ( t384 . projsCount < nProjs ) { t384 . counting = 1 ; } } else if ( circle . trackCount ( ) == 384 * 4 + 4 ) { if ( bufAt ( circle , " \x00 \x00 \x00 \x00 " , 4 ) ) { } else if ( bufAt ( circle , " \x01 \x00 \x05 \x00 " , 4 ) ) { t384 . need_proj_count = true ; } else { noteWarning ( " " ) ; } } else if ( t384 . need_proj_count && circle . trackCount ( ) == 384 * 4 + 8 ) { nProjs = getBufShort ( circle , -2 ) ; t384 . projsCount = 0 ; if ( nProjs > 0 ) { t384 . project . start ( ch ) ; starting_project = true ; } } if ( ! starting_project ) { t384 . project . track ( ch ) ; } if ( ! starting_file ) { t384 . file . track ( ch ) ; } }
Track the block of code which begins at the 1536th byte of a .opt file.
Track the block of code which begins at the 1536th byte of a . opt file .
// Counting the 4 bytes between one pair and the next. // At the end of a project name, start tracking the file name. // At the end of a file name, if this is not the last project // then count 4 bytes to the next pair. // cout << "Matchup of project \"" << t384.project.name() //      << "\" with file \"" << t384.file.name() << "\"" << endl; // Note the beginning of the interesting block. // Get the count of projects. // cout << "Number of projects is " << nProjs << "." << endl; // Track a project name. // Track a file name.