removed obsolete ffRead functions

This commit is contained in:
Linus Dierheimer
2021-02-19 16:38:54 +01:00
parent a8f165e5c9
commit f533767569
2 changed files with 5 additions and 33 deletions
+5 -31
View File
@@ -13,37 +13,6 @@ void ffPrintLogoAndKey(FFstate* state, const char* key)
ffPrintKey(state, key);
}
uint32_t ffTruncateLastNewline(char* buffer, uint32_t read)
{
if(read == 0)
return read;
if(buffer[read - 1] == '\n')
{
buffer[read - 1] = '\0';
--read;
}
return read;
}
uint32_t ffReadFile(const char* fileName, char* buffer, uint32_t bufferSize)
{
FILE* file = fopen(fileName, "r");
if(file == NULL)
{
buffer[0] = '\0';
return 0;
}
uint32_t read = fread(buffer, sizeof(char), bufferSize, file);
read = ffTruncateLastNewline(buffer, read);
fclose(file);
return read;
}
void ffParsePropFile(const char* fileName, const char* regex, char* buffer)
{
buffer[0] = '\0'; //If an error occures, this is the indicator
@@ -202,6 +171,11 @@ int main(int argc, char** argv)
strcpy(state.color, argv[i + 1]);
++i;
}
else
{
printf("Error: unknown options: %s\n", argv[i]);
return 43;
}
}
//Start the printing
-2
View File
@@ -42,8 +42,6 @@ typedef struct FFstate
void ffPrintLogoLine(FFstate* state);
void ffPrintKey(FFstate* state, const char* key);
void ffPrintLogoAndKey(FFstate* state, const char* key);
uint32_t ffTruncateLastNewline(char* buffer, uint32_t bufferSize);
uint32_t ffReadFile(const char* fileName, char* buffer, uint32_t bufferSize);
void ffParsePropFile(const char* file, const char* regex, char* buffer);
void ffParsePropFileHome(FFstate* state, const char* relativeFile, const char* regex, char* buffer);
void ffPrintGtkPretty(const char* gtk2, const char* gtk3, const char* gtk4);