[cvslog] Module eggdrop1.6: Change committed

cvslog cvs at tsss.iavalley.cc.ia.us
Fri Jan 26 15:20:30 CST 2001


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.6
Commit time: 2001-01-26 21:18:32 UTC

Modified files:
     src/dccutil.c src/misc.c src/patch.h src/tcl.c src/tclegg.h

Log message:

Tothwolf's lastest i18n fix

---------------------- diff included ----------------------
Index: eggdrop1.6/src/dccutil.c
diff -u eggdrop1.6/src/dccutil.c:1.25 eggdrop1.6/src/dccutil.c:1.26
--- eggdrop1.6/src/dccutil.c:1.25	Mon Jan 22 17:47:33 2001
+++ eggdrop1.6/src/dccutil.c	Fri Jan 26 15:18:22 2001
@@ -6,7 +6,7 @@
  *   memory management for dcc structures
  *   timeout checking for dcc connections
  * 
- * $Id: dccutil.c,v 1.25 2001/01/22 23:47:33 guppy Exp $
+ * $Id: dccutil.c,v 1.26 2001/01/26 21:18:22 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -39,6 +39,7 @@
 extern char		 botnetnick[], spaces[], version[];
 extern time_t		 now;
 extern sock_list	*socklist;
+extern Tcl_Interp	*interp;
 
 char	motdfile[121] = "text/motd";	/* File where the motd is stored */
 int	connect_timeout = 15;		/* How long to wait before a telnet
@@ -105,12 +106,26 @@
   char *format;
   int idx, len;
   va_list va;
+#if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION >= 1
+  Tcl_DString ds;
+#endif
 
   idx = EGG_VARARGS_START(int, arg1, va);
   format = va_arg(va, char *);
   if ((len = egg_vsnprintf(SBUF, 1023, format, va)) < 0)
     SBUF[len = 1023] = 0;
   va_end(va);
+
+/* Used for unicode text */
+#if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION >= 1
+  Tcl_DStringInit(&ds);
+  /* Don't call this before calling init_tcl() */
+  Tcl_UtfToExternalDString(NULL, SBUF, -1, &ds);
+  Tcl_DStringResult(interp, &ds);
+  Tcl_DStringFree(&ds);
+  strncpyz(SBUF, interp->result, sizeof SBUF);
+#endif
+
   if (idx < 0) {
     tputs(-idx, SBUF, len);
   } else if (idx > 0x7FF0) {
Index: eggdrop1.6/src/misc.c
diff -u eggdrop1.6/src/misc.c:1.34 eggdrop1.6/src/misc.c:1.35
--- eggdrop1.6/src/misc.c:1.34	Mon Dec 18 14:24:16 2000
+++ eggdrop1.6/src/misc.c	Fri Jan 26 15:18:22 2001
@@ -7,7 +7,7 @@
  *   help system
  *   motd display and %var substitution
  * 
- * $Id: misc.c,v 1.34 2000/12/18 20:24:16 guppy Exp $
+ * $Id: misc.c,v 1.35 2001/01/26 21:18:22 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -574,7 +574,7 @@
 	dprintf(i, "%s", out);
     }
   if ((!backgrd) && (!con_chan) && (!term_z))
-    printf("%s", out);
+    dprintf(DP_STDOUT, "%s", out);
   else if ((type & LOG_MISC) && use_stderr) {
     if (shtime)
       out += 8;
Index: eggdrop1.6/src/patch.h
diff -u eggdrop1.6/src/patch.h:1.421 eggdrop1.6/src/patch.h:1.422
--- eggdrop1.6/src/patch.h:1.421	Fri Jan 26 15:06:14 2001
+++ eggdrop1.6/src/patch.h	Fri Jan 26 15:18:22 2001
@@ -10,7 +10,7 @@
  * statement, leave the rest of the file alone, this allows better
  * overlapping patches.
  * 
- * $Id: patch.h,v 1.421 2001/01/26 21:06:14 guppy Exp $
+ * $Id: patch.h,v 1.422 2001/01/26 21:18:22 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -41,12 +41,12 @@
  *
  *
  */
-patch("980544090");		/* current unixtime */
+patch("980544254");		/* current unixtime */
 /*
  *
  *
  */
-patch("helpchans");
+patch("i18n");
 /*
  *
  *
Index: eggdrop1.6/src/tcl.c
diff -u eggdrop1.6/src/tcl.c:1.29 eggdrop1.6/src/tcl.c:1.30
--- eggdrop1.6/src/tcl.c:1.29	Wed Jan 24 07:43:36 2001
+++ eggdrop1.6/src/tcl.c	Fri Jan 26 15:18:22 2001
@@ -4,7 +4,7 @@
  *   Tcl initialization
  *   getting and setting Tcl/eggdrop variables
  * 
- * $Id: tcl.c,v 1.29 2001/01/24 13:43:36 tothwolf Exp $
+ * $Id: tcl.c,v 1.30 2001/01/26 21:18:22 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -25,8 +25,9 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
+#include <stdlib.h>		/* getenv()				*/
+#include <locale.h>		/* setlocale()				*/
 #include "main.h"
-#include <locale.h>
 
 /* Used for read/write to internal strings */
 typedef struct {
@@ -505,7 +506,10 @@
   char pver[1024] = "";
 #endif
 
-#ifndef HAVE_PRE7_5_TCL 
+/* This must be done *BEFORE* Tcl_SetSystemEncoding(),
+ * or Tcl_SetSystemEncoding() will cause a segfault.
+ */
+#ifndef HAVE_PRE7_5_TCL	
   /* This is used for 'info nameofexecutable'.
    * The filename in argv[0] must exist in a directory listed in
    * the environment variable PATH for it to register anything.
@@ -513,6 +517,20 @@
   Tcl_FindExecutable(argv[0]);
 #endif
 
+  /* Initialize the interpreter */
+  interp = Tcl_CreateInterp();
+
+#ifdef DEBUG_MEM
+  /* Initialize Tcl's memory debugging if we want it */
+  Tcl_InitMemory(interp);
+#endif
+
+  /* Set Tcl variable tcl_interactive to 0 */
+  Tcl_SetVar(interp, "tcl_interactive", "0", TCL_GLOBAL_ONLY);
+
+  /* Setup script library facility */
+  Tcl_Init(interp);
+
 /* Code based on Tcl's TclpSetInitialEncodings() */
 #if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION >= 1
   /* Determine the current encoding from the LC_* or LANG environment
@@ -572,7 +590,7 @@
 
   Tcl_SetSystemEncoding(NULL, encoding);
 
-  resetPath:
+resetPath:
 
   /* Initialize the C library's locale subsystem. */
   setlocale(LC_CTYPE, "");
@@ -585,20 +603,6 @@
    * gets on a binary channel. */
   Tcl_GetEncoding(NULL, "iso8859-1");
 #endif
-
-  /* Create Tcl interpreter */
-  interp = Tcl_CreateInterp();
-
-#ifdef DEBUG_MEM
-  /* Initialize Tcl's memory debugging if we want it */
-  Tcl_InitMemory(interp);
-#endif
-
-  /* Initialize Tcl interpreter */
-  Tcl_Init(interp);
-
-  /* Set Tcl variable tcl_interactive to 0 */
-  Tcl_SetVar(interp, "tcl_interactive", "0", TCL_GLOBAL_ONLY);
 
 #ifndef HAVE_PRE7_5_TCL
   /* Add eggdrop to Tcl's package list */
Index: eggdrop1.6/src/tclegg.h
diff -u eggdrop1.6/src/tclegg.h:1.10 eggdrop1.6/src/tclegg.h:1.11
--- eggdrop1.6/src/tclegg.h:1.10	Mon Jan 22 17:41:11 2001
+++ eggdrop1.6/src/tclegg.h	Fri Jan 26 15:18:22 2001
@@ -2,7 +2,7 @@
  * tclegg.h
  *   stuff used by tcl.c and tclhash.c
  * 
- * $Id: tclegg.h,v 1.10 2001/01/22 23:41:11 guppy Exp $
+ * $Id: tclegg.h,v 1.11 2001/01/26 21:18:22 guppy Exp $
  */
 /* 
  * Copyright (C) 1997  Robey Pointer
@@ -126,49 +126,49 @@
 
 /* From Tcl's tclUnixInit.c */
 /* The following table is used to map from Unix locale strings to
- * encoding files. */
-
+ * encoding files.
+ */
 typedef struct LocaleTable {
-    const char *lang;
-    const char *encoding;
+  const char *lang;
+  const char *encoding;
 } LocaleTable;
 
 static const LocaleTable localeTable[] = {
-    {"ja_JP.SJIS",	"shiftjis"},
-    {"ja_JP.EUC",	"euc-jp"},
-    {"ja_JP.JIS",	"iso2022-jp"},
-    {"ja_JP.mscode",	"shiftjis"},
-    {"ja_JP.ujis",	"euc-jp"},
-    {"ja_JP",		"euc-jp"},
-    {"Ja_JP",		"shiftjis"},
-    {"Jp_JP",		"shiftjis"},
-    {"japan",		"euc-jp"},
+  {"ja_JP.SJIS",	"shiftjis"},
+  {"ja_JP.EUC",		"euc-jp"},
+  {"ja_JP.JIS",		"iso2022-jp"},
+  {"ja_JP.mscode",	"shiftjis"},
+  {"ja_JP.ujis",	"euc-jp"},
+  {"ja_JP",		"euc-jp"},
+  {"Ja_JP",		"shiftjis"},
+  {"Jp_JP",		"shiftjis"},
+  {"japan",		"euc-jp"},
 #ifdef hpux
-    {"japanese",	"shiftjis"},	
-    {"ja",		"shiftjis"},	
+  {"japanese",		"shiftjis"},	
+  {"ja",		"shiftjis"},	
 #else
-    {"japanese",	"euc-jp"},
-    {"ja",		"euc-jp"},
+  {"japanese",		"euc-jp"},
+  {"ja",		"euc-jp"},
 #endif
-    {"japanese.sjis",	"shiftjis"},
-    {"japanese.euc",	"euc-jp"},
-    {"japanese-sjis",	"shiftjis"},
-    {"japanese-ujis",	"euc-jp"},
-
-    {"ko",              "euc-kr"},
-    {"ko_KR",           "euc-kr"},
-    {"ko_KR.EUC",       "euc-kr"},
-    {"ko_KR.euc",       "euc-kr"},
-    {"ko_KR.eucKR",     "euc-kr"},
-    {"korean",          "euc-kr"},
-
-    {"ru",		"iso8859-5"},		
-    {"ru_RU",		"iso8859-5"},		
-    {"ru_SU",		"iso8859-5"},		
+  {"japanese.sjis",	"shiftjis"},
+  {"japanese.euc",	"euc-jp"},
+  {"japanese-sjis",	"shiftjis"},
+  {"japanese-ujis",	"euc-jp"},
+
+  {"ko",		"euc-kr"},
+  {"ko_KR",		"euc-kr"},
+  {"ko_KR.EUC",		"euc-kr"},
+  {"ko_KR.euc",		"euc-kr"},
+  {"ko_KR.eucKR",	"euc-kr"},
+  {"korean",		"euc-kr"},
+
+  {"ru",		"iso8859-5"},		
+  {"ru_RU",		"iso8859-5"},		
+  {"ru_SU",		"iso8859-5"},		
 
-    {"zh",		"cp936"},
+  {"zh",		"cp936"},
 
-    {NULL, NULL}
+  {NULL,		NULL}
 };
 
 #endif				/* _EGG_TCLEGG_H */
----------------------- End of diff -----------------------



More information about the Changes mailing list