Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/eesh


Modified Files:
        Makefile.am main.c 


Log Message:
Sun Aug 17 15:28:17 CEST 2003
(Kim)

Removed possibility to use readline in eesh (readline is GPL, not LGPL).

===================================================================
RCS file: /cvsroot/enlightenment/e16/e/eesh/Makefile.am,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- Makefile.am 17 Aug 2003 10:11:50 -0000      1.6
+++ Makefile.am 17 Aug 2003 13:30:37 -0000      1.7
@@ -12,7 +12,7 @@
        file.c                  \
        alert.c
 
-LDADD = $(X_PRE_LIBS) $(X_LIBS) -lX11 $(X_EXTRA_LIBS) $(RL_LIBS) -lm
+LDADD = $(X_PRE_LIBS) $(X_LIBS) -lX11 $(X_EXTRA_LIBS) -lm
 
 INCLUDES = $(IMLIB_CFLAGS) -I$(top_builddir) -I$(top_srcdir)/intl
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/eesh/main.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- main.c      17 Aug 2003 10:11:50 -0000      1.11
+++ main.c      17 Aug 2003 13:30:37 -0000      1.12
@@ -28,51 +28,26 @@
 #endif
 #include <sys/types.h>
 #include <unistd.h>
-#if USE_READLINE
-#include <readline/readline.h>
-#include <readline/history.h>
-#endif
 
 extern char         waitonly;
 
-#if !USE_READLINE
-static char         buf[10240];
 static int          stdin_state;
-#endif
-static Client      *e;
-
-static void
+void                restore_stdin_state(void);
+void
 restore_stdin_state(void)
 {
-#if USE_READLINE
-   rl_callback_handler_remove();
-#else
    fcntl(0, F_SETFL, stdin_state);
-#endif
-}
-
-static void
-process_line(char *line)
-{
-   if (line == NULL)
-      exit(0);
-   if (*line == '\0')
-      return;
-
-   CommsSend(e, line);
-   XSync(disp, False);
-#if USE_READLINE
-   add_history(line);
-#endif
 }
 
 int
 main(int argc, char **argv)
 {
    XEvent              ev;
-   Client             *me;
-   int                 i, j;
+   Client             *me, *e;
+   char                buf[10240];
+   int                 i, j, k;
    fd_set              fd;
+   signed char         ret;
    char               *command;
 
    waitonly = 0;
@@ -144,16 +119,10 @@
      }
 
    XSync(disp, False);
-
-#if USE_READLINE
-   rl_callback_handler_install("", process_line);
-#else
+   j = 0;
    stdin_state = fcntl(0, F_GETFL, 0);
-   fcntl(0, F_SETFL, O_NONBLOCK);
-#endif
    atexit(restore_stdin_state);
-
-   j = 0;
+   fcntl(0, F_SETFL, O_NONBLOCK);
    for (;;)
      {
        if (waitonly)
@@ -176,11 +145,6 @@
 
             if (FD_ISSET(0, &fd))
               {
-#if USE_READLINE
-                 rl_callback_read_char();
-#else
-                 int                 k, ret;
-
                  k = 0;
                  while ((ret = read(0, &(buf[j]), 1) > 0))
                    {
@@ -189,14 +153,16 @@
                         {
                            buf[j] = 0;
                            if (strlen(buf) > 0)
-                              process_line(buf);
+                             {
+                                CommsSend(e, buf);
+                                XSync(disp, False);
+                             }
                            j = -1;
                         }
                       j++;
                    }
                  if ((ret < 0) || ((k == 0) && (ret == 0)))
                     exit(0);
-#endif
               }
             else if (FD_ISSET(ConnectionNumber(disp), &fd))
               {
@@ -212,6 +178,5 @@
               }
          }
      }
-
    return 0;
 }




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to