diff options
author | Steve Slaven <bpk@hoopajoo.net> | 2005-03-21 20:49:24 (GMT) |
---|---|---|
committer | Steve Slaven <bpk@hoopajoo.net> | 2005-03-21 20:49:24 (GMT) |
commit | 22e6d965aa95a519d2b5672ee2c888785fc524ee (patch) | |
tree | 13db9f59127a2b9169acfe7d10e707b2264e7133 /main.c | |
parent | abe994ae16b892106e0b36d7be5bfd7e1100075c (diff) | |
download | powwow-22e6d965aa95a519d2b5672ee2c888785fc524ee.zip powwow-22e6d965aa95a519d2b5672ee2c888785fc524ee.tar.gz powwow-22e6d965aa95a519d2b5672ee2c888785fc524ee.tar.bz2 |
Wide character (locale) support from Dain, changed output of the compiled
options line since there are more compile time options now
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 61 |
1 files changed, 44 insertions, 17 deletions
@@ -30,9 +30,19 @@ * #define POWWOW_DIR "/home/gustav/powwow" */ -#define POWWOW_VERSION VERSION ", Copyright 2000-2005 by Cosmos\n" \ - " Copyright 2005 by bpk - http://hoopajoo.net\n" \ - "(contributions by Yorick, Vivriel, Thuzzle, Ilie, Fror, Dain)\n" +#ifdef USE_LOCALE + #define POWWOW_HACKERS "Yorick, Vivriel, Thuzzle, Ilie, Fr\363r, D\341in" + #define COPYRIGHT "\251 " +#else + #define POWWOW_HACKERS "Yorick, Vivriel, Thuzzle, Ilie, Fror, Dain" + #define COPYRIGHT "" +#endif + +#define POWWOW_VERSION VERSION \ + ", Copyright 2000-2005 by Cosmos\n" \ + "Copyright 2005 by bpk - http://hoopajoo.net\n" \ + "(contributions by " POWWOW_HACKERS ")\n" + #define HELPNAME "powwow.help" #define COPYNAME "COPYING" @@ -56,6 +66,10 @@ #include <memory.h> #include <unistd.h> +#ifdef USE_LOCALE +#include <locale.h> +#endif + /* are these really needed? */ extern int errno; extern int select(); @@ -227,7 +241,13 @@ int main __P2 (int,argc, char **,argv) int i; int read_file = 0; /* GH: if true, powwow was started with * a file argument, and initstr shall be ran */ - + +#ifdef USE_LOCALE + if (!setlocale(LC_ALL, "")) { + fprintf(stderr, "Failed setlocale(LC_ALL, \"C\")\n"); + } +#endif + /* initializations */ initstr[0] = 0; memzero(conn_list, sizeof(conn_list)); @@ -399,26 +419,33 @@ under certain conditions; type \"#help copyright\" for details.\n" */ void printver __P0 (void) { - tty_printf("Powwow version %s\n%s (%s, %s)%s\n", POWWOW_VERSION, -#if __STDC__ - "compiled " __TIME__ " " __DATE__, -#else - "", -#endif + tty_printf("Powwow version %s\nOptions: %s%s\n", POWWOW_VERSION, #ifdef USE_VT100 - "vt100-only", + "vt100-only," #else - "termcaps", + "termcaps," #endif #ifdef USE_SGTTY - "BSD sgtty", + " BSD sgtty," #else - "termios", + " termios," #endif #ifdef USE_REGEXP - "" + " regexp," +#else + " no regexp," +#endif +#ifdef USE_LOCALE + " locale," +#endif +#ifdef HAVE_LIBDL + " modules," +#endif + , +#if __STDC__ + " compiled " __TIME__ " " __DATE__ #else - " no regexp" + " uknown compile date" #endif ); } @@ -1282,7 +1309,7 @@ static void get_user_input __P0 (void) if (!(linemode & (LM_NOECHO | LM_CHAR))) /* line mode, local echo */ chunk = BUFSIZE; - while ((j = tty_read(tty_read_fd, c, chunk)) < 0 && errno == EINTR) + while ((j = tty_read(c, chunk)) < 0 && errno == EINTR) ; if (j <= 0 || (chunk == 1 && j != chunk)) syserr("read from tty"); |