int cascade_element_show = EL_CASCADE_INACTIVE(cascade_element);
char *headline = element_info[cascade_element_show].editor_description;
- printf_line_with_prefix("# ", "-", 77);
- printf("# %s\n", headline);
- printf_line_with_prefix("# ", "-", 77);
+ PrintLineWithPrefix("# ", "-", 77);
+ Print("# %s\n", headline);
+ PrintLineWithPrefix("# ", "-", 77);
}
for (j = 0; j < *editor_elements_info[i].headline_list_size; j++)
if (IS_EDITOR_CASCADE(element))
element = EL_CHAR_MINUS;
- printf("# %s\n", element_info[element].token_name);
+ Print("# %s\n", element_info[element].token_name);
}
if (j > 0)
- printf("#\n");
+ Print("#\n");
for (j = 0; j < *editor_elements_info[i].element_list_size; j++)
{
int element = (*editor_elements_info[i].element_list)[j];
- printf("# %s\n", element_info[element].token_name);
+ Print("# %s\n", element_info[element].token_name);
}
if (j > 0)
- printf("#\n");
+ Print("#\n");
}
}
return;
}
- printf_line("-", 79);
- printf("Level xxx (file version %08d, game version %08d)\n",
- level->file_version, level->game_version);
- printf_line("-", 79);
-
- printf("Level author: '%s'\n", level->author);
- printf("Level title: '%s'\n", level->name);
- printf("\n");
- printf("Playfield size: %d x %d\n", level->fieldx, level->fieldy);
- printf("\n");
- printf("Level time: %d seconds\n", level->time);
- printf("Gems needed: %d\n", level->gems_needed);
- printf("\n");
- printf("Time for magic wall: %d seconds\n", level->time_magic_wall);
- printf("Time for wheel: %d seconds\n", level->time_wheel);
- printf("Time for light: %d seconds\n", level->time_light);
- printf("Time for timegate: %d seconds\n", level->time_timegate);
- printf("\n");
- printf("Amoeba speed: %d\n", level->amoeba_speed);
- printf("\n");
-
- printf("EM style slippery gems: %s\n", (level->em_slippery_gems ? "yes" : "no"));
- printf("Player blocks last field: %s\n", (level->block_last_field ? "yes" : "no"));
- printf("SP player blocks last field: %s\n", (level->sp_block_last_field ? "yes" : "no"));
- printf("use spring bug: %s\n", (level->use_spring_bug ? "yes" : "no"));
- printf("use step counter: %s\n", (level->use_step_counter ? "yes" : "no"));
-
- printf_line("-", 79);
+ PrintLine("-", 79);
+ Print("Level xxx (file version %08d, game version %08d)\n",
+ level->file_version, level->game_version);
+ PrintLine("-", 79);
+
+ Print("Level author: '%s'\n", level->author);
+ Print("Level title: '%s'\n", level->name);
+ Print("\n");
+ Print("Playfield size: %d x %d\n", level->fieldx, level->fieldy);
+ Print("\n");
+ Print("Level time: %d seconds\n", level->time);
+ Print("Gems needed: %d\n", level->gems_needed);
+ Print("\n");
+ Print("Time for magic wall: %d seconds\n", level->time_magic_wall);
+ Print("Time for wheel: %d seconds\n", level->time_wheel);
+ Print("Time for light: %d seconds\n", level->time_light);
+ Print("Time for timegate: %d seconds\n", level->time_timegate);
+ Print("\n");
+ Print("Amoeba speed: %d\n", level->amoeba_speed);
+ Print("\n");
+
+ Print("EM style slippery gems: %s\n", (level->em_slippery_gems ? "yes" : "no"));
+ Print("Player blocks last field: %s\n", (level->block_last_field ? "yes" : "no"));
+ Print("SP player blocks last field: %s\n", (level->sp_block_last_field ? "yes" : "no"));
+ Print("use spring bug: %s\n", (level->use_spring_bug ? "yes" : "no"));
+ Print("use step counter: %s\n", (level->use_step_counter ? "yes" : "no"));
+
+ PrintLine("-", 79);
}
return;
}
- printf_line("-", 79);
- printf("Tape of Level %03d (file version %08d, game version %08d)\n",
- tape->level_nr, tape->file_version, tape->game_version);
- printf(" (effective engine version %08d)\n",
- tape->engine_version);
- printf("Level series identifier: '%s'\n", tape->level_identifier);
- printf_line("-", 79);
+ PrintLine("-", 79);
+ Print("Tape of Level %03d (file version %08d, game version %08d)\n",
+ tape->level_nr, tape->file_version, tape->game_version);
+ Print(" (effective engine version %08d)\n",
+ tape->engine_version);
+ Print("Level series identifier: '%s'\n", tape->level_identifier);
+ PrintLine("-", 79);
tape_frame_counter = 0;
if (i >= MAX_TAPE_LEN)
break;
- printf("%04d: ", i);
+ Print("%04d: ", i);
for (j = 0; j < MAX_PLAYERS; j++)
{
{
int action = tape->pos[i].action[j];
- printf("%d:%02x ", j, action);
- printf("[%c%c%c%c|%c%c] - ",
- (action & JOY_LEFT ? '<' : ' '),
- (action & JOY_RIGHT ? '>' : ' '),
- (action & JOY_UP ? '^' : ' '),
- (action & JOY_DOWN ? 'v' : ' '),
- (action & JOY_BUTTON_1 ? '1' : ' '),
- (action & JOY_BUTTON_2 ? '2' : ' '));
+ Print("%d:%02x ", j, action);
+ Print("[%c%c%c%c|%c%c] - ",
+ (action & JOY_LEFT ? '<' : ' '),
+ (action & JOY_RIGHT ? '>' : ' '),
+ (action & JOY_UP ? '^' : ' '),
+ (action & JOY_DOWN ? 'v' : ' '),
+ (action & JOY_BUTTON_1 ? '1' : ' '),
+ (action & JOY_BUTTON_2 ? '2' : ' '));
}
}
- printf("(%03d) ", tape->pos[i].delay);
- printf("[%05d]\n", tape_frame_counter);
+ Print("(%03d) ", tape->pos[i].delay);
+ Print("[%05d]\n", tape_frame_counter);
tape_frame_counter += tape->pos[i].delay;
}
- printf_line("-", 79);
+ PrintLine("-", 79);
}
if (strEqual(command, "print graphicsinfo.conf"))
{
- printf("# You can configure additional/alternative image files here.\n");
- printf("# (The entries below are default and therefore commented out.)\n");
- printf("\n");
- printf("%s\n", getFormattedSetupEntry("name", "Classic Graphics"));
- printf("\n");
- printf("%s\n", getFormattedSetupEntry("sort_priority", "100"));
- printf("\n");
+ Print("# You can configure additional/alternative image files here.\n");
+ Print("# (The entries below are default and therefore commented out.)\n");
+ Print("\n");
+ Print("%s\n", getFormattedSetupEntry("name", "Classic Graphics"));
+ Print("\n");
+ Print("%s\n", getFormattedSetupEntry("sort_priority", "100"));
+ Print("\n");
for (i = 0; image_config[i].token != NULL; i++)
- printf("# %s\n", getFormattedSetupEntry(image_config[i].token,
- image_config[i].value));
+ Print("# %s\n", getFormattedSetupEntry(image_config[i].token,
+ image_config[i].value));
exit(0);
}
else if (strEqual(command, "print soundsinfo.conf"))
{
- printf("# You can configure additional/alternative sound files here.\n");
- printf("# (The entries below are default and therefore commented out.)\n");
- printf("\n");
- printf("%s\n", getFormattedSetupEntry("name", "Classic Sounds"));
- printf("\n");
- printf("%s\n", getFormattedSetupEntry("sort_priority", "100"));
- printf("\n");
+ Print("# You can configure additional/alternative sound files here.\n");
+ Print("# (The entries below are default and therefore commented out.)\n");
+ Print("\n");
+ Print("%s\n", getFormattedSetupEntry("name", "Classic Sounds"));
+ Print("\n");
+ Print("%s\n", getFormattedSetupEntry("sort_priority", "100"));
+ Print("\n");
for (i = 0; sound_config[i].token != NULL; i++)
- printf("# %s\n", getFormattedSetupEntry(sound_config[i].token,
- sound_config[i].value));
+ Print("# %s\n", getFormattedSetupEntry(sound_config[i].token,
+ sound_config[i].value));
exit(0);
}
else if (strEqual(command, "print musicinfo.conf"))
{
- printf("# You can configure additional/alternative music files here.\n");
- printf("# (The entries below are default and therefore commented out.)\n");
- printf("\n");
- printf("%s\n", getFormattedSetupEntry("name", "Classic Music"));
- printf("\n");
- printf("%s\n", getFormattedSetupEntry("sort_priority", "100"));
- printf("\n");
+ Print("# You can configure additional/alternative music files here.\n");
+ Print("# (The entries below are default and therefore commented out.)\n");
+ Print("\n");
+ Print("%s\n", getFormattedSetupEntry("name", "Classic Music"));
+ Print("\n");
+ Print("%s\n", getFormattedSetupEntry("sort_priority", "100"));
+ Print("\n");
for (i = 0; music_config[i].token != NULL; i++)
- printf("# %s\n", getFormattedSetupEntry(music_config[i].token,
- music_config[i].value));
+ Print("# %s\n", getFormattedSetupEntry(music_config[i].token,
+ music_config[i].value));
exit(0);
}
else if (strEqual(command, "print editorsetup.conf"))
{
- printf("# You can configure your personal editor element list here.\n");
- printf("# (The entries below are default and therefore commented out.)\n");
- printf("\n");
+ Print("# You can configure your personal editor element list here.\n");
+ Print("# (The entries below are default and therefore commented out.)\n");
+ Print("\n");
/* this is needed to be able to check element list for cascade elements */
InitElementPropertiesStatic();
}
else if (strEqual(command, "print helpanim.conf"))
{
- printf("# You can configure different element help animations here.\n");
- printf("# (The entries below are default and therefore commented out.)\n");
- printf("\n");
+ Print("# You can configure different element help animations here.\n");
+ Print("# (The entries below are default and therefore commented out.)\n");
+ Print("\n");
for (i = 0; helpanim_config[i].token != NULL; i++)
{
- printf("# %s\n", getFormattedSetupEntry(helpanim_config[i].token,
- helpanim_config[i].value));
+ Print("# %s\n", getFormattedSetupEntry(helpanim_config[i].token,
+ helpanim_config[i].value));
if (strEqual(helpanim_config[i].token, "end"))
- printf("#\n");
+ Print("#\n");
}
exit(0);
}
else if (strEqual(command, "print helptext.conf"))
{
- printf("# You can configure different element help text here.\n");
- printf("# (The entries below are default and therefore commented out.)\n");
- printf("\n");
+ Print("# You can configure different element help text here.\n");
+ Print("# (The entries below are default and therefore commented out.)\n");
+ Print("\n");
for (i = 0; helptext_config[i].token != NULL; i++)
- printf("# %s\n", getFormattedSetupEntry(helptext_config[i].token,
- helptext_config[i].value));
+ Print("# %s\n", getFormattedSetupEntry(helptext_config[i].token,
+ helptext_config[i].value));
exit(0);
}
// check if there are any displays available
if (num_displays < 0)
{
- printf("No displays available: %s\n", SDL_GetError());
+ Print("No displays available: %s\n", SDL_GetError());
exit(-1);
}
int num_modes = SDL_GetNumDisplayModes(i);
int j;
- printf("Available display modes for display %d:\n", i);
+ Print("Available display modes for display %d:\n", i);
// check if there are any display modes available for this display
if (num_modes < 0)
{
- printf("No display modes available for display %d: %s\n",
- i, SDL_GetError());
+ Print("No display modes available for display %d: %s\n",
+ i, SDL_GetError());
exit(-1);
}
if (SDL_GetDisplayMode(i, j, &mode) < 0)
{
- printf("Cannot get display mode %d for display %d: %s\n",
- j, i, SDL_GetError());
+ Print("Cannot get display mode %d for display %d: %s\n",
+ j, i, SDL_GetError());
exit(-1);
}
- printf("- %d x %d\n", mode.w, mode.h);
+ Print("- %d x %d\n", mode.w, mode.h);
}
}
/* check if there are any modes available */
if (modes == NULL)
{
- printf("No modes available!\n");
+ Print("No modes available!\n");
exit(-1);
}
/* check if our resolution is restricted */
if (modes == (SDL_Rect **)-1)
{
- printf("All resolutions available.\n");
+ Print("All resolutions available.\n");
}
else
{
- printf("Available display modes:\n");
+ Print("Available display modes:\n");
for (i = 0; modes[i]; i++)
- printf("- %d x %d\n", modes[i]->w, modes[i]->h);
+ Print("- %d x %d\n", modes[i]->w, modes[i]->h);
}
exit(0);
sy += 3 * font_height;
num_lines_printed =
- DrawTextBuffer(sx, sy, program.error_filename, font_2,
+ DrawTextBuffer(sx, sy, program.log_filename[LOG_ERR_ID], font_2,
line_length, line_length, max_lines,
0, BLIT_ON_BACKGROUND, TRUE, TRUE, FALSE);
/* logging functions */
/* ------------------------------------------------------------------------- */
-#define DUPLICATE_LOG_OUTPUT_TO_STDERR TRUE
+#define DUPLICATE_LOG_OUT_TO_STDOUT TRUE
+#define DUPLICATE_LOG_ERR_TO_STDERR TRUE
#if defined(PLATFORM_ANDROID)
static void vprintf_log_nonewline(char *format, va_list ap)
{
- FILE *file = program.error_file;
+ FILE *file = program.log_file[LOG_ERR_ID];
-#if DUPLICATE_LOG_OUTPUT_TO_STDERR
- if (file != stderr)
+#if DUPLICATE_LOG_ERR_TO_STDERR
+ if (file != program.log_file_default[LOG_ERR_ID])
{
va_list ap2;
va_copy(ap2, ap);
- vfprintf(stderr, format, ap2);
+ vfprintf(program.log_file_default[LOG_ERR_ID], format, ap2);
va_end(ap2);
}
static void vprintf_log(char *format, va_list ap)
{
- FILE *file = program.error_file;
+ FILE *file = program.log_file[LOG_ERR_ID];
char *newline = STRING_NEWLINE;
-#if DUPLICATE_LOG_OUTPUT_TO_STDERR
- if (file != stderr)
+#if DUPLICATE_LOG_ERR_TO_STDERR
+ if (file != program.log_file_default[LOG_ERR_ID])
{
va_list ap2;
va_copy(ap2, ap);
- vfprintf(stderr, format, ap2);
- fprintf(stderr, "%s", newline);
+ vfprintf(program.log_file_default[LOG_ERR_ID], format, ap2);
+ fprintf(program.log_file_default[LOG_ERR_ID], "%s", newline);
va_end(ap2);
}
fprintf_line_with_prefix(stdout, prefix, line_chars, line_length);
}
+static void vPrint(char *format, va_list ap)
+{
+ FILE *file = program.log_file[LOG_OUT_ID];
+
+#if DUPLICATE_LOG_OUT_TO_STDOUT
+ if (file != program.log_file_default[LOG_OUT_ID])
+ {
+ va_list ap2;
+ va_copy(ap2, ap);
+
+ vfprintf(program.log_file_default[LOG_OUT_ID], format, ap2);
+
+ va_end(ap2);
+ }
+#endif
+
+ vfprintf(file, format, ap);
+}
+
+void Print(char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ vPrint(format, ap);
+ va_end(ap);
+}
+
+void PrintLine(char *line_chars, int line_length)
+{
+ int i;
+
+ for (i = 0; i < line_length; i++)
+ Print(line_chars);
+
+ Print("\n");
+}
+
+void PrintLineWithPrefix(char *prefix, char *line_chars, int line_length)
+{
+ Print(prefix);
+ PrintLine(line_chars, line_length);
+}
+
/* ------------------------------------------------------------------------- */
/* string functions */
static boolean last_line_was_separator = FALSE;
char *process_name = "";
- if (program.error_file == NULL)
+ if (program.log_file[LOG_ERR_ID] == NULL)
return;
#if defined(PLATFORM_ANDROID)
/* (now also added for Windows, to create files in user data directory) */
/* ------------------------------------------------------------------------- */
-char *getErrorFilename(char *basename)
+char *getLogFilename(char *basename)
{
return getPath2(getUserGameDataDir(), basename);
}
-void openErrorFile()
+void OpenLogFiles()
{
+ int i;
+
InitUserDataDirectory();
- if ((program.error_file = fopen(program.error_filename, MODE_WRITE)) == NULL)
+ for (i = 0; i < NUM_LOGS; i++)
{
- program.error_file = stderr;
+ if ((program.log_file[i] = fopen(program.log_filename[i], MODE_WRITE))
+ == NULL)
+ {
+ program.log_file[i] = program.log_file_default[i]; // reset to default
- Error(ERR_WARN, "cannot open file '%s' for writing: %s",
- program.error_filename, strerror(errno));
- }
+ Error(ERR_WARN, "cannot open file '%s' for writing: %s",
+ program.log_filename[i], strerror(errno));
+ }
- /* error output should be unbuffered so it is not truncated in a crash */
- setbuf(program.error_file, NULL);
+ /* output should be unbuffered so it is not truncated in a crash */
+ setbuf(program.log_file[i], NULL);
+ }
}
-void closeErrorFile()
+void CloseLogFiles()
{
- if (program.error_file != stderr) /* do not close file 'stderr' */
- fclose(program.error_file);
+ int i;
+
+ for (i = 0; i < NUM_LOGS; i++)
+ if (program.log_file[i] != program.log_file_default[i])
+ fclose(program.log_file[i]);
}
-void dumpErrorFile()
+void DumpLogFile(int nr)
{
- FILE *error_file = fopen(program.error_filename, MODE_READ);
+ FILE *log_file = fopen(program.log_filename[nr], MODE_READ);
- if (error_file != NULL)
- {
- while (!feof(error_file))
- fputc(fgetc(error_file), stderr);
+ if (log_file == NULL)
+ return;
- fclose(error_file);
- }
+ while (!feof(log_file))
+ fputc(fgetc(log_file), stdout);
+
+ fclose(log_file);
}
void NotifyUserAboutErrorFile()
char *title_text = getStringCat2(program.program_title, " Error Message");
char *error_text = getStringCat2("The program was aborted due to an error; "
"for details, see the following error file:"
- STRING_NEWLINE, program.error_filename);
+ STRING_NEWLINE,
+ program.log_filename[LOG_ERR_ID]);
MessageBox(NULL, error_text, title_text, MB_OK);
#endif
void printf_line(char *, int);
void printf_line_with_prefix(char *, char *, int);
+void Print(char *, ...);
+void PrintLine(char *, int);
+void PrintLineWithPrefix(char *, char *, int);
+
char *int2str(int, int);
char *i_to_a(unsigned int);
int log_2(unsigned int);
void ReloadCustomArtworkList(struct ArtworkListInfo *);
void FreeCustomArtworkLists(struct ArtworkListInfo *);
-char *getErrorFilename(char *);
-void openErrorFile();
-void closeErrorFile();
-void dumpErrorFile();
+char *getLogFilename(char *);
+void OpenLogFiles();
+void CloseLogFiles();
+void DumpLogFile(int);
+
void NotifyUserAboutErrorFile();
#if DEBUG
program.version_build = VERSION_BUILD(program_version);
program.version_ident = program_version;
- program.error_filename = getErrorFilename(ERROR_BASENAME);
- program.error_file = stderr;
+ program.log_filename[LOG_OUT_ID] = getLogFilename(LOG_OUT_BASENAME);
+ program.log_filename[LOG_ERR_ID] = getLogFilename(LOG_ERR_BASENAME);
+ program.log_file[LOG_OUT_ID] = program.log_file_default[LOG_OUT_ID] = stdout;
+ program.log_file[LOG_ERR_ID] = program.log_file_default[LOG_ERR_ID] = stderr;
}
void SetWindowTitle()
updateUserGameDataDir();
#endif
- openErrorFile();
+ OpenLogFiles();
#if defined(TARGET_SDL2)
int sdl_init_flags = SDL_INIT_EVENTS | SDL_INIT_NOPARACHUTE;
void ClosePlatformDependentStuff(void)
{
-#if defined(PLATFORM_WIN32)
- closeErrorFile();
-#endif
+ CloseLogFiles();
}
void InitGfxFieldInfo(int sx, int sy, int sxsize, int sysize,
#define TAPEFILE_EXTENSION "tape"
#define SCOREFILE_EXTENSION "score"
-#define ERROR_BASENAME "stderr.txt"
+#define LOG_OUT_BASENAME "stdout.txt"
+#define LOG_ERR_BASENAME "stderr.txt"
+
+#define LOG_OUT_ID 0
+#define LOG_ERR_ID 1
+#define NUM_LOGS 2
#define STRING_PARENT_DIRECTORY ".."
#define STRING_TOP_DIRECTORY "/"
char *cookie_prefix;
- char *error_filename; /* filename where to write error messages to */
- FILE *error_file; /* (used instead of 'stderr' on some systems) */
+ char *log_filename[NUM_LOGS]; /* log filenames for out/err messages */
+ FILE *log_file[NUM_LOGS]; /* log file handles for out/err files */
+ FILE *log_file_default[NUM_LOGS]; /* default log file handles (out/err) */
int version_major;
int version_minor;
static void print_usage()
{
- printf("\n"
- "Usage: %s [OPTION]... [HOSTNAME [PORT]]\n"
- "\n"
- "Options:\n"
- " -d, --display HOSTNAME[:SCREEN] specify X server display\n"
- " -b, --basepath DIRECTORY alternative base DIRECTORY\n"
- " -l, --level DIRECTORY alternative level DIRECTORY\n"
- " -g, --graphics DIRECTORY alternative graphics DIRECTORY\n"
- " -s, --sounds DIRECTORY alternative sounds DIRECTORY\n"
- " -m, --music DIRECTORY alternative music DIRECTORY\n"
- " -n, --network network multiplayer game\n"
- " --serveronly only start network server\n"
- " -v, --verbose verbose mode\n"
- " -V, --version show program version\n"
- " --debug display debugging information\n"
- " -e, --execute COMMAND execute batch COMMAND\n"
- "\n"
- "Valid commands for '--execute' option:\n"
- " \"print graphicsinfo.conf\" print default graphics config\n"
- " \"print soundsinfo.conf\" print default sounds config\n"
- " \"print musicinfo.conf\" print default music config\n"
- " \"print editorsetup.conf\" print default editor config\n"
- " \"print helpanim.conf\" print default helpanim config\n"
- " \"print helptext.conf\" print default helptext config\n"
- " \"dump level FILE\" dump level data from FILE\n"
- " \"dump tape FILE\" dump tape data from FILE\n"
- " \"autoplay LEVELDIR [NR ...]\" play level tapes for LEVELDIR\n"
- " \"convert LEVELDIR [NR]\" convert levels in LEVELDIR\n"
- " \"create images DIRECTORY\" write BMP images to DIRECTORY\n"
- " \"create CE image DIRECTORY\" write BMP image to DIRECTORY\n"
- "\n",
- program.command_basename);
+ Print("\n"
+ "Usage: %s [OPTION]... [HOSTNAME [PORT]]\n"
+ "\n"
+ "Options:\n"
+ " -d, --display HOSTNAME[:SCREEN] specify X server display\n"
+ " -b, --basepath DIRECTORY alternative base DIRECTORY\n"
+ " -l, --level DIRECTORY alternative level DIRECTORY\n"
+ " -g, --graphics DIRECTORY alternative graphics DIRECTORY\n"
+ " -s, --sounds DIRECTORY alternative sounds DIRECTORY\n"
+ " -m, --music DIRECTORY alternative music DIRECTORY\n"
+ " -n, --network network multiplayer game\n"
+ " --serveronly only start network server\n"
+ " -v, --verbose verbose mode\n"
+ " -V, --version show program version\n"
+ " --debug display debugging information\n"
+ " -e, --execute COMMAND execute batch COMMAND\n"
+ "\n"
+ "Valid commands for '--execute' option:\n"
+ " \"print graphicsinfo.conf\" print default graphics config\n"
+ " \"print soundsinfo.conf\" print default sounds config\n"
+ " \"print musicinfo.conf\" print default music config\n"
+ " \"print editorsetup.conf\" print default editor config\n"
+ " \"print helpanim.conf\" print default helpanim config\n"
+ " \"print helptext.conf\" print default helptext config\n"
+ " \"dump level FILE\" dump level data from FILE\n"
+ " \"dump tape FILE\" dump tape data from FILE\n"
+ " \"autoplay LEVELDIR [NR ...]\" play level tapes for LEVELDIR\n"
+ " \"convert LEVELDIR [NR]\" convert levels in LEVELDIR\n"
+ " \"create images DIRECTORY\" write BMP images to DIRECTORY\n"
+ " \"create CE image DIRECTORY\" write BMP image to DIRECTORY\n"
+ "\n",
+ program.command_basename);
}
static void print_version()
{
- printf("%s %d.%d.%d.%d\n",
- PROGRAM_TITLE_STRING,
- PROGRAM_VERSION_MAJOR,
- PROGRAM_VERSION_MINOR,
- PROGRAM_VERSION_PATCH,
- PROGRAM_VERSION_BUILD);
+ Print("%s %d.%d.%d.%d\n",
+ PROGRAM_TITLE_STRING,
+ PROGRAM_VERSION_MAJOR,
+ PROGRAM_VERSION_MINOR,
+ PROGRAM_VERSION_PATCH,
+ PROGRAM_VERSION_BUILD);
if (options.debug)
{
SDL_version sdl_version;
SDL_VERSION(&sdl_version);
- printf("- SDL %d.%d.%d\n",
- sdl_version.major,
- sdl_version.minor,
- sdl_version.patch);
+ Print("- SDL %d.%d.%d\n",
+ sdl_version.major,
+ sdl_version.minor,
+ sdl_version.patch);
SDL_IMAGE_VERSION(&sdl_version);
- printf("- SDL_image %d.%d.%d\n",
- sdl_version.major,
- sdl_version.minor,
- sdl_version.patch);
+ Print("- SDL_image %d.%d.%d\n",
+ sdl_version.major,
+ sdl_version.minor,
+ sdl_version.patch);
SDL_MIXER_VERSION(&sdl_version);
- printf("- SDL_mixer %d.%d.%d\n",
- sdl_version.major,
- sdl_version.minor,
- sdl_version.patch);
+ Print("- SDL_mixer %d.%d.%d\n",
+ sdl_version.major,
+ sdl_version.minor,
+ sdl_version.patch);
SDL_NET_VERSION(&sdl_version);
- printf("- SDL_net %d.%d.%d\n",
- sdl_version.major,
- sdl_version.minor,
- sdl_version.patch);
+ Print("- SDL_net %d.%d.%d\n",
+ sdl_version.major,
+ sdl_version.minor,
+ sdl_version.patch);
}
}