├── .gitignore ├── native ├── tinfo │ ├── include │ │ ├── config.h │ │ ├── hashsize.h │ │ ├── eti.h │ │ ├── unctrl.h │ │ ├── nc_mingw.h │ │ ├── tty_input.h │ │ ├── fifo_defs.h │ │ ├── nc_panel.h │ │ ├── hashed_db.h │ │ └── termcap.h │ ├── fallback.c │ ├── expanded.c │ ├── version.c │ ├── lib_termname.c │ ├── use_window.c │ ├── lib_immedok.c │ ├── lib_winch.c │ ├── lib_clear.c │ ├── lib_clearok.c │ ├── lib_leaveok.c │ ├── lib_scrollok.c │ ├── getenv_num.c │ ├── nc_panel.c │ ├── lib_scrreg.c │ ├── lib_move.c │ ├── use_screen.c │ ├── legacy_coding.c │ ├── lib_isendwin.c │ ├── lib_insdel.c │ ├── lib_slktouch.c │ ├── lib_slkatrset.c │ ├── lib_colorset.c │ ├── lib_wattroff.c │ ├── lib_slkattr.c │ ├── lib_wattron.c │ ├── lib_delch.c │ ├── lib_inchstr.c │ ├── keybound.c │ ├── home_terminfo.c │ ├── lib_slklab.c │ ├── lib_insnstr.c │ ├── memmove.c │ ├── doalloc.c │ ├── lib_chgat.c │ ├── lib_hline.c │ ├── lib_vline.c │ ├── lib_slkatrof.c │ ├── lib_slkatron.c │ ├── lib_slkcolor.c │ ├── free_ttype.c │ ├── lib_clrbot.c │ ├── lib_echo.c │ ├── lib_endwin.c │ ├── lib_slkclear.c │ ├── lib_slkinit.c │ ├── lib_clreol.c │ ├── lib_redrawln.c │ ├── lib_flash.c │ ├── lib_slkatr_set.c │ ├── lib_longname.c │ ├── lib_nl.c │ ├── lib_beep.c │ └── lib_ungetch.c ├── tar_lzma.sh ├── .gitignore ├── terminfo │ ├── s │ │ └── screen │ ├── v │ │ └── vt100 │ └── x │ │ └── xterm ├── android-make ├── upload.sh ├── emacs-headers │ ├── arg-nonnull.h │ ├── warn-on-use.h │ ├── alloca.h │ └── stdalign.h ├── buildobj.h ├── android-configure ├── build-util.inc ├── android-configure-list ├── build.sh ├── android-configure-list-tinfo └── epaths.h └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /native/tinfo/include/config.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /native/tar_lzma.sh: -------------------------------------------------------------------------------- 1 | tar cv $2 | lzma > $1 2 | -------------------------------------------------------------------------------- /native/.gitignore: -------------------------------------------------------------------------------- 1 | /android.mk 2 | /emacs-src 3 | /build.log 4 | /build 5 | -------------------------------------------------------------------------------- /native/terminfo/s/screen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zielmicha/emacs-android/HEAD/native/terminfo/s/screen -------------------------------------------------------------------------------- /native/terminfo/v/vt100: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zielmicha/emacs-android/HEAD/native/terminfo/v/vt100 -------------------------------------------------------------------------------- /native/terminfo/x/xterm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zielmicha/emacs-android/HEAD/native/terminfo/x/xterm -------------------------------------------------------------------------------- /native/tinfo/include/hashsize.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hashsize.h -- hash and token table constants 3 | */ 4 | 5 | #define CAPTABSIZE 497 6 | #define HASHTABSIZE (497 * 2) 7 | -------------------------------------------------------------------------------- /native/android-make: -------------------------------------------------------------------------------- 1 | if [ "$TOOLCHAIN" = "" ]; then 2 | TOOLCHAIN=~/standalone-toolchain/ 3 | fi 4 | export PATH=$PATH:$TOOLCHAIN/bin 5 | make -f android.mk $* CC=arm-linux-androideabi-gcc 6 | -------------------------------------------------------------------------------- /native/tinfo/fallback.c: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE BY HAND! It is generated by MKfallback.sh. 3 | */ 4 | 5 | #include 6 | 7 | NCURSES_EXPORT(const TERMTYPE *) _nc_fallback (const char *name GCC_UNUSED) 8 | { 9 | /* the fallback list is empty */ 10 | return((TERMTYPE *)0); 11 | } 12 | -------------------------------------------------------------------------------- /native/upload.sh: -------------------------------------------------------------------------------- 1 | DESCR="Uploads packaged resources and emacs executable using SCP (scp file \$1/file)" 2 | if [ "$1" = "" ]; then 3 | echo "Usage: ./upload.sh user@host:path" 4 | echo $DESCR 5 | exit 1 6 | fi 7 | 8 | scp build/lisp.tlzma $1/lisp.tlzma 9 | scp build/terminfo.tlzma $1/terminfo.tlzma 10 | scp build/etc.tlzma $1/etc.tlzma 11 | lzma < build/emacs.bin > build/emacs.lzma 12 | scp build/emacs.lzma $1/emacs.lzma 13 | -------------------------------------------------------------------------------- /native/emacs-headers/arg-nonnull.h: -------------------------------------------------------------------------------- 1 | /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools 2 | that the values passed as arguments n, ..., m must be non-NULL pointers. 3 | n = 1 stands for the first argument, n = 2 for the second argument etc. */ 4 | #ifndef _GL_ARG_NONNULL 5 | # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3 6 | # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) 7 | # else 8 | # define _GL_ARG_NONNULL(params) 9 | # endif 10 | #endif 11 | -------------------------------------------------------------------------------- /native/buildobj.h: -------------------------------------------------------------------------------- 1 | #define BUILDOBJ "dispnew.o frame.o scroll.o xdisp.o menu.o window.o charset.o coding.o category.o ccl.o character.o chartab.o bidi.o cm.o term.o terminal.o xfaces.o dbusbind.o emacs.o keyboard.o macros.o keymap.o sysdep.o buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o dired.o cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o alloc.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o font.o print.o lread.o syntax.o unexelf.o bytecode.o process.o gnutls.o callproc.o region-cache.o sound.o atimer.o doprnt.o intervals.o textprop.o composite.o xml.o terminfo.o lastfile.o vm-limit.o " 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This is Emacs port for Android. 2 | This repo contains only build scripts. 3 | 4 | Building 5 | ============= 6 | 7 | cd native 8 | git clone http://github.com/zielmicha/emacs.git emacs-src 9 | ./build.sh 10 | 11 | Installation 12 | ============= 13 | 14 | git clone https://github.com/zielmicha/emacs-android-app.git 15 | cd emacs-android-app 16 | ant debug install 17 | 18 | Setting up mirror 19 | ============ 20 | 21 | By default Android application downloads pre-build Emacs from emacs.zielm.com. 22 | If you want to use your own build: 23 | 24 | 1. Setup HTTP server with SSH access. 25 | 2. `cd native; ./upload.sh username@host:path` 26 | 3. Download http://emacs.zielm.com/data/busyboxrc.sh to the same directory. 27 | 4. Change MIRROR=... in busyboxrc.sh to your server URL. 28 | -------------------------------------------------------------------------------- /native/android-configure: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | shopt -s lastpipe 3 | lines="$(cat android-configure-list | while read line; do echo emacs-src/$line; done; cat android-configure-list-tinfo)" 4 | all="" 5 | for line in $lines; do 6 | all="$all build/$line" 7 | bname=$(dirname $line)/$(basename $line .o) 8 | echo -e "build/$bname.o: $bname.c" 9 | echo -e "\t\$(CC) -std=gnu99 -Demacs -O2 -c -I. -Iemacs-src/src -Iemacs-src/lib -Itinfo/include -Iemacs-headers $bname.c -o build/$bname.o " 10 | done > .android.mk.tmp 11 | 12 | exec > android.mk 13 | echo -e "CC=gcc" 14 | echo -e "all: build/emacs.bin" 15 | echo -e "clean:" 16 | echo -e "\trm -rf build" 17 | echo -e "build/emacs.bin: $all" 18 | echo -e "\t\$(CC) build/emacs-src/lib/*.o build/emacs-src/src/*.o build/tinfo/*.o -o build/emacs.bin -ldl -lm" 19 | cat .android.mk.tmp 20 | rm .android.mk.tmp 21 | -------------------------------------------------------------------------------- /native/build-util.inc: -------------------------------------------------------------------------------- 1 | 2 | if [ "$RANDOM" = "" ]; then 3 | echo "Run this script with bash, not sh". 4 | exit 1 5 | fi 6 | 7 | 8 | check() { 9 | $* || exit 10 | } 11 | 12 | skip() { 13 | $* 2>/dev/null 14 | } 15 | 16 | trimout() { 17 | ($* 2>&1; echo $?>"$base/.success") | tee -a "$base/build.log" | (curr=0; while read line; do 18 | i=$[curr%7] 19 | [ $i = 0 ] && ch='|' 20 | [ $i = 1 ] && ch='/' 21 | [ $i = 2 ] && ch='-' 22 | [ $i = 3 ] && ch='\' 23 | [ $i = 4 ] && ch='/' 24 | [ $i = 5 ] && ch='-' 25 | [ $i = 6 ] && ch='\' 26 | printf "\b%s" $ch 27 | curr=$[curr+1] 28 | done) 29 | return $(cat "$base/.success"; rm "$base/.success") 30 | } 31 | 32 | die() { 33 | cd "$base" 34 | echo 35 | echo -e "${RED}Here is \`tail build.log\`:$NORMAL" 36 | tail build.log 37 | echo -e "${RED}Build failed. See build.log for details.$NORMAL" >&2 38 | exit 1 39 | } 40 | 41 | end_progress() { 42 | echo -e "\bdone" 43 | } 44 | 45 | NORMAL="\033[0m" 46 | RED="\033[31;1m" 47 | GREEN="\033[32;1m" 48 | BLUE="\033[34;1m" 49 | YELLOW="\033[33;1m" 50 | WHITE="\033[37;1m" 51 | AAA="\033[01;32m" 52 | 53 | 54 | progress() { 55 | printf "$GREEN%s$NORMAL... " "$1" 56 | } 57 | -------------------------------------------------------------------------------- /native/android-configure-list: -------------------------------------------------------------------------------- 1 | lib/allocator.o 2 | lib/careadlinkat.o 3 | lib/c-ctype.o 4 | lib/c-strcasecmp.o 5 | lib/c-strncasecmp.o 6 | lib/dtoastr.o 7 | lib/dtotimespec.o 8 | lib/filemode.o 9 | lib/getopt1.o 10 | lib/getopt.o 11 | lib/gettime.o 12 | lib/md5.o 13 | lib/sha1.o 14 | lib/sha256.o 15 | lib/sha512.o 16 | lib/strftime.o 17 | lib/timespec-add.o 18 | lib/timespec-sub.o 19 | lib/utimens.o 20 | src/alloc.o 21 | src/atimer.o 22 | src/bidi.o 23 | src/buffer.o 24 | src/bytecode.o 25 | src/callint.o 26 | src/callproc.o 27 | src/casefiddle.o 28 | src/casetab.o 29 | src/category.o 30 | src/ccl.o 31 | src/character.o 32 | src/charset.o 33 | src/chartab.o 34 | src/cmds.o 35 | src/cm.o 36 | src/coding.o 37 | src/composite.o 38 | src/data.o 39 | src/dbusbind.o 40 | src/dired.o 41 | src/dispnew.o 42 | src/doc.o 43 | src/doprnt.o 44 | src/editfns.o 45 | src/emacs.o 46 | src/eval.o 47 | src/fileio.o 48 | src/filelock.o 49 | src/floatfns.o 50 | src/fns.o 51 | src/font.o 52 | src/frame.o 53 | src/gnutls.o 54 | src/indent.o 55 | src/insdel.o 56 | src/intervals.o 57 | src/keyboard.o 58 | src/keymap.o 59 | src/lastfile.o 60 | src/lread.o 61 | src/macros.o 62 | src/marker.o 63 | src/menu.o 64 | src/minibuf.o 65 | src/pre-crt0.o 66 | src/print.o 67 | src/process.o 68 | src/regex.o 69 | src/region-cache.o 70 | src/scroll.o 71 | src/search.o 72 | src/sound.o 73 | src/syntax.o 74 | src/sysdep.o 75 | src/terminal.o 76 | src/terminfo.o 77 | src/term.o 78 | src/textprop.o 79 | src/undo.o 80 | src/unexelf.o 81 | src/vm-limit.o 82 | src/window.o 83 | src/xdisp.o 84 | src/xfaces.o 85 | src/xml.o 86 | -------------------------------------------------------------------------------- /native/tinfo/expanded.c: -------------------------------------------------------------------------------- 1 | /* generated by MKexpanded.sh */ 2 | #define NEED_NCURSES_CH_T 1 3 | #include 4 | 5 | #ifndef CUR 6 | #define CUR SP_TERMTYPE 7 | #endif 8 | 9 | #if NCURSES_EXPANDED 10 | void 11 | _nc_toggle_attr_on (attr_t *S, attr_t at) 12 | { 13 | { if (((int)((((unsigned long)(at) & ((((1U) << 8) - 1U) << ((0) + 8))) >> 8))) > 0) { (*S) = ((*S) & ALL_BUT_COLOR) | (attr_t) (at); } else { (*S) |= (attr_t) (at); } ;}; 14 | } 15 | 16 | void 17 | _nc_toggle_attr_off (attr_t *S, attr_t at) 18 | { 19 | { if (((int)((((unsigned long)(at) & ((((1U) << 8) - 1U) << ((0) + 8))) >> 8))) > 0) { (*S) &= ~(at|((((1U) << 8) - 1U) << ((0) + 8))); } else { (*S) &= ~(at); } ;}; 20 | } 21 | 22 | int 23 | _nc_DelCharCost ( int count) 24 | { 25 | return ((cur_term->type. Strings[105] != 0) ? SP->_dch_cost : ((cur_term->type. Strings[21] != 0) ? (SP->_dch1_cost * count) : 1000000)); 26 | } 27 | 28 | int 29 | _nc_InsCharCost ( int count) 30 | { 31 | return ((cur_term->type. Strings[108] != 0) ? SP->_ich_cost : ((cur_term->type. Strings[31] && cur_term->type. Strings[42]) ? SP->_smir_cost + SP->_rmir_cost + (SP->_ip_cost * count) : ((cur_term->type. Strings[52] != 0) ? ((SP->_ich1_cost + SP->_ip_cost) * count) : 1000000))); 32 | } 33 | 34 | void 35 | _nc_UpdateAttrs ( chtype c) 36 | { 37 | if (!((((*((SP)->_current_attr))) & (chtype)((~(1U - 1U)) << ((0) + 8))) == ((c) & (chtype)((~(1U - 1U)) << ((0) + 8))))) { vidattr(((c) & (chtype)((~(1U - 1U)) << ((0) + 8)))); }; 38 | } 39 | 40 | #if NCURSES_SP_FUNCS 41 | int 42 | _nc_DelCharCost (int count) 43 | { 44 | return _nc_DelCharCost (SP, count); 45 | } 46 | 47 | int 48 | _nc_InsCharCost (int count) 49 | { 50 | return _nc_InsCharCost(SP, count); 51 | } 52 | 53 | void 54 | _nc_UpdateAttrs (chtype c) 55 | { 56 | _nc_UpdateAttrs(SP,c); 57 | } 58 | #endif 59 | #else /* ! NCURSES_EXPANDED */ 60 | NCURSES_EXPORT(void) _nc_expanded (void) { } 61 | #endif /* NCURSES_EXPANDED */ 62 | -------------------------------------------------------------------------------- /native/emacs-headers/warn-on-use.h: -------------------------------------------------------------------------------- 1 | #ifndef _GL_WARN_ON_USE 2 | 3 | # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) 4 | /* A compiler attribute is available in gcc versions 4.3.0 and later. */ 5 | # define _GL_WARN_ON_USE(function, message) \ 6 | extern __typeof__ (function) function __attribute__ ((__warning__ (message))) 7 | # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 8 | /* Verify the existence of the function. */ 9 | # define _GL_WARN_ON_USE(function, message) \ 10 | extern __typeof__ (function) function 11 | # else /* Unsupported. */ 12 | # define _GL_WARN_ON_USE(function, message) \ 13 | _GL_WARN_EXTERN_C int _gl_warn_on_use 14 | # endif 15 | #endif 16 | 17 | /* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string") 18 | is like _GL_WARN_ON_USE (function, "string"), except that the function is 19 | declared with the given prototype, consisting of return type, parameters, 20 | and attributes. 21 | This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does 22 | not work in this case. */ 23 | #ifndef _GL_WARN_ON_USE_CXX 24 | # if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) 25 | # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 26 | extern rettype function parameters_and_attributes \ 27 | __attribute__ ((__warning__ (msg))) 28 | # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING 29 | /* Verify the existence of the function. */ 30 | # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 31 | extern rettype function parameters_and_attributes 32 | # else /* Unsupported. */ 33 | # define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ 34 | _GL_WARN_EXTERN_C int _gl_warn_on_use 35 | # endif 36 | #endif 37 | 38 | /* _GL_WARN_EXTERN_C declaration; 39 | performs the declaration with C linkage. */ 40 | #ifndef _GL_WARN_EXTERN_C 41 | # if defined __cplusplus 42 | # define _GL_WARN_EXTERN_C extern "C" 43 | # else 44 | # define _GL_WARN_EXTERN_C extern 45 | # endif 46 | #endif 47 | -------------------------------------------------------------------------------- /native/emacs-headers/alloca.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ 2 | /* Memory allocation on the stack. 3 | 4 | Copyright (C) 1995, 1999, 2001-2004, 2006-2012 Free Software Foundation, 5 | Inc. 6 | 7 | This program is free software; you can redistribute it and/or modify it 8 | under the terms of the GNU General Public License as published 9 | by the Free Software Foundation; either version 3, or (at your option) 10 | any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public 18 | License along with this program; if not, see 19 | . 20 | */ 21 | 22 | /* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H 23 | means there is a real alloca function. */ 24 | #ifndef _GL_ALLOCA_H 25 | #define _GL_ALLOCA_H 26 | 27 | /* alloca (N) returns a pointer to N bytes of memory 28 | allocated on the stack, which will last until the function returns. 29 | Use of alloca should be avoided: 30 | - inside arguments of function calls - undefined behaviour, 31 | - in inline functions - the allocation may actually last until the 32 | calling function returns, 33 | - for huge N (say, N >= 65536) - you never know how large (or small) 34 | the stack is, and when the stack cannot fulfill the memory allocation 35 | request, the program just crashes. 36 | */ 37 | 38 | #ifndef alloca 39 | # ifdef __GNUC__ 40 | # define alloca __builtin_alloca 41 | # elif defined _AIX 42 | # define alloca __alloca 43 | # elif defined _MSC_VER 44 | # include 45 | # define alloca _alloca 46 | # elif defined __DECC && defined __VMS 47 | # define alloca __ALLOCA 48 | # elif defined __TANDEM && defined _TNS_E_TARGET 49 | # ifdef __cplusplus 50 | extern "C" 51 | # endif 52 | void *_alloca (unsigned short); 53 | # pragma intrinsic (_alloca) 54 | # define alloca _alloca 55 | # else 56 | # include 57 | # ifdef __cplusplus 58 | extern "C" 59 | # endif 60 | void *alloca (size_t); 61 | # endif 62 | #endif 63 | 64 | #endif /* _GL_ALLOCA_H */ 65 | -------------------------------------------------------------------------------- /native/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source build-util.inc || exit 1 4 | 5 | if [ ! -d emacs-src/.git ]; then 6 | echo "Execute:" 7 | echo "git clone http://github.com/zielmicha/emacs.git emacs-src" 8 | exit 1 9 | fi 10 | 11 | export base="$(pwd)" 12 | 13 | (echo "started build"; date) >> build.log 14 | 15 | skip mkdir -p build/emacs-src/lib 16 | skip mkdir -p build/emacs-src/src 17 | skip mkdir -p build/tinfo 18 | 19 | echo "Building Emacs for Android." 20 | echo " * more detailed log: build.log" 21 | echo " * to start from begining remove build/ and android.mk" 22 | echo 23 | 24 | progress '1) Building Android Emacs' 25 | 26 | if [ ! -f android.mk ]; then 27 | trimout ./android-configure || die 28 | fi 29 | trimout ./android-make -j5 || die 30 | 31 | end_progress 32 | 33 | progress "2) Building Host Emacs" 34 | echo 35 | 36 | build_confirm_path=build/host/emacs_built 37 | if [ -f $build_confirm_path ]; then 38 | echo " already built - to rebuild delete $build_confirm_path" 39 | else 40 | progress " copying Emacs source" 41 | 42 | trimout rm -rvf build/host 43 | mkdir build/host || die 44 | trimout git clone --progress emacs-src build/host/ || die 45 | cd build/host 46 | trimout git checkout de81159faf05814ed5e89c1addcee41b80f25c29 -- . || die 47 | end_progress 48 | 49 | progress " running ./autogen.sh" 50 | trimout ./autogen.sh || die 51 | end_progress 52 | 53 | progress " running ./configure" 54 | trimout ./configure || die 55 | end_progress 56 | 57 | progress " running make -j4" 58 | trimout make -j4 || die 59 | end_progress 60 | 61 | cd ../.. 62 | 63 | touch $build_confirm_path 64 | fi 65 | 66 | progress "3) Finishing" 67 | echo 68 | 69 | if [ ! -f "build/busybox-arm" ]; then 70 | progress " downloading BusyBox binary" 71 | trimout wget --progress=dot http://busybox.net/downloads/binaries/1.19.0/busybox-armv5l -O build/busybox-arm || die 72 | end_progress 73 | else 74 | echo " BusyBox binary aleardy downloaded" 75 | fi 76 | 77 | progress " packaging Lisp modules" 78 | cd build/host || die 79 | trimout $base/tar_lzma.sh ../lisp.tlzma lisp || die 80 | end_progress 81 | cd ../.. 82 | 83 | progress " packaging etc" 84 | cd emacs-src || die 85 | trimout $base/tar_lzma.sh ../build/etc.tlzma etc || die 86 | end_progress 87 | cd .. 88 | 89 | progress " packaging terminfo" 90 | trimout $base/tar_lzma.sh build/terminfo.tlzma terminfo || die 91 | end_progress 92 | -------------------------------------------------------------------------------- /native/tinfo/version.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1999-2004,2005 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Thomas E. Dickey 1999 * 31 | ****************************************************************************/ 32 | 33 | #include 34 | 35 | MODULE_ID("$Id: version.c,v 1.6 2005/01/02 01:23:54 tom Exp $") 36 | 37 | NCURSES_EXPORT(const char *) 38 | curses_version(void) 39 | { 40 | T((T_CALLED("curses_version()"))); 41 | returnCPtr("ncurses " NCURSES_VERSION_STRING); 42 | } 43 | -------------------------------------------------------------------------------- /native/tinfo/lib_termname.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | #include 30 | 31 | MODULE_ID("$Id: lib_termname.c,v 1.12 2009/10/24 21:56:58 tom Exp $") 32 | 33 | NCURSES_EXPORT(char *) 34 | NCURSES_SP_NAME(termname) (NCURSES_SP_DCL0) 35 | { 36 | char *name = 0; 37 | 38 | T((T_CALLED("termname(%p)"), (void *) SP_PARM)); 39 | 40 | #if NCURSES_SP_FUNCS 41 | if (TerminalOf(SP_PARM) != 0) { 42 | name = TerminalOf(SP_PARM)->_termname; 43 | } 44 | #else 45 | if (cur_term != 0) 46 | name = cur_term->_termname; 47 | #endif 48 | 49 | returnPtr(name); 50 | } 51 | 52 | #if NCURSES_SP_FUNCS 53 | NCURSES_EXPORT(char *) 54 | termname(void) 55 | { 56 | return NCURSES_SP_NAME(termname) (CURRENT_SCREEN); 57 | } 58 | #endif 59 | -------------------------------------------------------------------------------- /native/tinfo/use_window.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 2007-2008,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Thomas E. Dickey 2007 * 31 | ****************************************************************************/ 32 | 33 | #include 34 | 35 | MODULE_ID("$Id: use_window.c,v 1.9 2009/10/24 22:40:24 tom Exp $") 36 | 37 | NCURSES_EXPORT(int) 38 | use_window(WINDOW *win, NCURSES_WINDOW_CB func, void *data) 39 | { 40 | int code = OK; 41 | 42 | T((T_CALLED("use_window(%p,%p,%p)"), (void *) win, func, data)); 43 | _nc_lock_global(curses); 44 | code = func(win, data); 45 | _nc_unlock_global(curses); 46 | 47 | returnCode(code); 48 | } 49 | -------------------------------------------------------------------------------- /native/tinfo/lib_immedok.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | ****************************************************************************/ 33 | 34 | /* 35 | ** lib_immedok.c 36 | ** 37 | ** The routine immedok. 38 | ** 39 | */ 40 | 41 | #include 42 | 43 | MODULE_ID("$Id: lib_immedok.c,v 1.5 2009/10/24 22:32:11 tom Exp $") 44 | 45 | NCURSES_EXPORT(void) 46 | immedok(WINDOW *win, bool flag) 47 | { 48 | T((T_CALLED("immedok(%p,%d)"), (void *) win, flag)); 49 | 50 | if (win) 51 | win->_immed = flag; 52 | 53 | returnVoid; 54 | } 55 | -------------------------------------------------------------------------------- /native/tinfo/lib_winch.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Thomas E. Dickey 1998 * 31 | ****************************************************************************/ 32 | 33 | /* 34 | ** lib_winch.c 35 | ** 36 | ** The routine winch(). 37 | ** 38 | */ 39 | 40 | #include 41 | 42 | MODULE_ID("$Id: lib_winch.c,v 1.8 2010/12/19 01:22:58 tom Exp $") 43 | 44 | NCURSES_EXPORT(chtype) 45 | winch(WINDOW *win) 46 | { 47 | T((T_CALLED("winch(%p)"), (void *) win)); 48 | if (win != 0) { 49 | returnChtype((chtype) CharOf(win->_line[win->_cury].text[win->_curx]) 50 | | AttrOf(win->_line[win->_cury].text[win->_curx])); 51 | } else { 52 | returnChtype(0); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /native/tinfo/lib_clear.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | ****************************************************************************/ 33 | 34 | /* 35 | ** lib_clear.c 36 | ** 37 | ** The routine wclear(). 38 | ** 39 | */ 40 | 41 | #include 42 | 43 | MODULE_ID("$Id: lib_clear.c,v 1.8 2009/10/24 22:33:29 tom Exp $") 44 | 45 | NCURSES_EXPORT(int) 46 | wclear(WINDOW *win) 47 | { 48 | int code = ERR; 49 | 50 | T((T_CALLED("wclear(%p)"), (void *) win)); 51 | 52 | if ((code = werase(win)) != ERR) 53 | win->_clear = TRUE; 54 | 55 | returnCode(code); 56 | } 57 | -------------------------------------------------------------------------------- /native/tinfo/lib_clearok.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | ****************************************************************************/ 33 | 34 | /* 35 | ** lib_clearok.c 36 | ** 37 | ** The routine clearok. 38 | ** 39 | */ 40 | 41 | #include 42 | 43 | MODULE_ID("$Id: lib_clearok.c,v 1.5 2009/10/24 22:34:53 tom Exp $") 44 | 45 | NCURSES_EXPORT(int) 46 | clearok(WINDOW *win, bool flag) 47 | { 48 | T((T_CALLED("clearok(%p,%d)"), (void *) win, flag)); 49 | 50 | if (win) { 51 | win->_clear = flag; 52 | returnCode(OK); 53 | } else 54 | returnCode(ERR); 55 | } 56 | -------------------------------------------------------------------------------- /native/tinfo/lib_leaveok.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | ****************************************************************************/ 33 | 34 | /* 35 | ** lib_leaveok.c 36 | ** 37 | ** The routine leaveok. 38 | ** 39 | */ 40 | 41 | #include 42 | 43 | MODULE_ID("$Id: lib_leaveok.c,v 1.6 2009/10/24 22:34:23 tom Exp $") 44 | 45 | NCURSES_EXPORT(int) 46 | leaveok(WINDOW *win, bool flag) 47 | { 48 | T((T_CALLED("leaveok(%p,%d)"), (void *) win, flag)); 49 | 50 | if (win) { 51 | win->_leaveok = flag; 52 | returnCode(OK); 53 | } else 54 | returnCode(ERR); 55 | } 56 | -------------------------------------------------------------------------------- /native/tinfo/lib_scrollok.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | ****************************************************************************/ 33 | 34 | /* 35 | ** lib_scrollok.c 36 | ** 37 | ** The routine scrollok. 38 | ** 39 | */ 40 | 41 | #include 42 | 43 | MODULE_ID("$Id: lib_scrollok.c,v 1.5 2009/10/24 22:35:38 tom Exp $") 44 | 45 | NCURSES_EXPORT(int) 46 | scrollok(WINDOW *win, bool flag) 47 | { 48 | T((T_CALLED("scrollok(%p,%d)"), (void *) win, flag)); 49 | 50 | if (win) { 51 | win->_scroll = flag; 52 | returnCode(OK); 53 | } else 54 | returnCode(ERR); 55 | } 56 | -------------------------------------------------------------------------------- /native/tinfo/getenv_num.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998,2000 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Thomas E. Dickey 1998 * 31 | ****************************************************************************/ 32 | 33 | /* 34 | * getenv_num.c -- obtain a number from the environment 35 | */ 36 | 37 | #include 38 | 39 | MODULE_ID("$Id: getenv_num.c,v 1.3 2000/12/10 02:55:07 tom Exp $") 40 | 41 | NCURSES_EXPORT(int) 42 | _nc_getenv_num(const char *name) 43 | { 44 | char *dst = 0; 45 | char *src = getenv(name); 46 | long value; 47 | 48 | if ((src == 0) 49 | || (value = strtol(src, &dst, 0)) < 0 50 | || (dst == src) 51 | || (*dst != '\0') 52 | || (int) value < value) 53 | value = -1; 54 | 55 | return (int) value; 56 | } 57 | -------------------------------------------------------------------------------- /native/tinfo/nc_panel.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Thomas E. Dickey 1997 * 31 | ****************************************************************************/ 32 | 33 | #include 34 | 35 | MODULE_ID("$Id: nc_panel.c,v 1.5 2009/04/11 21:05:10 tom Exp $") 36 | 37 | NCURSES_EXPORT(struct panelhook *) 38 | NCURSES_SP_NAME(_nc_panelhook) (NCURSES_SP_DCL0) 39 | { 40 | return (SP_PARM 41 | ? &(SP_PARM->_panelHook) 42 | : (CURRENT_SCREEN 43 | ? &(CURRENT_SCREEN->_panelHook) 44 | : 0)); 45 | } 46 | 47 | #if NCURSES_SP_FUNCS 48 | NCURSES_EXPORT(struct panelhook *) 49 | _nc_panelhook(void) 50 | { 51 | return NCURSES_SP_NAME(_nc_panelhook) (CURRENT_SCREEN); 52 | } 53 | #endif 54 | -------------------------------------------------------------------------------- /native/tinfo/include/eti.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2002,2003 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Juergen Pfeifer, 1995,1997 * 31 | ****************************************************************************/ 32 | 33 | /* $Id: eti.h,v 1.8 2003/10/25 15:24:29 tom Exp $ */ 34 | 35 | #ifndef NCURSES_ETI_H_incl 36 | #define NCURSES_ETI_H_incl 1 37 | 38 | #define E_OK (0) 39 | #define E_SYSTEM_ERROR (-1) 40 | #define E_BAD_ARGUMENT (-2) 41 | #define E_POSTED (-3) 42 | #define E_CONNECTED (-4) 43 | #define E_BAD_STATE (-5) 44 | #define E_NO_ROOM (-6) 45 | #define E_NOT_POSTED (-7) 46 | #define E_UNKNOWN_COMMAND (-8) 47 | #define E_NO_MATCH (-9) 48 | #define E_NOT_SELECTABLE (-10) 49 | #define E_NOT_CONNECTED (-11) 50 | #define E_REQUEST_DENIED (-12) 51 | #define E_INVALID_FIELD (-13) 52 | #define E_CURRENT (-14) 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /native/tinfo/lib_scrreg.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | ****************************************************************************/ 33 | 34 | /* 35 | ** lib_scrreg.c 36 | ** 37 | ** The routine wsetscrreg(). 38 | ** 39 | */ 40 | 41 | #include 42 | 43 | MODULE_ID("$Id: lib_scrreg.c,v 1.11 2009/10/24 22:35:28 tom Exp $") 44 | 45 | NCURSES_EXPORT(int) 46 | wsetscrreg(WINDOW *win, int top, int bottom) 47 | { 48 | T((T_CALLED("wsetscrreg(%p,%d,%d)"), (void *) win, top, bottom)); 49 | 50 | if (win && 51 | top >= 0 && top <= win->_maxy && 52 | bottom >= 0 && bottom <= win->_maxy && 53 | bottom > top) { 54 | win->_regtop = (NCURSES_SIZE_T) top; 55 | win->_regbottom = (NCURSES_SIZE_T) bottom; 56 | 57 | returnCode(OK); 58 | } else 59 | returnCode(ERR); 60 | } 61 | -------------------------------------------------------------------------------- /native/tinfo/lib_move.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2004,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | * and: Thomas E. Dickey 1996-on * 33 | ****************************************************************************/ 34 | 35 | /* 36 | ** lib_move.c 37 | ** 38 | ** The routine wmove(). 39 | ** 40 | */ 41 | 42 | #include 43 | 44 | MODULE_ID("$Id: lib_move.c,v 1.13 2009/10/24 22:34:07 tom Exp $") 45 | 46 | NCURSES_EXPORT(int) 47 | wmove(WINDOW *win, int y, int x) 48 | { 49 | T((T_CALLED("wmove(%p,%d,%d)"), (void *) win, y, x)); 50 | 51 | if (LEGALYX(win, y, x)) { 52 | win->_curx = (NCURSES_SIZE_T) x; 53 | win->_cury = (NCURSES_SIZE_T) y; 54 | 55 | win->_flags &= ~_WRAPPED; 56 | win->_flags |= _HASMOVED; 57 | returnCode(OK); 58 | } else 59 | returnCode(ERR); 60 | } 61 | -------------------------------------------------------------------------------- /native/tinfo/use_screen.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 2007-2008,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Thomas E. Dickey 2007 * 31 | ****************************************************************************/ 32 | 33 | #include 34 | 35 | MODULE_ID("$Id: use_screen.c,v 1.8 2009/10/24 22:40:20 tom Exp $") 36 | 37 | NCURSES_EXPORT(int) 38 | use_screen(SCREEN *screen, NCURSES_SCREEN_CB func, void *data) 39 | { 40 | SCREEN *save_SP; 41 | int code = OK; 42 | 43 | T((T_CALLED("use_screen(%p,%p,%p)"), (void *) screen, func, (void *) data)); 44 | 45 | /* 46 | * FIXME - add a flag so a given thread can check if _it_ has already 47 | * recurred through this point, return an error if so. 48 | */ 49 | _nc_lock_global(curses); 50 | save_SP = CURRENT_SCREEN; 51 | set_term(screen); 52 | 53 | code = func(screen, data); 54 | 55 | set_term(save_SP); 56 | _nc_unlock_global(curses); 57 | returnCode(code); 58 | } 59 | -------------------------------------------------------------------------------- /native/tinfo/legacy_coding.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 2005,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Thomas E. Dickey 2005 * 31 | * Juergen Pfeifer 2009 * 32 | ****************************************************************************/ 33 | 34 | #include 35 | 36 | MODULE_ID("$Id: legacy_coding.c,v 1.5 2009/10/24 22:15:00 tom Exp $") 37 | 38 | NCURSES_EXPORT(int) 39 | NCURSES_SP_NAME(use_legacy_coding) (NCURSES_SP_DCLx int level) 40 | { 41 | int result = ERR; 42 | 43 | T((T_CALLED("use_legacy_coding(%p,%d)"), (void *) SP_PARM, level)); 44 | if (level >= 0 && level <= 2 && SP_PARM != 0) { 45 | result = SP_PARM->_legacy_coding; 46 | SP_PARM->_legacy_coding = level; 47 | } 48 | returnCode(result); 49 | } 50 | 51 | #if NCURSES_SP_FUNCS 52 | NCURSES_EXPORT(int) 53 | use_legacy_coding(int level) 54 | { 55 | return NCURSES_SP_NAME(use_legacy_coding) (CURRENT_SCREEN, level); 56 | } 57 | #endif 58 | -------------------------------------------------------------------------------- /native/tinfo/lib_isendwin.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | * and: Thomas E. Dickey 1996-on * 33 | * and: Juergen Pfeifer 2009 * 34 | ****************************************************************************/ 35 | 36 | /* 37 | ** lib_endwin.c 38 | ** 39 | ** The routine endwin(). 40 | ** 41 | */ 42 | 43 | #include 44 | 45 | MODULE_ID("$Id: lib_isendwin.c,v 1.7 2009/02/15 00:36:24 tom Exp $") 46 | 47 | NCURSES_EXPORT(bool) 48 | NCURSES_SP_NAME(isendwin) (NCURSES_SP_DCL0) 49 | { 50 | if (SP_PARM == NULL) 51 | return FALSE; 52 | return SP_PARM->_endwin; 53 | } 54 | 55 | #if NCURSES_SP_FUNCS 56 | NCURSES_EXPORT(bool) 57 | isendwin(void) 58 | { 59 | return NCURSES_SP_NAME(isendwin) (CURRENT_SCREEN); 60 | } 61 | #endif 62 | -------------------------------------------------------------------------------- /native/tinfo/lib_insdel.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | ****************************************************************************/ 33 | 34 | /* 35 | ** lib_insdel.c 36 | ** 37 | ** The routine winsdelln(win, n). 38 | ** positive n insert n lines above current line 39 | ** negative n delete n lines starting from current line 40 | ** 41 | */ 42 | 43 | #include 44 | 45 | MODULE_ID("$Id: lib_insdel.c,v 1.13 2009/10/24 22:34:41 tom Exp $") 46 | 47 | NCURSES_EXPORT(int) 48 | winsdelln(WINDOW *win, int n) 49 | { 50 | int code = ERR; 51 | 52 | T((T_CALLED("winsdelln(%p,%d)"), (void *) win, n)); 53 | 54 | if (win) { 55 | if (n != 0) { 56 | _nc_scroll_window(win, -n, win->_cury, win->_maxy, 57 | win->_nc_bkgd); 58 | _nc_synchook(win); 59 | } 60 | code = OK; 61 | } 62 | returnCode(code); 63 | } 64 | -------------------------------------------------------------------------------- /native/tinfo/lib_slktouch.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Juergen Pfeifer 1997,2009 * 31 | * and: Thomas E. Dickey 1996-on * 32 | ****************************************************************************/ 33 | 34 | /* 35 | * lib_slktouch.c 36 | * Soft key routines. 37 | * Force the code to believe that the soft keys have been changed. 38 | */ 39 | #include 40 | 41 | MODULE_ID("$Id: lib_slktouch.c,v 1.8 2009/10/24 22:12:21 tom Exp $") 42 | 43 | NCURSES_EXPORT(int) 44 | NCURSES_SP_NAME(slk_touch) (NCURSES_SP_DCL0) 45 | { 46 | T((T_CALLED("slk_touch(%p)"), (void *) SP_PARM)); 47 | 48 | if (SP_PARM == 0 || SP_PARM->_slk == 0) 49 | returnCode(ERR); 50 | SP_PARM->_slk->dirty = TRUE; 51 | 52 | returnCode(OK); 53 | } 54 | 55 | #if NCURSES_SP_FUNCS 56 | NCURSES_EXPORT(int) 57 | slk_touch(void) 58 | { 59 | return NCURSES_SP_NAME(slk_touch) (CURRENT_SCREEN); 60 | } 61 | #endif 62 | -------------------------------------------------------------------------------- /native/tinfo/lib_slkatrset.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2005,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Juergen Pfeifer, 1997 * 31 | * and: Thomas E. Dickey 2005 * 32 | ****************************************************************************/ 33 | 34 | /* 35 | * lib_slkatrset.c 36 | * Soft key routines. 37 | * Set the labels attributes 38 | */ 39 | #include 40 | 41 | MODULE_ID("$Id: lib_slkatrset.c,v 1.10 2009/10/24 22:12:21 tom Exp $") 42 | 43 | NCURSES_EXPORT(int) 44 | NCURSES_SP_NAME(slk_attrset) (NCURSES_SP_DCLx const chtype attr) 45 | { 46 | T((T_CALLED("slk_attrset(%p,%s)"), (void *) SP_PARM, _traceattr(attr))); 47 | 48 | if (SP_PARM != 0 && SP_PARM->_slk != 0) { 49 | SetAttr(SP_PARM->_slk->attr, attr); 50 | returnCode(OK); 51 | } else 52 | returnCode(ERR); 53 | } 54 | 55 | #if NCURSES_SP_FUNCS 56 | NCURSES_EXPORT(int) 57 | slk_attrset(const chtype attr) 58 | { 59 | return NCURSES_SP_NAME(slk_attrset) (CURRENT_SCREEN, attr); 60 | } 61 | #endif 62 | -------------------------------------------------------------------------------- /native/tinfo/lib_colorset.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2005,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Juergen Pfeifer, 1998 * 31 | * and: Thomas E. Dickey, 2005-on * 32 | ****************************************************************************/ 33 | 34 | /* 35 | ** lib_colorset.c 36 | ** 37 | ** The routine wcolor_set(). 38 | ** 39 | */ 40 | 41 | #include 42 | #include 43 | 44 | MODULE_ID("$Id: lib_colorset.c,v 1.13 2009/10/24 22:02:14 tom Exp $") 45 | 46 | NCURSES_EXPORT(int) 47 | wcolor_set(WINDOW *win, short color_pair_number, void *opts) 48 | { 49 | int code = ERR; 50 | 51 | T((T_CALLED("wcolor_set(%p,%d)"), (void *) win, color_pair_number)); 52 | if (win 53 | && !opts 54 | && (SP != 0) 55 | && (color_pair_number >= 0) 56 | && (color_pair_number < SP->_pair_limit)) { 57 | TR(TRACE_ATTRS, ("... current %ld", (long) GET_WINDOW_PAIR(win))); 58 | SET_WINDOW_PAIR(win, color_pair_number); 59 | if_EXT_COLORS(win->_color = color_pair_number); 60 | code = OK; 61 | } 62 | returnCode(code); 63 | } 64 | -------------------------------------------------------------------------------- /native/tinfo/lib_wattroff.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | * and: Thomas E. Dickey 1996-on * 33 | ****************************************************************************/ 34 | 35 | /* 36 | ** lib_wattroff.c 37 | ** 38 | ** The routine wattr_off(). 39 | ** 40 | */ 41 | 42 | #include 43 | #include 44 | 45 | MODULE_ID("$Id: lib_wattroff.c,v 1.10 2009/10/24 22:36:08 tom Exp $") 46 | 47 | NCURSES_EXPORT(int) 48 | wattr_off(WINDOW *win, attr_t at, void *opts GCC_UNUSED) 49 | { 50 | T((T_CALLED("wattr_off(%p,%s)"), (void *) win, _traceattr(at))); 51 | if (win) { 52 | T(("... current %s (%d)", 53 | _traceattr(WINDOW_ATTRS(win)), 54 | GET_WINDOW_PAIR(win))); 55 | 56 | if_EXT_COLORS({ 57 | if (at & A_COLOR) 58 | win->_color = 0; 59 | }); 60 | toggle_attr_off(WINDOW_ATTRS(win), at); 61 | returnCode(OK); 62 | } else 63 | returnCode(ERR); 64 | } 65 | -------------------------------------------------------------------------------- /native/tinfo/lib_slkattr.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Juergen Pfeifer, 1997 * 31 | * and: Thomas E. Dickey 2005 * 32 | ****************************************************************************/ 33 | 34 | /* 35 | * lib_slkattr.c 36 | * Soft key routines. 37 | * Fetch the labels attributes 38 | */ 39 | #include 40 | 41 | MODULE_ID("$Id: lib_slkattr.c,v 1.11 2010/12/20 01:41:25 tom Exp $") 42 | 43 | NCURSES_EXPORT(attr_t) 44 | NCURSES_SP_NAME(slk_attr) (NCURSES_SP_DCL0) 45 | { 46 | T((T_CALLED("slk_attr(%p)"), (void *) SP_PARM)); 47 | 48 | if (SP_PARM != 0 && SP_PARM->_slk != 0) { 49 | attr_t result = AttrOf(SP_PARM->_slk->attr) & ALL_BUT_COLOR; 50 | int pair = GetPair(SP_PARM->_slk->attr); 51 | 52 | result |= (attr_t) ColorPair(pair); 53 | returnAttr(result); 54 | } else 55 | returnAttr(0); 56 | } 57 | 58 | #if NCURSES_SP_FUNCS 59 | NCURSES_EXPORT(attr_t) 60 | slk_attr(void) 61 | { 62 | return NCURSES_SP_NAME(slk_attr) (CURRENT_SCREEN); 63 | } 64 | #endif 65 | -------------------------------------------------------------------------------- /native/tinfo/lib_wattron.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | * and: Thomas E. Dickey 1996-on * 33 | ****************************************************************************/ 34 | 35 | /* 36 | ** lib_wattron.c 37 | ** 38 | ** The routines wattr_on(). 39 | ** 40 | */ 41 | 42 | #include 43 | #include 44 | 45 | MODULE_ID("$Id: lib_wattron.c,v 1.11 2010/03/31 23:38:02 tom Exp $") 46 | 47 | NCURSES_EXPORT(int) 48 | wattr_on(WINDOW *win, attr_t at, void *opts GCC_UNUSED) 49 | { 50 | T((T_CALLED("wattr_on(%p,%s)"), (void *) win, _traceattr(at))); 51 | if (win != 0) { 52 | T(("... current %s (%d)", 53 | _traceattr(WINDOW_ATTRS(win)), 54 | GET_WINDOW_PAIR(win))); 55 | 56 | if_EXT_COLORS({ 57 | if (at & A_COLOR) 58 | win->_color = PairNumber(at); 59 | }); 60 | toggle_attr_on(WINDOW_ATTRS(win), at); 61 | returnCode(OK); 62 | } else 63 | returnCode(ERR); 64 | } 65 | -------------------------------------------------------------------------------- /native/tinfo/lib_delch.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2001,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | ****************************************************************************/ 33 | 34 | /* 35 | ** lib_delch.c 36 | ** 37 | ** The routine wdelch(). 38 | ** 39 | */ 40 | 41 | #include 42 | 43 | MODULE_ID("$Id: lib_delch.c,v 1.13 2009/10/24 22:32:47 tom Exp $") 44 | 45 | NCURSES_EXPORT(int) 46 | wdelch(WINDOW *win) 47 | { 48 | int code = ERR; 49 | 50 | T((T_CALLED("wdelch(%p)"), (void *) win)); 51 | 52 | if (win) { 53 | NCURSES_CH_T blank = win->_nc_bkgd; 54 | struct ldat *line = &(win->_line[win->_cury]); 55 | NCURSES_CH_T *end = &(line->text[win->_maxx]); 56 | NCURSES_CH_T *temp2 = &(line->text[win->_curx + 1]); 57 | NCURSES_CH_T *temp1 = temp2 - 1; 58 | 59 | CHANGED_TO_EOL(line, win->_curx, win->_maxx); 60 | while (temp1 < end) 61 | *temp1++ = *temp2++; 62 | 63 | *temp1 = blank; 64 | 65 | _nc_synchook(win); 66 | code = OK; 67 | } 68 | returnCode(code); 69 | } 70 | -------------------------------------------------------------------------------- /native/tinfo/lib_inchstr.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | * and: Thomas E. Dickey 1996-on * 33 | ****************************************************************************/ 34 | 35 | /* 36 | ** lib_inchstr.c 37 | ** 38 | ** The routine winchnstr(). 39 | ** 40 | */ 41 | 42 | #include 43 | 44 | MODULE_ID("$Id: lib_inchstr.c,v 1.12 2010/12/20 01:37:41 tom Exp $") 45 | 46 | NCURSES_EXPORT(int) 47 | winchnstr(WINDOW *win, chtype *str, int n) 48 | { 49 | int i = 0; 50 | 51 | T((T_CALLED("winchnstr(%p,%p,%d)"), (void *) win, (void *) str, n)); 52 | 53 | if (!str) 54 | returnCode(0); 55 | 56 | if (win) { 57 | for (; (n < 0 || (i < n)) && (win->_curx + i <= win->_maxx); i++) 58 | str[i] = 59 | (chtype) CharOf(win->_line[win->_cury].text[win->_curx + i]) | 60 | AttrOf(win->_line[win->_cury].text[win->_curx + i]); 61 | } 62 | str[i] = (chtype) 0; 63 | 64 | returnCode(i); 65 | } 66 | -------------------------------------------------------------------------------- /native/tinfo/include/unctrl.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | ****************************************************************************/ 33 | 34 | /* 35 | * unctrl.h 36 | * 37 | * Display a printable version of a control character. 38 | * Control characters are displayed in caret notation (^x), DELETE is displayed 39 | * as ^?. Printable characters are displayed as is. 40 | */ 41 | 42 | /* $Id: unctrl.h.in,v 1.11 2009/04/18 21:00:52 tom Exp $ */ 43 | 44 | #ifndef NCURSES_UNCTRL_H_incl 45 | #define NCURSES_UNCTRL_H_incl 1 46 | 47 | #undef NCURSES_VERSION 48 | #define NCURSES_VERSION "5.9" 49 | 50 | #ifdef __cplusplus 51 | extern "C" { 52 | #endif 53 | 54 | #include 55 | 56 | #undef unctrl 57 | NCURSES_EXPORT(NCURSES_CONST char *) unctrl (chtype); 58 | 59 | #if 0 60 | NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(unctrl) (SCREEN*, chtype); 61 | #endif 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #endif /* NCURSES_UNCTRL_H_incl */ 68 | -------------------------------------------------------------------------------- /native/tinfo/keybound.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1999-2006,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Thomas E. Dickey 1999-on * 31 | * and: Juergen Pfeifer 2009 * 32 | ****************************************************************************/ 33 | 34 | #include 35 | 36 | MODULE_ID("$Id: keybound.c,v 1.10 2009/10/24 22:15:47 tom Exp $") 37 | 38 | /* 39 | * Returns the count'th string definition which is associated with the 40 | * given keycode. The result is malloc'd, must be freed by the caller. 41 | */ 42 | NCURSES_EXPORT(char *) 43 | NCURSES_SP_NAME(keybound) (NCURSES_SP_DCLx int code, int count) 44 | { 45 | char *result = 0; 46 | 47 | T((T_CALLED("keybound(%p, %d,%d)"), (void *) SP_PARM, code, count)); 48 | if (SP_PARM != 0 && code >= 0) { 49 | result = _nc_expand_try(SP_PARM->_keytry, (unsigned) code, &count, 0); 50 | } 51 | returnPtr(result); 52 | } 53 | 54 | #if NCURSES_SP_FUNCS 55 | NCURSES_EXPORT(char *) 56 | keybound(int code, int count) 57 | { 58 | return NCURSES_SP_NAME(keybound) (CURRENT_SCREEN, code, count); 59 | } 60 | #endif 61 | -------------------------------------------------------------------------------- /native/tinfo/home_terminfo.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Thomas E. Dickey * 31 | ****************************************************************************/ 32 | 33 | /* 34 | * home_terminfo.c -- return the $HOME/.terminfo string, expanded 35 | */ 36 | 37 | #include 38 | #include 39 | 40 | MODULE_ID("$Id: home_terminfo.c,v 1.12 2010/12/25 23:43:58 tom Exp $") 41 | 42 | /* ncurses extension...fall back on user's private directory */ 43 | 44 | #define MyBuffer _nc_globals.home_terminfo 45 | 46 | NCURSES_EXPORT(char *) 47 | _nc_home_terminfo(void) 48 | { 49 | char *result = 0; 50 | #if USE_HOME_TERMINFO 51 | char *home; 52 | 53 | if (use_terminfo_vars()) { 54 | if (MyBuffer == 0) { 55 | if ((home = getenv("HOME")) != 0) { 56 | size_t want = (strlen(home) + sizeof(PRIVATE_INFO)); 57 | MyBuffer = typeMalloc(char, want); 58 | if (MyBuffer == 0) 59 | _nc_err_abort(MSG_NO_MEMORY); 60 | (void) sprintf(MyBuffer, PRIVATE_INFO, home); 61 | } 62 | } 63 | result = MyBuffer; 64 | } 65 | #endif 66 | return result; 67 | } 68 | -------------------------------------------------------------------------------- /native/tinfo/lib_slklab.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | * and: Juergen Pfeifer, 1998,2009 * 33 | * and: Thomas E. Dickey 1998-on * 34 | ****************************************************************************/ 35 | 36 | /* 37 | * lib_slklab.c 38 | * Soft key routines. 39 | * Fetch the label text. 40 | */ 41 | #include 42 | 43 | MODULE_ID("$Id: lib_slklab.c,v 1.10 2009/10/24 22:12:21 tom Exp $") 44 | 45 | NCURSES_EXPORT(char *) 46 | NCURSES_SP_NAME(slk_label) (NCURSES_SP_DCLx int n) 47 | { 48 | T((T_CALLED("slk_label(%p,%d)"), (void *) SP_PARM, n)); 49 | 50 | if (SP_PARM == 0 || SP_PARM->_slk == 0 || n < 1 || n > SP_PARM->_slk->labcnt) 51 | returnPtr(0); 52 | returnPtr(SP_PARM->_slk->ent[n - 1].ent_text); 53 | } 54 | 55 | #if NCURSES_SP_FUNCS 56 | NCURSES_EXPORT(char *) 57 | slk_label(int n) 58 | { 59 | return NCURSES_SP_NAME(slk_label) (CURRENT_SCREEN, n); 60 | } 61 | #endif 62 | -------------------------------------------------------------------------------- /native/tinfo/lib_insnstr.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 2004,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Thomas E. Dickey * 31 | ****************************************************************************/ 32 | 33 | /* 34 | ** lib_insnstr.c 35 | ** 36 | ** The routine winsnstr(). 37 | ** 38 | */ 39 | 40 | #include 41 | #include 42 | 43 | MODULE_ID("$Id: lib_insnstr.c,v 1.3 2009/10/24 22:04:35 tom Exp $") 44 | 45 | NCURSES_EXPORT(int) 46 | winsnstr(WINDOW *win, const char *s, int n) 47 | { 48 | int code = ERR; 49 | NCURSES_SIZE_T oy; 50 | NCURSES_SIZE_T ox; 51 | const unsigned char *str = (const unsigned char *) s; 52 | const unsigned char *cp; 53 | 54 | T((T_CALLED("winsnstr(%p,%s,%d)"), (void *) win, _nc_visbufn(s, n), n)); 55 | 56 | if (win != 0 && str != 0) { 57 | SCREEN *sp = _nc_screen_of(win); 58 | 59 | oy = win->_cury; 60 | ox = win->_curx; 61 | for (cp = str; *cp && (n <= 0 || (cp - str) < n); cp++) { 62 | _nc_insert_ch(sp, win, (chtype) UChar(*cp)); 63 | } 64 | win->_curx = ox; 65 | win->_cury = oy; 66 | _nc_synchook(win); 67 | code = OK; 68 | } 69 | returnCode(code); 70 | } 71 | -------------------------------------------------------------------------------- /native/tinfo/memmove.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2000,2007 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | #include 30 | 31 | MODULE_ID("$Id: memmove.c,v 1.5 2007/08/11 17:12:43 tom Exp $") 32 | 33 | /**************************************************************************** 34 | * Author: Thomas E. Dickey 1998 * 35 | ****************************************************************************/ 36 | 37 | #if USE_MY_MEMMOVE 38 | #define DST ((char *)s1) 39 | #define SRC ((const char *)s2) 40 | NCURSES_EXPORT(void *) 41 | _nc_memmove(void *s1, const void *s2, size_t n) 42 | { 43 | if (n != 0) { 44 | if ((DST + n > SRC) && (SRC + n > DST)) { 45 | static char *bfr; 46 | static size_t length; 47 | register size_t j; 48 | if (length < n) { 49 | length = (n * 3) / 2; 50 | bfr = typeRealloc(char, length, bfr); 51 | } 52 | for (j = 0; j < n; j++) 53 | bfr[j] = SRC[j]; 54 | s2 = bfr; 55 | } 56 | while (n-- != 0) 57 | DST[n] = SRC[n]; 58 | } 59 | return s1; 60 | } 61 | #else 62 | extern 63 | NCURSES_EXPORT(void) 64 | _nc_memmove(void); /* quiet's gcc warning */ 65 | NCURSES_EXPORT(void) 66 | _nc_memmove(void) 67 | { 68 | } /* nonempty for strict ANSI compilers */ 69 | #endif /* USE_MY_MEMMOVE */ 70 | -------------------------------------------------------------------------------- /native/tinfo/include/nc_mingw.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 2008-2009,2010 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Thomas Dickey, 2008-on * 31 | * * 32 | ****************************************************************************/ 33 | 34 | /* $Id: nc_mingw.h,v 1.3 2010/09/25 22:16:12 juergen Exp $ */ 35 | 36 | #ifndef NC_MINGW_H 37 | #define NC_MINGW_H 1 38 | 39 | #ifdef WINVER 40 | # if WINVER < 0x0501 41 | # error WINVER must at least be 0x0501 42 | # endif 43 | #else 44 | # define WINVER 0x0501 45 | #endif 46 | #include 47 | 48 | #undef sleep 49 | #define sleep(n) Sleep((n) * 1000) 50 | 51 | #undef gettimeofday 52 | #define gettimeofday(tv,tz) _nc_gettimeofday(tv,tz) 53 | 54 | #include /* for struct timeval */ 55 | 56 | extern int _nc_gettimeofday(struct timeval *, void *); 57 | 58 | #undef HAVE_GETTIMEOFDAY 59 | #define HAVE_GETTIMEOFDAY 1 60 | 61 | #define SIGHUP 1 62 | #define SIGKILL 9 63 | #define getlogin() "username" 64 | 65 | #undef wcwidth 66 | #define wcwidth(ucs) _nc_wcwidth(ucs) 67 | extern int _nc_wcwidth(wchar_t); 68 | 69 | #endif /* NC_MINGW_H */ 70 | -------------------------------------------------------------------------------- /native/tinfo/include/tty_input.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998,2000 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /* 30 | * $Id: tty_input.h,v 1.2 2000/12/10 02:26:51 tom Exp $ 31 | */ 32 | 33 | #ifndef TTY_INPUT_H 34 | #define TTY_INPUT_H 1 35 | 36 | extern NCURSES_EXPORT(bool) _nc_tty_mouse_mask (mmask_t); 37 | extern NCURSES_EXPORT(bool) _nc_tty_pending (void); 38 | extern NCURSES_EXPORT(int) _nc_tty_next_event (int); 39 | extern NCURSES_EXPORT(void) _nc_tty_flags_changed (void); 40 | extern NCURSES_EXPORT(void) _nc_tty_flush (void); 41 | extern NCURSES_EXPORT(void) _nc_tty_input_resume (void); 42 | extern NCURSES_EXPORT(void) _nc_tty_input_suspend (void); 43 | 44 | struct tty_input_data { 45 | int _ifd; /* input file ptr for screen */ 46 | int _keypad_xmit; /* current terminal state */ 47 | int _meta_on; /* current terminal state */ 48 | 49 | /* 50 | * These are the data that support the mouse interface. 51 | */ 52 | bool (*_mouse_event) (SCREEN *); 53 | bool (*_mouse_inline)(SCREEN *); 54 | bool (*_mouse_parse) (int); 55 | void (*_mouse_resume)(SCREEN *); 56 | void (*_mouse_wrap) (SCREEN *); 57 | int _mouse_fd; /* file-descriptor, if any */ 58 | int mousetype; 59 | }; 60 | 61 | #endif /* TTY_INPUT_H */ 62 | -------------------------------------------------------------------------------- /native/tinfo/doalloc.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998,2000 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Thomas E. Dickey 1998 * 31 | ****************************************************************************/ 32 | 33 | /* 34 | * Wrapper for malloc/realloc. Standard implementations allow realloc with 35 | * a null pointer, but older libraries may not (e.g., SunOS). 36 | * 37 | * Also if realloc fails, we discard the old memory to avoid leaks. 38 | */ 39 | 40 | #include 41 | 42 | MODULE_ID("$Id: doalloc.c,v 1.8 2002/08/31 21:48:11 Philippe.Blain Exp $") 43 | 44 | NCURSES_EXPORT(void *) 45 | _nc_doalloc(void *oldp, size_t amount) 46 | { 47 | void *newp; 48 | 49 | if (oldp != 0) { 50 | if ((newp = realloc(oldp, amount)) == 0) { 51 | free(oldp); 52 | errno = ENOMEM; /* just in case 'free' reset */ 53 | } 54 | } else { 55 | newp = malloc(amount); 56 | } 57 | return newp; 58 | } 59 | 60 | #if !HAVE_STRDUP 61 | NCURSES_EXPORT(char *) 62 | _nc_strdup(const char *src) 63 | { 64 | char *dst; 65 | if (src != 0) { 66 | dst = typeMalloc(char, strlen(src) + 1); 67 | if (dst != 0) { 68 | (void) strcpy(dst, src); 69 | } 70 | } else { 71 | dst = 0; 72 | } 73 | return dst; 74 | } 75 | #endif 76 | -------------------------------------------------------------------------------- /native/tinfo/lib_chgat.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | * and: Sven Verdoolaege 2001 * 33 | * and: Thomas E. Dickey 2005 * 34 | ****************************************************************************/ 35 | 36 | /* 37 | ** lib_chgat.c 38 | ** 39 | ** The routine wchgat(). 40 | ** 41 | */ 42 | 43 | #include 44 | 45 | MODULE_ID("$Id: lib_chgat.c,v 1.9 2010/03/31 23:38:02 tom Exp $") 46 | 47 | NCURSES_EXPORT(int) 48 | wchgat(WINDOW *win, int n, attr_t attr, short color, const void *opts GCC_UNUSED) 49 | { 50 | int i; 51 | 52 | T((T_CALLED("wchgat(%p,%d,%s,%d)"), (void *) win, n, _traceattr(attr), color)); 53 | 54 | if (win) { 55 | struct ldat *line = &(win->_line[win->_cury]); 56 | 57 | toggle_attr_on(attr, ColorPair(color)); 58 | 59 | for (i = win->_curx; i <= win->_maxx && (n == -1 || (n-- > 0)); i++) { 60 | SetAttr(line->text[i], attr); 61 | SetPair(line->text[i], color); 62 | CHANGED_CELL(line, i); 63 | } 64 | 65 | returnCode(OK); 66 | } else 67 | returnCode(ERR); 68 | } 69 | -------------------------------------------------------------------------------- /native/tinfo/lib_hline.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | ****************************************************************************/ 33 | 34 | /* 35 | ** lib_hline.c 36 | ** 37 | ** The routine whline(). 38 | ** 39 | */ 40 | 41 | #include 42 | 43 | MODULE_ID("$Id: lib_hline.c,v 1.13 2010/12/19 01:48:39 tom Exp $") 44 | 45 | NCURSES_EXPORT(int) 46 | whline(WINDOW *win, chtype ch, int n) 47 | { 48 | int code = ERR; 49 | int start; 50 | int end; 51 | 52 | T((T_CALLED("whline(%p,%s,%d)"), (void *) win, _tracechtype(ch), n)); 53 | 54 | if (win) { 55 | struct ldat *line = &(win->_line[win->_cury]); 56 | NCURSES_CH_T wch; 57 | 58 | start = win->_curx; 59 | end = start + n - 1; 60 | if (end > win->_maxx) 61 | end = win->_maxx; 62 | 63 | CHANGED_RANGE(line, start, end); 64 | 65 | if (ch == 0) 66 | SetChar2(wch, ACS_HLINE); 67 | else 68 | SetChar2(wch, ch); 69 | wch = _nc_render(win, wch); 70 | 71 | while (end >= start) { 72 | line->text[end] = wch; 73 | end--; 74 | } 75 | 76 | _nc_synchook(win); 77 | code = OK; 78 | } 79 | returnCode(code); 80 | } 81 | -------------------------------------------------------------------------------- /native/tinfo/lib_vline.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | ****************************************************************************/ 33 | 34 | /* 35 | ** lib_vline.c 36 | ** 37 | ** The routine wvline(). 38 | ** 39 | */ 40 | 41 | #include 42 | 43 | MODULE_ID("$Id: lib_vline.c,v 1.12 2010/12/19 01:22:58 tom Exp $") 44 | 45 | NCURSES_EXPORT(int) 46 | wvline(WINDOW *win, chtype ch, int n) 47 | { 48 | int code = ERR; 49 | int row, col; 50 | int end; 51 | 52 | T((T_CALLED("wvline(%p,%s,%d)"), (void *) win, _tracechtype(ch), n)); 53 | 54 | if (win) { 55 | NCURSES_CH_T wch; 56 | row = win->_cury; 57 | col = win->_curx; 58 | end = row + n - 1; 59 | if (end > win->_maxy) 60 | end = win->_maxy; 61 | 62 | if (ch == 0) 63 | SetChar2(wch, ACS_VLINE); 64 | else 65 | SetChar2(wch, ch); 66 | wch = _nc_render(win, wch); 67 | 68 | while (end >= row) { 69 | struct ldat *line = &(win->_line[end]); 70 | line->text[col] = wch; 71 | CHANGED_CELL(line, col); 72 | end--; 73 | } 74 | 75 | _nc_synchook(win); 76 | code = OK; 77 | } 78 | returnCode(code); 79 | } 80 | -------------------------------------------------------------------------------- /native/tinfo/include/fifo_defs.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2002,2008 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | ****************************************************************************/ 33 | 34 | /* 35 | * Common macros for lib_getch.c, lib_ungetch.c 36 | * 37 | * $Id: fifo_defs.h,v 1.6 2008/06/28 15:52:32 tom Exp $ 38 | */ 39 | 40 | #ifndef FIFO_DEFS_H 41 | #define FIFO_DEFS_H 1 42 | 43 | #define head sp->_fifohead 44 | #define tail sp->_fifotail 45 | /* peek points to next uninterpreted character */ 46 | #define peek sp->_fifopeek 47 | 48 | #define h_inc() { head == FIFO_SIZE-1 ? head = 0 : head++; if (head == tail) head = -1, tail = 0;} 49 | #define h_dec() { head == 0 ? head = FIFO_SIZE-1 : head--; if (head == tail) tail = -1;} 50 | #define t_inc() { tail == FIFO_SIZE-1 ? tail = 0 : tail++; if (tail == head) tail = -1;} 51 | #define t_dec() { tail == 0 ? tail = FIFO_SIZE-1 : tail--; if (head == tail) fifo_clear(sp);} 52 | #define p_inc() { peek == FIFO_SIZE-1 ? peek = 0 : peek++;} 53 | 54 | #define cooked_key_in_fifo() ((head != -1) && (peek != head)) 55 | #define raw_key_in_fifo() ((head != -1) && (peek != tail)) 56 | 57 | #undef HIDE_EINTR 58 | 59 | #endif /* FIFO_DEFS_H */ 60 | -------------------------------------------------------------------------------- /native/tinfo/lib_slkatrof.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2005,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Juergen Pfeifer, 1997 * 31 | * and: Thomas E. Dickey 2005 * 32 | ****************************************************************************/ 33 | 34 | /* 35 | * lib_slkatrof.c 36 | * Soft key routines. 37 | * Switch off labels attributes 38 | */ 39 | #include 40 | 41 | MODULE_ID("$Id: lib_slkatrof.c,v 1.11 2009/10/24 22:12:21 tom Exp $") 42 | 43 | NCURSES_EXPORT(int) 44 | NCURSES_SP_NAME(slk_attroff) (NCURSES_SP_DCLx const chtype attr) 45 | { 46 | T((T_CALLED("slk_attroff(%p,%s)"), (void *) SP_PARM, _traceattr(attr))); 47 | 48 | if (SP_PARM != 0 && SP_PARM->_slk != 0) { 49 | TR(TRACE_ATTRS, ("... current %s", _tracech_t(CHREF(SP_PARM->_slk->attr)))); 50 | RemAttr(SP_PARM->_slk->attr, attr); 51 | if ((attr & A_COLOR) != 0) { 52 | SetPair(SP_PARM->_slk->attr, 0); 53 | } 54 | TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP_PARM->_slk->attr)))); 55 | returnCode(OK); 56 | } else 57 | returnCode(ERR); 58 | } 59 | 60 | #if NCURSES_SP_FUNCS 61 | NCURSES_EXPORT(int) 62 | slk_attroff(const chtype attr) 63 | { 64 | return NCURSES_SP_NAME(slk_attroff) (CURRENT_SCREEN, attr); 65 | } 66 | #endif 67 | -------------------------------------------------------------------------------- /native/tinfo/lib_slkatron.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Juergen Pfeifer, 1997 * 31 | * and: Thomas E. Dickey 2005 * 32 | ****************************************************************************/ 33 | 34 | /* 35 | * lib_slkatron.c 36 | * Soft key routines. 37 | * Switch on labels attributes 38 | */ 39 | #include 40 | 41 | MODULE_ID("$Id: lib_slkatron.c,v 1.12 2010/03/31 23:38:02 tom Exp $") 42 | 43 | NCURSES_EXPORT(int) 44 | NCURSES_SP_NAME(slk_attron) (NCURSES_SP_DCLx const chtype attr) 45 | { 46 | T((T_CALLED("slk_attron(%p,%s)"), (void *) SP_PARM, _traceattr(attr))); 47 | 48 | if (SP_PARM != 0 && SP_PARM->_slk != 0) { 49 | TR(TRACE_ATTRS, ("... current %s", _tracech_t(CHREF(SP_PARM->_slk->attr)))); 50 | AddAttr(SP_PARM->_slk->attr, attr); 51 | if ((attr & A_COLOR) != 0) { 52 | SetPair(SP_PARM->_slk->attr, PairNumber(attr)); 53 | } 54 | TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP_PARM->_slk->attr)))); 55 | returnCode(OK); 56 | } else 57 | returnCode(ERR); 58 | } 59 | 60 | #if NCURSES_SP_FUNCS 61 | NCURSES_EXPORT(int) 62 | slk_attron(const chtype attr) 63 | { 64 | return NCURSES_SP_NAME(slk_attron) (CURRENT_SCREEN, attr); 65 | } 66 | #endif 67 | -------------------------------------------------------------------------------- /native/android-configure-list-tinfo: -------------------------------------------------------------------------------- 1 | tinfo/access.o 2 | tinfo/add_tries.o 3 | tinfo/alloc_entry.o 4 | tinfo/alloc_ttype.o 5 | tinfo/captoinfo.o 6 | tinfo/codes.o 7 | tinfo/comp_captab.o 8 | tinfo/comp_error.o 9 | tinfo/comp_expand.o 10 | tinfo/comp_hash.o 11 | tinfo/comp_parse.o 12 | tinfo/comp_scan.o 13 | tinfo/db_iterator.o 14 | tinfo/define_key.o 15 | tinfo/doalloc.o 16 | tinfo/entries.o 17 | tinfo/expanded.o 18 | tinfo/fallback.o 19 | tinfo/free_ttype.o 20 | tinfo/getenv_num.o 21 | tinfo/hardscroll.o 22 | tinfo/hashed_db.o 23 | tinfo/hashmap.o 24 | tinfo/home_terminfo.o 25 | tinfo/init_keytry.o 26 | tinfo/keybound.o 27 | tinfo/key_defined.o 28 | tinfo/keyok.o 29 | tinfo/legacy_coding.o 30 | tinfo/lib_acs.o 31 | tinfo/lib_addch.o 32 | tinfo/lib_addstr.o 33 | tinfo/lib_baudrate.o 34 | tinfo/lib_beep.o 35 | tinfo/lib_bkgd.o 36 | tinfo/lib_box.o 37 | tinfo/lib_chgat.o 38 | tinfo/lib_clear.o 39 | tinfo/lib_clearok.o 40 | tinfo/lib_clrbot.o 41 | tinfo/lib_clreol.o 42 | tinfo/lib_color.o 43 | tinfo/lib_colorset.o 44 | tinfo/lib_cur_term.o 45 | tinfo/lib_data.o 46 | tinfo/lib_delch.o 47 | tinfo/lib_delwin.o 48 | tinfo/lib_dft_fgbg.o 49 | tinfo/lib_echo.o 50 | tinfo/lib_endwin.o 51 | tinfo/lib_erase.o 52 | tinfo/lib_flash.o 53 | tinfo/lib_freeall.o 54 | tinfo/lib_gen.o 55 | tinfo/lib_getch.o 56 | tinfo/lib_getstr.o 57 | tinfo/lib_has_cap.o 58 | tinfo/lib_hline.o 59 | tinfo/lib_immedok.o 60 | tinfo/lib_inchstr.o 61 | tinfo/lib_initscr.o 62 | tinfo/lib_insch.o 63 | tinfo/lib_insdel.o 64 | tinfo/lib_insnstr.o 65 | tinfo/lib_instr.o 66 | tinfo/lib_isendwin.o 67 | tinfo/lib_kernel.o 68 | tinfo/lib_keyname.o 69 | tinfo/lib_leaveok.o 70 | tinfo/lib_longname.o 71 | tinfo/lib_mouse.o 72 | tinfo/lib_move.o 73 | tinfo/lib_mvcur.o 74 | tinfo/lib_mvwin.o 75 | tinfo/lib_napms.o 76 | tinfo/lib_newterm.o 77 | tinfo/lib_newwin.o 78 | tinfo/lib_nl.o 79 | tinfo/lib_options.o 80 | tinfo/lib_overlay.o 81 | tinfo/lib_pad.o 82 | tinfo/lib_print.o 83 | tinfo/lib_printw.o 84 | tinfo/lib_raw.o 85 | tinfo/lib_redrawln.o 86 | tinfo/lib_refresh.o 87 | tinfo/lib_restart.o 88 | tinfo/lib_scanw.o 89 | tinfo/lib_screen.o 90 | tinfo/lib_scroll.o 91 | tinfo/lib_scrollok.o 92 | tinfo/lib_scrreg.o 93 | tinfo/lib_set_term.o 94 | tinfo/lib_setup.o 95 | tinfo/lib_slkatrof.o 96 | tinfo/lib_slkatron.o 97 | tinfo/lib_slkatr_set.o 98 | tinfo/lib_slkatrset.o 99 | tinfo/lib_slkattr.o 100 | tinfo/lib_slk.o 101 | tinfo/lib_slkclear.o 102 | tinfo/lib_slkcolor.o 103 | tinfo/lib_slkinit.o 104 | tinfo/lib_slklab.o 105 | tinfo/lib_slkrefr.o 106 | tinfo/lib_slkset.o 107 | tinfo/lib_slktouch.o 108 | tinfo/lib_termcap.o 109 | tinfo/lib_termname.o 110 | tinfo/lib_tgoto.o 111 | tinfo/lib_ti.o 112 | tinfo/lib_touch.o 113 | tinfo/lib_tparm.o 114 | tinfo/lib_tputs.o 115 | tinfo/lib_trace.o 116 | tinfo/lib_tstp.o 117 | tinfo/lib_ttyflags.o 118 | tinfo/lib_twait.o 119 | tinfo/lib_ungetch.o 120 | tinfo/lib_vidattr.o 121 | tinfo/lib_vline.o 122 | tinfo/lib_wattroff.o 123 | tinfo/lib_wattron.o 124 | tinfo/lib_winch.o 125 | tinfo/lib_window.o 126 | tinfo/memmove.o 127 | tinfo/name_match.o 128 | tinfo/names.o 129 | tinfo/nc_panel.o 130 | tinfo/parse_entry.o 131 | tinfo/read_entry.o 132 | tinfo/read_termcap.o 133 | tinfo/resizeterm.o 134 | tinfo/safe_sprintf.o 135 | tinfo/setbuf.o 136 | tinfo/strings.o 137 | tinfo/tries.o 138 | tinfo/trim_sgr0.o 139 | tinfo/tty_update.o 140 | tinfo/unctrl.o 141 | tinfo/use_screen.o 142 | tinfo/use_window.o 143 | tinfo/varargs.o 144 | tinfo/version.o 145 | tinfo/visbuf.o 146 | tinfo/vsscanf.o 147 | tinfo/wresize.o 148 | tinfo/write_entry.o 149 | -------------------------------------------------------------------------------- /native/tinfo/lib_slkcolor.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2005,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Juergen Pfeifer, 1998,2009 * 31 | * and: Thomas E. Dickey 2005-on * 32 | ****************************************************************************/ 33 | 34 | /* 35 | * lib_slkcolor.c 36 | * Soft key routines. 37 | * Set the label's color 38 | */ 39 | #include 40 | 41 | MODULE_ID("$Id: lib_slkcolor.c,v 1.16 2009/10/24 22:12:21 tom Exp $") 42 | 43 | NCURSES_EXPORT(int) 44 | NCURSES_SP_NAME(slk_color) (NCURSES_SP_DCLx short color_pair_number) 45 | { 46 | int code = ERR; 47 | 48 | T((T_CALLED("slk_color(%p,%d)"), (void *) SP_PARM, color_pair_number)); 49 | 50 | if (SP_PARM != 0 51 | && SP_PARM->_slk != 0 52 | && color_pair_number >= 0 53 | && color_pair_number < SP_PARM->_pair_limit) { 54 | TR(TRACE_ATTRS, ("... current is %s", _tracech_t(CHREF(SP_PARM->_slk->attr)))); 55 | SetPair(SP_PARM->_slk->attr, color_pair_number); 56 | TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP_PARM->_slk->attr)))); 57 | code = OK; 58 | } 59 | returnCode(code); 60 | } 61 | 62 | #if NCURSES_SP_FUNCS 63 | NCURSES_EXPORT(int) 64 | slk_color(short color_pair_number) 65 | { 66 | return NCURSES_SP_NAME(slk_color) (CURRENT_SCREEN, color_pair_number); 67 | } 68 | #endif 69 | -------------------------------------------------------------------------------- /native/tinfo/free_ttype.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1999-2010,2011 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Thomas E. Dickey 1999-on * 31 | ****************************************************************************/ 32 | 33 | /* 34 | * free_ttype.c -- allocation functions for TERMTYPE 35 | * 36 | * _nc_free_termtype() 37 | * use_extended_names() 38 | * 39 | */ 40 | 41 | #include 42 | 43 | #include 44 | 45 | MODULE_ID("$Id: free_ttype.c,v 1.15 2011/02/06 01:08:31 tom Exp $") 46 | 47 | NCURSES_EXPORT(void) 48 | _nc_free_termtype(TERMTYPE *ptr) 49 | { 50 | T(("_nc_free_termtype(%s)", ptr->term_names)); 51 | 52 | FreeIfNeeded(ptr->str_table); 53 | FreeIfNeeded(ptr->Booleans); 54 | FreeIfNeeded(ptr->Numbers); 55 | FreeIfNeeded(ptr->Strings); 56 | #if NCURSES_XNAMES 57 | FreeIfNeeded(ptr->ext_str_table); 58 | FreeIfNeeded(ptr->ext_Names); 59 | #endif 60 | memset(ptr, 0, sizeof(TERMTYPE)); 61 | _nc_free_entry(_nc_head, ptr); 62 | } 63 | 64 | #if NCURSES_XNAMES 65 | NCURSES_EXPORT_VAR(bool) _nc_user_definable = TRUE; 66 | 67 | NCURSES_EXPORT(int) 68 | use_extended_names(bool flag) 69 | { 70 | int oldflag = _nc_user_definable; 71 | 72 | START_TRACE(); 73 | T((T_CALLED("use_extended_names(%d)"), flag)); 74 | _nc_user_definable = flag; 75 | returnBool(oldflag); 76 | } 77 | #endif 78 | -------------------------------------------------------------------------------- /native/tinfo/lib_clrbot.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | ****************************************************************************/ 33 | 34 | /* 35 | ** lib_clrbot.c 36 | ** 37 | ** The routine wclrtobot(). 38 | ** 39 | */ 40 | 41 | #include 42 | 43 | MODULE_ID("$Id: lib_clrbot.c,v 1.21 2009/10/24 22:33:19 tom Exp $") 44 | 45 | NCURSES_EXPORT(int) 46 | wclrtobot(WINDOW *win) 47 | { 48 | int code = ERR; 49 | 50 | T((T_CALLED("wclrtobot(%p)"), (void *) win)); 51 | 52 | if (win) { 53 | NCURSES_SIZE_T y; 54 | NCURSES_SIZE_T startx = win->_curx; 55 | NCURSES_CH_T blank = win->_nc_bkgd; 56 | 57 | T(("clearing from y = %ld to y = %ld with maxx = %ld", 58 | (long) win->_cury, (long) win->_maxy, (long) win->_maxx)); 59 | 60 | for (y = win->_cury; y <= win->_maxy; y++) { 61 | struct ldat *line = &(win->_line[y]); 62 | NCURSES_CH_T *ptr = &(line->text[startx]); 63 | NCURSES_CH_T *end = &(line->text[win->_maxx]); 64 | 65 | CHANGED_TO_EOL(line, startx, win->_maxx); 66 | 67 | while (ptr <= end) 68 | *ptr++ = blank; 69 | 70 | startx = 0; 71 | } 72 | _nc_synchook(win); 73 | code = OK; 74 | } 75 | returnCode(code); 76 | } 77 | -------------------------------------------------------------------------------- /native/tinfo/include/nc_panel.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Juergen Pfeifer 1997 * 31 | * and: Thomas E. Dickey * 32 | ****************************************************************************/ 33 | 34 | /* 35 | * $Id: nc_panel.h,v 1.7 2009/07/04 18:20:02 tom Exp $ 36 | * 37 | * nc_panel.h 38 | * 39 | * Headerfile to provide an interface for the panel layer into 40 | * the SCREEN structure of the ncurses core. 41 | */ 42 | 43 | #ifndef NC_PANEL_H 44 | #define NC_PANEL_H 1 45 | 46 | #ifdef __cplusplus 47 | extern "C" 48 | { 49 | #endif 50 | 51 | struct panel; /* Forward Declaration */ 52 | 53 | struct panelhook 54 | { 55 | struct panel *top_panel; 56 | struct panel *bottom_panel; 57 | struct panel *stdscr_pseudo_panel; 58 | #if NO_LEAKS 59 | int (*destroy) (struct panel *); 60 | #endif 61 | }; 62 | 63 | struct screen; /* Forward declaration */ 64 | /* Retrieve the panelhook of the specified screen */ 65 | extern NCURSES_EXPORT(struct panelhook *) 66 | _nc_panelhook (void); 67 | #if NCURSES_SP_FUNCS 68 | extern NCURSES_EXPORT(struct panelhook *) 69 | NCURSES_SP_NAME(_nc_panelhook) (SCREEN *); 70 | #endif 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | 76 | #endif /* NC_PANEL_H */ 77 | -------------------------------------------------------------------------------- /native/epaths.h: -------------------------------------------------------------------------------- 1 | /* Hey Emacs, this is -*- C -*- code! */ 2 | /* 3 | Copyright (C) 1993, 1995, 1997, 1999, 2001-2012 4 | Free Software Foundation, Inc. 5 | 6 | This file is part of GNU Emacs. 7 | 8 | GNU Emacs is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | GNU Emacs is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with GNU Emacs. If not, see . */ 20 | 21 | 22 | /* Together with PATH_SITELOADSEARCH, this gives the default value of 23 | load-path, which is the search path for the Lisp function "load". 24 | Configure (using "make epaths-force") sets this to 25 | ${standardlisppath}, which typically has a value like: 26 | /emacs/VERSION/lisp:/emacs/VERSION/leim 27 | where datadir is eg /usr/local/share. 28 | */ 29 | /* NOTICE: there has to be at least one : */ 30 | #define PATH_LOADSEARCH "/sdcard/emacs/lisp:/sdcard/emacs/leim" 31 | 32 | 33 | /* Like PATH_LOADSEARCH, but contains the non-standard pieces. 34 | These are the site-lisp directories, typically something like 35 | /emacs/VERSION/site-lisp:/emacs/site-lisp 36 | Configure prepends any $locallisppath, as set by the 37 | --enable-locallisppath argument. 38 | This is combined with PATH_LOADSEARCH to make the default load-path. 39 | If the --no-site-lisp option is used, this piece is excluded. 40 | */ 41 | /* NOTICE: there has to be at least one : */ 42 | #define PATH_SITELOADSEARCH "/sdcard/emacs/site-lisp:/sdcard/emacs/site-leim" 43 | 44 | 45 | /* Like PATH_LOADSEARCH, but used only during the build process 46 | when Emacs is dumping. Configure (using "make epaths-force") sets 47 | this to $buildlisppath, which normally has the value: /lisp. 48 | */ 49 | #define PATH_DUMPLOADSEARCH "/sdcard/emacs/lisp" 50 | 51 | /* The extra search path for programs to invoke. This is appended to 52 | whatever the PATH environment variable says to set the Lisp 53 | variable exec-path and the first file name in it sets the Lisp 54 | variable exec-directory. exec-directory is used for finding 55 | executables and other architecture-dependent files. */ 56 | #define PATH_EXEC "/sdcard/emacs/libexec" 57 | 58 | /* Where Emacs should look for its architecture-independent data 59 | files, like the NEWS file. The lisp variable data-directory 60 | is set to this value. */ 61 | #define PATH_DATA "/sdcard/emacs/etc" 62 | 63 | /* Where Emacs should look for X bitmap files. 64 | The lisp variable x-bitmap-file-path is set based on this value. */ 65 | #define PATH_BITMAPS "" 66 | 67 | /* Where Emacs should look for its docstring file. The lisp variable 68 | doc-directory is set to this value. */ 69 | #define PATH_DOC "/sdcard/emacs/etc" 70 | 71 | /* Where the configuration process believes the info tree lives. The 72 | lisp variable configure-info-directory gets its value from this 73 | macro, and is then used to set the Info-default-directory-list. */ 74 | #define PATH_INFO "/sdcard/emacs/share/info" 75 | 76 | /* Where Emacs should store game score files. */ 77 | #define PATH_GAME "/sdcard/emacs/games" 78 | 79 | /* Where Emacs should look for the application default file. */ 80 | #define PATH_X_DEFAULTS "" 81 | -------------------------------------------------------------------------------- /native/tinfo/lib_echo.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | * and: Thomas E. Dickey 1996-on * 33 | * and: Juergen Pfeifer 2009 * 34 | ****************************************************************************/ 35 | 36 | /* 37 | * echo.c 38 | * 39 | * Routines: 40 | * echo() 41 | * noecho() 42 | * 43 | */ 44 | 45 | #include 46 | 47 | MODULE_ID("$Id: lib_echo.c,v 1.8 2009/10/24 22:02:14 tom Exp $") 48 | 49 | NCURSES_EXPORT(int) 50 | NCURSES_SP_NAME(echo) (NCURSES_SP_DCL0) 51 | { 52 | T((T_CALLED("echo(%p)"), (void *) SP_PARM)); 53 | if (0 == SP_PARM) 54 | returnCode(ERR); 55 | SP_PARM->_echo = TRUE; 56 | returnCode(OK); 57 | } 58 | 59 | #if NCURSES_SP_FUNCS 60 | NCURSES_EXPORT(int) 61 | echo(void) 62 | { 63 | return NCURSES_SP_NAME(echo) (CURRENT_SCREEN); 64 | } 65 | #endif 66 | 67 | NCURSES_EXPORT(int) 68 | NCURSES_SP_NAME(noecho) (NCURSES_SP_DCL0) 69 | { 70 | T((T_CALLED("noecho(%p)"), (void *) SP_PARM)); 71 | if (0 == SP_PARM) 72 | returnCode(ERR); 73 | SP_PARM->_echo = FALSE; 74 | returnCode(OK); 75 | } 76 | 77 | #if NCURSES_SP_FUNCS 78 | NCURSES_EXPORT(int) 79 | noecho(void) 80 | { 81 | return NCURSES_SP_NAME(noecho) (CURRENT_SCREEN); 82 | } 83 | #endif 84 | -------------------------------------------------------------------------------- /native/tinfo/include/hashed_db.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 2006 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Thomas E. Dickey 2006 * 31 | ****************************************************************************/ 32 | 33 | /* 34 | * $Id: hashed_db.h,v 1.5 2006/08/19 15:58:34 tom Exp $ 35 | */ 36 | 37 | #ifndef HASHED_DB_H 38 | #define HASHED_DB_H 1 39 | 40 | #include 41 | 42 | #if USE_HASHED_DB 43 | 44 | #include 45 | 46 | #ifndef DBN_SUFFIX 47 | #define DBM_SUFFIX ".db" 48 | #endif 49 | 50 | #ifdef DB_VERSION_MAJOR 51 | #define HASHED_DB_API DB_VERSION_MAJOR 52 | #else 53 | #define HASHED_DB_API 1 /* e.g., db 1.8.5 */ 54 | #endif 55 | 56 | extern NCURSES_EXPORT(DB *) _nc_db_open(const char * /* path */, bool /* modify */); 57 | extern NCURSES_EXPORT(bool) _nc_db_have_data(DBT * /* key */, DBT * /* data */, char ** /* buffer */, int * /* size */); 58 | extern NCURSES_EXPORT(bool) _nc_db_have_index(DBT * /* key */, DBT * /* data */, char ** /* buffer */, int * /* size */); 59 | extern NCURSES_EXPORT(int) _nc_db_close(DB * /* db */); 60 | extern NCURSES_EXPORT(int) _nc_db_first(DB * /* db */, DBT * /* key */, DBT * /* data */); 61 | extern NCURSES_EXPORT(int) _nc_db_next(DB * /* db */, DBT * /* key */, DBT * /* data */); 62 | extern NCURSES_EXPORT(int) _nc_db_get(DB * /* db */, DBT * /* key */, DBT * /* data */); 63 | extern NCURSES_EXPORT(int) _nc_db_put(DB * /* db */, DBT * /* key */, DBT * /* data */); 64 | 65 | #endif 66 | 67 | #endif /* HASHED_DB_H */ 68 | -------------------------------------------------------------------------------- /native/tinfo/lib_endwin.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | * and: Thomas E. Dickey 1996-on * 33 | * and: Juergen Pfeifer 2009 * 34 | ****************************************************************************/ 35 | 36 | /* 37 | ** lib_endwin.c 38 | ** 39 | ** The routine endwin(). 40 | ** 41 | */ 42 | 43 | #include 44 | 45 | MODULE_ID("$Id: lib_endwin.c,v 1.22 2009/10/24 22:02:14 tom Exp $") 46 | 47 | NCURSES_EXPORT(int) 48 | NCURSES_SP_NAME(endwin) (NCURSES_SP_DCL0) 49 | { 50 | int code = ERR; 51 | 52 | T((T_CALLED("endwin(%p)"), (void *) SP_PARM)); 53 | 54 | if (SP_PARM) { 55 | #ifdef USE_TERM_DRIVER 56 | TERMINAL_CONTROL_BLOCK *TCB = TCBOf(SP_PARM); 57 | 58 | SP_PARM->_endwin = TRUE; 59 | if (TCB && TCB->drv && TCB->drv->scexit) 60 | TCB->drv->scexit(SP_PARM); 61 | #else 62 | SP_PARM->_endwin = TRUE; 63 | SP_PARM->_mouse_wrap(SP_PARM); 64 | _nc_screen_wrap(); 65 | _nc_mvcur_wrap(); /* wrap up cursor addressing */ 66 | #endif 67 | code = NCURSES_SP_NAME(reset_shell_mode) (NCURSES_SP_ARG); 68 | } 69 | 70 | returnCode(code); 71 | } 72 | 73 | #if NCURSES_SP_FUNCS 74 | NCURSES_EXPORT(int) 75 | endwin(void) 76 | { 77 | return NCURSES_SP_NAME(endwin) (CURRENT_SCREEN); 78 | } 79 | #endif 80 | -------------------------------------------------------------------------------- /native/tinfo/include/termcap.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998,2000 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | ****************************************************************************/ 33 | 34 | /* $Id: termcap.h.in,v 1.16 2001/03/24 21:53:27 tom Exp $ */ 35 | 36 | #ifndef NCURSES_TERMCAP_H_incl 37 | #define NCURSES_TERMCAP_H_incl 1 38 | 39 | #undef NCURSES_VERSION 40 | #define NCURSES_VERSION "5.9" 41 | 42 | #include 43 | 44 | #ifdef __cplusplus 45 | extern "C" 46 | { 47 | #endif /* __cplusplus */ 48 | 49 | #include 50 | 51 | #undef NCURSES_CONST 52 | #define NCURSES_CONST /*nothing*/ 53 | 54 | #undef NCURSES_OSPEED 55 | #define NCURSES_OSPEED short 56 | 57 | extern NCURSES_EXPORT_VAR(char) PC; 58 | extern NCURSES_EXPORT_VAR(char *) UP; 59 | extern NCURSES_EXPORT_VAR(char *) BC; 60 | extern NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed; 61 | 62 | #if !defined(NCURSES_TERM_H_incl) 63 | extern NCURSES_EXPORT(char *) tgetstr (NCURSES_CONST char *, char **); 64 | extern NCURSES_EXPORT(char *) tgoto (const char *, int, int); 65 | extern NCURSES_EXPORT(int) tgetent (char *, const char *); 66 | extern NCURSES_EXPORT(int) tgetflag (NCURSES_CONST char *); 67 | extern NCURSES_EXPORT(int) tgetnum (NCURSES_CONST char *); 68 | extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int)); 69 | #endif 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | #endif /* NCURSES_TERMCAP_H_incl */ 76 | -------------------------------------------------------------------------------- /native/tinfo/lib_slkclear.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2007,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | * and: Juergen Pfeifer 1996-1999 * 33 | * and: Thomas E. Dickey 1996-on * 34 | ****************************************************************************/ 35 | 36 | /* 37 | * lib_slkclear.c 38 | * Soft key routines. 39 | * Remove soft labels from the screen. 40 | */ 41 | #include 42 | 43 | MODULE_ID("$Id: lib_slkclear.c,v 1.14 2009/11/07 16:27:05 tom Exp $") 44 | 45 | NCURSES_EXPORT(int) 46 | NCURSES_SP_NAME(slk_clear) (NCURSES_SP_DCL0) 47 | { 48 | int rc = ERR; 49 | 50 | T((T_CALLED("slk_clear(%p)"), (void *) SP_PARM)); 51 | 52 | if (SP_PARM != 0 && SP_PARM->_slk != 0) { 53 | SP_PARM->_slk->hidden = TRUE; 54 | /* For simulated SLK's it looks much more natural to 55 | inherit those attributes from the standard screen */ 56 | SP_PARM->_slk->win->_nc_bkgd = StdScreen(SP_PARM)->_nc_bkgd; 57 | WINDOW_ATTRS(SP_PARM->_slk->win) = WINDOW_ATTRS(StdScreen(SP_PARM)); 58 | if (SP_PARM->_slk->win == StdScreen(SP_PARM)) { 59 | rc = OK; 60 | } else { 61 | werase(SP_PARM->_slk->win); 62 | rc = wrefresh(SP_PARM->_slk->win); 63 | } 64 | } 65 | returnCode(rc); 66 | } 67 | 68 | #if NCURSES_SP_FUNCS 69 | NCURSES_EXPORT(int) 70 | slk_clear(void) 71 | { 72 | return NCURSES_SP_NAME(slk_clear) (CURRENT_SCREEN); 73 | } 74 | #endif 75 | -------------------------------------------------------------------------------- /native/emacs-headers/stdalign.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT! GENERATED AUTOMATICALLY! */ 2 | /* A substitute for ISO C11 . 3 | 4 | Copyright 2011-2012 Free Software Foundation, Inc. 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 3, or (at your option) 9 | any later version. 10 | 11 | This program is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with this program; if not, see . */ 18 | 19 | /* Written by Paul Eggert and Bruno Haible. */ 20 | 21 | #ifndef _GL_STDALIGN_H 22 | #define _GL_STDALIGN_H 23 | 24 | /* ISO C11 for platforms that lack it. 25 | 26 | References: 27 | ISO C11 (latest free draft 28 | ) 29 | sections 6.5.3.4, 6.7.5, 7.15. 30 | C++11 (latest free draft 31 | ) 32 | section 18.10. */ 33 | 34 | /* alignof (TYPE), also known as _Alignof (TYPE), yields the alignment 35 | requirement of a structure member (i.e., slot or field) that is of 36 | type TYPE, as an integer constant expression. 37 | 38 | This differs from GCC's __alignof__ operator, which can yield a 39 | better-performing alignment for an object of that type. For 40 | example, on x86 with GCC, __alignof__ (double) and __alignof__ 41 | (long long) are 8, whereas alignof (double) and alignof (long long) 42 | are 4 unless the option '-malign-double' is used. 43 | 44 | The result cannot be used as a value for an 'enum' constant, if you 45 | want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc. */ 46 | #include 47 | #if defined __cplusplus 48 | template struct __alignof_helper { char __a; __t __b; }; 49 | # define _Alignof(type) offsetof (__alignof_helper, __b) 50 | #else 51 | # define _Alignof(type) offsetof (struct { char __a; type __b; }, __b) 52 | #endif 53 | #define alignof _Alignof 54 | #define __alignof_is_defined 1 55 | 56 | /* alignas (A), also known as _Alignas (A), aligns a variable or type 57 | to the alignment A, where A is an integer constant expression. For 58 | example: 59 | 60 | int alignas (8) foo; 61 | struct s { int a; int alignas (8) bar; }; 62 | 63 | aligns the address of FOO and the offset of BAR to be multiples of 8. 64 | 65 | A should be a power of two that is at least the type's alignment 66 | and at most the implementation's alignment limit. This limit is 67 | 2**28 on typical GNUish hosts, and 2**13 on MSVC. To be portable 68 | to MSVC through at least version 10.0, A should be an integer 69 | constant, as MSVC does not support expressions such as 1 << 3. 70 | To be portable to Sun C 5.11, do not align auto variables to 71 | anything stricter than their default alignment. 72 | 73 | The following C11 requirements are not supported here: 74 | 75 | - If A is zero, alignas has no effect. 76 | - alignas can be used multiple times; the strictest one wins. 77 | - alignas (TYPE) is equivalent to alignas (alignof (TYPE)). 78 | 79 | */ 80 | 81 | #if __GNUC__ || __IBMC__ || __IBMCPP__ || 0x5110 <= __SUNPRO_C 82 | # define _Alignas(a) __attribute__ ((__aligned__ (a))) 83 | #elif 1300 <= _MSC_VER 84 | # define _Alignas(a) __declspec (align (a)) 85 | #endif 86 | #ifdef _Alignas 87 | # define alignas _Alignas 88 | # define __alignas_is_defined 1 89 | #endif 90 | 91 | #endif /* _GL_STDALIGN_H */ 92 | -------------------------------------------------------------------------------- /native/tinfo/lib_slkinit.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | * and: Thomas E. Dickey 1996-on * 33 | * and: Juergen Pfeifer 2009 * 34 | ****************************************************************************/ 35 | 36 | /* 37 | * lib_slkinit.c 38 | * Soft key routines. 39 | * Initialize soft labels. Called by the user before initscr(). 40 | */ 41 | #include 42 | 43 | MODULE_ID("$Id: lib_slkinit.c,v 1.13 2009/10/31 00:10:46 tom Exp $") 44 | 45 | #ifdef USE_SP_RIPOFF 46 | #define SoftkeyFormat SP_PARM->slk_format 47 | #else 48 | #define SoftkeyFormat _nc_globals.slk_format 49 | #endif 50 | 51 | NCURSES_EXPORT(int) 52 | NCURSES_SP_NAME(slk_init) (NCURSES_SP_DCLx int format) 53 | { 54 | int code = ERR; 55 | 56 | START_TRACE(); 57 | T((T_CALLED("slk_init(%p,%d)"), (void *) SP_PARM, format)); 58 | 59 | if (format >= 0 60 | && format <= 3 61 | #ifdef USE_SP_RIPOFF 62 | && SP_PARM 63 | && SP_PARM->_prescreen 64 | #endif 65 | && !SoftkeyFormat) { 66 | SoftkeyFormat = 1 + format; 67 | code = NCURSES_SP_NAME(_nc_ripoffline) (NCURSES_SP_ARGx 68 | -SLK_LINES(SoftkeyFormat), 69 | _nc_slk_initialize); 70 | } 71 | returnCode(code); 72 | } 73 | 74 | #if NCURSES_SP_FUNCS 75 | NCURSES_EXPORT(int) 76 | slk_init(int format) 77 | { 78 | return NCURSES_SP_NAME(slk_init) (CURRENT_SCREEN_PRE, format); 79 | } 80 | #endif 81 | -------------------------------------------------------------------------------- /native/tinfo/lib_clreol.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2001,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | ****************************************************************************/ 33 | 34 | /* 35 | ** lib_clreol.c 36 | ** 37 | ** The routine wclrtoeol(). 38 | ** 39 | */ 40 | 41 | #include 42 | 43 | MODULE_ID("$Id: lib_clreol.c,v 1.22 2009/10/24 22:33:06 tom Exp $") 44 | 45 | NCURSES_EXPORT(int) 46 | wclrtoeol(WINDOW *win) 47 | { 48 | int code = ERR; 49 | 50 | T((T_CALLED("wclrtoeol(%p)"), (void *) win)); 51 | 52 | if (win) { 53 | NCURSES_CH_T blank; 54 | NCURSES_CH_T *ptr, *end; 55 | struct ldat *line; 56 | NCURSES_SIZE_T y = win->_cury; 57 | NCURSES_SIZE_T x = win->_curx; 58 | 59 | /* 60 | * If we have just wrapped the cursor, the clear applies to the 61 | * new line, unless we are at the lower right corner. 62 | */ 63 | if ((win->_flags & _WRAPPED) != 0 64 | && y < win->_maxy) { 65 | win->_flags &= ~_WRAPPED; 66 | } 67 | 68 | /* 69 | * There's no point in clearing if we're not on a legal 70 | * position, either. 71 | */ 72 | if ((win->_flags & _WRAPPED) != 0 73 | || y > win->_maxy 74 | || x > win->_maxx) 75 | returnCode(ERR); 76 | 77 | blank = win->_nc_bkgd; 78 | line = &win->_line[y]; 79 | CHANGED_TO_EOL(line, x, win->_maxx); 80 | 81 | ptr = &(line->text[x]); 82 | end = &(line->text[win->_maxx]); 83 | 84 | while (ptr <= end) 85 | *ptr++ = blank; 86 | 87 | _nc_synchook(win); 88 | code = OK; 89 | } 90 | returnCode(code); 91 | } 92 | -------------------------------------------------------------------------------- /native/tinfo/lib_redrawln.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Thomas E. Dickey 1997 * 31 | ****************************************************************************/ 32 | 33 | /* 34 | * lib_redrawln.c 35 | * 36 | * The routine wredrawln(). 37 | * 38 | */ 39 | 40 | #include 41 | 42 | MODULE_ID("$Id: lib_redrawln.c,v 1.17 2010/12/19 00:03:23 tom Exp $") 43 | 44 | NCURSES_EXPORT(int) 45 | wredrawln(WINDOW *win, int beg, int num) 46 | { 47 | int i; 48 | int end; 49 | size_t len; 50 | SCREEN *sp; 51 | 52 | T((T_CALLED("wredrawln(%p,%d,%d)"), (void *) win, beg, num)); 53 | 54 | if (win == 0) 55 | returnCode(ERR); 56 | 57 | sp = _nc_screen_of(win); 58 | 59 | if (beg < 0) 60 | beg = 0; 61 | 62 | if (touchline(win, beg, num) == ERR) 63 | returnCode(ERR); 64 | 65 | if (touchline(CurScreen(sp), beg + win->_begy, num) == ERR) 66 | returnCode(ERR); 67 | 68 | end = beg + num; 69 | if (end > CurScreen(sp)->_maxy + 1 - win->_begy) 70 | end = CurScreen(sp)->_maxy + 1 - win->_begy; 71 | if (end > win->_maxy + 1) 72 | end = win->_maxy + 1; 73 | 74 | len = (size_t) (win->_maxx + 1); 75 | if (len > (size_t) (CurScreen(sp)->_maxx + 1 - win->_begx)) 76 | len = (size_t) (CurScreen(sp)->_maxx + 1 - win->_begx); 77 | len *= sizeof(CurScreen(sp)->_line[0].text[0]); 78 | 79 | for (i = beg; i < end; i++) { 80 | int crow = i + win->_begy; 81 | 82 | memset(CurScreen(sp)->_line[crow].text + win->_begx, 0, len); 83 | NCURSES_SP_NAME(_nc_make_oldhash) (NCURSES_SP_ARGx crow); 84 | } 85 | 86 | returnCode(OK); 87 | } 88 | -------------------------------------------------------------------------------- /native/tinfo/lib_flash.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | * and: Thomas E. Dickey 1996-on * 33 | * and: Juergen Pfeifer 2009 * 34 | ****************************************************************************/ 35 | 36 | /* 37 | * flash.c 38 | * 39 | * The routine flash(). 40 | * 41 | */ 42 | 43 | #include 44 | 45 | #ifndef CUR 46 | #define CUR SP_TERMTYPE 47 | #endif 48 | 49 | MODULE_ID("$Id: lib_flash.c,v 1.11 2009/10/24 22:02:14 tom Exp $") 50 | 51 | /* 52 | * flash() 53 | * 54 | * Flash the current terminal's screen if possible. If not, 55 | * sound the audible bell if one exists. 56 | * 57 | */ 58 | 59 | NCURSES_EXPORT(int) 60 | NCURSES_SP_NAME(flash) (NCURSES_SP_DCL0) 61 | { 62 | int res = ERR; 63 | 64 | T((T_CALLED("flash(%p)"), (void *) SP_PARM)); 65 | #ifdef USE_TERM_DRIVER 66 | if (SP_PARM != 0) 67 | res = CallDriver_1(SP_PARM, doBeepOrFlash, FALSE); 68 | #else 69 | /* FIXME: should make sure that we are not in altchar mode */ 70 | if (flash_screen) { 71 | TPUTS_TRACE("flash_screen"); 72 | res = putp(flash_screen); 73 | _nc_flush(); 74 | } else if (bell) { 75 | TPUTS_TRACE("bell"); 76 | res = putp(bell); 77 | _nc_flush(); 78 | } 79 | #endif 80 | returnCode(res); 81 | } 82 | 83 | #if NCURSES_SP_FUNCS 84 | NCURSES_EXPORT(int) 85 | flash(void) 86 | { 87 | return NCURSES_SP_NAME(flash) (CURRENT_SCREEN); 88 | } 89 | #endif 90 | -------------------------------------------------------------------------------- /native/tinfo/lib_slkatr_set.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2005,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Juergen Pfeifer, 1998 * 31 | * and: Thomas E. Dickey 2005-on * 32 | ****************************************************************************/ 33 | 34 | /* 35 | * lib_slkatr_set.c 36 | * Soft key routines. 37 | * Set the label's attributes 38 | */ 39 | #include 40 | 41 | MODULE_ID("$Id: lib_slkatr_set.c,v 1.14 2009/10/24 22:47:03 tom Exp $") 42 | 43 | NCURSES_EXPORT(int) 44 | NCURSES_SP_NAME(slk_attr_set) (NCURSES_SP_DCLx 45 | const attr_t attr, 46 | short color_pair_number, 47 | void *opts) 48 | { 49 | int code = ERR; 50 | 51 | T((T_CALLED("slk_attr_set(%p,%s,%d)"), 52 | (void *) SP_PARM, 53 | _traceattr(attr), 54 | color_pair_number)); 55 | 56 | if (SP_PARM != 0 57 | && SP_PARM->_slk != 0 58 | && !opts 59 | && color_pair_number >= 0 60 | && color_pair_number < SP_PARM->_pair_limit) { 61 | TR(TRACE_ATTRS, ("... current %s", _tracech_t(CHREF(SP_PARM->_slk->attr)))); 62 | SetAttr(SP_PARM->_slk->attr, attr); 63 | if (color_pair_number > 0) { 64 | SetPair(SP_PARM->_slk->attr, color_pair_number); 65 | } 66 | TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP_PARM->_slk->attr)))); 67 | code = OK; 68 | } 69 | returnCode(code); 70 | } 71 | 72 | #if NCURSES_SP_FUNCS 73 | NCURSES_EXPORT(int) 74 | slk_attr_set(const attr_t attr, short color_pair_number, void *opts) 75 | { 76 | return NCURSES_SP_NAME(slk_attr_set) (CURRENT_SCREEN, attr, 77 | color_pair_number, opts); 78 | } 79 | #endif 80 | -------------------------------------------------------------------------------- /native/tinfo/lib_longname.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | * and: Thomas E. Dickey 1996-on * 33 | * and: Juergen Pfeifer 2009 * 34 | ****************************************************************************/ 35 | 36 | /* 37 | ** lib_longname.c 38 | ** 39 | ** The routine longname(). 40 | ** 41 | */ 42 | 43 | #include 44 | 45 | MODULE_ID("$Id: lib_longname.c,v 1.12 2010/12/20 00:31:26 tom Exp $") 46 | 47 | #if USE_REENTRANT 48 | NCURSES_EXPORT(char *) 49 | NCURSES_SP_NAME(longname) (NCURSES_SP_DCL0) 50 | { 51 | static char empty[] = 52 | {'\0'}; 53 | char *ptr; 54 | 55 | T((T_CALLED("longname(%p)"), (void *) SP_PARM)); 56 | 57 | if (SP_PARM) { 58 | for (ptr = SP_PARM->_ttytype + strlen(SP_PARM->_ttytype); 59 | ptr > SP_PARM->_ttytype; 60 | ptr--) 61 | if (*ptr == '|') 62 | returnPtr(ptr + 1); 63 | returnPtr(SP_PARM->_ttytype); 64 | } 65 | return empty; 66 | } 67 | 68 | #if NCURSES_SP_FUNCS 69 | NCURSES_EXPORT(char *) 70 | longname(void) 71 | { 72 | return NCURSES_SP_NAME(longname) (CURRENT_SCREEN); 73 | } 74 | #endif 75 | 76 | #else 77 | NCURSES_EXPORT(char *) 78 | longname(void) 79 | { 80 | char *ptr; 81 | 82 | T((T_CALLED("longname()"))); 83 | 84 | for (ptr = ttytype + strlen(ttytype); 85 | ptr > ttytype; 86 | ptr--) 87 | if (*ptr == '|') 88 | returnPtr(ptr + 1); 89 | returnPtr(ttytype); 90 | } 91 | #endif 92 | -------------------------------------------------------------------------------- /native/tinfo/lib_nl.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | * and: Thomas E. Dickey 1996-on * 33 | * and: Juergen Pfeifer 2009 * 34 | ****************************************************************************/ 35 | 36 | /* 37 | * nl.c 38 | * 39 | * Routines: 40 | * nl() 41 | * nonl() 42 | * 43 | */ 44 | 45 | #include 46 | 47 | MODULE_ID("$Id: lib_nl.c,v 1.12 2009/10/24 22:05:55 tom Exp $") 48 | 49 | #ifdef __EMX__ 50 | #include 51 | #endif 52 | 53 | NCURSES_EXPORT(int) 54 | NCURSES_SP_NAME(nl) (NCURSES_SP_DCL0) 55 | { 56 | T((T_CALLED("nl(%p)"), (void *) SP_PARM)); 57 | if (0 == SP_PARM) 58 | returnCode(ERR); 59 | SP_PARM->_nl = TRUE; 60 | #ifdef __EMX__ 61 | _nc_flush(); 62 | _fsetmode(NC_OUTPUT(SP_PARM), "t"); 63 | #endif 64 | returnCode(OK); 65 | } 66 | 67 | #if NCURSES_SP_FUNCS 68 | NCURSES_EXPORT(int) 69 | nl(void) 70 | { 71 | return NCURSES_SP_NAME(nl) (CURRENT_SCREEN); 72 | } 73 | #endif 74 | 75 | NCURSES_EXPORT(int) 76 | NCURSES_SP_NAME(nonl) (NCURSES_SP_DCL0) 77 | { 78 | T((T_CALLED("nonl(%p)"), (void *) SP_PARM)); 79 | if (0 == SP_PARM) 80 | returnCode(ERR); 81 | SP_PARM->_nl = FALSE; 82 | #ifdef __EMX__ 83 | _nc_flush(); 84 | _fsetmode(NC_OUTPUT(SP_PARM), "b"); 85 | #endif 86 | returnCode(OK); 87 | } 88 | 89 | #if NCURSES_SP_FUNCS 90 | NCURSES_EXPORT(int) 91 | nonl(void) 92 | { 93 | return NCURSES_SP_NAME(nonl) (CURRENT_SCREEN); 94 | } 95 | #endif 96 | -------------------------------------------------------------------------------- /native/tinfo/lib_beep.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | * and: Thomas E. Dickey 1996-on * 33 | * and: Juergen Pfeifer 2009 * 34 | ****************************************************************************/ 35 | 36 | /* 37 | * beep.c 38 | * 39 | * The routine beep(). 40 | * 41 | */ 42 | 43 | #include 44 | 45 | #ifndef CUR 46 | #define CUR SP_TERMTYPE 47 | #endif 48 | 49 | MODULE_ID("$Id: lib_beep.c,v 1.15 2009/10/24 22:02:14 tom Exp $") 50 | 51 | /* 52 | * beep() 53 | * 54 | * Sound the current terminal's audible bell if it has one. If not, 55 | * flash the screen if possible. 56 | * 57 | */ 58 | 59 | NCURSES_EXPORT(int) 60 | NCURSES_SP_NAME(beep) (NCURSES_SP_DCL0) 61 | { 62 | int res = ERR; 63 | 64 | T((T_CALLED("beep(%p)"), (void *) SP_PARM)); 65 | 66 | #ifdef USE_TERM_DRIVER 67 | if (SP_PARM != 0) 68 | res = CallDriver_1(SP_PARM, doBeepOrFlash, TRUE); 69 | #else 70 | /* FIXME: should make sure that we are not in altchar mode */ 71 | if (cur_term == 0) { 72 | res = ERR; 73 | } else if (bell) { 74 | TPUTS_TRACE("bell"); 75 | res = putp(bell); 76 | _nc_flush(); 77 | } else if (flash_screen) { 78 | TPUTS_TRACE("flash_screen"); 79 | res = putp(flash_screen); 80 | _nc_flush(); 81 | } 82 | #endif 83 | 84 | returnCode(res); 85 | } 86 | 87 | #if NCURSES_SP_FUNCS 88 | NCURSES_EXPORT(int) 89 | beep(void) 90 | { 91 | return NCURSES_SP_NAME(beep) (CURRENT_SCREEN); 92 | } 93 | #endif 94 | -------------------------------------------------------------------------------- /native/tinfo/lib_ungetch.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * 3 | * * 4 | * Permission is hereby granted, free of charge, to any person obtaining a * 5 | * copy of this software and associated documentation files (the * 6 | * "Software"), to deal in the Software without restriction, including * 7 | * without limitation the rights to use, copy, modify, merge, publish, * 8 | * distribute, distribute with modifications, sublicense, and/or sell * 9 | * copies of the Software, and to permit persons to whom the Software is * 10 | * furnished to do so, subject to the following conditions: * 11 | * * 12 | * The above copyright notice and this permission notice shall be included * 13 | * in all copies or substantial portions of the Software. * 14 | * * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 16 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 18 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 19 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 20 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 21 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 22 | * * 23 | * Except as contained in this notice, the name(s) of the above copyright * 24 | * holders shall not be used in advertising or otherwise to promote the * 25 | * sale, use or other dealings in this Software without prior written * 26 | * authorization. * 27 | ****************************************************************************/ 28 | 29 | /**************************************************************************** 30 | * Author: Zeyd M. Ben-Halim 1992,1995 * 31 | * and: Eric S. Raymond * 32 | * and: Thomas E. Dickey 1996-on * 33 | * and: Juergen Pfeifer 2009 * 34 | ****************************************************************************/ 35 | 36 | /* 37 | ** lib_ungetch.c 38 | ** 39 | ** The routine ungetch(). 40 | ** 41 | */ 42 | 43 | #include 44 | 45 | MODULE_ID("$Id: lib_ungetch.c,v 1.14 2009/10/24 22:12:21 tom Exp $") 46 | 47 | #include 48 | 49 | #ifdef TRACE 50 | NCURSES_EXPORT(void) 51 | _nc_fifo_dump(SCREEN *sp) 52 | { 53 | int i; 54 | T(("head = %d, tail = %d, peek = %d", head, tail, peek)); 55 | for (i = 0; i < 10; i++) 56 | T(("char %d = %s", i, _nc_tracechar(sp, sp->_fifo[i]))); 57 | } 58 | #endif /* TRACE */ 59 | 60 | NCURSES_EXPORT(int) 61 | safe_ungetch(SCREEN *sp, int ch) 62 | { 63 | int rc = ERR; 64 | 65 | T((T_CALLED("ungetch(%p,%s)"), (void *) sp, _nc_tracechar(sp, ch))); 66 | 67 | if (tail != -1) { 68 | if (head == -1) { 69 | head = 0; 70 | t_inc(); 71 | peek = tail; /* no raw keys */ 72 | } else 73 | h_dec(); 74 | 75 | sp->_fifo[head] = ch; 76 | T(("ungetch %s ok", _nc_tracechar(sp, ch))); 77 | #ifdef TRACE 78 | if (USE_TRACEF(TRACE_IEVENT)) { 79 | _nc_fifo_dump(sp); 80 | _nc_unlock_global(tracef); 81 | } 82 | #endif 83 | rc = OK; 84 | } 85 | returnCode(rc); 86 | } 87 | 88 | NCURSES_EXPORT(int) 89 | ungetch(int ch) 90 | { 91 | return safe_ungetch(CURRENT_SCREEN, ch); 92 | } 93 | --------------------------------------------------------------------------------