In an assignment for college it was suggested to use the C readline function in an exercise. I have searched for its reference but still haven’t found it. Does it really exist? In which header? Can you please post the link to the reference?
In an assignment for college it was suggested to use the C readline function
Share
Readline exists in two places,
libreadlineandlibedit(also calledlibeditline). Both have an identical interface. The difference is libreadline is licensed under the GPL, libedit is 3 clause BSD. Licensing is really not a concern for an assignment, at least I don’t think it is. Either license allows you to use the code freely. If you link against readline, be sure to make the whole programGPL 2 or laterwhich will satisfy whatever version of the GPL governs the systemreadline. It may be GPL2+ or GPL3+, depending on the age of the system. I’m not advocating either license, that’s up to you.Note, take care to install either / or and adjust linking as needed (
-lreadlineor-leditor-leditline). Both are libraries and not a part of the standard C library.Edit (afterthought):
If releasing a program to the wild, its a nice gesture to allow the user to configure it with their
readlineof choice. For instance:--with-readlineor--with-libedit, etc. This allows a binary package that conforms to their choice of license, at least as far asreadlineis concerned.Links: Readline and Edit/Editline.