Changeset 40
- Timestamp:
- 07/11/04 17:07:05 (4 years ago)
- Files:
-
- wire/trunk/configure (modified) (2 diffs)
- wire/trunk/configure.in (modified) (1 diff)
- wire/trunk/wire/commands.c (modified) (3 diffs)
- wire/trunk/wire/main.c (modified) (6 diffs)
- wire/trunk/wire/utility.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wire/trunk/configure
r34 r40 4366 4366 LIBS="$LIBS -liconv" 4367 4367 4368 echo "$as_me:$LINENO: checking if iconv understands Unicode and ISO-8859-1" >&54369 echo $ECHO_N "checking if iconv understands Unicode and ISO-8859-1... $ECHO_C" >&64368 echo "$as_me:$LINENO: checking if iconv understands Unicode" >&5 4369 echo $ECHO_N "checking if iconv understands Unicode... $ECHO_C" >&6 4370 4370 if test "$cross_compiling" = yes; then 4371 4371 { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling … … 4385 4385 #include <iconv.h> 4386 4386 int main(void) { 4387 iconv_t conv = iconv_open("UTF-8", " ISO-8859-1");4387 iconv_t conv = iconv_open("UTF-8", "UTF-8"); 4388 4388 if(conv == (iconv_t) -1) 4389 4389 return 1; wire/trunk/configure.in
r34 r40 107 107 LIBS="$LIBS -liconv" 108 108 109 AC_MSG_CHECKING([if iconv understands Unicode and ISO-8859-1])109 AC_MSG_CHECKING([if iconv understands Unicode]) 110 110 AC_TRY_RUN([ 111 111 #include <iconv.h> 112 112 int main(void) { 113 iconv_t conv = iconv_open("UTF-8", " ISO-8859-1");113 iconv_t conv = iconv_open("UTF-8", "UTF-8"); 114 114 if(conv == (iconv_t) -1) 115 115 return 1; wire/trunk/wire/commands.c
r39 r40 1 /* $Id: commands.c,v 1.1 6 2004/07/11 14:02:05 morris Exp $ */1 /* $Id: commands.c,v 1.17 2004/07/11 15:07:05 morris Exp $ */ 2 2 3 3 /* … … 1233 1233 wr_list_node *node; 1234 1234 wr_user *user; 1235 unsigned int length, max length = 0;1235 unsigned int length, max_length = 0; 1236 1236 1237 1237 /* find max string length */ … … 1239 1239 WR_LIST_FOREACH(wr_users, node, user) { 1240 1240 length = strlen(user->nick); 1241 max length = length > maxlength ? length : maxlength;1242 1241 max_length = length > max_length ? length : max_length; 1242 1243 1243 length = strlen(user->login); 1244 max length = length > maxlength ? length : maxlength;1244 max_length = length > max_length ? length : max_length; 1245 1245 1246 1246 length = strlen(user->ip); 1247 max length = length > maxlength ? length : maxlength;1247 max_length = length > max_length ? length : max_length; 1248 1248 } 1249 1249 1250 1250 /* print users */ 1251 wr_printf_prefix("Users currently online: \n");1251 wr_printf_prefix("Users currently online: %d\n", max_length); 1252 1252 1253 1253 WR_LIST_FOREACH(wr_users, node, user) 1254 wr_print_user(node->data, max length);1254 wr_print_user(node->data, max_length); 1255 1255 WR_LIST_UNLOCK(wr_users); 1256 1256 } wire/trunk/wire/main.c
r38 r40 1 /* $Id: main.c,v 1.1 6 2004/07/11 13:50:54morris Exp $ */1 /* $Id: main.c,v 1.17 2004/07/11 15:07:05 morris Exp $ */ 2 2 3 3 /* … … 96 96 97 97 case 'c': 98 snprintf(charset, sizeof(charset), "%s// TRANSLIT", optarg);98 snprintf(charset, sizeof(charset), "%s//IGNORE//TRANSLIT", optarg); 99 99 break; 100 100 … … 120 120 /* default charset */ 121 121 if(strlen(charset) == 0) 122 snprintf(charset, sizeof(charset), "ISO-8859-1// TRANSLIT");122 snprintf(charset, sizeof(charset), "ISO-8859-1//IGNORE//TRANSLIT"); 123 123 124 124 /* create version string */ … … 164 164 165 165 /* init libiconv */ 166 wr_conv_from = iconv_open( charset, "UTF-8");167 wr_conv_to = iconv_open("UTF-8// TRANSLIT", charset);166 wr_conv_from = iconv_open("ISO-8859-1//IGNORE//TRANSLIT", "UTF-8"); 167 wr_conv_to = iconv_open("UTF-8//IGNORE//TRANSLIT", "ISO-8859-1"); 168 168 169 169 if(wr_conv_from == (iconv_t) -1 || wr_conv_to == (iconv_t) -1) { … … 1000 1000 1001 1001 1002 void wr_print_user(wr_user *user, unsigned int max length) {1002 void wr_print_user(wr_user *user, unsigned int max_length) { 1003 1003 char *color; 1004 1004 … … 1018 1018 user->nick, 1019 1019 "\033[0m", 1020 max length - strlen(user->nick) + 1,1020 max_length - strlen(user->nick) + 1, 1021 1021 " ", 1022 1022 user->login, 1023 max length - strlen(user->login) + 1,1023 max_length - strlen(user->login) + 1, 1024 1024 " ", 1025 1025 user->ip); wire/trunk/wire/utility.c
r33 r40 1 /* $Id: utility.c,v 1. 7 2004/07/11 04:14:38morris Exp $ */1 /* $Id: utility.c,v 1.8 2004/07/11 15:07:05 morris Exp $ */ 2 2 3 3 /* … … 63 63 64 64 void wr_text_convert(iconv_t conv, char *inbuffer, size_t *inbytes) { 65 char *i , *o, *outbuffer;65 char *in, *out, *outbuffer; 66 66 size_t outbytes, length; 67 67 … … 74 74 outbuffer = (char *) malloc(outbytes); 75 75 memset(outbuffer, 0, outbytes); 76 o = outbuffer;77 i = inbuffer;76 out = outbuffer; 77 in = inbuffer; 78 78 79 79 /* convert */ 80 if(iconv(conv, (const char **) &i , inbytes, &o, &outbytes) != -1) {80 if(iconv(conv, (const char **) &in, inbytes, &out, &outbytes) != -1) { 81 81 /* copy back */ 82 82 memcpy(inbuffer, outbuffer, length - outbytes);
