Zum Inhalt springen

curses

aus Wikipedia, der freien Enzyklopädie
Datei:Termapi.svg
Beziehungen und Abhängigkeiten

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.<ref>{{#if:|{{#iferror: {{#iferror:{{#invoke:Vorlage:FormatDate|Execute}}|}}| |}}}}{{#if:David L. Craddock|David L. Craddock: }}{{#if:|{{#if:Procedural Dungeons of Doom: The Making of Rogue – Chapter 3|[{{#invoke:Vorlage:Internetquelle|archivURL|1={{#invoke:URLutil|getNormalized|1={{{archiv-url}}}}}}} {{#invoke:Vorlage:Internetquelle|TitelFormat|titel=Procedural Dungeons of Doom: The Making of Rogue – Chapter 3}}]{{#if:Blog| (Blog)}}{{#if:| {{{titelerg}}}{{#invoke:Vorlage:Internetquelle|Endpunkt|titel={{{titelerg}}}}}}}}}|{{#if:https://episodiccontentmag.com/2016/06/17/rogue_chapter3/%7C{{#if:{{#invoke:TemplUtl%7Cfaculty%7C}}%7C{{#invoke:Vorlage:Internetquelle%7CTitelFormat%7Ctitel={{#invoke:WLink%7CgetEscapedTitle%7C1=Procedural Dungeons of Doom: The Making of Rogue – Chapter 3}}}}|[{{#invoke:URLutil|getNormalized|1=https://episodiccontentmag.com/2016/06/17/rogue_chapter3/}} {{#invoke:Vorlage:Internetquelle|TitelFormat|titel={{#invoke:WLink|getEscapedTitle|1=Procedural Dungeons of Doom: The Making of Rogue – Chapter 3}}}}]}}{{#if:Blog| (Blog{{#if:2016-06-17{{#if: 2026-01-27 | {{#if:{{#invoke:TemplUtl|faculty|}}||1}}}}

          | )
          | {{#if:{{#ifeq:en|de||{{#if:en|1}}}}| ; 
              | )}}}}}}{{#if:| {{{titelerg}}}{{#invoke:Vorlage:Internetquelle|Endpunkt|titel={{{titelerg}}}}}}}}}}}{{#if:https://episodiccontentmag.com/2016/06/17/rogue_chapter3/%7C{{#if:{{#invoke:URLutil%7CisResourceURL%7C1=https://episodiccontentmag.com/2016/06/17/rogue_chapter3/}}%7C%7C}}}}{{#if:Procedural Dungeons of Doom: The Making of Rogue – Chapter 3|{{#if:{{#invoke:WLink|isValidLinktext|1=Procedural Dungeons of Doom: The Making of Rogue – Chapter 3|lines=0}}||}}}}{{#if: | In: {{#invoke:Vorlage:Internetquelle|TitelFormat|titel={{{werk}}}}}}}{{#if: | {{{hrsg}}}{{#if: 2016-06-17|,|{{#if: 2026-01-27 | {{#if:{{#invoke:TemplUtl|faculty|}}|;|,}}}}}}}}{{#if: 2016-06-17| {{#if:{{#invoke:DateTime|format|2016-06-17|noerror=1}}
            |{{#invoke:DateTime|format|2016-06-17|T._Monat JJJJ}}
            |{{#invoke:TemplUtl|failure|1=Fehler bei Vorlage:Internetquelle, datum=2016-06-17|class=Zitationswartung}} }}{{#if: |,|{{#if: 2026-01-27 | {{#if:{{#invoke:TemplUtl|faculty|}}|;|,}}}}}}}}{{#if: | S. {{{seiten}}}{{#if: |,|{{#if: 2026-01-27 | {{#if:{{#invoke:TemplUtl|faculty|}}|;|,}}}}}}}}{{#if: {{#invoke:TemplUtl|faculty|}}| {{#if:2016-06-17|{{#if:|archiviert|ehemals}}|{{#if:|Archiviert|Ehemals}}}} {{#if:|vom|im}} Vorlage:Referrer{{#if:{{#invoke:TemplUtl|faculty|}}| (nicht mehr online verfügbar)}}{{#if: | am {{#iferror: {{#iferror:{{#invoke:Vorlage:FormatDate|Execute}}|}}|{{{archiv-datum}}}{{#if:605185||(?)}}}}}}{{#if: 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. …’2026-01-27|;}}}}{{#if: 2026-01-27| {{#if:2016-06-17{{#invoke:TemplUtl|faculty|}}|abgerufen|Abgerufen}} {{#switch: {{#invoke:Str|len| {{#invoke:DateTime|format| 2026-01-27 |ISO|noerror=1}} }}
       |4=im Jahr
       |7=im
       |10=am
       |#default={{#invoke:TemplUtl|failure|1=Fehler bei Vorlage:Internetquelle, abruf=2026-01-27|class=Zitationswartung}} }} {{#invoke:DateTime|format|2026-01-27|T._Monat JJJJ}}
    | {{#invoke:TemplUtl|failure|1=Vorlage:Internetquelle | abruf=2026-MM-TT ist Pflichtparameter}} }}{{#if:{{#ifeq:en|de||{{#if:en|1}}}}|{{#if:2016-06-17{{#if: 2026-01-27 | {{#if:{{#invoke:TemplUtl|faculty|}}||1}}}}
       |  (
       | {{#if:Blog | |  (}}
       }}{{#ifeq:{{#if:en|en|de}}|de||
          {{#invoke:Multilingual|format|en|slang=!|split=[%s,]+|shift=m|separator=, }}}}{{#if: |{{#ifeq:{{#if:en|en|de}}|de||, }}{{{kommentar}}}}})}}{{#if: 2016-06-17{{#if: 2026-01-27 | {{#if:{{#invoke:TemplUtl|faculty|}}||1}} }}enCursor-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. …’|{{#if: 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. …’|: {{
 #if: 
 | {{
     #ifeq: {{#if:{{#if: {{#invoke:templutl|faculty|}}|de-ch|de}}|{{#if: {{#invoke:templutl|faculty|}}|de-ch|de}}|de}} | de
     | Vorlage:Str trim
     | {{#invoke:Vorlage:lang|flat}}
     }}
 | {{#ifeq: {{#if:{{#if: {{#invoke:templutl|faculty|}}|de-ch|de}}|{{#if: {{#invoke:templutl|faculty|}}|de-ch|de}}|de}} | de
     | „Vorlage:Str trim“
     | {{#invoke:Text|quote
         |1={{#if: 
              | {{#invoke:Vorlage:lang|flat}}
              | {{#invoke:Vorlage:lang|flat}} }}
         |2={{#if: {{#invoke:TemplUtl|faculty|}}|de-CH|de}}
         |3=1}} }}

}}{{#if:

   |  (<templatestyles src="Person/styles.css" />{{#if:  | :  }}{{#if:  | , deutsch: „“ }})
   | {{#if: 
       |  ({{#if:  | , deutsch: „“ }})
       | {{#if:  |  (deutsch: „“) }}
 }}

}}{{#if: 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. …’

   | {{#if: 
       | {{#if: 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. …’
           | Vorlage:": Text= und 1= gleichzeitig, bzw. Pipe zu viel }} }}
   | Vorlage:": Text= fehlt }}{{#if:  | {{#if: {{#invoke:Text|unstrip|{{{ref}}}}}
             | Vorlage:": Ungültiger Wert: ref=
             | {{{ref}}} }}

}}|.{{#if:{{#invoke:TemplUtl|faculty|}}|{{#if:||{{#ifeq: | JaKeinHinweis |{{#switch:

   |0|=Vorlage:Toter Link/Core{{#if: https://episodiccontentmag.com/2016/06/17/rogue_chapter3/
       | {{#if:  | [1] }} (Seite {{#switch:|no|0|=|dauerhaft }}nicht mehr abrufbar{{#if:  | , festgestellt im {{#invoke:DateTime|format||F Y}} }}. Suche im Internet Archive ){{#if: 
           | {{#if: deadurlausgeblendet | | Vorlage:Toter Link/archivebot }}
         }}
       |   (Seite {{#switch:|no|0|=|#default=dauerhaft }}nicht mehr abrufbar{{#if:  | , festgestellt im {{#invoke:DateTime|format||F Y}} }}.)
     }}{{#switch: 
         |no|0|=
         |#default={{#if:  ||  }}
    }}{{#invoke:TemplatePar|check
         |opt      = inline= url= text= datum= date= archivebot= bot= botlauf= fix-attempted= checked=
         |cat      = Wikipedia:Vorlagenfehler/Vorlage:Toter Link
         |errNS    = 0
         |template = Vorlage:Toter Link
         |format   = 
         |preview  = 1
    }}{{#if: https://episodiccontentmag.com/2016/06/17/rogue_chapter3/
      | {{#if:{{#invoke:URLutil|isWebURL|https://episodiccontentmag.com/2016/06/17/rogue_chapter3/}}
          || {{#if:  ||  }} 
        }}
      | {{#if: 
           | {{#if:  ||  }}
           | {{#if:  ||  }}
        }}
    }}{{#if: 
       | {{#if:{{#invoke:DateTime|format||F Y|noerror=1}}
             || {{#if:  ||  }} 
         }}
    }}{{#switch: deadurl
         |checked|deadurl|= 
         |#default=  {{#if:  ||  }}
    }}|#default= https://wiki-de.moshellshocker.dns64.de/index.php?title=Wikipedia:Defekte_Weblinks&dwl=https://episodiccontentmag.com/2016/06/17/rogue_chapter3/ Die nachstehende Seite ist {{#switch:|no|0|=|dauerhaft }}nicht mehr abrufbar]{{#if:  | , festgestellt im {{#invoke:DateTime|format||F Y}} }}. (Suche im Internet Archive. )  {{#if: 
            | {{#if: deadurlausgeblendet | | Vorlage:Toter Link/archivebot }}
         }}Vorlage:Toter Link/Core{{#switch: 
          |no|0|=
          |#default= {{#if:  ||  }}
        }}{{#invoke:TemplatePar|check
         |all      = inline= url=
         |opt      = datum= date= archivebot= bot= botlauf= fix-attempted= checked=
         |cat      = Wikipedia:Vorlagenfehler/Vorlage:Toter Link
         |errNS    = 0
         |template = Vorlage:Toter Link
         |format   = 
         |preview  = 1
       }}{{#if: https://episodiccontentmag.com/2016/06/17/rogue_chapter3/
       | {{#if:{{#invoke:URLutil|isWebURL|https://episodiccontentmag.com/2016/06/17/rogue_chapter3/}}
          || {{#if:  ||  }} 
        }}
    }}{{#if: 
         | {{#if:{{#invoke:DateTime|format||F Y|noerror=1}}
             || {{#if:  ||  }} 
           }}
    }}{{#switch: deadurl
         |checked|deadurl|= 
         |#default=  {{#if:  ||  }}
    }}[https://episodiccontentmag.com/2016/06/17/rogue_chapter3/ }}|{{#switch: 
   |0|=Vorlage:Toter Link/Core{{#if: https://episodiccontentmag.com/2016/06/17/rogue_chapter3/
       | {{#if:  | [2] }} (Seite {{#switch:|no|0|=|dauerhaft }}nicht mehr abrufbar{{#if:  | , festgestellt im {{#invoke:DateTime|format||F Y}} }}. Suche im Internet Archive ){{#if: 
           | {{#if:  | | Vorlage:Toter Link/archivebot }}
         }}
       |   (Seite {{#switch:|no|0|=|#default=dauerhaft }}nicht mehr abrufbar{{#if:  | , festgestellt im {{#invoke:DateTime|format||F Y}} }}.)
     }}{{#switch: 
         |no|0|=
         |#default={{#if:  ||  }}
    }}{{#invoke:TemplatePar|check
         |opt      = inline= url= text= datum= date= archivebot= bot= botlauf= fix-attempted= checked=
         |cat      = Wikipedia:Vorlagenfehler/Vorlage:Toter Link
         |errNS    = 0
         |template = Vorlage:Toter Link
         |format   = 
         |preview  = 1
    }}{{#if: https://episodiccontentmag.com/2016/06/17/rogue_chapter3/
      | {{#if:{{#invoke:URLutil|isWebURL|https://episodiccontentmag.com/2016/06/17/rogue_chapter3/}}
          || {{#if:  ||  }} 
        }}
      | {{#if: 
           | {{#if:  ||  }}
           | {{#if:  ||  }}
        }}
    }}{{#if: 
       | {{#if:{{#invoke:DateTime|format||F Y|noerror=1}}
             || {{#if:  ||  }} 
         }}
    }}{{#switch: 
         |checked|deadurl|= 
         |#default=  {{#if:  ||  }}
    }}|#default= https://wiki-de.moshellshocker.dns64.de/index.php?title=Wikipedia:Defekte_Weblinks&dwl=https://episodiccontentmag.com/2016/06/17/rogue_chapter3/ Die nachstehende Seite ist {{#switch:|no|0|=|dauerhaft }}nicht mehr abrufbar]{{#if:  | , festgestellt im {{#invoke:DateTime|format||F Y}} }}. (Suche im Internet Archive. )  {{#if: 
            | {{#if:  | | Vorlage:Toter Link/archivebot }}
         }}Vorlage:Toter Link/Core{{#switch: 
          |no|0|=
          |#default= {{#if:  ||  }}
        }}{{#invoke:TemplatePar|check
         |all      = inline= url=
         |opt      = datum= date= archivebot= bot= botlauf= fix-attempted= checked=
         |cat      = Wikipedia:Vorlagenfehler/Vorlage:Toter Link
         |errNS    = 0
         |template = Vorlage:Toter Link
         |format   = 
         |preview  = 1
       }}{{#if: https://episodiccontentmag.com/2016/06/17/rogue_chapter3/
       | {{#if:{{#invoke:URLutil|isWebURL|https://episodiccontentmag.com/2016/06/17/rogue_chapter3/}}
          || {{#if:  ||  }} 
        }}
    }}{{#if: 
         | {{#if:{{#invoke:DateTime|format||F Y|noerror=1}}
             || {{#if:  ||  }} 
           }}
    }}{{#switch: 
         |checked|deadurl|= 
         |#default=  {{#if:  ||  }}
    }}[https://episodiccontentmag.com/2016/06/17/rogue_chapter3/ }} }}}}}}}}}}{{#if:|
        {{#invoke:Vorlage:Internetquelle|archivBot|stamp={{{archiv-bot}}}|text={{#if:|Vorlage:Webarchiv/archiv-bot}}

}}}}{{#invoke:TemplatePar|check |all= url= titel= |opt= autor= hrsg= format= sprache= titelerg= werk= seiten= datum= abruf= zugriff= abruf-verborgen= archiv-url= archiv-datum= archiv-bot= kommentar= zitat= AT= CH= offline= |cat= {{#ifeq: 0 | 0 | Wikipedia:Vorlagenfehler/Vorlage:Internetquelle}} |template= Vorlage:Internetquelle |format=0 |preview=1 }}</ref>

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)<ref>pdcurses.sf.net</ref> 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:

<syntaxhighlight lang="c">

  1. include <curses.h>

int main(void) {

 initscr();
 printw("Hallo Welt!");
 refresh();
 getch();
 endwin();
 return 0;

} </syntaxhighlight>

Literatur

  • {{#invoke:Vorlage:Literatur|f}}

Weblinks

Einzelnachweise

<references />