[TUHS] RAND editor e19

Gunnar Ritter gunnarr at acm.org
Wed Jan 10 02:17:21 AEST 2007


"Jose R. Valverde" <txomsy at yahoo.es> wrote:

> To cut a long story short: RAND E is alive and well, being maintained by
> Fabien Perriollat at CERN.

Thanks. Here is a basic patch to make it work on CentOS 4
(and probably other Linux distributions too).

	Gunnar

diff -Naur Rand-E19.58.orig/e19/e.c Rand-E19.58/e19/e.c
--- Rand-E19.58.orig/e19/e.c	Wed Mar 20 16:21:21 2002
+++ Rand-E19.58/e19/e.c	Tue Jan  9 17:00:04 2007
@@ -27,6 +27,7 @@
 #include "e.inf.h"
 #include <sys/stat.h>
 #include <string.h>
+#include <errno.h>
 #ifdef SYSIII
 #include <fcntl.h>
 #endif /* SYSIII */
@@ -553,6 +554,11 @@
 
 /* XXXXXXXXXXXXXXXXXXXXXXX */
 static void keyedit ();
+static void clean_all ();
+static void exit_now ();
+static void check_message_file ();
+static int get_kbfile_dname (char *, char *, int, char **);
+static int display_bigbuf ();
 
 static void strip_path (char * path)
 {
@@ -747,8 +753,6 @@
     }
 
     if (helpflg) {
-	static void clean_all ();
-	static void exit_now ();
 	showhelp ();
 	helpflg = NO;
 	clean_all (NO); /* do not delete change and key stroke files */
@@ -2126,7 +2130,6 @@
     char *pref_name, *stname;
     Flag use_flg;
     void getConsoleSize (int *width, int *height);
-    static int display_bigbuf ();
     int i, nbli, ctrlc, nb, idx;
     char bigbuf [8192]; /* must be large enough for the message */
     char strg [256];
@@ -2332,7 +2335,6 @@
     }
 
     if ( helpflg ) {
-	static int get_kbfile_dname (char *, char *, int, char **);
 	S_looktbl *slpt;
 
 	sprintf (bigbuf + strlen (bigbuf), " Build in terminals & keyboards :");
@@ -2378,7 +2380,6 @@
     if ( check_access (xdir_dir, R_OK, &tmpstrg) )
 	sprintf (bigbuf + strlen (bigbuf), "    WARNING : %s\n", tmpstrg);
     else {
-	static void check_message_file ();
 	check_message_file (recovermsg, bigbuf);
 	/* check_message_file (xdir_kr   , bigbuf);  -- no more in use */
 	check_message_file (xdir_help , bigbuf);
diff -Naur Rand-E19.58.orig/e19/e.cm.c Rand-E19.58/e19/e.cm.c
--- Rand-E19.58.orig/e19/e.cm.c	Mon Mar  4 14:54:15 2002
+++ Rand-E19.58/e19/e.cm.c	Tue Jan  9 17:00:12 2007
@@ -17,6 +17,7 @@
 #include <dirent.h>
 #include <string.h>
 #include <sys/stat.h>
+#include <errno.h>
 #include "e.h"
 #include "e.e.h"
 #include "e.m.h"
@@ -486,11 +487,13 @@
 
 #define CLASS_CMDS_NB (sizeof (class_cmds) / sizeof (class_cmds[0]))
 
+static Cmdret call_help (char *);
+static void save_preferences ();
+static int comp_alpha_looktb (S_looktbl *obj1, S_looktbl *obj2);
 
 void init_all_lookup_tables ()
 /* does not return in case of error */
 {
-    static int comp_alpha_looktb (S_looktbl *obj1, S_looktbl *obj2);
     static Flag done = NO;
     int i, nb, cc;
     struct _lookup_table *ltbl;
@@ -931,7 +934,6 @@
 {
     extern void reset_ctrlc ();
     extern char * help_cmd_str ();
-    static Cmdret call_help (char *);
     int i, cc;
     struct _class_cmd * class_cmd_pt;
     char txt[256];
@@ -2380,7 +2382,6 @@
     extern Flag set_reset_utf8 (Flag);
     extern Flag set_reset_graph (Flag);
     extern char * get_debug_name ();
-    static void save_preferences ();
     extern int open_dbgfile (Flag append_flg);
     extern int get_debug_default_level ();
 
diff -Naur Rand-E19.58.orig/e19/e.h.c Rand-E19.58/e19/e.h.c
--- Rand-E19.58.orig/e19/e.h.c	Tue Jan 22 23:05:08 2002
+++ Rand-E19.58/e19/e.h.c	Tue Jan  9 16:54:10 2007
@@ -33,6 +33,13 @@
 /* registered resize screen routine for full screen info display */
 static void (*resize_service) () = NULL;    /* specifique resize routine */
 static void (*resize_param) (int *, int *) = NULL;  /* get current term size */
+static int browse_keyfhelp (char *, char *);
+static int print_alias_table (S_lookstruct *);
+static int browse_cmdhelp  (char *, char *);
+static int waitkb (short);
+static int help_description ();
+static Cmdret show_ambiguous ();
+extern void all_ctrl_key_by_func (char *msg, int msg_sz, int fcmd);
 
 /* browse_keyboard : display the description of the pushed key assigned function */
 /* ----------------------------------------------------------------------------- */
@@ -45,7 +52,6 @@
 {
     extern char * itsyms_by_val (short val);
     extern void ignore_quote ();
-    static int help_description ();
     char blank [128];
     char *str;
     int qq, ctrlc, sz, nbli;
@@ -414,7 +420,6 @@
 static Cmdret keyfunc_ibmpc (helparg)
 char *helparg;
 {
-    extern void all_ctrl_key_by_func (char *msg, int msg_sz, int fcmd);
     extern Flag verbose_helpflg;
     extern S_looktbl itsyms[];
     int idx, sz;
@@ -655,8 +660,6 @@
 {
     extern char *nxtop;
     extern S_looktbl cmdtable[];
-    static int browse_cmdhelp  (char *, char *);
-    static int browse_keyfhelp (char *, char *);
     extern int get_ctrlc_fkey ();
 
 static char stmsg [] = "\n\
@@ -684,7 +687,6 @@
     extern char verstr[];
     extern S_looktbl itsyms[];
     extern void set_ambiguous_param (S_looktbl *table, char *str, Flag abv);
-    static Cmdret show_ambiguous ();
     Cmdret help_ambiguous (Flag *ctrlc_flg_pt, Flag ambig_flg);
 
     if (   (helparg == NULL) || (*helparg == '\0')
@@ -1184,8 +1186,6 @@
 
 static int browse_sortedtbl (S_lookstruct *tblstruct, char * mystr, char *waitmsg)
 {
-    static int waitkb (short);
-
     char *all_aliases;
     int nb, i, di, idx, cmd_val, cc;
     char *str, *cmd_str;
@@ -1572,7 +1572,6 @@
 
 void print_sort_table (S_lookstruct *tblstruct)
 {
-    static int print_alias_table (S_lookstruct *);
     char *cmt1, *cmt2;
     int width, height;
     int i, sz;
diff -Naur Rand-E19.58.orig/e19/e.iit.c Rand-E19.58/e19/e.iit.c
--- Rand-E19.58.orig/e19/e.iit.c	Tue Jan 22 09:45:26 2002
+++ Rand-E19.58/e19/e.iit.c	Tue Jan  9 17:00:21 2007
@@ -9,6 +9,7 @@
 #endif
 
 
+#include <errno.h>
 #include <string.h>
 #include "e.h"
 #ifdef  KBFILE
@@ -205,6 +206,7 @@
 static struct itable  it_leave_ctrlc_ref;
 static int ctrlc_is_ret;
 static char ccreturn_val [2] = { CCRETURN, 0 };
+static Flag itparse ();
 
 #if 0
 int build_sorted_itsyms ()
@@ -418,7 +420,6 @@
 int level;
 {
     extern void customize_xlate ();
-    static Flag itparse ();
 
     char line[TMPSTRLEN], string[TMPSTRLEN], value[TMPSTRLEN];
     FILE *f;
diff -Naur Rand-E19.58.orig/e19/e.keyboard_map.c Rand-E19.58/e19/e.keyboard_map.c
--- Rand-E19.58.orig/e19/e.keyboard_map.c	Thu Feb 28 00:32:02 2002
+++ Rand-E19.58/e19/e.keyboard_map.c	Tue Jan  9 17:00:48 2007
@@ -38,6 +38,7 @@
 /* ---------------------------------------------------------------------- */
 
 #include <stdlib.h>
+#include <errno.h>
 
 #ifdef TEST_PROGRAM
 #define CCUNAS1 0202 /* defined in e.h */
@@ -534,6 +535,10 @@
 /*
 static short *mykb_esc_idx = nor_esc_idx;
 */
+static void print_keys (char *escp, Flag *nl_pt);
+static Flag build_escape_seq (char ch, char *escp, int idx);
+static void switch_mode (struct KTdesc *, int, Flag);
+static char * kcode2string (int, unsigned int, Flag, Flag, int *, char **, char **);
 
 #if 0
 /* for fast search */
@@ -1261,6 +1266,7 @@
 	    if ( ! keypad_appl_mode ) return (NULL);
 	    break;
 	default :
+	    ;
 	}
     strg = get_kt_strg (ktcode, NULL);
     return (strg);
@@ -1753,8 +1759,6 @@
 
 static void set_cursor_mode ()
 {
-    static void switch_mode (struct KTdesc *, int, Flag);
-
     switch ( kbmap_type ) {
 	case user_mapfile :
 	    return;
@@ -3421,8 +3425,6 @@
 static char * string2key_label (char *strg, int *key, int *idx,
 				int *shift, char **modstrg)
 {
-    static char * kcode2string (int, unsigned int, Flag, Flag, int *, char **, char **);
-
     int i, j;
     int ktf;
     char *ktstrg;
@@ -3594,9 +3596,6 @@
 
 static void checkkeyb (Flag echo)
 {
-    static void print_keys (char *escp, Flag *nl_pt);
-    static Flag build_escape_seq (char ch, char *escp, int idx);
-
     static char msg[] = "type \"Ctrl C\" exit, \"Ctrl A\" switch App mode, \"Ctrl B\" switch cusor mode\n";
     static char int_msg[] = " Interrupted control sequence\n";
     Flag app_mode, alt_cursor_mode;
diff -Naur Rand-E19.58.orig/e19/e.pa.c Rand-E19.58/e19/e.pa.c
--- Rand-E19.58.orig/e19/e.pa.c	Thu Feb 21 23:09:09 2002
+++ Rand-E19.58/e19/e.pa.c	Tue Jan  9 16:56:23 2007
@@ -56,6 +56,7 @@
 
 static S_lookstruct tblstr [lookuptbl_comment_sz];
 
+static int longest_cmd (char *, S_looktbl *, int);
 
 #ifdef COMMENT
 Small
@@ -422,7 +423,6 @@
 
     if ( max_flg ) {
 	/* found the longest keyword string */
-	static int longest_cmd (char *, S_looktbl *, int);
 	idx1 = longest_cmd (kwd, table, table[idx].val);
 	if ( idx1 >= 0 ) idx = idx1;
     }
diff -Naur Rand-E19.58.orig/e19/e.u.c Rand-E19.58/e19/e.u.c
--- Rand-E19.58.orig/e19/e.u.c	Sun Feb 17 23:05:16 2002
+++ Rand-E19.58/e19/e.u.c	Tue Jan  9 16:51:03 2007
@@ -23,6 +23,7 @@
 extern Cmdret remove_file (Fn fn);
 
 static Fn getnxfn ();
+static char *ReadSymLink (char *);
 
 /* variables used to list the edited file */
 static int term_width, term_height; /* current display size */
@@ -473,7 +474,6 @@
      */
     Block {
 	char *cp;
-	static char *ReadSymLink (char *);
 
 	cp = ReadSymLink (file);
 	if (cp == NULL) {
diff -Naur Rand-E19.58.orig/e19/term/linux_pc.c Rand-E19.58/e19/term/linux_pc.c
--- Rand-E19.58.orig/e19/term/linux_pc.c	Thu Feb 28 00:32:02 2002
+++ Rand-E19.58/e19/term/linux_pc.c	Tue Jan  9 17:00:48 2007
@@ -38,6 +38,7 @@
 /* ---------------------------------------------------------------------- */
 
 #include <stdlib.h>
+#include <errno.h>
 
 #ifdef TEST_PROGRAM
 #define CCUNAS1 0202 /* defined in e.h */
@@ -534,6 +535,10 @@
 /*
 static short *mykb_esc_idx = nor_esc_idx;
 */
+static void print_keys (char *escp, Flag *nl_pt);
+static Flag build_escape_seq (char ch, char *escp, int idx);
+static void switch_mode (struct KTdesc *, int, Flag);
+static char * kcode2string (int, unsigned int, Flag, Flag, int *, char **, char **);
 
 #if 0
 /* for fast search */
@@ -1261,6 +1266,7 @@
 	    if ( ! keypad_appl_mode ) return (NULL);
 	    break;
 	default :
+	    ;
 	}
     strg = get_kt_strg (ktcode, NULL);
     return (strg);
@@ -1753,8 +1759,6 @@
 
 static void set_cursor_mode ()
 {
-    static void switch_mode (struct KTdesc *, int, Flag);
-
     switch ( kbmap_type ) {
 	case user_mapfile :
 	    return;
@@ -3421,8 +3425,6 @@
 static char * string2key_label (char *strg, int *key, int *idx,
 				int *shift, char **modstrg)
 {
-    static char * kcode2string (int, unsigned int, Flag, Flag, int *, char **, char **);
-
     int i, j;
     int ktf;
     char *ktstrg;
@@ -3594,9 +3596,6 @@
 
 static void checkkeyb (Flag echo)
 {
-    static void print_keys (char *escp, Flag *nl_pt);
-    static Flag build_escape_seq (char ch, char *escp, int idx);
-
     static char msg[] = "type \"Ctrl C\" exit, \"Ctrl A\" switch App mode, \"Ctrl B\" switch cusor mode\n";
     static char int_msg[] = " Interrupted control sequence\n";
     Flag app_mode, alt_cursor_mode;



More information about the TUHS mailing list