diff client/civclient.c client/civclient.c --- client/civclient.c Sat Jan 6 14:39:24 2001 +++ client/civclient.c Sat Jan 6 18:02:59 2001 @@ -126,7 +126,7 @@ #endif fprintf(stderr, _(" -v, --version\t\tPrint the version number\n")); } else if (is_option("--version",argv[i])) { - fprintf(stderr, "%s\n", FREECIV_NAME_VERSION); + fprintf(stderr, "%s\n", freeciv_name_version()); exit(0); } else if ((option = get_option("--log",argv,&i,argc)) != NULL) logfile = mystrdup(option); /* never free()d */ diff client/gui-gtk/graphics.c client/gui-gtk/graphics.c --- client/gui-gtk/graphics.c Tue Dec 26 22:50:52 2000 +++ client/gui-gtk/graphics.c Sat Jan 6 18:02:59 2001 @@ -122,11 +122,11 @@ y=radar_gfx_sprite->height-(lin+((int)(1.5*main_font->descent))); - w = gdk_string_width(main_font, WORD_VERSION); + w = gdk_string_width(main_font, word_version()); gdk_draw_string(radar_gfx_sprite->pixmap, main_font, - toplevel->style->black_gc, (tot/2-w/2)+1, y+1, WORD_VERSION); + toplevel->style->black_gc, (tot/2-w/2)+1, y+1, word_version()); gdk_draw_string(radar_gfx_sprite->pixmap, main_font, - toplevel->style->white_gc, tot/2-w/2, y, WORD_VERSION); + toplevel->style->white_gc, tot/2-w/2, y, word_version()); y+=lin; diff client/gui-gtk/helpdlg.c client/gui-gtk/helpdlg.c --- client/gui-gtk/helpdlg.c Sat Dec 30 16:18:05 2000 +++ client/gui-gtk/helpdlg.c Sat Jan 6 18:02:59 2001 @@ -125,7 +125,7 @@ if(!strcmp(topic, "Freeciv") || !strcmp(topic, "About") || !strcmp(topic, _("About"))) { - gtk_frame_set_label(GTK_FRAME(help_frame), FREECIV_NAME_VERSION); + gtk_frame_set_label(GTK_FRAME(help_frame), freeciv_name_version()); } else { gtk_frame_set_label(GTK_FRAME(help_frame), topic); } diff client/gui-mui/helpdlg.c client/gui-mui/helpdlg.c --- client/gui-mui/helpdlg.c Tue Dec 26 22:50:55 2000 +++ client/gui-mui/helpdlg.c Sat Jan 6 18:31:37 2001 @@ -117,7 +117,7 @@ || !strcmp(topic, "About") || !strcmp(topic, _("About"))) { - text = FREECIV_NAME_VERSION; + text = freeciv_name_version(); } else { diff client/gui-xaw/graphics.c client/gui-xaw/graphics.c --- client/gui-xaw/graphics.c Tue Dec 26 22:51:00 2000 +++ client/gui-xaw/graphics.c Sat Jan 6 18:30:08 2001 @@ -120,15 +120,15 @@ y=radar_gfx_sprite->height-(lin+((int)(1.5*main_font_struct->descent))); - w=XTextWidth(main_font_struct, WORD_VERSION, strlen(WORD_VERSION)); + w=XTextWidth(main_font_struct, word_version(), strlen(word_version())); XSetForeground(display, font_gc, colors_standard[COLOR_STD_BLACK]); XDrawString(display, radar_gfx_sprite->pixmap, font_gc, (tot/2-w/2)+1, y+1, - WORD_VERSION, strlen(WORD_VERSION)); + word_version(), strlen(word_version())); XSetForeground(display, font_gc, colors_standard[COLOR_STD_WHITE]); XDrawString(display, radar_gfx_sprite->pixmap, font_gc, tot/2-w/2, y, - WORD_VERSION, strlen(WORD_VERSION)); + word_version(), strlen(word_version())); y+=lin; diff client/gui-xaw/helpdlg.c client/gui-xaw/helpdlg.c --- client/gui-xaw/helpdlg.c Sat Dec 30 16:18:05 2000 +++ client/gui-xaw/helpdlg.c Sat Jan 6 18:30:02 2001 @@ -127,7 +127,7 @@ if(!strcmp(pitem->topic, "Freeciv") || !strcmp(pitem->topic, "About") || !strcmp(pitem->topic, _("About"))) { - xaw_set_label(help_title, FREECIV_NAME_VERSION); + xaw_set_label(help_title, freeciv_name_version()); } else { xaw_set_label(help_title, pitem->topic); } diff common/version.c common/version.c --- common/version.c Tue Dec 26 22:51:09 2000 +++ common/version.c Sat Jan 6 18:03:59 2001 @@ -20,6 +20,37 @@ #include "version.h" + +/********************************************************************** + ... +***********************************************************************/ +char *freeciv_name_version() +{ + static char msgbuf[128]; + +#if IS_BETA_VERSION + my_snprintf(msgbuf, sizeof (msgbuf), _("Freeciv version %s %s"), + VERSION_STRING, _("(beta version)")); +#else + my_snprintf(msgbuf, sizeof (msgbuf), _("Freeciv version %s"), + VERSION_STRING); +#endif + + return msgbuf; +} + +/********************************************************************** + ... +***********************************************************************/ +char *word_version() +{ +#if IS_BETA_VERSION + return _("betatest version "); +#else + return _("version "); +#endif +} + /********************************************************************** Return the BETA message. If returns NULL, not a beta version. diff common/version.h common/version.h --- common/version.h Tue Dec 26 22:51:09 2000 +++ common/version.h Sat Jan 6 18:02:59 2001 @@ -58,16 +58,10 @@ VER_STRINGIFY(PATCH_VERSION) VERSION_LABEL #endif -/* below, FREECIV_NAME_VERSION uses pre-processor string concatenation --dwp */ -#if IS_BETA_VERSION -#define FREECIV_NAME_VERSION "Freeciv version " VERSION_STRING " (beta version)" -#define WORD_VERSION "betatest version" -#else -#define FREECIV_NAME_VERSION "Freeciv version " VERSION_STRING -#define WORD_VERSION "version" -#endif - /* If returns NULL, not a beta version. */ char *beta_message (void); + +char *freeciv_name_version(); +char *word_version(); #endif /* FC__VERSION_H */ diff server/civserver.c server/civserver.c --- server/civserver.c Tue Dec 26 22:52:33 2000 +++ server/civserver.c Sat Jan 6 18:02:59 2001 @@ -111,10 +111,10 @@ } if (showvers && !showhelp) { - fprintf(stderr, FREECIV_NAME_VERSION "\n"); + fprintf(stderr, "%s \n", freeciv_name_version()); exit(0); } - con_write(C_VERSION, _("This is the server for %s"), FREECIV_NAME_VERSION); + con_write(C_VERSION, _("This is the server for %s"), freeciv_name_version()); con_write(C_COMMENT, _("You can learn a lot about Freeciv at %s"), WEBSITE_URL); diff server/srv_main.c server/srv_main.c --- server/srv_main.c Fri Dec 29 21:45:13 2000 +++ server/srv_main.c Sat Jan 6 18:02:59 2001 @@ -1316,10 +1316,10 @@ if (my_gethostname(hostname, sizeof(hostname))==0) { notify_conn(dest, _("Welcome to the %s Server running at %s port %d."), - FREECIV_NAME_VERSION, hostname, srvarg.port); + freeciv_name_version(), hostname, srvarg.port); } else { notify_conn(dest, _("Welcome to the %s Server at port %d."), - FREECIV_NAME_VERSION, srvarg.port); + freeciv_name_version(), srvarg.port); } /* tell who we're waiting on to end the game turn */