Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh Adjust to the new alias text libedit API.



details:   https://anonhg.NetBSD.org/src/rev/5cb59763a9ff
branches:  trunk
changeset: 330043:5cb59763a9ff
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Jun 18 18:17:30 2014 +0000

description:
Adjust to the new alias text libedit API.

diffstat:

 bin/sh/alias.c    |  14 +++++++-------
 bin/sh/alias.h    |   6 +++---
 bin/sh/histedit.c |   6 ++++--
 3 files changed, 14 insertions(+), 12 deletions(-)

diffs (108 lines):

diff -r 68f9827ed697 -r 5cb59763a9ff bin/sh/alias.c
--- a/bin/sh/alias.c    Wed Jun 18 18:12:28 2014 +0000
+++ b/bin/sh/alias.c    Wed Jun 18 18:17:30 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: alias.c,v 1.14 2011/06/18 21:18:46 christos Exp $      */
+/*     $NetBSD: alias.c,v 1.15 2014/06/18 18:17:30 christos Exp $      */
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)alias.c    8.3 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: alias.c,v 1.14 2011/06/18 21:18:46 christos Exp $");
+__RCSID("$NetBSD: alias.c,v 1.15 2014/06/18 18:17:30 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -59,7 +59,7 @@
 
 STATIC void setalias(char *, char *);
 STATIC int unalias(char *);
-STATIC struct alias **hashalias(char *);
+STATIC struct alias **hashalias(const char *);
 
 STATIC
 void
@@ -178,7 +178,7 @@
 }
 
 struct alias *
-lookupalias(char *name, int check)
+lookupalias(const char *name, int check)
 {
        struct alias *ap = *hashalias(name);
 
@@ -193,8 +193,8 @@
        return (NULL);
 }
 
-char *
-get_alias_text(char *name)
+const char *
+alias_text(void *dummy __unused, const char *name)
 {
        struct alias *ap;
 
@@ -264,7 +264,7 @@
 }
 
 STATIC struct alias **
-hashalias(char *p)
+hashalias(const char *p)
 {
        unsigned int hashval;
 
diff -r 68f9827ed697 -r 5cb59763a9ff bin/sh/alias.h
--- a/bin/sh/alias.h    Wed Jun 18 18:12:28 2014 +0000
+++ b/bin/sh/alias.h    Wed Jun 18 18:17:30 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: alias.h,v 1.7 2011/06/18 21:18:46 christos Exp $       */
+/*     $NetBSD: alias.h,v 1.8 2014/06/18 18:17:30 christos Exp $       */
 
 /*-
  * Copyright (c) 1993
@@ -43,6 +43,6 @@
        int flag;
 };
 
-struct alias *lookupalias(char *, int);
-char *get_alias_text(char *);
+struct alias *lookupalias(const char *, int);
+const char *alias_text(void *, const char *);
 void rmaliases(void);
diff -r 68f9827ed697 -r 5cb59763a9ff bin/sh/histedit.c
--- a/bin/sh/histedit.c Wed Jun 18 18:12:28 2014 +0000
+++ b/bin/sh/histedit.c Wed Jun 18 18:17:30 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: histedit.c,v 1.46 2014/03/23 05:07:59 dholland Exp $   */
+/*     $NetBSD: histedit.c,v 1.47 2014/06/18 18:17:30 christos Exp $   */
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: histedit.c,v 1.46 2014/03/23 05:07:59 dholland Exp $");
+__RCSID("$NetBSD: histedit.c,v 1.47 2014/06/18 18:17:30 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -59,6 +59,7 @@
 #include "mystring.h"
 #include "myhistedit.h"
 #include "error.h"
+#include "alias.h"
 #ifndef SMALL
 #include "eval.h"
 #include "memalloc.h"
@@ -135,6 +136,7 @@
                                        el_set(el, EL_HIST, history, hist);
                                el_set(el, EL_PROMPT, getprompt);
                                el_set(el, EL_SIGNAL, 1);
+                               el_set(el, EL_ALIAS_TEXT, alias_text, NULL);
                                el_set(el, EL_ADDFN, "rl-complete",
                                    "ReadLine compatible completion function",
                                    _el_fn_complete);



Home | Main Index | Thread Index | Old Index