Curses

curses ist der Name verschiedener Programmbibliotheken zur Darstellung zeichenorientierter Benutzerschnittstellen (Text User Interface, TUI) unabhängig vom darstellenden Textterminal bzw. Terminalemulator. Die Bibliothek wurde von Ken Arnold entwickelt und vermutlich von Bill Joy, dem Entwickler von ex und vi, in der BSD-UNIX-Version 2.79BSD von 1980 inkludiert. U. a. das sich ab 1980 an Universitäten verbreitende Computerspiel Rogue nutzt die curses-Bibliothek.[1]
Auch in 4.2BSD und späteren Versionen ist die Implementierung enthalten, der 1989 eine Weiterentwicklung für Veröffentlichung 4 von System V folgte.
Andere Weiterentwicklungen sind pcurses (1982) von Pavel Curtis und (1987) Public Domain Curses (PDCurses)[2] von Mark Hessling.
In den frühen 1990er Jahren setzten Zeyd Ben Halim und Eric Raymond die Entwicklung von pcurses fort und nannten es ncurses, die heute überwiegend in Gebrauch ist. Thomas Dickey trat 1995 in das Projekt ein und ist seit 1996 der Hauptentwickler.
Es gibt einen Standard von X/Open, der sich ausgesprochen nahe an die System-V-Implementierung hält.
Programmbeispiel
Einfaches Hallo-Welt-Programm mit curses:
#include <curses.h>
int main(void)
{
initscr();
printw("Hallo Welt!");
refresh();
getch();
endwin();
return 0;
}
Literatur
- John Strang: Programming with curses. O’Reilly & Associates, Sebastopol CA 1986, ISBN 978-0-937175-02-6 (UNIX C library for screen manipulation. A Nutshell handbook).
Weblinks
- X/Open-Standard: Referenz der Funktionen, Überblick über die Schnittstelle
Einzelnachweise
- ↑ David L. Craddock: Procedural Dungeons of Doom: The Making of Rogue – Chapter 3. (Blog) 17. Juni 2016, abgerufen am 27. Januar 2026 (englisch): „Cursor-addressable terminals presented one downside. Each terminal stored characters differently, so programmers had to rewrite cursor-addressable code on every type of cursor-addressable terminal they used. Tired of revising code every time a new terminal appeared in the lab, [Ken C. R. C.] Arnold wrote a platform-agnostic library of cursor functions that worked on any cursor-addressable terminal. He called his library curses. … When Bill Joy corralled worthy programs and packaged them in BSD UNIX in 1978, curses received a place of honor. By 1980, Rogue had spread from its home on UC Santa Cruz’s computers to other UC campuses, including UC Berkeley. Arnold took to the game right away. ‘People often believe that curses was written for Rogue because most people saw them at the same time. …’“
- ↑ pdcurses.sf.net
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.