fbpx
维基百科

GNU Readline

GNU Readline是一个软件库,可为具有命令行界面(例如Bash)的交互式程序英语interactive program提供行编辑器和历史记录功能。是GNU計劃的一部分,目前由Chet Ramey维护。

GNU Readline
原作者布萊恩·福克斯
開發者Chet Ramey
首次发布1989年,​33年前​(1989
目前版本
  • 8.2 (2022年9月26日;穩定版本)[1]
源代码库
  • git.savannah.gnu.org/cgit/readline.git
编程语言C
类型
许可协议GNU通用公共许可证
网站tiswww.case.edu/php/chet/readline/rltop.html

用户可以移动文本光标,搜索命令历史,控制kill ring(一个更灵活的剪贴板),并在文本终端上使用Tab键自动完成。作为一个跨平臺的库,readline允许不同系统上的应用程序展现相同的行编辑行为。

GPL许可协议

GNU Readline是一个著名的自由软件库,它是通过GNU通用公共许可协议(GPL)进行授权的。而其他的自由软件库通常是通过GNU宽公用许可协议(LGPL)进行授权,例如GNU C库GNU GettextFLTK[2]但其它软件在分发时,如果链接到像GNU Readline这种GPL协议的库,必须将与之相连的整个软件以GPL协议进行授权,以符合GPL第5章的规定。[3][4]自由软件基金会为GNU Readline选用了这个授权协议,以鼓励其它软件选用GPL协议。[5]

示例代码

下面的代码是C语言的,必须通过向编译器传递-lreadline标志来链接到readline库:

#include <stdlib.h> #include <stdio.h> #include <readline/readline.h> #include <readline/history.h> int main() {  // Configure readline to auto-complete paths when the tab key is hit.  rl_bind_key('\t', rl_complete);  while (1) {  // Display prompt and read input  char* input = readline("prompt> ");  // Check for EOF.  if (!input)  break;  // Add input to readline history.  add_history(input);  // Do stuff...  // Free buffer that was allocated by readline  free(input);  }  return 0; } 

外部链接

  • 关于GNU Readline你不知道的事情 (页面存档备份,存于互联网档案馆
  1. ^ Readline-8.2 Release available. 2022年9月26日 [2022年9月26日] (英語). 
  2. ^ GNU Lesser General Public License. The GNU Lesser General Public License v3.0 - GNU Project. Free Software Foundation. 2007 [2011-09-03]. (原始内容于2018-04-04). 
  3. ^ GNU General Public License. The GNU General Public License v3.0 - GNU Project. Free Software Foundation. 2007 [2011-09-03]. (原始内容于2021-02-05). 
  4. ^ Frequently Asked Questions about the GNU licenses. Frequently Asked Questions about the GNU Licenses - GNU Project. Free Software Foundation. 2010 [2011-09-03]. (原始内容于2016-12-29). 
  5. ^ Why you shouldn't use the Lesser GPL for your next library. Why you shouldn't use the Lesser GPL for your next library - GNU Project - Free Software Foundation. Free Software Foundation. 2016 [2019-10-15]. (原始内容于2020-12-09). 

readline, 是一个软件库, 可为具有命令行界面, 例如bash, 的交互式程序, 英语, interactive, program, 提供行编辑器和历史记录功能, 是gnu計劃的一部分, 目前由chet, ramey维护, 原作者布萊恩, 福克斯開發者chet, ramey首次发布1989年, 33年前, 1989, 目前版本8, 2022年9月26日, 穩定版本, 源代码库git, savannah, cgit, readline, git编程语言c类型库许可协议gnu通用公共许可证网站tiswww, c. GNU Readline是一个软件库 可为具有命令行界面 例如Bash 的交互式程序 英语 interactive program 提供行编辑器和历史记录功能 是GNU計劃的一部分 目前由Chet Ramey维护 GNU Readline原作者布萊恩 福克斯開發者Chet Ramey首次发布1989年 33年前 1989 目前版本8 2 2022年9月26日 穩定版本 1 源代码库git wbr savannah wbr gnu wbr org wbr cgit wbr readline wbr git编程语言C类型库许可协议GNU通用公共许可证网站tiswww wbr case wbr edu wbr php wbr chet wbr readline wbr rltop wbr html用户可以移动文本光标 搜索命令历史 控制kill ring 一个更灵活的剪贴板 并在文本终端上使用Tab键自动完成 作为一个跨平臺的库 readline允许不同系统上的应用程序展现相同的行编辑行为 GPL许可协议 编辑GNU Readline是一个著名的自由软件库 它是通过GNU通用公共许可协议 GPL 进行授权的 而其他的自由软件库通常是通过GNU宽公用许可协议 LGPL 进行授权 例如GNU C库 GNU Gettext和FLTK 2 但其它软件在分发时 如果链接到像GNU Readline这种GPL协议的库 必须将与之相连的整个软件以GPL协议进行授权 以符合GPL第5章的规定 3 4 自由软件基金会为GNU Readline选用了这个授权协议 以鼓励其它软件选用GPL协议 5 示例代码 编辑下面的代码是C语言的 必须通过向编译器传递 lreadline标志来链接到readline库 include lt stdlib h gt include lt stdio h gt include lt readline readline h gt include lt readline history h gt int main Configure readline to auto complete paths when the tab key is hit rl bind key t rl complete while 1 Display prompt and read input char input readline prompt gt Check for EOF if input break Add input to readline history add history input Do stuff Free buffer that was allocated by readline free input return 0 外部链接 编辑 自由软件主题 GNU readline主页 关于GNU Readline你不知道的事情 页面存档备份 存于互联网档案馆 Readline 8 2 Release available 2022年9月26日 2022年9月26日 英語 引文格式1维护 未识别语文类型 link GNU Lesser General Public License The GNU Lesser General Public License v3 0 GNU Project Free Software Foundation 2007 2011 09 03 原始内容存档于2018 04 04 GNU General Public License The GNU General Public License v3 0 GNU Project Free Software Foundation 2007 2011 09 03 原始内容存档于2021 02 05 Frequently Asked Questions about the GNU licenses Frequently Asked Questions about the GNU Licenses GNU Project Free Software Foundation 2010 2011 09 03 原始内容存档于2016 12 29 Why you shouldn t use the Lesser GPL for your next library Why you shouldn t use the Lesser GPL for your next library GNU Project Free Software Foundation Free Software Foundation 2016 2019 10 15 原始内容存档于2020 12 09 取自 https zh wikipedia org w index php title GNU Readline amp oldid 73834615, 维基百科,wiki,书籍,书籍,图书馆,

文章

,阅读,下载,免费,免费下载,mp3,视频,mp4,3gp, jpg,jpeg,gif,png,图片,音乐,歌曲,电影,书籍,游戏,游戏。