;;Konstanten. //diese werden beim make durch die Konstanten aus curses.h expandiert. //Dazu erfolgt der Aufruf des C-Pre-Prozessors folgendermaßen: //cpp -P -imacros /usr/include/ncurses.h ncurses-constants.scm | // sed -e '/^ *$/d' // -e 's/refresh1/refresh/' -e 's/move1/move/' -e 's/clear1/clear/' // > ncurses-constants.scm //-P: //keine linemarker erzeugen. //-imacros file: //es wird zuerst file eingelesen. Die Ausgabe wird weggeworfen. Es sind jetzt //die Macros von dort verfügbar. //sed: //-e: Befehl ausführen (in diesem Fall reguläre Ausdrücke ersetzen) //-^:Zeilenanfang //- *:beliebig viele Leerzeichen //$:Zeilenende //d: löscht die Zeile //s: reguläre Ausdrücke ersetzen ;Funktion um die Oktal-Zahlen aus der Headerdatei in scheme-integer ;zu konvertieren (define make-oct-int (lambda (i) (string->number (string-append "#o" (number->string i))))) ; ; ;;Farben ; (define color-black COLOR_BLACK) (define color-red COLOR_RED) (define color-green COLOR_GREEN) (define color-yellow COLOR_YELLOW) (define color-blue COLOR_BLUE) (define color-magenta COLOR_MAGENTA) (define color-cyan COLOR_CYAN) (define color-white COLOR_WHITE) //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! //M-x replace-regexp //#define KEY_\(.*\).*0[0-9][0-9][0-9].**/ //(define key-\1 KEY_\1) ; ; ;;Sondertasten ; (define key-code-yes (make-oct-int KEY_CODE_YES)) (define key-min (make-oct-int KEY_MIN)) (define key-break (make-oct-int KEY_BREAK)) (define key-sreset (make-oct-int KEY_SRESET)) (define key-reset (make-oct-int KEY_RESET)) ; (define key-down (make-oct-int KEY_DOWN)) (define key-up (make-oct-int KEY_UP)) (define key-left (make-oct-int KEY_LEFT)) (define key-right (make-oct-int KEY_RIGHT)) (define key-home (make-oct-int KEY_HOME)) (define key-backspace (make-oct-int KEY_BACKSPACE)) (define key-f0 (make-oct-int KEY_F0)) ; (define key-f1 (+ (make-oct-int KEY_F0) 1)) (define key-f2 (+ (make-oct-int KEY_F0) 2)) (define key-f3 (+ (make-oct-int KEY_F0) 3)) (define key-f4 (+ (make-oct-int KEY_F0) 4)) (define key-f5 (+ (make-oct-int KEY_F0) 5)) (define key-f6 (+ (make-oct-int KEY_F0) 6)) (define key-f7 (+ (make-oct-int KEY_F0) 7)) (define key-f8 (+ (make-oct-int KEY_F0) 8)) (define key-f9 (+ (make-oct-int KEY_F0) 9)) (define key-f10 (+ (make-oct-int KEY_F0) 10)) (define key-f11 (+ (make-oct-int KEY_F0) 11)) (define key-f12 (+ (make-oct-int KEY_F0) 12)) ; (define key-dl (make-oct-int KEY_DL)) (define key-il (make-oct-int KEY_IL)) (define key-dc (make-oct-int KEY_DC)) (define key-ic (make-oct-int KEY_IC)) (define key-eic (make-oct-int KEY_EIC)) (define key-clear1 (make-oct-int KEY_CLEAR)) (define key-eos (make-oct-int KEY_EOS)) (define key-eol (make-oct-int KEY_EOL)) (define key-sf (make-oct-int KEY_SF)) (define key-sr (make-oct-int KEY_SR)) (define key-npage (make-oct-int KEY_NPAGE)) (define key-ppage (make-oct-int KEY_PPAGE)) (define key-stab (make-oct-int KEY_STAB)) (define key-ctab (make-oct-int KEY_CTAB)) (define key-catab (make-oct-int KEY_CATAB)) (define key-enter (make-oct-int KEY_ENTER)) (define key-print (make-oct-int KEY_PRINT)) (define key-ll (make-oct-int KEY_LL)) (define key-a1 (make-oct-int KEY_A1)) (define key-a3 (make-oct-int KEY_A3)) (define key-b2 (make-oct-int KEY_B2)) (define key-c1 (make-oct-int KEY_C1)) (define key-c3 (make-oct-int KEY_C3)) (define key-btab (make-oct-int KEY_BTAB)) (define key-beg (make-oct-int KEY_BEG)) (define key-cancel (make-oct-int KEY_CANCEL)) (define key-close (make-oct-int KEY_CLOSE)) (define key-command (make-oct-int KEY_COMMAND)) (define key-copy (make-oct-int KEY_COPY)) (define key-create (make-oct-int KEY_CREATE)) (define key-end (make-oct-int KEY_END)) (define key-exit (make-oct-int KEY_EXIT)) (define key-find (make-oct-int KEY_FIND)) (define key-help (make-oct-int KEY_HELP)) (define key-mark (make-oct-int KEY_MARK)) (define key-message (make-oct-int KEY_MESSAGE)) (define key-move1 (make-oct-int KEY_MOVE)) (define key-next (make-oct-int KEY_NEXT)) (define key-open (make-oct-int KEY_OPEN)) (define key-options (make-oct-int KEY_OPTIONS)) (define key-previous (make-oct-int KEY_PREVIOUS)) (define key-redo (make-oct-int KEY_REDO)) (define key-reference (make-oct-int KEY_REFERENCE)) (define key-refresh1 (make-oct-int KEY_REFRESH)) (define key-replace (make-oct-int KEY_REPLACE)) (define key-restart (make-oct-int KEY_RESTART)) (define key-resume (make-oct-int KEY_RESUME)) (define key-save (make-oct-int KEY_SAVE)) (define key-sbeg (make-oct-int KEY_SBEG)) (define key-scancel (make-oct-int KEY_SCANCEL)) (define key-scommand (make-oct-int KEY_SCOMMAND)) (define key-scopy (make-oct-int KEY_SCOPY)) (define key-screate (make-oct-int KEY_SCREATE)) (define key-sdc (make-oct-int KEY_SDC)) (define key-sdl (make-oct-int KEY_SDL)) (define key-select (make-oct-int KEY_SELECT)) (define key-send (make-oct-int KEY_SEND)) (define key-seol (make-oct-int KEY_SEOL)) (define key-sexit (make-oct-int KEY_SEXIT)) (define key-sfind (make-oct-int KEY_SFIND)) (define key-shelp (make-oct-int KEY_SHELP)) (define key-shome (make-oct-int KEY_SHOME)) (define key-sic (make-oct-int KEY_SIC)) (define key-sleft (make-oct-int KEY_SLEFT)) (define key-smessage (make-oct-int KEY_SMESSAGE)) (define key-smove (make-oct-int KEY_SMOVE)) (define key-snext (make-oct-int KEY_SNEXT)) (define key-soptions (make-oct-int KEY_SOPTIONS)) (define key-sprevious (make-oct-int KEY_SPREVIOUS)) (define key-sprint (make-oct-int KEY_SPRINT)) (define key-sredo (make-oct-int KEY_SREDO)) (define key-sreplace (make-oct-int KEY_SREPLACE)) (define key-sright (make-oct-int KEY_SRIGHT)) (define key-srsume (make-oct-int KEY_SRSUME)) (define key-ssave (make-oct-int KEY_SSAVE)) (define key-ssuspend (make-oct-int KEY_SSUSPEND)) (define key-sundo (make-oct-int KEY_SUNDO)) (define key-suspend (make-oct-int KEY_SUSPEND)) (define key-undo (make-oct-int KEY_UNDO)) (define key-mouse (make-oct-int KEY_MOUSE)) (define key-resize (make-oct-int KEY_RESIZE)) (define key-event (make-oct-int KEY_EVENT))