Re: S-Lang problems



Pavel Roskin wrote:
The second problem is compile error during the link:

slint.o(.text+0x77): In function `SLang_input_pending2':
/home/proski/src/mc.v0/src/slint.c:116: undefined reference to `_SLsys_input_pending'
slint.o(.text+0x19): In function `SLang_getkey2':
/home/proski/src/mc.v0/src/slint.c:103: undefined reference to `_SLsys_getkey'
collect2: ld returned 1 exit status
make[2]: *** [mc] Error 1

I vote for wiping out the SLang_getkey2 and SLang_input_pending2 functions from src/slint.c. They only are in effect when the user types a character in the range 0x80..0x9f. These characters don't have a meaning in the ISO8859 character sets, so I guess they are rarely used. (Or are they used in Russian codepages?)

Roland
Index: src/slint.c
===================================================================
RCS file: /cvsroot/mc/mc/src/slint.c,v
retrieving revision 1.37
diff -u -p -u -r1.37 slint.c
--- src/slint.c	7 Nov 2004 12:48:48 -0000	1.37
+++ src/slint.c	7 Jan 2005 13:37:32 -0000
@@ -71,64 +71,9 @@ static int slinterrupt;
 /* Controls whether we should wait for input in getch */
 static int no_slang_delay;
 
-/* {{{  Copied from ../slang/slgetkey.c, removed the DEC_8Bit_HACK, */
-extern unsigned char SLang_Input_Buffer [];
-#if SLANG_VERSION >= 10000
-extern unsigned int _SLsys_getkey (void);
-extern int _SLsys_input_pending (int);
-#else
-extern unsigned int SLsys_getkey (void);
-extern int SLsys_input_pending (int);
-#endif
-
 /* Forward declarations */
 static void load_terminfo_keys (void);
 
-static unsigned int SLang_getkey2 (void)
-{
-   unsigned int imax;
-   unsigned int ch;
-   
-   if (SLang_Input_Buffer_Len)
-     {
-	ch = (unsigned int) *SLang_Input_Buffer;
-	SLang_Input_Buffer_Len--;
-	imax = SLang_Input_Buffer_Len;
-   
-	memmove ((char *) SLang_Input_Buffer, 
-		(char *) (SLang_Input_Buffer + 1), imax);
-	return(ch);
-     }
-#if SLANG_VERSION >= 10000
-   else return(_SLsys_getkey ());
-#else
-   else return(SLsys_getkey());
-#endif
-}
-
-static int SLang_input_pending2 (int tsecs)
-{
-   int n, i;
-   unsigned char c;
-
-   if (SLang_Input_Buffer_Len) return (int) SLang_Input_Buffer_Len;
-#if SLANG_VERSION >= 10000  
-   n = _SLsys_input_pending (tsecs);
-#else
-   n = SLsys_input_pending (tsecs);
-#endif
-   if (n <= 0) return 0;
-   
-   i = SLang_getkey2 ();
-   if (i == SLANG_GETKEY_ERROR)
-	return 0;  /* don't put crippled error codes into the input buffer */
-   c = (unsigned char)i;
-   SLang_ungetkey_string (&c, 1);
-   
-   return n;
-}
-/* }}} */
-
 static void
 slang_intr (int signo)
 {
@@ -502,10 +447,10 @@ getch (void)
 {
     int c;
     if (no_slang_delay)
-	if (SLang_input_pending2 (0) == 0)
+	if (SLang_input_pending (0) == 0)
 	    return -1;
 
-    c = SLang_getkey2 ();
+    c = SLang_getkey ();
     if (c == SLANG_GETKEY_ERROR) {
 	fprintf (stderr,
 		 "SLang_getkey returned SLANG_GETKEY_ERROR\n"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]