✨ Enable use of command line options
This commit is contained in:
parent
313f65609f
commit
43614e1498
6 changed files with 137 additions and 20 deletions
|
@ -19,6 +19,19 @@ void readBytesIntoBuffer(uint8_t* buffer, long numBytes) {
|
|||
}
|
||||
|
||||
|
||||
//Skips the given amount of bytes in the file
|
||||
void skipBytes(long numBytes) {
|
||||
const int result = fseek(file.filePointer, numBytes, SEEK_CUR);
|
||||
|
||||
if (result != 0) {
|
||||
fprintf(stderr, "Could not skip %lu bytes from file: %s\n", numBytes, strerror(errno));
|
||||
exit(1);
|
||||
} else {
|
||||
file.offset += numBytes;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Closes the currently opened file and opens the next file at its beginning.
|
||||
void openNextFile() {
|
||||
const int closeResult = fclose(file.filePointer);
|
||||
|
|
|
@ -17,5 +17,9 @@ struct FILE_INFO file;
|
|||
void readBytesIntoBuffer(uint8_t* buffer, long numBytes);
|
||||
|
||||
|
||||
//Skips the given amount of bytes in the file
|
||||
void skipBytes(long numBytes);
|
||||
|
||||
|
||||
//Closes the currently opened file and opens the next file at its beginning.
|
||||
void openNextFile();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue