summaryrefslogtreecommitdiffstats
path: root/lib/libedit/el.c
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>1999-08-20 01:17:12 +0000
committermdodd <mdodd@FreeBSD.org>1999-08-20 01:17:12 +0000
commitb47bf1ab5f378718e3afceba062ddbe540147e75 (patch)
tree5b335b96bb47515c3169dd10772cd3d0180deb62 /lib/libedit/el.c
parent90786531ff6e7a3610108631f31c3cb35c737ac4 (diff)
downloadFreeBSD-src-b47bf1ab5f378718e3afceba062ddbe540147e75.zip
FreeBSD-src-b47bf1ab5f378718e3afceba062ddbe540147e75.tar.gz
Add 2 functions: el_data_set() and el_data_get() which do what you
would expect. (Allow user data to be associated with an EditLine context). As this changes no existing interfaces and doesn't alter any structs visable to the user I've been told that its not necessary to bump the version of the library.
Diffstat (limited to 'lib/libedit/el.c')
-rw-r--r--lib/libedit/el.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/libedit/el.c b/lib/libedit/el.c
index c9c3f72..87f6813 100644
--- a/lib/libedit/el.c
+++ b/lib/libedit/el.c
@@ -103,6 +103,7 @@ el_init(prog, fin, fout)
(void) prompt_init(el);
(void) sig_init(el);
el->el_flags = 0;
+ el->data = NULL;
return el;
} /* end el_init */
@@ -336,3 +337,22 @@ el_resize(el)
(void) sigprocmask(SIG_SETMASK, &oset, NULL);
}
+
+public void
+el_data_set (el, data)
+ EditLine *el;
+ void *data;
+{
+ el->data = data;
+
+ return;
+}
+
+public void *
+el_data_get (el)
+ EditLine *el;
+{
+ if (el->data)
+ return (el->data);
+ return (NULL);
+}
OpenPOWER on IntegriCloud