Module Name: src
Committed By: christos
Date: Wed Jun 18 18:17:30 UTC 2014
Modified Files:
src/bin/sh: alias.c alias.h histedit.c
Log Message:
Adjust to the new alias text libedit API.
To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/bin/sh/alias.c
cvs rdiff -u -r1.7 -r1.8 src/bin/sh/alias.h
cvs rdiff -u -r1.46 -r1.47 src/bin/sh/histedit.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/sh/alias.c
diff -u src/bin/sh/alias.c:1.14 src/bin/sh/alias.c:1.15
--- src/bin/sh/alias.c:1.14 Sat Jun 18 17:18:46 2011
+++ src/bin/sh/alias.c Wed Jun 18 14:17:30 2014
@@ -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 @@ struct alias *atab[ATABSIZE];
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 @@ rmaliases(void)
}
struct alias *
-lookupalias(char *name, int check)
+lookupalias(const char *name, int check)
{
struct alias *ap = *hashalias(name);
@@ -193,8 +193,8 @@ lookupalias(char *name, int check)
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 @@ unaliascmd(int argc, char **argv)
}
STATIC struct alias **
-hashalias(char *p)
+hashalias(const char *p)
{
unsigned int hashval;
Index: src/bin/sh/alias.h
diff -u src/bin/sh/alias.h:1.7 src/bin/sh/alias.h:1.8
--- src/bin/sh/alias.h:1.7 Sat Jun 18 17:18:46 2011
+++ src/bin/sh/alias.h Wed Jun 18 14:17:30 2014
@@ -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 @@ struct alias {
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);
Index: src/bin/sh/histedit.c
diff -u src/bin/sh/histedit.c:1.46 src/bin/sh/histedit.c:1.47
--- src/bin/sh/histedit.c:1.46 Sun Mar 23 01:07:59 2014
+++ src/bin/sh/histedit.c Wed Jun 18 14:17:30 2014
@@ -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 @@ __RCSID("$NetBSD: histedit.c,v 1.46 2014
#include "mystring.h"
#include "myhistedit.h"
#include "error.h"
+#include "alias.h"
#ifndef SMALL
#include "eval.h"
#include "memalloc.h"
@@ -135,6 +136,7 @@ histedit(void)
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);