ansilove

ANSI and ASCII art to PNG converter in C
Log | Files | Refs | README | LICENSE

commit c6ad4b8aa10e59b7125daa1c42c84754350cf54b
parent 80707ea4bf886e6ff90e0567366d0293650dcaa3
Author: Frederic Cambus <fred@statdns.com>
Date:   Fri, 23 Nov 2018 17:06:18 +0100

Use OpenBSD style(9) for function prototypes and declarations

Diffstat:
MTODO | 1-
Msrc/main.c | 20+++++++++++++++-----
Msrc/sauce.c | 12++++++++----
Msrc/sauce.h | 8++++----
Msrc/strtolower.c | 3++-
Msrc/strtolower.h | 2+-
6 files changed, 30 insertions(+), 16 deletions(-)

diff --git a/TODO b/TODO @@ -1,4 +1,3 @@ - Import documentation from Ansilove/PHP - Display mode information in summary, and DOS aspect if enabled - Use include-what-you-use to remove unnecessary headers -- Use OpenBSD style(9) for function prototypes and declarations? diff --git a/src/main.c b/src/main.c @@ -37,7 +37,9 @@ static void listExamples(void); static void versionInfo(void); static void synopsis(void); -static void showHelp(void) { +static void +showHelp(void) +{ fprintf(stderr, "\nSUPPORTED FILE TYPES:\n" " ANS PCB BIN ADF IDF TND XB\n" " Files with custom suffix default to the ANSI renderer.\n\n" @@ -61,7 +63,9 @@ static void showHelp(void) { " <https://github.com/ansilove/ansilove>\n\n"); } -static void listExamples(void) { +static void +listExamples(void) +{ fprintf(stderr, "\nEXAMPLES:\n"); fprintf(stderr, " ansilove file.ans (output path/name identical to input, no options)\n" " ansilove -i file.ans (enable iCE colors)\n" @@ -75,7 +79,9 @@ static void listExamples(void) { "\n"); } -static void versionInfo(void) { +static void +versionInfo(void) +{ fprintf(stderr, "All rights reserved.\n" "\nFork me on GitHub: <https://github.com/ansilove/ansilove>\n" "Bug reports: <https://github.com/ansilove/ansilove/issues>\n\n" @@ -84,7 +90,9 @@ static void versionInfo(void) { } // following the IEEE Std 1003.1 for utility conventions -static void synopsis(void) { +static void +synopsis(void) +{ fprintf(stderr, "\nSYNOPSIS:\n" " ansilove [options] file\n" " ansilove -e | -h | -v\n\n" @@ -108,7 +116,9 @@ static void synopsis(void) { "\n"); } -int main(int argc, char *argv[]) { +int +main(int argc, char *argv[]) +{ fprintf(stderr, "AnsiLove/C %s - ANSI / ASCII art to PNG converter\n" \ "Copyright (c) 2011-2018 Stefan Vogt, Brian Cassidy, and Frederic Cambus.\n", VERSION); diff --git a/src/sauce.c b/src/sauce.c @@ -12,7 +12,8 @@ #include "sauce.h" // Reads SAUCE via a filename. -sauce *sauceReadFileName(char *fileName) +sauce * +sauceReadFileName(char *fileName) { FILE *file = fopen(fileName, "r"); if (file == NULL) { @@ -25,7 +26,8 @@ sauce *sauceReadFileName(char *fileName) } // Read SAUCE via a FILE pointer. -sauce *sauceReadFile(FILE *file) +sauce * +sauceReadFile(FILE *file) { sauce *record; record = malloc(sizeof *record); @@ -36,7 +38,8 @@ sauce *sauceReadFile(FILE *file) return record; } -void readRecord(FILE *file, sauce *record) +void +readRecord(FILE *file, sauce *record) { if (fseek(file, 0 - RECORD_SIZE, SEEK_END) != EXIT_SUCCESS) { free(record); @@ -91,7 +94,8 @@ void readRecord(FILE *file, sauce *record) } } -int readComments(FILE *file, char **comment_lines, int32_t comments) +int +readComments(FILE *file, char **comment_lines, int32_t comments) { int32_t i; diff --git a/src/sauce.h b/src/sauce.h @@ -44,9 +44,9 @@ typedef struct { char **comment_lines; } sauce; -sauce *sauceReadFileName(char *fileName); -sauce *sauceReadFile(FILE *file); -void readRecord(FILE *file, sauce *record); -int readComments(FILE *file, char **comment_lines, int32_t comments); +sauce *sauceReadFileName(char *fileName); +sauce *sauceReadFile(FILE *file); +void readRecord(FILE *file, sauce *record); +int readComments(FILE *file, char **comment_lines, int32_t comments); #endif diff --git a/src/strtolower.c b/src/strtolower.c @@ -11,7 +11,8 @@ #include "strtolower.h" -char *strtolower(char *str) +char * +strtolower(char *str) { char *p = str; diff --git a/src/strtolower.h b/src/strtolower.h @@ -18,6 +18,6 @@ // In-place modification of a string to be all lower case. -char *strtolower(char *str); +char *strtolower(char *str); #endif