├── .gitignore ├── .gitlab-ci.yml ├── .version ├── AUTHORS ├── CMakeLists.txt ├── COPYING ├── INSTALL ├── Makefile.am ├── README ├── cmake ├── FindGPERF.cmake ├── FindLibRegex.cmake ├── FindPackageHandleStandardArgs.cmake └── toolchain-i686-w64-mingw32.cmake ├── configure.ac ├── docs ├── Makefile.am ├── kconfig-language.txt ├── kconfig.txt └── known-issues.txt ├── frontends ├── CMakeLists.txt ├── Makefile.am ├── conf │ ├── Makefile.am │ └── conf.c ├── gconf │ ├── Makefile.am │ ├── gconf.c │ ├── gconf.c.patch │ └── gconf.glade ├── mconf │ ├── CMakeLists.txt │ ├── Makefile.am │ └── mconf.c ├── nconf │ ├── Makefile.am │ ├── nconf.c │ ├── nconf.gui.c │ └── nconf.h └── qconf │ ├── Makefile.am │ ├── qconf.cc │ ├── qconf.cc.patch │ └── qconf.h ├── libs ├── CMakeLists.txt ├── Makefile.am ├── expand_env │ ├── CMakeLists.txt │ ├── expand_env.c │ └── expand_env.h ├── images │ ├── CMakeLists.txt │ ├── Makefile.am │ └── images.c_orig ├── lxdialog │ ├── BIG.FAT.WARNING │ ├── CMakeLists.txt │ ├── Makefile.am │ ├── checklist.c │ ├── dialog.h │ ├── inputbox.c │ ├── menubox.c │ ├── textbox.c │ ├── util.c │ └── yesno.c ├── parser │ ├── CMakeLists.txt │ ├── Makefile.am │ ├── confdata.c │ ├── expr.c │ ├── expr.h │ ├── hconf.gperf │ ├── lconf.l │ ├── list.h │ ├── lkc.h │ ├── lkc_proto.h │ ├── menu.c │ ├── symbol.c │ ├── util.c │ ├── yconf.y │ └── yconf.y.patch └── pdcurses-3.4 │ ├── CMakeLists.txt │ ├── HISTORY │ ├── IMPLEMNT │ ├── PDCurses.spec │ ├── README │ ├── config.guess │ ├── config.h.in │ ├── config.sub │ ├── configure.ac │ ├── curses.h │ ├── curspriv.h │ ├── demos │ ├── README │ ├── firework.c │ ├── newdemo.c │ ├── ptest.c │ ├── rain.c │ ├── testcurs.c │ ├── tui.c │ ├── tui.h │ ├── tuidemo.c │ ├── worm.c │ └── xmas.c │ ├── doc │ ├── intro.txt │ ├── manext.c │ ├── sdl.txt │ └── x11.txt │ ├── dos │ ├── README │ ├── bccdos.lrf │ ├── bccdos.mak │ ├── gccdos.mak │ ├── mscdos.lrf │ ├── mscdos.mak │ ├── pdcclip.c │ ├── pdcdisp.c │ ├── pdcdos.h │ ├── pdcgetsc.c │ ├── pdckbd.c │ ├── pdcscrn.c │ ├── pdcsetsc.c │ ├── pdcutil.c │ ├── wccdos16.mak │ └── wccdos4g.mak │ ├── exp-base.def │ ├── exp-wide.def │ ├── install-sh │ ├── libobjs.mif │ ├── makedist.mif │ ├── os2 │ ├── README │ ├── bccos2.mak │ ├── gccos2.mak │ ├── iccos2.lrf │ ├── iccos2.mak │ ├── pdcclip.c │ ├── pdcdisp.c │ ├── pdcgetsc.c │ ├── pdckbd.c │ ├── pdcos2.h │ ├── pdcscrn.c │ ├── pdcsetsc.c │ ├── pdcutil.c │ └── wccos2.mak │ ├── panel.h │ ├── pdcurses │ ├── CMakeLists.txt │ ├── README │ ├── addch.c │ ├── addchstr.c │ ├── addstr.c │ ├── attr.c │ ├── beep.c │ ├── bkgd.c │ ├── border.c │ ├── clear.c │ ├── color.c │ ├── debug.c │ ├── delch.c │ ├── deleteln.c │ ├── deprec.c │ ├── getch.c │ ├── getstr.c │ ├── getyx.c │ ├── inch.c │ ├── inchstr.c │ ├── initscr.c │ ├── inopts.c │ ├── insch.c │ ├── insstr.c │ ├── instr.c │ ├── kernel.c │ ├── keyname.c │ ├── mouse.c │ ├── move.c │ ├── outopts.c │ ├── overlay.c │ ├── pad.c │ ├── panel.c │ ├── printw.c │ ├── refresh.c │ ├── scanw.c │ ├── scr_dump.c │ ├── scroll.c │ ├── slk.c │ ├── termattr.c │ ├── terminfo.c │ ├── touch.c │ ├── util.c │ └── window.c │ ├── sdl1 │ ├── Makefile.mng │ ├── README │ ├── deffont.h │ ├── deficon.h │ ├── pdcclip.c │ ├── pdcdisp.c │ ├── pdcgetsc.c │ ├── pdckbd.c │ ├── pdcscrn.c │ ├── pdcsdl.h │ ├── pdcsetsc.c │ ├── pdcutil.c │ └── sdltest.c │ ├── term.h │ ├── version.mif │ ├── watcom.mif │ ├── win32 │ ├── CMakeLists.txt │ ├── README │ ├── bccwin32.mak │ ├── dmcwin32.mak │ ├── gccwin32.mak │ ├── lccwin32.mak │ ├── mingwin32.mak │ ├── pdcclip.c │ ├── pdcdisp.c │ ├── pdcgetsc.c │ ├── pdckbd.c │ ├── pdcscrn.c │ ├── pdcsetsc.c │ ├── pdcurses.ico │ ├── pdcurses.rc │ ├── pdcutil.c │ ├── pdcwin.h │ ├── vcwin32.mak │ └── wccwin32.mak │ └── x11 │ ├── Makefile.aix.in │ ├── README │ ├── ScrollBox.c │ ├── ScrollBox.h │ ├── ScrollBoxP.h │ ├── big_icon.xbm │ ├── compose.h │ ├── little_icon.xbm │ ├── ncurses_cfg.h │ ├── pdcclip.c │ ├── pdcdisp.c │ ├── pdcgetsc.c │ ├── pdckbd.c │ ├── pdcscrn.c │ ├── pdcsetsc.c │ ├── pdcutil.c │ ├── pdcx11.c │ ├── pdcx11.h │ ├── sb.c │ ├── x11.c │ └── xcurses-config.in ├── scripts ├── .autostuff │ └── m4 │ │ └── .empty ├── Makefile.am ├── ksync.list ├── ksync.log ├── ksync.sh └── version.sh └── utils ├── Makefile.am ├── diff ├── gettext.c ├── merge ├── tweak.in └── tweak.in.patch /.gitignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | *.o 3 | *.lo 4 | *.a 5 | *.la 6 | *.lai 7 | *.exe 8 | 9 | .libs/ 10 | 11 | /frontends/conf/conf 12 | /frontends/conf/*-conf 13 | /frontends/gconf/gconf 14 | /frontends/gconf/*-gconf 15 | /frontends/mconf/mconf 16 | /frontends/mconf/*-mconf 17 | /frontends/nconf/nconf 18 | /frontends/nconf/*-nconf 19 | /frontends/qconf/qconf 20 | /frontends/qconf/*-qconf 21 | /frontends/qconf/qconf.moc 22 | 23 | /libs/images/images.c 24 | /libs/images/images.h 25 | /libs/parser/?conf.c 26 | 27 | /utils/tweak 28 | /utils/gettext 29 | /utils/*-gettext 30 | 31 | aclocal.m4 32 | configure 33 | config.log 34 | config.status 35 | libtool 36 | 37 | Makefile 38 | Makefile.in 39 | stamp-h1 40 | 41 | .deps/ 42 | /autom4te.cache/ 43 | /scripts/.autostuff 44 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | stages: 2 | - build 3 | - deploy 4 | 5 | build_kconfig_win: 6 | stage: build 7 | tags: 8 | - build 9 | 10 | image: ${DOCKER_REGISTRY}/esp32-toolchain-win-cross 11 | 12 | artifacts: 13 | paths: 14 | - dist 15 | expire_in: 1 week 16 | 17 | script: 18 | - export REL_NAME=mconf-`git describe --always`-win32 19 | - mkdir -p extra 20 | - cd extra 21 | - wget https://sourceforge.net/projects/gnuwin32/files/regex/2.7/regex-2.7-lib.zip/download -O regex-2.7-lib.zip 22 | - unzip regex-2.7-lib.zip 23 | - wget https://sourceforge.net/projects/gnuwin32/files/regex/2.7/regex-2.7-bin.zip/download -O regex-2.7-bin.zip 24 | - unzip -o regex-2.7-bin.zip 25 | - wget https://sourceforge.net/projects/gnuwin32/files/libintl/0.14.4/libintl-0.14.4-lib.zip/download -O libintl-0.14.4-lib.zip 26 | - unzip libintl-0.14.4-lib.zip 27 | - wget https://sourceforge.net/projects/gnuwin32/files/libintl/0.14.4/libintl-0.14.4-bin.zip/download -O libintl-0.14.4-bin.zip 28 | - unzip -o libintl-0.14.4-bin.zip 29 | - wget https://sourceforge.net/projects/gnuwin32/files/libintl/0.14.4/libintl-0.14.4-dep.zip/download -O libintl-0.14.4-dep.zip 30 | - unzip -o libintl-0.14.4-dep.zip 31 | - cd .. 32 | - mkdir -p build 33 | - cd build 34 | - > 35 | cmake 36 | -D CMAKE_TOOLCHAIN_FILE=../cmake/toolchain-i686-w64-mingw32.cmake 37 | -D CMAKE_PREFIX_PATH="${PWD}/../extra" 38 | -D CMAKE_BUILD_TYPE=MinSizeRel 39 | -D REL_NAME="${REL_NAME}" 40 | .. 41 | - make -j VERBOSE=1 42 | - cd .. 43 | - mkdir dist 44 | - mkdir dist/${REL_NAME} 45 | - cp build/bin/mconf-idf.exe dist/${REL_NAME}/ 46 | - cp extra/bin/libiconv2.dll dist/${REL_NAME}/ 47 | - cp extra/bin/libintl3.dll dist/${REL_NAME}/ 48 | - cp extra/bin/regex2.dll dist/${REL_NAME}/ 49 | - cp AUTHORS COPYING README dist/${REL_NAME} 50 | - cd dist 51 | - zip -r ${REL_NAME}.zip ${REL_NAME} 52 | - rm -rf ${REL_NAME} 53 | 54 | build_kconfig_linux: 55 | stage: build 56 | tags: 57 | - build 58 | 59 | image: ${DOCKER_REGISTRY}/esp32-toolchain 60 | 61 | script: 62 | - mkdir -p build 63 | - cd build 64 | - cmake .. 65 | - make -j 66 | 67 | 68 | push_our_branches_to_github: 69 | stage: deploy 70 | tags: 71 | - deploy 72 | only: 73 | - 4.6.x-idf 74 | when: on_success 75 | dependencies: [] 76 | variables: 77 | GITHUB_PUSH_REFS: refs/remotes/origin/4.6.x-idf 78 | script: 79 | - mkdir -p ~/.ssh 80 | - chmod 700 ~/.ssh 81 | - echo -n $GH_PUSH_KEY > ~/.ssh/id_ed25519_base64 82 | - base64 --decode --ignore-garbage ~/.ssh/id_ed25519_base64 > ~/.ssh/id_ed25519 83 | - chmod 600 ~/.ssh/id_ed25519 84 | - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config 85 | - git remote remove github &>/dev/null || true 86 | - git remote add github git@github.com:espressif/kconfig-frontends.git 87 | # What the next line of script does: goes through the list of refs for all branches we push to github, 88 | # generates a snippet of shell which is evaluated. The snippet checks CI_COMMIT_SHA against the SHA 89 | # (aka objectname) at tip of each branch, and if any SHAs match then it checks out the local branch 90 | # and then pushes that ref to a corresponding github branch 91 | - eval $(git for-each-ref --shell bash --format 'if [ $CI_COMMIT_SHA == %(objectname) ]; then git checkout -B %(refname:strip=3); git push --follow-tags github %(refname:strip=3); fi;' $GITHUB_PUSH_REFS) 92 | -------------------------------------------------------------------------------- /.version: -------------------------------------------------------------------------------- 1 | 4.6.0 2dcd0af568b0cf583645c8a317dd12e344b1c72a Charred Weasel 2 | 0 3 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Authors of kconfig-frontends. 2 | 3 | The developers of the Linux kernel are the original authors of the kconfig 4 | parser and frontends. The list is too long to reproduce here, but you can 5 | get a pretty complete list from the Linux kernel repository logs: 6 | git shortlog scripts/kconfig 7 | 8 | The packaging uses the CMake tools. 9 | 10 | The initial packaging was done by: 11 | "Yann E. MORIN" 12 | 13 | The Windows port was done by: 14 | "Max Holtzberg" 15 | 16 | ESP-IDF-specific modifications made by Espressif Systems (Shanghai) PTE LTD. 17 | 18 | For a complete list, see the commit-logs of the kconfig repository. 19 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project(kconfig) 3 | 4 | set(PROJECT_VERSION_MAJOR "4") 5 | set(PROJECT_VERSION_MINOR "6") 6 | set(PROJECT_VERSION_PATCH "0") 7 | set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") 8 | set(PROJECT_VENDOR "Espressif Systems") 9 | 10 | if (NOT REL_NAME) 11 | set(REL_NAME "${PROJECT_VERSION}") 12 | endif () 13 | 14 | get_filename_component(ROOT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 15 | set(CMAKE_MODULE_PATH "${ROOT_DIR}/cmake" ${CMAKE_MODULE_PATH}) 16 | 17 | set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin") 18 | 19 | set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -s") 20 | 21 | include_directories(libs) 22 | 23 | if (UNIX) 24 | set(BIN_INSTALL_DIR "bin") 25 | else () 26 | set(BIN_INSTALL_DIR ".") 27 | set(DOC_INSTALL_DIR ".") 28 | set(LOCALES_INSTALL_DIR "${BIN_INSTALL_DIR}/locale") 29 | endif () 30 | 31 | add_subdirectory(libs) 32 | add_subdirectory(frontends) 33 | 34 | 35 | # 36 | # CPack 37 | # 38 | 39 | set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") 40 | set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") 41 | set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") 42 | set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}") 43 | set(CPACK_PACKAGE_VENDOR "${PROJECT_VENDOR}") 44 | 45 | if (WIN32) 46 | set(CPACK_GENERATOR "ZIP") 47 | elseif (UNIX) 48 | set(CPACK_GENERATOR "TBZ2") 49 | endif () 50 | 51 | set(CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}") 52 | 53 | include(CPack) 54 | 55 | set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION "${BIN_INSTALL_DIR}") 56 | include(InstallRequiredSystemLibraries) 57 | install(FILES "README" "COPYING" DESTINATION ${BIN_INSTALL_DIR}) 58 | 59 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Installation Instructions 2 | ************************* 3 | 4 | Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 5 | 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 6 | 7 | Copying and distribution of this file, with or without modification, 8 | are permitted in any medium without royalty provided the copyright 9 | notice and this notice are preserved. This file is offered as-is, 10 | without warranty of any kind. 11 | 12 | Basic Installation under Windows 13 | ================================ 14 | 15 | You need to have CMake installed. 16 | 17 | cd kconfig-frontends 18 | mkdir build 19 | cd build 20 | cmake -G "MinGW Makefiles" .. 21 | make 22 | 23 | Building under non Windows Platforms 24 | ==================================== 25 | 26 | Use the original package from: 27 | http://ymorin.is-a-geek.org/projects/kconfig-frontends -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I scripts/.autostuff/m4 2 | MAKEFLAGS = $(SILENT_MAKEFLAGS) 3 | if COND_utils 4 | MAYBE_utils = utils 5 | endif 6 | SUBDIRS = docs libs frontends scripts $(MAYBE_utils) 7 | EXTRA_DIST = bootstrap .version 8 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | This package contains the kconfig frontends and parser. 2 | 3 | Modifications in this repository & branch are for use with Espressif ESP-IDF. Upstream 4 | project is at http://ymorin.is-a-geek.org/projects/kconfig-frontends 5 | 6 | Kconfig is the configuration language used by the Linux kernel. This package 7 | is a simple copy of the frontends and the parser found in the Linux kernel 8 | source tree, with very minor changes to adapt them to being built out of 9 | the kernel build infrastructure. 10 | 11 | This package has been ported to Windows, so the code has been changed to get 12 | it work properly. The package also contains a copy PDCurses with some minor 13 | changes. By now only the the mconf tool has been ported. 14 | 15 | Under non Windows platforms use the original package from: 16 | http://ymorin.is-a-geek.org/projects/kconfig-frontends 17 | 18 | Note: if using the git tree, or changing the autostuff sources, you'll first 19 | have to run: 20 | autoreconf -fi 21 | -------------------------------------------------------------------------------- /cmake/FindLibRegex.cmake: -------------------------------------------------------------------------------- 1 | # Try to find the libregex library. Explicit searching is currently 2 | # only required for Win32, though it might be useful for some UNIX 3 | # variants, too. Therefore code for searching common UNIX include 4 | # directories is included, too. 5 | # 6 | # Once done this will define 7 | # 8 | # LIBREGEX_FOUND - system has libregex 9 | # LIBREGEX_LIBRARIES - the library needed for linking 10 | 11 | IF (LibRegex_LIBRARY) 12 | SET(LibRegex_FIND_QUIETLY TRUE) 13 | ENDIF () 14 | 15 | FIND_PATH(LibRegex_INCLUDE_DIR 16 | NAMES "regex.h" 17 | ) 18 | 19 | FIND_LIBRARY(LibRegex_LIBRARY 20 | NAMES regex 21 | ) 22 | 23 | IF (LibRegex_INCLUDE_DIR) 24 | SET(LIBREGEX_FOUND TRUE) 25 | SET(LIBREGEX_INCLUDE_DIRS ${LibRegex_INCLUDE_DIR}) 26 | IF (LibRegex_LIBRARY) 27 | SET(LIBREGEX_LIBRARIES ${LibRegex_LIBRARY}) 28 | ENDIF () 29 | ELSE () 30 | SET(LIBREGEX_FOUND FALSE) 31 | ENDIF () 32 | 33 | IF (LIBREGEX_FOUND) 34 | IF (NOT LibRegex_FIND_QUIETLY) 35 | MESSAGE(STATUS "Found libregex: ${LibRegex_INCLUDE_DIR}") 36 | ENDIF () 37 | ELSE () 38 | IF (LibRegex_FIND_REQUIRED) 39 | MESSAGE(FATAL_ERROR "Could NOT find libregex") 40 | ENDIF () 41 | ENDIF () 42 | 43 | MARK_AS_ADVANCED(LibRegex_INCLUDE_DIR) 44 | MARK_AS_ADVANCED(LibRegex_LIBRARY) 45 | -------------------------------------------------------------------------------- /cmake/toolchain-i686-w64-mingw32.cmake: -------------------------------------------------------------------------------- 1 | SET(CMAKE_SYSTEM_NAME Windows) 2 | set(CMAKE_SYSTEM_PROCESSOR x86) 3 | SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc) 4 | SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) 5 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 6 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 7 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 8 | -------------------------------------------------------------------------------- /docs/Makefile.am: -------------------------------------------------------------------------------- 1 | dist_doc_DATA = kconfig-language.txt kconfig.txt 2 | -------------------------------------------------------------------------------- /docs/known-issues.txt: -------------------------------------------------------------------------------- 1 | This file lists the known issues encountered while packaging the kconfig 2 | frontends. 3 | 4 | ---------------------------------------- 5 | 6 | Under Cygwin, the build does not succeed with both -Wall and -Werror. 7 | 8 | ---------------------------------------- 9 | 10 | Under Cygwin, the nconf frontends does not build, because headers are 11 | hard-coded, and patching them would be too intrusive. 12 | 13 | You have to explicitly disable nconf at ./configure time: 14 | ./configure --disable-nconf 15 | 16 | ---------------------------------------- 17 | 18 | Under Cygwin, gettext is not in the C library, but in an external libintl, 19 | so it must be explicitly linked in. The packaging does check this situation, 20 | and correctly link against libintl. libintl depends on some other libraries 21 | (libncursesw and libiconv). Simply linking against libintl does pull the 22 | dependencies in. 23 | 24 | However, at least libiconv is not installed by default, even if the devel 25 | libintl package is installed. This is considered a bug in the Cygwin 26 | installation mechanism. 27 | 28 | To fix it, re-run the Cygwin install process, and expressly select: 29 | - Devel/libiconv 30 | 31 | (and say 'yes' if you are prompted for required packages), and re-build 32 | (no need to re-run .configure). 33 | 34 | ---------------------------------------- 35 | 36 | Under Cygwin, gtk+2.0 depends on: 37 | - libglitz 38 | - libxcb-render-util 39 | - libpng15 40 | 41 | but they are not installed by default, even if the gtk devel package is 42 | installed. 43 | 44 | To fix it, re-run the Cygwin install process, and expressly select: 45 | - X11/libglitz-devel 46 | - X11/libxcb-render-util-devel 47 | - Libs/libpng15-devel 48 | 49 | (and say 'yes' if you are prompted for required packages), and re-build 50 | (no need to re-run ./configure). 51 | 52 | gtk+2.0 is used by the gconf frontend. 53 | 54 | ---------------------------------------- 55 | 56 | Under Cygwin, libglade's .la file explictly links against -lpng12, but 57 | the version of libpng is 1.5, not 1.2. 58 | 59 | To fix it, you can do either of: 60 | - disable the gconf frontend with --disable-gconf, or 61 | - edit /lib/libglade-2.0.la, and change '-lpng12' to '-lpng'. 62 | 63 | libglade is used by the gconf frontend. 64 | 65 | ---------------------------------------- 66 | 67 | Under Cygwin, Qt4 depends on libffi, but it is only available if you 68 | installed the gcc4 package (the gcc package is a gcc-3). 69 | 70 | To fix it, re-run the Cygwin install process, and expressly select: 71 | - Devel/gcc4 72 | 73 | (and say 'yes' if you are prompted for required packages). You'll need 74 | to re-run ./configure. 75 | 76 | Qt4 is used by the qconf frontend. 77 | 78 | ---------------------------------------- 79 | 80 | Under MacOS X, the build does not succeed with both -Wall and -Werror. It fails 81 | with the error: 82 | menu.c: In function 'get_symbol_str': 83 | menu.c:515: warning: 'jump' may be used uninitialized in this function 84 | [Tested under MacOS X 10.6 with i686-apple-darwin10-gcc-4.2.1 build 5666 (dot 3)] 85 | 86 | ---------------------------------------- 87 | -------------------------------------------------------------------------------- /frontends/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(mconf) -------------------------------------------------------------------------------- /frontends/Makefile.am: -------------------------------------------------------------------------------- 1 | if COND_conf 2 | MAYBE_conf = conf 3 | endif 4 | if COND_mconf 5 | MAYBE_mconf = mconf 6 | endif 7 | if COND_nconf 8 | MAYBE_nconf = nconf 9 | endif 10 | if COND_gconf 11 | MAYBE_gconf = gconf 12 | endif 13 | if COND_qconf 14 | MAYBE_qconf = qconf 15 | endif 16 | SUBDIRS = $(MAYBE_conf) $(MAYBE_mconf) $(MAYBE_nconf) $(MAYBE_gconf) $(MAYBE_qconf) 17 | -------------------------------------------------------------------------------- /frontends/conf/Makefile.am: -------------------------------------------------------------------------------- 1 | bin_PROGRAMS = conf 2 | 3 | conf_SOURCES = conf.c 4 | conf_CPPFLAGS = $(AM_CPPFLAGS) \ 5 | $(intl_CPPFLAGS) \ 6 | -I$(top_srcdir)/libs/parser 7 | conf_CFLAGS = $(AM_CFLAGS) $(kf_CFLAGS) 8 | conf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la \ 9 | $(intl_LIBS) \ 10 | $(conf_EXTRA_LIBS) 11 | -------------------------------------------------------------------------------- /frontends/gconf/Makefile.am: -------------------------------------------------------------------------------- 1 | bin_PROGRAMS = gconf 2 | 3 | gconf_SOURCES = gconf.c gconf.glade 4 | gconf_CPPFLAGS = $(AM_CPPFLAGS) \ 5 | $(intl_CPPFLAGS) \ 6 | -I$(top_srcdir)/libs/parser \ 7 | -I$(top_builddir)/libs/images \ 8 | -DGUI_PATH='"$(pkgdatadir)/gconf.glade"' 9 | gconf_CFLAGS = $(AM_CFLAGS) \ 10 | $(kf_CFLAGS) \ 11 | $(gtk_CFLAGS) 12 | gconf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la \ 13 | $(top_builddir)/libs/images/libkconfig-images.a \ 14 | $(intl_LIBS) $(gtk_LIBS) $(gconf_EXTRA_LIBS) 15 | gconfdir = $(pkgdatadir) 16 | gconf_DATA = gconf.glade 17 | EXTRA_DIST = gconf.c.patch 18 | -------------------------------------------------------------------------------- /frontends/gconf/gconf.c.patch: -------------------------------------------------------------------------------- 1 | diff --git a/frontends/gconf/gconf.c b/frontends/gconf/gconf.c 2 | --- a/frontends/gconf/gconf.c 3 | +++ b/frontends/gconf/gconf.c 4 | @@ -12,7 +12,7 @@ 5 | 6 | #include 7 | #include "lkc.h" 8 | -#include "images.c" 9 | +#include "images.h" 10 | 11 | #include 12 | #include 13 | @@ -1468,8 +1468,10 @@ 14 | int main(int ac, char *av[]) 15 | { 16 | const char *name; 17 | +#if 0 18 | char *env; 19 | +#endif 20 | - gchar *glade_file; 21 | + gchar *glade_file = GUI_PATH; 22 | 23 | bindtextdomain(PACKAGE, LOCALEDIR); 24 | bind_textdomain_codeset(PACKAGE, "UTF-8"); 25 | @@ -1483,6 +1485,7 @@ 26 | //add_pixmap_directory (PACKAGE_DATA_DIR "/" PACKAGE "/pixmaps"); 27 | //add_pixmap_directory (PACKAGE_SOURCE_DIR "/pixmaps"); 28 | 29 | +#if 0 30 | /* Determine GUI path */ 31 | env = getenv(SRCTREE); 32 | if (env) 33 | @@ -1491,6 +1494,7 @@ 34 | glade_file = g_strconcat(av[0], ".glade", NULL); 35 | else 36 | glade_file = g_strconcat(g_get_current_dir(), "/", av[0], ".glade", NULL); 37 | +#endif 38 | 39 | /* Conf stuffs */ 40 | if (ac > 1 && av[1][0] == '-') { 41 | -------------------------------------------------------------------------------- /frontends/mconf/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (NOT WIN32) 2 | find_package(Curses REQUIRED) 3 | else(NOT WIN32) 4 | set(CURSES_INCLUDE_DIRS ${pdcurses_INCLUDE_DIRS}) 5 | set(CURSES_NCURSES_LIBRARIES ${pdcurses_LIBRARIES}) 6 | endif(NOT WIN32) 7 | 8 | find_package(Intl REQUIRED) 9 | add_definitions(${lxdialog_DEFINES}) 10 | 11 | include_directories( 12 | ${kparser_INCLUDE_DIRS} 13 | ${lxdialog_INCLUDE_DIRS} 14 | ) 15 | 16 | include_directories( 17 | ${CURSES_INCLUDE_DIRS} 18 | ${Intl_INCLUDE_DIRS} 19 | ) 20 | 21 | set(TARGET_NAME mconf-idf) 22 | 23 | add_executable(${TARGET_NAME} 24 | mconf.c 25 | ) 26 | 27 | add_definitions(-DREL_NAME="${REL_NAME}" -DPROG_NAME="${TARGET_NAME}") 28 | 29 | target_link_libraries(${TARGET_NAME} 30 | ${kparser_LIBRARIES} 31 | ${lxdialog_LIBRARIES} 32 | ${Intl_LIBRARIES} 33 | ${CURSES_NCURSES_LIBRARIES} 34 | expand-env 35 | ) 36 | 37 | set(EXECUTABLE "${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}${CMAKE_EXECUTABLE_SUFFIX}") 38 | 39 | if (WIN32) 40 | get_filename_component(MINGW_PATH "${CMAKE_C_COMPILER}" PATH) 41 | endif () 42 | 43 | # install(TARGETS mconf-idf DESTINATION ${BIN_INSTALL_DIR}) 44 | install(CODE " 45 | include(BundleUtilities) 46 | fixup_bundle(\"${EXECUTABLE}\" \"\" \"\") 47 | " COMPONENT Runtime) 48 | 49 | install(TARGETS ${TARGET_NAME} DESTINATION ${BIN_INSTALL_DIR}) 50 | -------------------------------------------------------------------------------- /frontends/mconf/Makefile.am: -------------------------------------------------------------------------------- 1 | bin_PROGRAMS = mconf 2 | 3 | mconf_SOURCES = mconf.c 4 | mconf_CPPFLAGS = $(AM_CPPFLAGS) \ 5 | ${ncurses_mconf_CPPFLAGS} \ 6 | $(intl_CPPFLAGS) \ 7 | -I$(top_srcdir)/libs \ 8 | -I$(top_srcdir)/libs/parser 9 | mconf_CFLAGS = $(AM_CFLAGS) \ 10 | $(kf_CFLAGS) 11 | mconf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la \ 12 | $(top_builddir)/libs/lxdialog/libkconfig-lxdialog.a \ 13 | $(intl_LIBS) $(ncurses_LIBS) $(mconf_EXTRA_LIBS) 14 | -------------------------------------------------------------------------------- /frontends/nconf/Makefile.am: -------------------------------------------------------------------------------- 1 | bin_PROGRAMS = nconf 2 | 3 | nconf_SOURCES = nconf.c nconf.gui.c nconf.h 4 | nconf_CPPFLAGS = $(AM_CPPFLAGS) \ 5 | $(intl_CPPFLAGS) \ 6 | $(ncurses_nconf_CPPFLAGS) \ 7 | -I$(top_srcdir)/libs/parser 8 | nconf_CFLAGS = $(AM_CFLAGS) \ 9 | $(kf_CFLAGS) 10 | nconf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la \ 11 | $(intl_LIBS) $(ncurses_panel_menu_LIBS) $(ncurses_LIBS) \ 12 | $(nconf_EXTRA_LIBS) 13 | -------------------------------------------------------------------------------- /frontends/nconf/nconf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 Nir Tzachar 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include "ncurses.h" 28 | 29 | #define max(a, b) ({\ 30 | typeof(a) _a = a;\ 31 | typeof(b) _b = b;\ 32 | _a > _b ? _a : _b; }) 33 | 34 | #define min(a, b) ({\ 35 | typeof(a) _a = a;\ 36 | typeof(b) _b = b;\ 37 | _a < _b ? _a : _b; }) 38 | 39 | typedef enum { 40 | NORMAL = 1, 41 | MAIN_HEADING, 42 | MAIN_MENU_BOX, 43 | MAIN_MENU_FORE, 44 | MAIN_MENU_BACK, 45 | MAIN_MENU_GREY, 46 | MAIN_MENU_HEADING, 47 | SCROLLWIN_TEXT, 48 | SCROLLWIN_HEADING, 49 | SCROLLWIN_BOX, 50 | DIALOG_TEXT, 51 | DIALOG_MENU_FORE, 52 | DIALOG_MENU_BACK, 53 | DIALOG_BOX, 54 | INPUT_BOX, 55 | INPUT_HEADING, 56 | INPUT_TEXT, 57 | INPUT_FIELD, 58 | FUNCTION_TEXT, 59 | FUNCTION_HIGHLIGHT, 60 | ATTR_MAX 61 | } attributes_t; 62 | extern attributes_t attributes[]; 63 | 64 | typedef enum { 65 | F_HELP = 1, 66 | F_SYMBOL = 2, 67 | F_INSTS = 3, 68 | F_CONF = 4, 69 | F_BACK = 5, 70 | F_SAVE = 6, 71 | F_LOAD = 7, 72 | F_SEARCH = 8, 73 | F_EXIT = 9, 74 | } function_key; 75 | 76 | void set_colors(void); 77 | 78 | /* this changes the windows attributes !!! */ 79 | void print_in_middle(WINDOW *win, 80 | int starty, 81 | int startx, 82 | int width, 83 | const char *string, 84 | chtype color); 85 | int get_line_length(const char *line); 86 | int get_line_no(const char *text); 87 | const char *get_line(const char *text, int line_no); 88 | void fill_window(WINDOW *win, const char *text); 89 | int btn_dialog(WINDOW *main_window, const char *msg, int btn_num, ...); 90 | int dialog_inputbox(WINDOW *main_window, 91 | const char *title, const char *prompt, 92 | const char *init, char **resultp, int *result_len); 93 | void refresh_all_windows(WINDOW *main_window); 94 | void show_scroll_win(WINDOW *main_window, 95 | const char *title, 96 | const char *text); 97 | -------------------------------------------------------------------------------- /frontends/qconf/Makefile.am: -------------------------------------------------------------------------------- 1 | bin_PROGRAMS = qconf 2 | 3 | qconf_SOURCES = qconf.cc qconf.h 4 | BUILT_SOURCES = qconf.moc 5 | qconf_CPPFLAGS = $(AM_CPPFLAGS) \ 6 | $(intl_CPPFLAGS) \ 7 | -I$(top_srcdir)/libs/parser \ 8 | -I$(top_builddir)/libs/images 9 | qconf_CXXFLAGS = $(AM_CXXFLAGS) \ 10 | $(kf_CFLAGS) \ 11 | $(Qt5_CFLAGS) \ 12 | -fPIC 13 | qconf_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la \ 14 | $(top_builddir)/libs/images/libkconfig-images.a \ 15 | $(intl_LIBS) $(Qt5_LIBS) $(qconf_EXTRA_LIBS) 16 | CLEANFILES = qconf.moc 17 | EXTRA_DIST = qconf.cc.patch 18 | 19 | AM_V_MOC = $(AM_V_MOC_$(V)) 20 | AM_V_MOC_ = $(AM_V_MOC_$(AM_DEFAULT_VERBOSITY)) 21 | AM_V_MOC_0 = @echo " MOC " $@; 22 | 23 | .h.moc: 24 | $(AM_V_MOC)$(MOC) -i $< -o $@ 25 | -------------------------------------------------------------------------------- /frontends/qconf/qconf.cc.patch: -------------------------------------------------------------------------------- 1 | diff --git a/frontends/qconf/qconf.cc b/frontends/qconf/qconf.cc 2 | --- a/frontends/qconf/qconf.cc 3 | +++ b/frontends/qconf/qconf.cc 4 | @@ -47,7 +47,7 @@ 5 | #include "qconf.h" 6 | 7 | #include "qconf.moc" 8 | -#include "images.c" 9 | +#include "images.h" 10 | 11 | #ifdef _ 12 | # undef _ 13 | -------------------------------------------------------------------------------- /libs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (WIN32) 2 | add_subdirectory(pdcurses-3.4) 3 | endif () 4 | 5 | add_subdirectory(expand_env) 6 | add_subdirectory(parser) 7 | add_subdirectory(lxdialog) 8 | # add_subdirectory(images) 9 | 10 | 11 | -------------------------------------------------------------------------------- /libs/Makefile.am: -------------------------------------------------------------------------------- 1 | if COND_lxdialog 2 | MAYBE_lxdialog = lxdialog 3 | endif 4 | if COND_images 5 | MAYBE_images = images 6 | endif 7 | SUBDIRS = parser $(MAYBE_images) $(MAYBE_lxdialog) 8 | -------------------------------------------------------------------------------- /libs/expand_env/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(.) 2 | add_library(expand-env expand_env.c) 3 | 4 | set(expand-env_INCLUDE_DIRS 5 | "${CMAKE_CURRENT_SOURCE_DIR}" 6 | CACHE INTERNAL "" 7 | ) 8 | -------------------------------------------------------------------------------- /libs/expand_env/expand_env.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "expand_env.h" 9 | 10 | static bool allowed_env_var_name(char c) 11 | { 12 | return c != '\0' && 13 | !isblank(c) && 14 | !iscntrl(c) && 15 | c != '/' && 16 | c != '\\' && 17 | c != '=' && 18 | c != '$'; 19 | } 20 | 21 | #define MAX_LEN (128 * 1024) /* Longest a result can expand to */ 22 | 23 | /* Very basic expansion that looks for variable references like $NAME and expands them 24 | * 25 | */ 26 | char *expand_environment(const char *input, const char *src_name, int src_line_no) 27 | { 28 | char *result = malloc(MAX_LEN); 29 | 30 | char *out = result; 31 | const char *in = input; 32 | 33 | while (*in != '\0') { 34 | // check for buffer overflow 35 | if (out >= result + MAX_LEN - 1) { 36 | goto too_long; 37 | } 38 | 39 | if (*in != '$') { 40 | // not part of an environment variable name, copy directly 41 | *out++ = *in++; 42 | continue; 43 | } 44 | 45 | // *in points to start of an environment variable reference 46 | in++; 47 | const char *env_start = in; 48 | while (allowed_env_var_name(*in)) { // scan to the end of the name 49 | in++; 50 | } 51 | size_t env_len = in - env_start; 52 | 53 | // make a buffer to hold the environment variable name 54 | // 55 | // strndup is not available on mingw32, apparently. 56 | char *env_name = calloc(1, env_len + 1); 57 | assert(env_name != NULL); 58 | strncpy(env_name, env_start, env_len); 59 | 60 | const char *value = getenv(env_name); 61 | if (value == NULL || strlen(value) == 0) { 62 | printf("%s:%d: undefined environment variable \"%s\"\n", 63 | src_name, src_line_no, env_name); 64 | exit(1); 65 | } 66 | free(env_name); 67 | if (out + strlen(value) >= result + MAX_LEN - 1) { 68 | goto too_long; 69 | } 70 | strcpy(out, value); // append the value to the result (range checked in previous statement) 71 | out += strlen(value); 72 | } 73 | 74 | *out = '\0'; // null terminate the result string 75 | 76 | return result; 77 | 78 | too_long: 79 | printf("%s:%d: Expansion is longer than %d bytes\n", 80 | src_name, src_line_no, MAX_LEN); 81 | free(result); 82 | exit(1); 83 | } 84 | 85 | void free_expanded(char *expanded) 86 | { 87 | free(expanded); 88 | } 89 | -------------------------------------------------------------------------------- /libs/expand_env/expand_env.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Expand any $ENV type environment variables in 'input', 4 | return a newly allocated buffer with the result. 5 | 6 | This is very basic expansion, doesn't do escaping or anything else. 7 | */ 8 | char *expand_environment(const char *input, const char *src_name, int src_line_no); 9 | 10 | /* Free a buffer allocated by expand_environment */ 11 | void free_expanded(char *expanded); 12 | -------------------------------------------------------------------------------- /libs/images/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(images 2 | images.c 3 | ) 4 | 5 | set(images_LIBRARIES 6 | images 7 | CACHE INTERNAL "" 8 | ) 9 | 10 | set(images_INCLUDE_DIRS 11 | "${CMAKE_CURRENT_SOURCE_DIR}" 12 | CACHE INTERNAL "" 13 | ) 14 | -------------------------------------------------------------------------------- /libs/images/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libkconfig-images.a 2 | 3 | libkconfig_images_a_SOURCES = images.c_orig 4 | nodist_libkconfig_images_a_SOURCES = images.c 5 | BUILT_SOURCES = images.c images.h 6 | CLEANFILES = images.c images.h 7 | 8 | images.c: images.c_orig 9 | $(AM_V_GEN)$(SED) -e 's/^static //' $< >$@ 10 | 11 | images.h: images.c_orig 12 | $(AM_V_GEN)$(SED) -e '/^static \(const char \*xpm_\(.\{1,\}\)\[\]\) = {/!d; s//extern \1;/' \ 13 | $< >$@ 14 | -------------------------------------------------------------------------------- /libs/lxdialog/BIG.FAT.WARNING: -------------------------------------------------------------------------------- 1 | This is NOT the official version of dialog. This version has been 2 | significantly modified from the original. It is for use by the Linux 3 | kernel configuration script. Please do not bother Savio Lam with 4 | questions about this program. 5 | -------------------------------------------------------------------------------- /libs/lxdialog/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package(Intl REQUIRED) 2 | 3 | if (WIN32) 4 | set(lxdialog_INCLUDE_DIRS 5 | "${CMAKE_CURRENT_SOURCE_DIR}" 6 | ${pdcurses_INCLUDE_DIRS} 7 | CACHE INTERNAL "" 8 | ) 9 | set(lxdialog_DEFINES "-DCURSES_LOC=\"curses.h\"" CACHE INTERNAL "") 10 | set(CURSES_LIBRARIES ${pdcurses_LIBRARIES}) 11 | 12 | else () 13 | find_package(Curses) 14 | set(lxdialog_INCLUDE_DIRS 15 | "${CMAKE_CURRENT_SOURCE_DIR}" 16 | ${CURSES_INCLUDE_DIR} 17 | CACHE INTERNAL "" 18 | ) 19 | 20 | if (${CURSES_HAVE_NCURSES_H}) 21 | set(lxdialog_DEFINES "-DCURSES_LOC=\"ncurses.h\"" CACHE INTERNAL "") 22 | else (${CURSES_HAVE_NCURSES_H}) 23 | set(lxdialog_DEFINES "-DCURSES_LOC=\"curses.h\"" CACHE INTERNAL "") 24 | endif (${CURSES_HAVE_NCURSES_H}) 25 | 26 | endif () 27 | 28 | add_definitions(${lxdialog_DEFINES}) 29 | include_directories( 30 | ${lxdialog_INCLUDE_DIRS} 31 | ${Intl_INCLUDE_DIRS} 32 | ) 33 | 34 | add_library(lxdialog 35 | checklist.c 36 | inputbox.c 37 | menubox.c 38 | textbox.c 39 | util.c 40 | yesno.c 41 | ) 42 | 43 | target_link_libraries(lxdialog 44 | ${CURSES_LIBRARIES} 45 | ) 46 | 47 | set(lxdialog_LIBRARIES 48 | lxdialog 49 | ${CURSES_LIBRARIES} 50 | CACHE INTERNAL "" 51 | ) 52 | -------------------------------------------------------------------------------- /libs/lxdialog/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libkconfig-lxdialog.a 2 | 3 | libkconfig_lxdialog_a_SOURCES = \ 4 | checklist.c \ 5 | dialog.h \ 6 | inputbox.c \ 7 | menubox.c \ 8 | textbox.c \ 9 | util.c \ 10 | yesno.c 11 | 12 | libkconfig_lxdialog_a_CPPFLAGS = $(AM_CPPFLAGS) \ 13 | ${ncurses_mconf_CPPFLAGS} \ 14 | $(intl_CPPFLAGS) 15 | liblxdialog_a_CFLAGS = $(AM_CFLAGS) $(kf_CFLAGS) 16 | -------------------------------------------------------------------------------- /libs/lxdialog/yesno.c: -------------------------------------------------------------------------------- 1 | /* 2 | * yesno.c -- implements the yes/no box 3 | * 4 | * ORIGINAL AUTHOR: Savio Lam (lam836@cs.cuhk.hk) 5 | * MODIFIED FOR LINUX KERNEL CONFIG BY: William Roadcap (roadcap@cfw.com) 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License 9 | * as published by the Free Software Foundation; either version 2 10 | * of the License, or (at your option) 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 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | */ 21 | 22 | #include "dialog.h" 23 | 24 | /* 25 | * Display termination buttons 26 | */ 27 | static void print_buttons(WINDOW * dialog, int height, int width, int selected) 28 | { 29 | int x = width / 2 - 10; 30 | int y = height - 2; 31 | 32 | print_button(dialog, gettext(" Yes "), y, x, selected == 0); 33 | print_button(dialog, gettext(" No "), y, x + 13, selected == 1); 34 | 35 | wmove(dialog, y, x + 1 + 13 * selected); 36 | wrefresh(dialog); 37 | } 38 | 39 | /* 40 | * Display a dialog box with two buttons - Yes and No 41 | */ 42 | int dialog_yesno(const char *title, const char *prompt, int height, int width) 43 | { 44 | int i, x, y, key = 0, button = 0; 45 | WINDOW *dialog; 46 | 47 | do_resize: 48 | if (getmaxy(stdscr) < (height + YESNO_HEIGTH_MIN)) 49 | return -ERRDISPLAYTOOSMALL; 50 | if (getmaxx(stdscr) < (width + YESNO_WIDTH_MIN)) 51 | return -ERRDISPLAYTOOSMALL; 52 | 53 | /* center dialog box on screen */ 54 | x = (getmaxx(stdscr) - width) / 2; 55 | y = (getmaxy(stdscr) - height) / 2; 56 | 57 | draw_shadow(stdscr, y, x, height, width); 58 | 59 | dialog = newwin(height, width, y, x); 60 | keypad(dialog, TRUE); 61 | 62 | draw_box(dialog, 0, 0, height, width, 63 | dlg.dialog.atr, dlg.border.atr); 64 | wattrset(dialog, dlg.border.atr); 65 | mvwaddch(dialog, height - 3, 0, ACS_LTEE); 66 | for (i = 0; i < width - 2; i++) 67 | waddch(dialog, ACS_HLINE); 68 | wattrset(dialog, dlg.dialog.atr); 69 | waddch(dialog, ACS_RTEE); 70 | 71 | print_title(dialog, title, width); 72 | 73 | wattrset(dialog, dlg.dialog.atr); 74 | print_autowrap(dialog, prompt, width - 2, 1, 3); 75 | 76 | print_buttons(dialog, height, width, 0); 77 | 78 | while (key != KEY_ESC) { 79 | key = wgetch(dialog); 80 | switch (key) { 81 | case 'Y': 82 | case 'y': 83 | delwin(dialog); 84 | return 0; 85 | case 'N': 86 | case 'n': 87 | delwin(dialog); 88 | return 1; 89 | 90 | case TAB: 91 | case KEY_LEFT: 92 | case KEY_RIGHT: 93 | button = ((key == KEY_LEFT ? --button : ++button) < 0) ? 1 : (button > 1 ? 0 : button); 94 | 95 | print_buttons(dialog, height, width, button); 96 | wrefresh(dialog); 97 | break; 98 | case ' ': 99 | case '\n': 100 | delwin(dialog); 101 | return button; 102 | case KEY_ESC: 103 | key = on_key_esc(dialog); 104 | break; 105 | case KEY_RESIZE: 106 | delwin(dialog); 107 | on_key_resize(); 108 | goto do_resize; 109 | } 110 | } 111 | 112 | delwin(dialog); 113 | return key; /* ESC pressed */ 114 | } 115 | -------------------------------------------------------------------------------- /libs/parser/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package(GPERF REQUIRED) 2 | find_package(FLEX REQUIRED) 3 | find_package(BISON REQUIRED) 4 | find_package(Intl REQUIRED) 5 | find_package(LibRegex REQUIRED) 6 | 7 | include_directories( 8 | . 9 | ${CMAKE_CURRENT_BINARY_DIR} 10 | ${Intl_INCLUDE_DIRS} 11 | ${LIBREGEX_INCLUDE_DIRS} 12 | ${LibPDCurses_INCLUDE_DIRS} 13 | ${expand-env_INCLUDE_DIRS} 14 | ) 15 | 16 | gperf_target(hconf 17 | hconf.gperf 18 | ${CMAKE_CURRENT_BINARY_DIR}/hconf.c 19 | COMPILE_FLAGS "-a -C -E -g -k 1,3,$$ -p -t") 20 | add_custom_target(hconftarget ALL DEPENDS hconf.c) 21 | 22 | flex_target(lconf lconf.l ${CMAKE_CURRENT_BINARY_DIR}/lconf.c) 23 | add_custom_target(lconftarget ALL DEPENDS lconf.c) 24 | 25 | bison_target(yconf 26 | ${CMAKE_CURRENT_SOURCE_DIR}/yconf.y 27 | ${CMAKE_CURRENT_BINARY_DIR}/yconf.y.c 28 | COMPILE_FLAGS "-y -t -l -p zconf") 29 | 30 | add_definitions(-DROOTMENU=\"RootMenu\") 31 | 32 | add_library(kparser 33 | ${BISON_yconf_OUTPUTS} 34 | ) 35 | 36 | add_dependencies(kparser hconftarget lconftarget) 37 | 38 | if (WIN32) 39 | set(kparser_LIBRARIES 40 | kparser 41 | ${Intl_LIBRARY} 42 | ${LibRegex_LIBRARY} 43 | ${LibPDCurses_LIBRARY} 44 | CACHE INTERNAL "" 45 | ) 46 | else () 47 | set(kparser_LIBRARIES 48 | kparser 49 | CACHE INTERNAL "" 50 | ) 51 | endif () 52 | 53 | set(kparser_INCLUDE_DIRS 54 | "${CMAKE_CURRENT_SOURCE_DIR}" 55 | CACHE INTERNAL "" 56 | ) 57 | -------------------------------------------------------------------------------- /libs/parser/Makefile.am: -------------------------------------------------------------------------------- 1 | SUFFIXES = .gperf 2 | 3 | lib_LTLIBRARIES = libkconfig-parser.la 4 | libkconfig_parser_la_SOURCES = yconf.y 5 | dist_EXTRA_libkconfig_parser_la_SOURCES = \ 6 | hconf.gperf lconf.l \ 7 | confdata.c menu.c symbol.c util.c \ 8 | expr.c expr.h lkc.h lkc_proto.h 9 | libkconfig_parser_la_CPPFLAGS = -DROOTMENU="\"$(root_menu)\"" \ 10 | -DCONFIG_=\"$(config_prefix)\" \ 11 | $(intl_CPPFLAGS) 12 | libkconfig_parser_la_CFLAGS = $(AM_CFLAGS) $(kf_CFLAGS) 13 | libkconfig_parser_la_LDFLAGS = -release $(KCONFIGPARSER_LIB_VERSION) -no-undefined 14 | libkconfig_parser_la_LIBADD = $(intl_LIBS) 15 | 16 | kconfig_includedir = $(includedir)/kconfig 17 | kconfig_include_HEADERS = list.h lkc.h expr.h lkc_proto.h 18 | 19 | BUILT_SOURCES = hconf.c lconf.c 20 | CLEANFILES = hconf.c lconf.c yconf.c 21 | EXTRA_DIST = yconf.y.patch 22 | 23 | AM_V_GPERF = $(AM_V_GPERF_$(V)) 24 | AM_V_GPERF_ = $(AM_V_GPERF_$(AM_DEFAULT_VERBOSITY)) 25 | AM_V_GPERF_0 = @echo " GPERF " $@; 26 | 27 | .gperf.c: 28 | $(AM_V_GPERF)$(GPERF) -t --output-file $@ -a -C -E -g -k 1,3,$$ -p -t $< 29 | 30 | # The following rule produces a warning: 31 | # libs/parser/Makefile.am:41: user target `.l.c' defined here... 32 | # /usr/share/automake-1.11/am/lex.am: ... overrides Automake target 33 | # `.l.c' defined here 34 | # 35 | # This is expected, and can't be avoided (for now). 36 | # That's because, when working with lex+yacc sources, the default is to 37 | # build each files searately, and then link them together into the final 38 | # output. But the Linux kernel's parser simply #include-s the lexer, 39 | # so we can't put lconf.l into the _SOURCES (it's in EXTRA_SOURCES), 40 | # and thus automake does not catch the need to call lex. 41 | # Secondly, when flex is told to change the symbols' prefix (kconfig 42 | # uses zconf in lieue of the original yy), then the output file is 43 | # also renamed, but automake does not now that, and make would fail 44 | # because it would think no file was generated. 45 | .l.c: 46 | $(AM_V_LEX)$(LEXCOMPILE) -o$@ $< 47 | -------------------------------------------------------------------------------- /libs/parser/hconf.gperf: -------------------------------------------------------------------------------- 1 | %language=ANSI-C 2 | %define hash-function-name kconf_id_hash 3 | %define lookup-function-name kconf_id_lookup 4 | %define string-pool-name kconf_id_strings 5 | %compare-strncmp 6 | %enum 7 | %pic 8 | %struct-type 9 | 10 | struct kconf_id; 11 | 12 | %% 13 | mainmenu, T_MAINMENU, TF_COMMAND 14 | menu, T_MENU, TF_COMMAND 15 | endmenu, T_ENDMENU, TF_COMMAND 16 | source, T_SOURCE, TF_COMMAND 17 | choice, T_CHOICE, TF_COMMAND 18 | endchoice, T_ENDCHOICE, TF_COMMAND 19 | comment, T_COMMENT, TF_COMMAND 20 | config, T_CONFIG, TF_COMMAND 21 | menuconfig, T_MENUCONFIG, TF_COMMAND 22 | help, T_HELP, TF_COMMAND 23 | ---help---, T_HELP, TF_COMMAND 24 | if, T_IF, TF_COMMAND|TF_PARAM 25 | endif, T_ENDIF, TF_COMMAND 26 | depends, T_DEPENDS, TF_COMMAND 27 | optional, T_OPTIONAL, TF_COMMAND 28 | default, T_DEFAULT, TF_COMMAND, S_UNKNOWN 29 | prompt, T_PROMPT, TF_COMMAND 30 | tristate, T_TYPE, TF_COMMAND, S_TRISTATE 31 | def_tristate, T_DEFAULT, TF_COMMAND, S_TRISTATE 32 | bool, T_TYPE, TF_COMMAND, S_BOOLEAN 33 | boolean, T_TYPE, TF_COMMAND, S_BOOLEAN 34 | def_bool, T_DEFAULT, TF_COMMAND, S_BOOLEAN 35 | int, T_TYPE, TF_COMMAND, S_INT 36 | hex, T_TYPE, TF_COMMAND, S_HEX 37 | string, T_TYPE, TF_COMMAND, S_STRING 38 | select, T_SELECT, TF_COMMAND 39 | range, T_RANGE, TF_COMMAND 40 | visible, T_VISIBLE, TF_COMMAND 41 | option, T_OPTION, TF_COMMAND 42 | on, T_ON, TF_PARAM 43 | modules, T_OPT_MODULES, TF_OPTION 44 | defconfig_list, T_OPT_DEFCONFIG_LIST,TF_OPTION 45 | env, T_OPT_ENV, TF_OPTION 46 | allnoconfig_y, T_OPT_ALLNOCONFIG_Y,TF_OPTION 47 | %% 48 | -------------------------------------------------------------------------------- /libs/parser/list.h: -------------------------------------------------------------------------------- 1 | #ifndef LIST_H 2 | #define LIST_H 3 | 4 | /* 5 | * Copied from include/linux/... 6 | */ 7 | 8 | #undef offsetof 9 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) 10 | 11 | /** 12 | * container_of - cast a member of a structure out to the containing structure 13 | * @ptr: the pointer to the member. 14 | * @type: the type of the container struct this is embedded in. 15 | * @member: the name of the member within the struct. 16 | * 17 | */ 18 | #define container_of(ptr, type, member) ({ \ 19 | const typeof( ((type *)0)->member ) *__mptr = (ptr); \ 20 | (type *)( (char *)__mptr - offsetof(type,member) );}) 21 | 22 | 23 | struct list_head { 24 | struct list_head *next, *prev; 25 | }; 26 | 27 | 28 | #define LIST_HEAD_INIT(name) { &(name), &(name) } 29 | 30 | #define LIST_HEAD(name) \ 31 | struct list_head name = LIST_HEAD_INIT(name) 32 | 33 | /** 34 | * list_entry - get the struct for this entry 35 | * @ptr: the &struct list_head pointer. 36 | * @type: the type of the struct this is embedded in. 37 | * @member: the name of the list_head within the struct. 38 | */ 39 | #define list_entry(ptr, type, member) \ 40 | container_of(ptr, type, member) 41 | 42 | /** 43 | * list_for_each_entry - iterate over list of given type 44 | * @pos: the type * to use as a loop cursor. 45 | * @head: the head for your list. 46 | * @member: the name of the list_head within the struct. 47 | */ 48 | #define list_for_each_entry(pos, head, member) \ 49 | for (pos = list_entry((head)->next, typeof(*pos), member); \ 50 | &pos->member != (head); \ 51 | pos = list_entry(pos->member.next, typeof(*pos), member)) 52 | 53 | /** 54 | * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry 55 | * @pos: the type * to use as a loop cursor. 56 | * @n: another type * to use as temporary storage 57 | * @head: the head for your list. 58 | * @member: the name of the list_head within the struct. 59 | */ 60 | #define list_for_each_entry_safe(pos, n, head, member) \ 61 | for (pos = list_entry((head)->next, typeof(*pos), member), \ 62 | n = list_entry(pos->member.next, typeof(*pos), member); \ 63 | &pos->member != (head); \ 64 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) 65 | 66 | /** 67 | * list_empty - tests whether a list is empty 68 | * @head: the list to test. 69 | */ 70 | static inline int list_empty(const struct list_head *head) 71 | { 72 | return head->next == head; 73 | } 74 | 75 | /* 76 | * Insert a new entry between two known consecutive entries. 77 | * 78 | * This is only for internal list manipulation where we know 79 | * the prev/next entries already! 80 | */ 81 | static inline void __list_add(struct list_head *_new, 82 | struct list_head *prev, 83 | struct list_head *next) 84 | { 85 | next->prev = _new; 86 | _new->next = next; 87 | _new->prev = prev; 88 | prev->next = _new; 89 | } 90 | 91 | /** 92 | * list_add_tail - add a new entry 93 | * @new: new entry to be added 94 | * @head: list head to add it before 95 | * 96 | * Insert a new entry before the specified head. 97 | * This is useful for implementing queues. 98 | */ 99 | static inline void list_add_tail(struct list_head *_new, struct list_head *head) 100 | { 101 | __list_add(_new, head->prev, head); 102 | } 103 | 104 | /* 105 | * Delete a list entry by making the prev/next entries 106 | * point to each other. 107 | * 108 | * This is only for internal list manipulation where we know 109 | * the prev/next entries already! 110 | */ 111 | static inline void __list_del(struct list_head *prev, struct list_head *next) 112 | { 113 | next->prev = prev; 114 | prev->next = next; 115 | } 116 | 117 | #define LIST_POISON1 ((void *) 0x00100100) 118 | #define LIST_POISON2 ((void *) 0x00200200) 119 | /** 120 | * list_del - deletes entry from list. 121 | * @entry: the element to delete from the list. 122 | * Note: list_empty() on entry does not return true after this, the entry is 123 | * in an undefined state. 124 | */ 125 | static inline void list_del(struct list_head *entry) 126 | { 127 | __list_del(entry->prev, entry->next); 128 | entry->next = (struct list_head*)LIST_POISON1; 129 | entry->prev = (struct list_head*)LIST_POISON2; 130 | } 131 | #endif 132 | -------------------------------------------------------------------------------- /libs/parser/lkc_proto.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* confdata.c */ 4 | void conf_parse(const char *name); 5 | int conf_read(const char *name); 6 | int conf_read_simple(const char *name, int); 7 | int conf_write_defconfig(const char *name); 8 | int conf_write(const char *name); 9 | int conf_write_autoconf(void); 10 | bool conf_get_changed(void); 11 | void conf_set_changed_callback(void (*fn)(void)); 12 | void conf_set_message_callback(void (*fn)(const char *fmt, va_list ap)); 13 | 14 | /* menu.c */ 15 | extern struct menu rootmenu; 16 | 17 | bool menu_is_empty(struct menu *menu); 18 | bool menu_is_visible(struct menu *menu); 19 | bool menu_has_prompt(struct menu *menu); 20 | const char * menu_get_prompt(struct menu *menu); 21 | struct menu * menu_get_root_menu(struct menu *menu); 22 | struct menu * menu_get_parent_menu(struct menu *menu); 23 | bool menu_has_help(struct menu *menu); 24 | const char * menu_get_help(struct menu *menu); 25 | struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head); 26 | void menu_get_ext_help(struct menu *menu, struct gstr *help); 27 | 28 | /* symbol.c */ 29 | extern struct symbol * symbol_hash[SYMBOL_HASHSIZE]; 30 | 31 | struct symbol * sym_lookup(const char *name, int flags); 32 | struct symbol * sym_find(const char *name); 33 | const char * sym_expand_string_value(const char *in); 34 | const char * sym_escape_string_value(const char *in); 35 | struct symbol ** sym_re_search(const char *pattern); 36 | const char * sym_type_name(enum symbol_type type); 37 | void sym_calc_value(struct symbol *sym); 38 | enum symbol_type sym_get_type(struct symbol *sym); 39 | bool sym_tristate_within_range(struct symbol *sym,tristate tri); 40 | bool sym_set_tristate_value(struct symbol *sym,tristate tri); 41 | tristate sym_toggle_tristate_value(struct symbol *sym); 42 | bool sym_string_valid(struct symbol *sym, const char *newval); 43 | bool sym_string_within_range(struct symbol *sym, const char *str); 44 | bool sym_set_string_value(struct symbol *sym, const char *newval); 45 | bool sym_is_changable(struct symbol *sym); 46 | struct property * sym_get_choice_prop(struct symbol *sym); 47 | const char * sym_get_string_value(struct symbol *sym); 48 | 49 | const char * prop_get_type_name(enum prop_type type); 50 | 51 | /* expr.c */ 52 | void expr_print(struct expr *e, void (*fn)(void *, struct symbol *, const char *), void *data, int prevtoken); 53 | -------------------------------------------------------------------------------- /libs/parser/util.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2005 Roman Zippel 3 | * Copyright (C) 2002-2005 Sam Ravnborg 4 | * 5 | * Released under the terms of the GNU GPL v2.0. 6 | */ 7 | 8 | #include 9 | #include 10 | #include 11 | #include "lkc.h" 12 | 13 | /* file already present in list? If not add it */ 14 | struct file *file_lookup(const char *name) 15 | { 16 | struct file *file; 17 | const char *file_name = sym_expand_string_value(name); 18 | 19 | for (file = file_list; file; file = file->next) { 20 | if (!strcmp(name, file->name)) { 21 | free((void *)file_name); 22 | return file; 23 | } 24 | } 25 | 26 | file = xmalloc(sizeof(*file)); 27 | memset(file, 0, sizeof(*file)); 28 | file->name = file_name; 29 | file->next = file_list; 30 | file_list = file; 31 | return file; 32 | } 33 | 34 | /* write a dependency file as used by kbuild to track dependencies */ 35 | int file_write_dep(const char *name) 36 | { 37 | struct symbol *sym, *env_sym; 38 | struct expr *e; 39 | struct file *file; 40 | FILE *out; 41 | 42 | if (!name) 43 | name = ".kconfig.d"; 44 | out = fopen("..config.tmp", "w"); 45 | if (!out) 46 | return 1; 47 | fprintf(out, "deps_config := \\\n"); 48 | for (file = file_list; file; file = file->next) { 49 | if (file->next) 50 | fprintf(out, "\t%s \\\n", file->name); 51 | else 52 | fprintf(out, "\t%s\n", file->name); 53 | } 54 | fprintf(out, "\n%s: \\\n" 55 | "\t$(deps_config)\n\n", conf_get_autoconfig_name()); 56 | 57 | expr_list_for_each_sym(sym_env_list, e, sym) { 58 | struct property *prop; 59 | const char *value; 60 | 61 | prop = sym_get_env_prop(sym); 62 | env_sym = prop_get_symbol(prop); 63 | if (!env_sym) 64 | continue; 65 | value = getenv(env_sym->name); 66 | if (!value) 67 | value = ""; 68 | fprintf(out, "ifneq \"$(%s)\" \"%s\"\n", env_sym->name, value); 69 | fprintf(out, "%s: FORCE\n", conf_get_autoconfig_name()); 70 | fprintf(out, "endif\n"); 71 | } 72 | 73 | fprintf(out, "\n$(deps_config): ;\n"); 74 | fclose(out); 75 | rename("..config.tmp", name); 76 | return 0; 77 | } 78 | 79 | 80 | /* Allocate initial growable string */ 81 | struct gstr str_new(void) 82 | { 83 | struct gstr gs; 84 | gs.s = xmalloc(sizeof(char) * 64); 85 | gs.len = 64; 86 | gs.max_width = 0; 87 | strcpy(gs.s, "\0"); 88 | return gs; 89 | } 90 | 91 | /* Free storage for growable string */ 92 | void str_free(struct gstr *gs) 93 | { 94 | if (gs->s) 95 | free(gs->s); 96 | gs->s = NULL; 97 | gs->len = 0; 98 | } 99 | 100 | /* Append to growable string */ 101 | void str_append(struct gstr *gs, const char *s) 102 | { 103 | size_t l; 104 | if (s) { 105 | l = strlen(gs->s) + strlen(s) + 1; 106 | if (l > gs->len) { 107 | gs->s = realloc(gs->s, l); 108 | gs->len = l; 109 | } 110 | strcat(gs->s, s); 111 | } 112 | } 113 | 114 | /* Append printf formatted string to growable string */ 115 | void str_printf(struct gstr *gs, const char *fmt, ...) 116 | { 117 | va_list ap; 118 | char s[10000]; /* big enough... */ 119 | va_start(ap, fmt); 120 | vsnprintf(s, sizeof(s), fmt, ap); 121 | str_append(gs, s); 122 | va_end(ap); 123 | } 124 | 125 | /* Retrieve value of growable string */ 126 | const char *str_get(struct gstr *gs) 127 | { 128 | return gs->s; 129 | } 130 | 131 | void *xmalloc(size_t size) 132 | { 133 | void *p = malloc(size); 134 | if (p) 135 | return p; 136 | fprintf(stderr, "Out of memory.\n"); 137 | exit(1); 138 | } 139 | 140 | void *xcalloc(size_t nmemb, size_t size) 141 | { 142 | void *p = calloc(nmemb, size); 143 | if (p) 144 | return p; 145 | fprintf(stderr, "Out of memory.\n"); 146 | exit(1); 147 | } 148 | -------------------------------------------------------------------------------- /libs/parser/yconf.y.patch: -------------------------------------------------------------------------------- 1 | --- a/libs/parser/yconf.y 2012-01-12 22:37:17.582339777 +0100 2 | +++ b/libs/parser/yconf.y 2012-03-03 23:55:29.889737630 +0100 3 | @@ -96,7 +96,7 @@ 4 | 5 | %{ 6 | /* Include zconf.hash.c here so it can see the token constants. */ 7 | -#include "zconf.hash.c" 8 | +#include "hconf.c" 9 | %} 10 | 11 | %% 12 | @@ -493,7 +493,7 @@ 13 | 14 | sym_init(); 15 | _menu_init(); 16 | - rootmenu.prompt = menu_add_prompt(P_MENU, "Linux Kernel Configuration", NULL); 17 | + rootmenu.prompt = menu_add_prompt(P_MENU, ROOTMENU, NULL); 18 | 19 | if (getenv("ZCONF_DEBUG")) 20 | zconfdebug = 1; 21 | @@ -725,7 +725,7 @@ 22 | } 23 | } 24 | 25 | -#include "zconf.lex.c" 26 | +#include "lconf.c" 27 | #include "util.c" 28 | #include "confdata.c" 29 | #include "expr.c" 30 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(.) 2 | 3 | add_subdirectory(win32) 4 | add_subdirectory(pdcurses) 5 | 6 | set(pdcurses_LIBRARIES 7 | pdcurses 8 | pdcurses-win32 9 | CACHE INTERNAL "" 10 | ) 11 | 12 | set(pdcurses_INCLUDE_DIRS 13 | "${CMAKE_CURRENT_SOURCE_DIR}" 14 | CACHE INTERNAL "" 15 | ) -------------------------------------------------------------------------------- /libs/pdcurses-3.4/PDCurses.spec: -------------------------------------------------------------------------------- 1 | # $Id: PDCurses.spec,v 1.18 2008/07/21 12:25:20 wmcbrine Exp $ 2 | 3 | %define ver 34 4 | %define verdot 3.4 5 | %define base /usr 6 | 7 | Summary: Public Domain Curses for X11 8 | Name: PDCurses 9 | Version: %verdot 10 | Release: 1 11 | Copyright: Public Domain 12 | Group: Development/Libraries 13 | Source: %{name}-%{version}.tar.gz 14 | URL: http://pdcurses.sourceforge.net 15 | BuildRoot: %{_tmppath}/%{name}-%{version}-root 16 | Prefix: %base 17 | 18 | %description 19 | PDCurses for X11 is an implementation of the curses library that lets 20 | you build text-mode curses programs as native X11 applications. For more 21 | information, visit http://pdcurses.sourceforge.net/ 22 | 23 | %prep 24 | %setup -q 25 | 26 | %build 27 | ./configure --prefix=%{base} 28 | make 29 | 30 | %install 31 | make DESTDIR=$RPM_BUILD_ROOT install 32 | 33 | %clean 34 | rm -rf $RPM_BUILD_ROOT 35 | rm -rf $RPM_BUILD_DIR/%{name}-%{version} 36 | 37 | %post -p /sbin/ldconfig 38 | 39 | %postun -p /sbin/ldconfig 40 | 41 | %files 42 | %defattr(-,root,root) 43 | %doc README HISTORY 44 | %{base}/bin/xcurses-config 45 | %{base}/lib/libXCurses.a 46 | %{base}/lib/libXpanel.a 47 | %{base}/lib/libXCurses.so 48 | %{base}/include/xcurses.h 49 | %{base}/include/xpanel.h 50 | %{base}/include/xcurses/curses.h 51 | %{base}/include/xcurses/panel.h 52 | %{base}/include/xcurses/term.h 53 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/README: -------------------------------------------------------------------------------- 1 | Welcome to PDCurses! 2 | ==================== 3 | 4 | Public Domain Curses, aka PDCurses, is an implementation of X/Open 5 | curses for multiple platforms. The latest version can be found at: 6 | 7 | http://pdcurses.sourceforge.net/ 8 | 9 | For changes, see the HISTORY file. 10 | 11 | 12 | Legal Stuff 13 | ----------- 14 | 15 | The core package is in the public domain, but small portions of PDCurses 16 | are subject to copyright under various licenses. Each directory 17 | contains a README file, with a section titled "Distribution Status" 18 | which describes the status of the files in that directory. 19 | 20 | If you use PDCurses in an application, an acknowledgement would be 21 | appreciated, but is not mandatory. If you make corrections or 22 | enhancements to PDCurses, please forward them to the current maintainer 23 | for the benefit of other users. 24 | 25 | This software is provided AS IS with NO WARRANTY whatsoever. 26 | 27 | 28 | Ports 29 | ----- 30 | 31 | PDCurses has been ported to DOS, OS/2, Win32, X11 and SDL. A directory 32 | containing the port-specific source files exists for each of these 33 | platforms. Build instructions are in the README file for each platform. 34 | 35 | 36 | Distribution Status 37 | ------------------- 38 | 39 | All files in this directory except configure, config.guess and 40 | config.sub are released to the Public Domain. config.guess and 41 | config.sub are under the GPL; configure is under a free license 42 | described within it. 43 | 44 | 45 | Maintainer 46 | ---------- 47 | 48 | William McBrine 49 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define if you have the header file */ 4 | #undef HAVE_DECKEYSYM_H 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_DLFCN_H 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_DL_H 11 | 12 | /* Define to 1 if you have the header file. */ 13 | #undef HAVE_FCNTL_H 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_INTTYPES_H 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_MEMORY_H 20 | 21 | /* Define to 1 if you have the `poll' function. */ 22 | #undef HAVE_POLL 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_STDINT_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_STDLIB_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_STRINGS_H 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_STRING_H 35 | 36 | /* Define if you have the header file */ 37 | #undef HAVE_SUNKEYSYM_H 38 | 39 | /* Define to 1 if you have the header file. */ 40 | #undef HAVE_SYS_SELECT_H 41 | 42 | /* Define to 1 if you have the header file. */ 43 | #undef HAVE_SYS_STAT_H 44 | 45 | /* Define to 1 if you have the header file. */ 46 | #undef HAVE_SYS_TIME_H 47 | 48 | /* Define to 1 if you have the header file. */ 49 | #undef HAVE_SYS_TYPES_H 50 | 51 | /* Define to 1 if you have the header file. */ 52 | #undef HAVE_UNISTD_H 53 | 54 | /* Define to 1 if you have the `usleep' function. */ 55 | #undef HAVE_USLEEP 56 | 57 | /* Define to 1 if you have the `vsnprintf' function. */ 58 | #undef HAVE_VSNPRINTF 59 | 60 | /* Define to 1 if you have the `vsscanf' function. */ 61 | #undef HAVE_VSSCANF 62 | 63 | /* Define if you have this defined in */ 64 | #undef HAVE_XK_KP_BEGIN 65 | 66 | /* Define if you have this defined in */ 67 | #undef HAVE_XK_KP_DELETE 68 | 69 | /* Define if you have this defined in */ 70 | #undef HAVE_XK_KP_DOWN 71 | 72 | /* Define if you have this defined in */ 73 | #undef HAVE_XK_KP_END 74 | 75 | /* Define if you have this defined in */ 76 | #undef HAVE_XK_KP_HOME 77 | 78 | /* Define if you have this defined in */ 79 | #undef HAVE_XK_KP_INSERT 80 | 81 | /* Define if you have this defined in */ 82 | #undef HAVE_XK_KP_LEFT 83 | 84 | /* Define if you have this defined in */ 85 | #undef HAVE_XK_KP_NEXT 86 | 87 | /* Define if you have this defined in */ 88 | #undef HAVE_XK_KP_PRIOR 89 | 90 | /* Define if you have this defined in */ 91 | #undef HAVE_XK_KP_RIGHT 92 | 93 | /* Define if you have this defined in */ 94 | #undef HAVE_XK_KP_UP 95 | 96 | /* Define if you have the header file */ 97 | #undef HAVE_XPM_H 98 | 99 | /* Define to the address where bug reports for this package should be sent. */ 100 | #undef PACKAGE_BUGREPORT 101 | 102 | /* Define to the full name of this package. */ 103 | #undef PACKAGE_NAME 104 | 105 | /* Define to the full name and version of this package. */ 106 | #undef PACKAGE_STRING 107 | 108 | /* Define to the one symbol short name of this package. */ 109 | #undef PACKAGE_TARNAME 110 | 111 | /* Define to the version of this package. */ 112 | #undef PACKAGE_VERSION 113 | 114 | /* Define as the system defined limit for number of signals */ 115 | #undef PDC_MAX_SIGNALS 116 | 117 | /* Define as the return type of signal handlers (`int' or `void'). */ 118 | #undef RETSIGTYPE 119 | 120 | /* Define to 1 if you have the ANSI C header files. */ 121 | #undef STDC_HEADERS 122 | 123 | /* Define to 1 if you can safely include both and . */ 124 | #undef TIME_WITH_SYS_TIME 125 | 126 | /* Define if you want to use neXtaw library */ 127 | #undef USE_NEXTAW 128 | 129 | /* Define if you want to use Xaw3d library */ 130 | #undef USE_XAW3D 131 | 132 | /* Define XPointer is typedefed in X11/Xlib.h */ 133 | #undef XPOINTER_TYPEDEFED 134 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/demos/README: -------------------------------------------------------------------------------- 1 | PDCurses Demos 2 | ============== 3 | 4 | This directory contains demonstration programs to show and test the 5 | capabilities of curses libraries. Some of them predate PDCurses, 6 | PCcurses or even pcurses/ncurses. Although some PDCurses-specific code 7 | has been added, all programs remain portable to other implementations 8 | (at a minimum, to ncurses). 9 | 10 | 11 | Building 12 | -------- 13 | 14 | The demos are built by the platform-specific makefiles, in the platform 15 | directories. Alternatively, you can build them manually, individually, 16 | and link with any curses library; e.g., "cc -lcurses -orain rain.c". 17 | There are no dependencies besides curses and the standard C library, and 18 | no configuration is needed. 19 | 20 | 21 | Distribution Status 22 | ------------------- 23 | 24 | Public Domain, except for rain.c and worm.c, which are under the ncurses 25 | license (MIT-like). 26 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/demos/firework.c: -------------------------------------------------------------------------------- 1 | /* $Id: firework.c,v 1.25 2008/07/13 16:08:17 wmcbrine Exp $ */ 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #define DELAYSIZE 200 12 | 13 | void myrefresh(void); 14 | void get_color(void); 15 | void explode(int, int); 16 | 17 | short color_table[] = 18 | { 19 | COLOR_RED, COLOR_BLUE, COLOR_GREEN, COLOR_CYAN, 20 | COLOR_RED, COLOR_MAGENTA, COLOR_YELLOW, COLOR_WHITE 21 | }; 22 | 23 | int main(int argc, char **argv) 24 | { 25 | int i, start, end, row, diff, flag, direction, seed; 26 | 27 | #ifdef XCURSES 28 | Xinitscr(argc, argv); 29 | #else 30 | initscr(); 31 | #endif 32 | nodelay(stdscr, TRUE); 33 | noecho(); 34 | 35 | if (has_colors()) 36 | start_color(); 37 | 38 | for (i = 0; i < 8; i++) 39 | init_pair(i, color_table[i], COLOR_BLACK); 40 | 41 | seed = time((time_t *)0); 42 | srand(seed); 43 | flag = 0; 44 | 45 | while (getch() == ERR) /* loop until a key is hit */ 46 | { 47 | do { 48 | start = rand() % (COLS - 3); 49 | end = rand() % (COLS - 3); 50 | start = (start < 2) ? 2 : start; 51 | end = (end < 2) ? 2 : end; 52 | direction = (start > end) ? -1 : 1; 53 | diff = abs(start - end); 54 | 55 | } while (diff < 2 || diff >= LINES - 2); 56 | 57 | attrset(A_NORMAL); 58 | 59 | for (row = 0; row < diff; row++) 60 | { 61 | mvaddstr(LINES - row, row * direction + start, 62 | (direction < 0) ? "\\" : "/"); 63 | 64 | if (flag++) 65 | { 66 | myrefresh(); 67 | erase(); 68 | flag = 0; 69 | } 70 | } 71 | 72 | if (flag++) 73 | { 74 | myrefresh(); 75 | flag = 0; 76 | } 77 | 78 | explode(LINES - row, diff * direction + start); 79 | erase(); 80 | myrefresh(); 81 | } 82 | 83 | endwin(); 84 | 85 | return 0; 86 | } 87 | 88 | void explode(int row, int col) 89 | { 90 | erase(); 91 | mvaddstr(row, col, "-"); 92 | myrefresh(); 93 | 94 | --col; 95 | 96 | get_color(); 97 | mvaddstr(row - 1, col, " - "); 98 | mvaddstr(row, col, "-+-"); 99 | mvaddstr(row + 1, col, " - "); 100 | myrefresh(); 101 | 102 | --col; 103 | 104 | get_color(); 105 | mvaddstr(row - 2, col, " --- "); 106 | mvaddstr(row - 1, col, "-+++-"); 107 | mvaddstr(row, col, "-+#+-"); 108 | mvaddstr(row + 1, col, "-+++-"); 109 | mvaddstr(row + 2, col, " --- "); 110 | myrefresh(); 111 | 112 | get_color(); 113 | mvaddstr(row - 2, col, " +++ "); 114 | mvaddstr(row - 1, col, "++#++"); 115 | mvaddstr(row, col, "+# #+"); 116 | mvaddstr(row + 1, col, "++#++"); 117 | mvaddstr(row + 2, col, " +++ "); 118 | myrefresh(); 119 | 120 | get_color(); 121 | mvaddstr(row - 2, col, " # "); 122 | mvaddstr(row - 1, col, "## ##"); 123 | mvaddstr(row, col, "# #"); 124 | mvaddstr(row + 1, col, "## ##"); 125 | mvaddstr(row + 2, col, " # "); 126 | myrefresh(); 127 | 128 | get_color(); 129 | mvaddstr(row - 2, col, " # # "); 130 | mvaddstr(row - 1, col, "# #"); 131 | mvaddstr(row, col, " "); 132 | mvaddstr(row + 1, col, "# #"); 133 | mvaddstr(row + 2, col, " # # "); 134 | myrefresh(); 135 | } 136 | 137 | void myrefresh(void) 138 | { 139 | napms(DELAYSIZE); 140 | move(LINES - 1, COLS - 1); 141 | refresh(); 142 | } 143 | 144 | void get_color(void) 145 | { 146 | chtype bold = (rand() % 2) ? A_BOLD : A_NORMAL; 147 | attrset(COLOR_PAIR(rand() % 8) | bold); 148 | } 149 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/demos/tui.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 'textual user interface' 3 | * 4 | * $Id: tui.h,v 1.11 2008/07/14 12:35:23 wmcbrine Exp $ 5 | * 6 | * Author : P.J. Kunst 7 | * Date : 25-02-93 8 | */ 9 | 10 | #ifndef _TUI_H_ 11 | #define _TUI_H_ 12 | 13 | #include 14 | 15 | #ifdef A_COLOR 16 | #define A_ATTR (A_ATTRIBUTES ^ A_COLOR) /* A_BLINK, A_REVERSE, A_BOLD */ 17 | #else 18 | #define A_ATTR (A_ATTRIBUTES) /* standard UNIX attributes */ 19 | #endif 20 | 21 | #define MAXSTRLEN 256 22 | #define KEY_ESC 0x1b /* Escape */ 23 | 24 | typedef void (*FUNC)(void); 25 | 26 | typedef struct 27 | { 28 | char *name; /* item label */ 29 | FUNC func; /* (pointer to) function */ 30 | char *desc; /* function description */ 31 | } menu; 32 | 33 | /* ANSI C function prototypes: */ 34 | 35 | void clsbody(void); 36 | int bodylen(void); 37 | WINDOW *bodywin(void); 38 | 39 | void rmerror(void); 40 | void rmstatus(void); 41 | 42 | void titlemsg(char *msg); 43 | void bodymsg(char *msg); 44 | void errormsg(char *msg); 45 | void statusmsg(char *msg); 46 | 47 | bool keypressed(void); 48 | int getkey(void); 49 | int waitforkey(void); 50 | 51 | void DoExit(void); 52 | void startmenu(menu *mp, char *title); 53 | void domenu(menu *mp); 54 | 55 | int weditstr(WINDOW *win, char *buf, int field); 56 | WINDOW *winputbox(WINDOW *win, int nlines, int ncols); 57 | int getstrings(char *desc[], char *buf[], int field); 58 | 59 | #define editstr(s,f) (weditstr(stdscr,s,f)) 60 | #define mveditstr(y,x,s,f) (move(y,x)==ERR?ERR:editstr(s,f)) 61 | #define mvweditstr(w,y,x,s,f) (wmove(w,y,x)==ERR?ERR:weditstr(w,s,f)) 62 | 63 | #define inputbox(l,c) (winputbox(stdscr,l,c)) 64 | #define mvinputbox(y,x,l,c) (move(y,x)==ERR?w:inputbox(l,c)) 65 | #define mvwinputbox(w,y,x,l,c) (wmove(w,y,x)==ERR?w:winputbox(w,l,c)) 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/doc/manext.c: -------------------------------------------------------------------------------- 1 | /***********************************************************************/ 2 | /* MANEXT - Extract manual pages from C source code. */ 3 | /***********************************************************************/ 4 | /* 5 | * MANEXT - A program to extract manual pages from C source code. 6 | * Copyright (C) 1991-1996 Mark Hessling 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation; either version 2 of 11 | * the License, or any later version. 12 | * 13 | * This program 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 GNU 16 | * General Public License for more details. 17 | * 18 | * If you make modifications to this software that you feel increases 19 | * it usefulness for the rest of the community, please email the 20 | * changes, enhancements, bug fixes as well as any and all ideas to me. 21 | * This software is going to be maintained and enhanced as deemed 22 | * necessary by the community. 23 | * 24 | * Mark Hessling 25 | */ 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #define MAX_LINE 255 32 | 33 | void display_info() 34 | { 35 | fprintf(stderr, "\nMANEXT 1.03 Copyright (C) 1991-1996 Mark Hessling\n" 36 | "All rights reserved.\n" 37 | "MANEXT is distributed under the terms of the GNU\n" 38 | "General Public License and comes with NO WARRANTY.\n" 39 | "See the file COPYING for details.\n" 40 | "\nUsage: manext sourcefile [...]\n\n"); 41 | } 42 | 43 | int main(int argc, char **argv) 44 | { 45 | char s[MAX_LINE + 1]; /* input line */ 46 | int i; 47 | FILE *fp; 48 | 49 | #ifdef __EMX__ 50 | _wildcard(&argc, &argv); 51 | #endif 52 | if (strcmp(argv[1], "-h") == 0) 53 | { 54 | display_info(); 55 | exit(1); 56 | } 57 | 58 | for (i = 1; i < argc; i++) 59 | { 60 | if ((fp = fopen(argv[i], "r")) == NULL) 61 | { 62 | fprintf(stderr, "\nCould not open %s\n", argv[i]); 63 | continue; 64 | } 65 | 66 | while (!feof(fp)) 67 | { 68 | if (fgets(s, (int)sizeof(s), fp) == NULL) 69 | { 70 | if (ferror(fp) != 0) 71 | { 72 | fprintf(stderr, "*** Error reading %s. Exiting.\n", 73 | argv[i]); 74 | exit(1); 75 | } 76 | 77 | break; 78 | } 79 | 80 | /* check for manual entry marker at beginning of line */ 81 | 82 | if (strncmp(s, "/*man-start*", 12) != 0) 83 | continue; 84 | 85 | /* inner loop */ 86 | 87 | for (;;) 88 | { 89 | /* read next line of manual entry */ 90 | 91 | if (fgets(s, (int)sizeof(s), fp) == NULL) 92 | { 93 | if (ferror(fp) != 0) 94 | { 95 | fprintf(stderr, "*** Error reading %s. Exiting.\n", 96 | argv[i]); 97 | exit(1); 98 | } 99 | 100 | break; 101 | } 102 | 103 | /* check for end of entry marker */ 104 | 105 | if (strncmp(s, "**man-end", 9) == 0) 106 | break; 107 | 108 | printf("%s", s); 109 | } 110 | 111 | printf("\n\n-----------------------------------" 112 | "---------------------------------------\n\n"); 113 | } 114 | 115 | fclose(fp); 116 | } 117 | 118 | return 0; 119 | } 120 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/dos/README: -------------------------------------------------------------------------------- 1 | PDCurses for DOS 2 | ================ 3 | 4 | This directory contains PDCurses source code files specific to DOS. 5 | 6 | 7 | Building 8 | -------- 9 | 10 | . Choose the appropriate makefile for your compiler: 11 | 12 | bccdos.mak - Borland C++ 3.0+ 13 | gccdos.mak - DJGPP V2 14 | mscdos.mak - Microsoft C 15 | wccdos16.mak - Watcom 10.6+ (16-bit) 16 | wccdos4g.mak - Watcom 10.6+ (32-bit) 17 | 18 | . For 16-bit compilers, you can change the memory MODEL in the makefile. 19 | (Large model is the default, and recommended.) 20 | 21 | . Optionally, you can build in a different directory than the platform 22 | directory by setting PDCURSES_SRCDIR to point to the directory where 23 | you unpacked PDCurses, and changing to your target directory: 24 | 25 | set PDCURSES_SRCDIR=c:\pdcurses 26 | 27 | . Build it: 28 | 29 | make -f makefile 30 | 31 | (For Watcom, use "wmake" instead of "make"; for MSVC, "nmake".) You'll 32 | get the libraries (pdcurses.lib or .a, depending on your compiler; and 33 | panel.lib or .a), the demos (*.exe), and a lot of object files. Note 34 | that the panel library is just a copy of the main library, provided 35 | for convenience; both panel and curses functions are in the main 36 | library. 37 | 38 | 39 | Distribution Status 40 | ------------------- 41 | 42 | The files in this directory are released to the Public Domain. 43 | 44 | 45 | Acknowledgements 46 | ---------------- 47 | 48 | Watcom C port was provided by Pieter Kunst 49 | DJGPP 1.x port was provided by David Nugent 50 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/dos/bccdos.lrf: -------------------------------------------------------------------------------- 1 | +addch.obj +addchstr.obj +addstr.obj +attr.obj +beep.obj +bkgd.obj & 2 | +border.obj +clear.obj +color.obj +delch.obj +deleteln.obj +deprec.obj & 3 | +getch.obj +getstr.obj +getyx.obj +inch.obj +inchstr.obj +initscr.obj & 4 | +inopts.obj +insch.obj +insstr.obj +instr.obj +kernel.obj +keyname.obj & 5 | +mouse.obj +move.obj +outopts.obj +overlay.obj +pad.obj +panel.obj & 6 | +printw.obj +refresh.obj +scanw.obj +scr_dump.obj +scroll.obj +slk.obj & 7 | +termattr.obj +terminfo.obj +touch.obj +util.obj +window.obj +debug.obj & 8 | +pdcclip.obj +pdcdisp.obj +pdcgetsc.obj +pdckbd.obj +pdcscrn.obj & 9 | +pdcsetsc.obj +pdcutil.obj ,lib.map 10 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/dos/bccdos.mak: -------------------------------------------------------------------------------- 1 | # Borland MAKE Makefile for PDCurses library - DOS BC++ 3.0+ 2 | # 3 | # Usage: make -f [path\]bccdos.mak [DEBUG=] [target] 4 | # 5 | # where target can be any of: 6 | # [all|demos|pdcurses.lib|testcurs.exe...] 7 | 8 | # Change the memory MODEL here, if desired 9 | MODEL = l 10 | 11 | O = obj 12 | 13 | !ifndef PDCURSES_SRCDIR 14 | PDCURSES_SRCDIR = .. 15 | !endif 16 | 17 | !include $(PDCURSES_SRCDIR)\version.mif 18 | !include $(PDCURSES_SRCDIR)\libobjs.mif 19 | 20 | osdir = $(PDCURSES_SRCDIR)\dos 21 | 22 | !ifdef DEBUG 23 | CFLAGS = -N -v -y -DPDCDEBUG 24 | !else 25 | CFLAGS = -O 26 | !endif 27 | 28 | CPPFLAGS = -I$(PDCURSES_SRCDIR) 29 | 30 | BUILD = $(CC) -1- -K -G -rd -d -w-eff -w-par -c \ 31 | -m$(MODEL) $(CFLAGS) $(CPPFLAGS) 32 | 33 | LIBEXE = tlib /C /E 34 | 35 | LIBCURSES = pdcurses.lib 36 | 37 | all: $(LIBCURSES) $(DEMOS) 38 | 39 | clean: 40 | -del *.obj 41 | -del *.lib 42 | -del *.map 43 | -del *.exe 44 | 45 | demos: $(DEMOS) 46 | 47 | $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS) 48 | -del $@ 49 | $(LIBEXE) $@ @$(osdir)\bccdos.lrf 50 | -copy $(LIBCURSES) panel.lib 51 | 52 | .autodepend 53 | 54 | {$(srcdir)\}.c.obj: 55 | $(BUILD) $< 56 | 57 | {$(osdir)\}.c.obj: 58 | $(BUILD) $< 59 | 60 | {$(demodir)\}.c.obj: 61 | $(BUILD) $< 62 | 63 | .c.obj: 64 | $(BUILD) $< 65 | 66 | .obj.exe: 67 | $(CC) -m$(MODEL) -e$@ $** $(LIBCURSES) 68 | 69 | tuidemo.exe: tuidemo.obj tui.obj $(LIBCURSES) 70 | $(CC) -m$(MODEL) -e$@ $** 71 | 72 | tui.obj: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H) 73 | $(BUILD) -I$(demodir) $(demodir)\tui.c 74 | 75 | tuidemo.obj: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H) 76 | $(BUILD) -I$(demodir) $(demodir)\tuidemo.c 77 | 78 | PLATFORM1 = Borland C++ 3.1 79 | PLATFORM2 = Borland C/C++ 3.1 for DOS 80 | ARCNAME = pdc$(VER)bcc 81 | 82 | !include $(PDCURSES_SRCDIR)\makedist.mif 83 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/dos/gccdos.mak: -------------------------------------------------------------------------------- 1 | # GNU MAKE (3.79.1) Makefile for PDCurses library - DOS DJGPP V2.0+ 2 | # 3 | # Usage: make -f [path\]gccdos.mak [DEBUG=Y] [target] 4 | # 5 | # where target can be any of: 6 | # [all|libs|demos|dist|pdcurses.a|testcurs.exe...] 7 | 8 | O = o 9 | 10 | ifndef PDCURSES_SRCDIR 11 | PDCURSES_SRCDIR = .. 12 | endif 13 | 14 | include $(PDCURSES_SRCDIR)/version.mif 15 | include $(PDCURSES_SRCDIR)/libobjs.mif 16 | 17 | osdir = $(PDCURSES_SRCDIR)/dos 18 | 19 | PDCURSES_DOS_H = $(osdir)/pdcdos.h 20 | 21 | CC = gcc 22 | 23 | ifeq ($(DEBUG),Y) 24 | CFLAGS = -g -Wall -DPDCDEBUG 25 | LDFLAGS = -g 26 | else 27 | CFLAGS = -O2 -Wall 28 | LDFLAGS = 29 | endif 30 | 31 | CFLAGS += -I$(PDCURSES_SRCDIR) 32 | 33 | LINK = gcc 34 | 35 | LIBEXE = ar 36 | LIBFLAGS = rcv 37 | 38 | LIBCURSES = pdcurses.a 39 | 40 | .PHONY: all libs clean demos dist 41 | 42 | all: libs demos 43 | 44 | libs: $(LIBCURSES) 45 | 46 | clean: 47 | -del *.o 48 | -del *.a 49 | -del *.exe 50 | 51 | demos: $(DEMOS) 52 | strip *.exe 53 | 54 | $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS) 55 | $(LIBEXE) $(LIBFLAGS) $@ $? 56 | -copy $(LIBCURSES) panel.a 57 | 58 | $(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS) 59 | $(PDCOBJS) : $(PDCURSES_DOS_H) 60 | $(DEMOS) : $(PDCURSES_CURSES_H) $(LIBCURSES) 61 | panel.o : $(PANEL_HEADER) 62 | terminfo.o: $(TERM_HEADER) 63 | 64 | $(LIBOBJS) : %.o: $(srcdir)/%.c 65 | $(CC) -c $(CFLAGS) $< 66 | 67 | $(PDCOBJS) : %.o: $(osdir)/%.c 68 | $(CC) -c $(CFLAGS) $< 69 | 70 | firework.exe newdemo.exe rain.exe testcurs.exe worm.exe xmas.exe \ 71 | ptest.exe: %.exe: $(demodir)/%.c 72 | $(CC) $(CFLAGS) -o$@ $< $(LIBCURSES) 73 | 74 | tuidemo.exe: tuidemo.o tui.o 75 | $(LINK) $(LDFLAGS) -o$@ tuidemo.o tui.o $(LIBCURSES) 76 | 77 | tui.o: $(demodir)/tui.c $(demodir)/tui.h $(PDCURSES_CURSES_H) 78 | $(CC) -c $(CFLAGS) -I$(demodir) -o$@ $< 79 | 80 | tuidemo.o: $(demodir)/tuidemo.c $(PDCURSES_CURSES_H) 81 | $(CC) -c $(CFLAGS) -I$(demodir) -o$@ $< 82 | 83 | PLATFORM1 = DJGPP 2.03 84 | PLATFORM2 = DJGPP 2.03 for DOS 85 | ARCNAME = pdc$(VER)djg 86 | 87 | include $(PDCURSES_SRCDIR)/makedist.mif 88 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/dos/mscdos.lrf: -------------------------------------------------------------------------------- 1 | -+addch.obj & 2 | -+addchstr.obj & 3 | -+addstr.obj & 4 | -+attr.obj & 5 | -+beep.obj & 6 | -+bkgd.obj & 7 | -+border.obj & 8 | -+clear.obj & 9 | -+color.obj & 10 | -+delch.obj & 11 | -+deleteln.obj & 12 | -+deprec.obj & 13 | -+getch.obj & 14 | -+getstr.obj & 15 | -+getyx.obj & 16 | -+inch.obj & 17 | -+inchstr.obj & 18 | -+initscr.obj & 19 | -+inopts.obj & 20 | -+insch.obj & 21 | -+insstr.obj & 22 | -+instr.obj & 23 | -+kernel.obj & 24 | -+keyname.obj & 25 | -+mouse.obj & 26 | -+move.obj & 27 | -+outopts.obj & 28 | -+overlay.obj & 29 | -+pad.obj & 30 | -+panel.obj & 31 | -+printw.obj & 32 | -+refresh.obj & 33 | -+scanw.obj & 34 | -+scr_dump.obj & 35 | -+scroll.obj & 36 | -+slk.obj & 37 | -+termattr.obj & 38 | -+terminfo.obj & 39 | -+touch.obj & 40 | -+util.obj & 41 | -+window.obj & 42 | -+debug.obj & 43 | -+pdcclip.obj & 44 | -+pdcdisp.obj & 45 | -+pdcgetsc.obj & 46 | -+pdckbd.obj & 47 | -+pdcscrn.obj & 48 | -+pdcsetsc.obj & 49 | -+pdcutil.obj & 50 | ,lib.map; 51 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/dos/mscdos.mak: -------------------------------------------------------------------------------- 1 | # NMAKE Makefile for PDCurses library - Microsoft C for DOS 2 | # 3 | # Usage: nmake -f [path\]dosmsc.mak [DEBUG=] [target] 4 | # 5 | # where target can be any of: 6 | # [all|demos|pdcurses.lib|testcurs.exe...] 7 | 8 | # Change the memory MODEL here, if desired 9 | MODEL = L # one of L, S, M, T, H, C 10 | SIZE = LARGE # one of LARGE, SMALL, MEDIUM, TINY, HUGE, COMPACT 11 | 12 | O = obj 13 | 14 | !ifndef PDCURSES_SRCDIR 15 | PDCURSES_SRCDIR = .. 16 | !endif 17 | 18 | !include $(PDCURSES_SRCDIR)\version.mif 19 | !include $(PDCURSES_SRCDIR)\libobjs.mif 20 | 21 | osdir = $(PDCURSES_SRCDIR)\dos 22 | 23 | PDCURSES_DOS_H = $(osdir)\pdcdos.h 24 | 25 | CC = cl 26 | 27 | !ifdef DEBUG 28 | CFLAGS = /Od /Zi /DPDCDEBUG 29 | LDFLAGS = /CO /NOE /SE:160 30 | !else 31 | CFLAGS = /Ox 32 | LDFLAGS = /NOE /SE:160 33 | !endif 34 | 35 | CPPFLAGS = -I$(PDCURSES_SRCDIR) 36 | 37 | BUILD = $(CC) /J /nologo /c /D$(SIZE) /A$(MODEL) $(CFLAGS) $(CPPFLAGS) 38 | 39 | LINK = link 40 | 41 | CCLIBS = 42 | 43 | LIBEXE = lib 44 | 45 | LIBCURSES = pdcurses.lib 46 | 47 | all: $(LIBCURSES) $(DEMOS) 48 | 49 | clean: 50 | -del *.obj 51 | -del *.lib 52 | -del *.exe 53 | 54 | demos: $(DEMOS) 55 | 56 | DEMOOBJS = $(DEMOS:.exe=.obj) tui.obj 57 | 58 | $(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS) 59 | $(DEMOOBJS) : $(PDCURSES_CURSES_H) 60 | $(DEMOS) : $(LIBCURSES) 61 | panel.obj : $(PANEL_HEADER) 62 | terminfo.obj: $(TERM_HEADER) 63 | 64 | $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS) 65 | $(LIBEXE) $@ @$(osdir)\mscdos.lrf 66 | -copy $(LIBCURSES) panel.lib 67 | 68 | {$(srcdir)\}.c{}.obj: 69 | $(BUILD) $< 70 | 71 | {$(osdir)\}.c{}.obj: 72 | $(BUILD) $< 73 | 74 | {$(demodir)\}.c{}.obj: 75 | $(BUILD) $< 76 | 77 | firework.exe: firework.obj 78 | $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); 79 | 80 | newdemo.exe: newdemo.obj 81 | $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); 82 | 83 | ptest.exe: ptest.obj 84 | $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); 85 | 86 | rain.exe: rain.obj 87 | $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); 88 | 89 | testcurs.exe: testcurs.obj 90 | $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); 91 | 92 | tuidemo.exe: tuidemo.obj tui.obj 93 | $(LINK) $(LDFLAGS) $*.obj+tui.obj,$*,,$(LIBCURSES); 94 | 95 | worm.exe: worm.obj 96 | $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); 97 | 98 | xmas.exe: xmas.obj 99 | $(LINK) $(LDFLAGS) $*.obj,$*,,$(LIBCURSES); 100 | 101 | ptest.obj: $(demodir)\ptest.c $(PANEL_HEADER) 102 | $(BUILD) $(demodir)\ptest.c 103 | 104 | tui.obj: $(demodir)\tui.c $(demodir)\tui.h 105 | $(BUILD) -I$(demodir) $(demodir)\tui.c 106 | 107 | tuidemo.obj: $(demodir)\tuidemo.c 108 | $(BUILD) -I$(demodir) $(demodir)\tuidemo.c 109 | 110 | PLATFORM1 = Microsoft C 111 | PLATFORM2 = Microsoft C for DOS 112 | ARCNAME = pdc$(VER)msc 113 | 114 | !include $(PDCURSES_SRCDIR)\makedist.mif 115 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/dos/pdcgetsc.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcdos.h" 4 | 5 | RCSID("$Id: pdcgetsc.c,v 1.42 2008/07/13 16:08:17 wmcbrine Exp $") 6 | 7 | #include 8 | 9 | /* return width of screen/viewport */ 10 | 11 | int PDC_get_columns(void) 12 | { 13 | PDCREGS regs; 14 | int cols; 15 | const char *env_cols; 16 | 17 | PDC_LOG(("PDC_get_columns() - called\n")); 18 | 19 | /* use the value from COLS environment variable, if set. MH 10-Jun-92 */ 20 | /* and use the minimum of COLS and return from int10h MH 18-Jun-92 */ 21 | 22 | regs.h.ah = 0x0f; 23 | PDCINT(0x10, regs); 24 | cols = (int)regs.h.ah; 25 | 26 | env_cols = getenv("COLS"); 27 | 28 | if (env_cols) 29 | cols = min(atoi(env_cols), cols); 30 | 31 | PDC_LOG(("PDC_get_columns() - returned: cols %d\n", cols)); 32 | 33 | return cols; 34 | } 35 | 36 | /* get the cursor size/shape */ 37 | 38 | int PDC_get_cursor_mode(void) 39 | { 40 | PDC_LOG(("PDC_get_cursor_mode() - called\n")); 41 | 42 | return getdosmemword(0x460); 43 | } 44 | 45 | /* return number of screen rows */ 46 | 47 | int PDC_get_rows(void) 48 | { 49 | const char *env_rows; 50 | int rows; 51 | 52 | PDC_LOG(("PDC_get_rows() - called\n")); 53 | 54 | /* use the value from LINES environment variable, if set. MH 10-Jun-92 */ 55 | /* and use the minimum of LINES and *ROWS. MH 18-Jun-92 */ 56 | 57 | rows = getdosmembyte(0x484) + 1; 58 | env_rows = getenv("LINES"); 59 | 60 | if (env_rows) 61 | rows = min(atoi(env_rows), rows); 62 | 63 | if (rows == 1 && pdc_adapter == _MDS_GENIUS) 64 | rows = 66; 65 | if (rows == 1 && pdc_adapter == _MDA) 66 | rows = 25; 67 | 68 | if (rows == 1) 69 | { 70 | rows = 25; 71 | pdc_direct_video = FALSE; 72 | } 73 | 74 | switch (pdc_adapter) 75 | { 76 | case _EGACOLOR: 77 | case _EGAMONO: 78 | switch (rows) 79 | { 80 | case 25: 81 | case 43: 82 | break; 83 | default: 84 | rows = 25; 85 | } 86 | break; 87 | 88 | case _VGACOLOR: 89 | case _VGAMONO: 90 | break; 91 | 92 | default: 93 | rows = 25; 94 | break; 95 | } 96 | 97 | PDC_LOG(("PDC_get_rows() - returned: rows %d\n", rows)); 98 | 99 | return rows; 100 | } 101 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/dos/pdcsetsc.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcdos.h" 4 | 5 | RCSID("$Id: pdcsetsc.c,v 1.39 2008/07/13 16:08:17 wmcbrine Exp $") 6 | 7 | /*man-start************************************************************** 8 | 9 | Name: pdcsetsc 10 | 11 | Synopsis: 12 | int PDC_set_blink(bool blinkon); 13 | void PDC_set_title(const char *title); 14 | 15 | Description: 16 | PDC_set_blink() toggles whether the A_BLINK attribute sets an 17 | actual blink mode (TRUE), or sets the background color to high 18 | intensity (FALSE). The default is platform-dependent (FALSE in 19 | most cases). It returns OK if it could set the state to match 20 | the given parameter, ERR otherwise. Current platforms also 21 | adjust the value of COLORS according to this function -- 16 for 22 | FALSE, and 8 for TRUE. 23 | 24 | PDC_set_title() sets the title of the window in which the curses 25 | program is running. This function may not do anything on some 26 | platforms. (Currently it only works in Win32 and X11.) 27 | 28 | Portability X/Open BSD SYS V 29 | PDC_set_blink - - - 30 | PDC_set_title - - - 31 | 32 | **man-end****************************************************************/ 33 | 34 | int PDC_curs_set(int visibility) 35 | { 36 | PDCREGS regs; 37 | int ret_vis, start, end; 38 | 39 | PDC_LOG(("PDC_curs_set() - called: visibility=%d\n", visibility)); 40 | 41 | ret_vis = SP->visibility; 42 | SP->visibility = visibility; 43 | 44 | switch (visibility) 45 | { 46 | case 0: /* invisible */ 47 | start = 32; 48 | end = 0; /* was 32 */ 49 | break; 50 | case 2: /* highly visible */ 51 | start = 0; /* full-height block */ 52 | end = 7; 53 | break; 54 | default: /* normal visibility */ 55 | start = (SP->orig_cursor >> 8) & 0xff; 56 | end = SP->orig_cursor & 0xff; 57 | } 58 | 59 | /* if scrnmode is not set, some BIOSes hang */ 60 | 61 | regs.h.ah = 0x01; 62 | regs.h.al = (unsigned char)pdc_scrnmode; 63 | regs.h.ch = (unsigned char)start; 64 | regs.h.cl = (unsigned char)end; 65 | PDCINT(0x10, regs); 66 | 67 | return ret_vis; 68 | } 69 | 70 | void PDC_set_title(const char *title) 71 | { 72 | PDC_LOG(("PDC_set_title() - called: <%s>\n", title)); 73 | } 74 | 75 | int PDC_set_blink(bool blinkon) 76 | { 77 | PDCREGS regs; 78 | 79 | switch (pdc_adapter) 80 | { 81 | case _EGACOLOR: 82 | case _EGAMONO: 83 | case _VGACOLOR: 84 | case _VGAMONO: 85 | regs.W.ax = 0x1003; 86 | regs.W.bx = blinkon; 87 | 88 | PDCINT(0x10, regs); 89 | 90 | if (pdc_color_started) 91 | COLORS = blinkon ? 8 : 16; 92 | 93 | break; 94 | default: 95 | COLORS = 8; 96 | } 97 | 98 | return (COLORS - (blinkon * 8) != 8) ? OK : ERR; 99 | } 100 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/dos/pdcutil.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcdos.h" 4 | 5 | RCSID("$Id: pdcutil.c,v 1.24 2008/07/13 16:08:17 wmcbrine Exp $") 6 | 7 | void PDC_beep(void) 8 | { 9 | PDCREGS regs; 10 | 11 | PDC_LOG(("PDC_beep() - called\n")); 12 | 13 | regs.W.ax = 0x0e07; /* Write ^G in TTY fashion */ 14 | regs.W.bx = 0; 15 | PDCINT(0x10, regs); 16 | } 17 | 18 | void PDC_napms(int ms) 19 | { 20 | PDCREGS regs; 21 | long goal, start, current; 22 | 23 | PDC_LOG(("PDC_napms() - called: ms=%d\n", ms)); 24 | 25 | goal = DIVROUND((long)ms, 50); 26 | if (!goal) 27 | goal++; 28 | 29 | start = getdosmemdword(0x46c); 30 | 31 | goal += start; 32 | 33 | while (goal > (current = getdosmemdword(0x46c))) 34 | { 35 | if (current < start) /* in case of midnight reset */ 36 | return; 37 | 38 | regs.W.ax = 0x1680; 39 | PDCINT(0x2f, regs); 40 | PDCINT(0x28, regs); 41 | } 42 | } 43 | 44 | const char *PDC_sysname(void) 45 | { 46 | return "DOS"; 47 | } 48 | 49 | #ifdef __DJGPP__ 50 | 51 | unsigned char getdosmembyte(int offset) 52 | { 53 | unsigned char b; 54 | 55 | dosmemget(offset, sizeof(unsigned char), &b); 56 | return b; 57 | } 58 | 59 | unsigned short getdosmemword(int offset) 60 | { 61 | unsigned short w; 62 | 63 | dosmemget(offset, sizeof(unsigned short), &w); 64 | return w; 65 | } 66 | 67 | unsigned long getdosmemdword(int offset) 68 | { 69 | unsigned long dw; 70 | 71 | dosmemget(offset, sizeof(unsigned long), &dw); 72 | return dw; 73 | } 74 | 75 | void setdosmembyte(int offset, unsigned char b) 76 | { 77 | dosmemput(&b, sizeof(unsigned char), offset); 78 | } 79 | 80 | void setdosmemword(int offset, unsigned short w) 81 | { 82 | dosmemput(&w, sizeof(unsigned short), offset); 83 | } 84 | 85 | #endif 86 | 87 | #if defined(__WATCOMC__) && defined(__386__) 88 | 89 | void PDC_dpmi_int(int vector, pdc_dpmi_regs *rmregs) 90 | { 91 | union REGPACK regs = {0}; 92 | 93 | rmregs->w.ss = 0; 94 | rmregs->w.sp = 0; 95 | rmregs->w.flags = 0; 96 | 97 | regs.w.ax = 0x300; 98 | regs.h.bl = vector; 99 | regs.x.edi = FP_OFF(rmregs); 100 | regs.x.es = FP_SEG(rmregs); 101 | 102 | intr(0x31, ®s); 103 | } 104 | 105 | #endif 106 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/dos/wccdos16.mak: -------------------------------------------------------------------------------- 1 | # Watcom WMAKE Makefile for PDCurses library - DOS (16 bit) Watcom C/C++ 10.6+ 2 | # 3 | # Usage: wmake -f [path\]wccdos16.mak [DEBUG=Y] [target] 4 | # 5 | # where target can be any of: 6 | # [all|demos|pdcurses.lib|testcurs.exe...] 7 | 8 | # Change the memory MODEL here, if desired 9 | MODEL = l 10 | 11 | !ifdef %PDCURSES_SRCDIR 12 | PDCURSES_SRCDIR = $(%PDCURSES_SRCDIR) 13 | !else 14 | PDCURSES_SRCDIR = .. 15 | !endif 16 | 17 | !include $(PDCURSES_SRCDIR)\version.mif 18 | 19 | osdir = $(PDCURSES_SRCDIR)\dos 20 | 21 | CC = wcc 22 | TARGET = dos 23 | 24 | CFLAGS = /bt=$(TARGET) /zq /wx /m$(MODEL) /i=$(PDCURSES_SRCDIR) 25 | 26 | !ifeq DEBUG Y 27 | CFLAGS += /d2 /DPDCDEBUG 28 | LDFLAGS = D W A op q sys $(TARGET) 29 | !else 30 | CFLAGS += /oneatx 31 | LDFLAGS = op q sys $(TARGET) 32 | !endif 33 | 34 | LIBEXE = wlib /q /n /t 35 | 36 | !include $(PDCURSES_SRCDIR)\watcom.mif 37 | 38 | $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS) 39 | %write wccdos.lrf $(LIBOBJS) $(PDCOBJS) 40 | $(LIBEXE) $@ @wccdos.lrf 41 | -del wccdos.lrf 42 | -copy $(LIBCURSES) panel.lib 43 | 44 | PLATFORM1 = Watcom C++ 16-bit DOS 45 | PLATFORM2 = Open Watcom 1.6 for 16-bit DOS 46 | ARCNAME = pdc$(VER)16w 47 | 48 | !include $(PDCURSES_SRCDIR)\makedist.mif 49 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/dos/wccdos4g.mak: -------------------------------------------------------------------------------- 1 | # Watcom WMAKE Makefile for PDCurses library - DOS/4GW Watcom C/C++ 10.6+ 2 | # 3 | # Usage: wmake -f [path\]wccdos4g.mak [DEBUG=Y] [target] 4 | # 5 | # where target can be any of: 6 | # [all|demos|pdcurses.lib|testcurs.exe...] 7 | 8 | !ifdef %PDCURSES_SRCDIR 9 | PDCURSES_SRCDIR = $(%PDCURSES_SRCDIR) 10 | !else 11 | PDCURSES_SRCDIR = .. 12 | !endif 13 | 14 | !include $(PDCURSES_SRCDIR)\version.mif 15 | 16 | osdir = $(PDCURSES_SRCDIR)\dos 17 | 18 | CC = wcc386 19 | TARGET = dos4g 20 | 21 | CFLAGS = /bt=$(TARGET) /zq /wx /mf /i=$(PDCURSES_SRCDIR) 22 | 23 | !ifeq DEBUG Y 24 | CFLAGS += /d2 /DPDCDEBUG 25 | LDFLAGS = D W A op q sys $(TARGET) 26 | !else 27 | CFLAGS += /oneatx 28 | LDFLAGS = op q sys $(TARGET) 29 | !endif 30 | 31 | LIBEXE = wlib /q /n /t 32 | 33 | !include $(PDCURSES_SRCDIR)\watcom.mif 34 | 35 | $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS) 36 | %write wccdos.lrf $(LIBOBJS) $(PDCOBJS) 37 | $(LIBEXE) $@ @wccdos.lrf 38 | -del wccdos.lrf 39 | -copy $(LIBCURSES) panel.lib 40 | 41 | PLATFORM1 = Watcom C++ 32-bit DOS 42 | PLATFORM2 = Open Watcom 1.6 for 32-bit DOS 43 | ARCNAME = pdc$(VER)32w 44 | 45 | !include $(PDCURSES_SRCDIR)\makedist.mif 46 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/exp-wide.def: -------------------------------------------------------------------------------- 1 | addnwstr 2 | addwstr 3 | add_wch 4 | add_wchnstr 5 | add_wchstr 6 | border_set 7 | box_set 8 | echo_wchar 9 | erasewchar 10 | getbkgrnd 11 | getcchar 12 | getn_wstr 13 | get_wch 14 | get_wstr 15 | hline_set 16 | innwstr 17 | ins_nwstr 18 | ins_wch 19 | ins_wstr 20 | inwstr 21 | in_wch 22 | in_wchnstr 23 | in_wchstr 24 | key_name 25 | killwchar 26 | mvaddnwstr 27 | mvaddwstr 28 | mvadd_wch 29 | mvadd_wchnstr 30 | mvadd_wchstr 31 | mvgetn_wstr 32 | mvget_wch 33 | mvget_wstr 34 | mvhline_set 35 | mvinnwstr 36 | mvins_nwstr 37 | mvins_wch 38 | mvins_wstr 39 | mvinwstr 40 | mvin_wch 41 | mvin_wchnstr 42 | mvin_wchstr 43 | mvvline_set 44 | mvwaddnwstr 45 | mvwaddwstr 46 | mvwadd_wch 47 | mvwadd_wchnstr 48 | mvwadd_wchstr 49 | mvwgetn_wstr 50 | mvwget_wch 51 | mvwget_wstr 52 | mvwhline_set 53 | mvwinnwstr 54 | mvwins_nwstr 55 | mvwins_wch 56 | mvwins_wstr 57 | mvwin_wch 58 | mvwin_wchnstr 59 | mvwin_wchstr 60 | mvwinwstr 61 | mvwvline_set 62 | pecho_wchar 63 | setcchar 64 | slk_wset 65 | unget_wch 66 | vline_set 67 | waddnwstr 68 | waddwstr 69 | wadd_wch 70 | wadd_wchnstr 71 | wadd_wchstr 72 | wbkgrnd 73 | wbkgrndset 74 | wborder_set 75 | wecho_wchar 76 | wgetbkgrnd 77 | wgetn_wstr 78 | wget_wch 79 | wget_wstr 80 | whline_set 81 | winnwstr 82 | wins_nwstr 83 | wins_wch 84 | wins_wstr 85 | winwstr 86 | win_wch 87 | win_wchnstr 88 | win_wchstr 89 | wunctrl 90 | wvline_set 91 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/libobjs.mif: -------------------------------------------------------------------------------- 1 | # Common elements for most of the DOS, OS/2 and Win32 2 | # makefiles (not Watcom or LCC) 3 | 4 | PDCURSES_CURSES_H = $(PDCURSES_SRCDIR)/curses.h 5 | PDCURSES_CURSPRIV_H = $(PDCURSES_SRCDIR)/curspriv.h 6 | PDCURSES_HEADERS = $(PDCURSES_CURSES_H) $(PDCURSES_CURSPRIV_H) 7 | PANEL_HEADER = $(PDCURSES_SRCDIR)/panel.h 8 | TERM_HEADER = $(PDCURSES_SRCDIR)/term.h 9 | 10 | srcdir = $(PDCURSES_SRCDIR)/pdcurses 11 | demodir = $(PDCURSES_SRCDIR)/demos 12 | 13 | LIBOBJS = addch.$(O) addchstr.$(O) addstr.$(O) attr.$(O) beep.$(O) \ 14 | bkgd.$(O) border.$(O) clear.$(O) color.$(O) delch.$(O) deleteln.$(O) \ 15 | deprec.$(O) getch.$(O) getstr.$(O) getyx.$(O) inch.$(O) inchstr.$(O) \ 16 | initscr.$(O) inopts.$(O) insch.$(O) insstr.$(O) instr.$(O) kernel.$(O) \ 17 | keyname.$(O) mouse.$(O) move.$(O) outopts.$(O) overlay.$(O) pad.$(O) \ 18 | panel.$(O) printw.$(O) refresh.$(O) scanw.$(O) scr_dump.$(O) scroll.$(O) \ 19 | slk.$(O) termattr.$(O) terminfo.$(O) touch.$(O) util.$(O) window.$(O) \ 20 | debug.$(O) 21 | 22 | PDCOBJS = pdcclip.$(O) pdcdisp.$(O) pdcgetsc.$(O) pdckbd.$(O) pdcscrn.$(O) \ 23 | pdcsetsc.$(O) pdcutil.$(O) 24 | 25 | DEMOS = testcurs.exe newdemo.exe xmas.exe tuidemo.exe firework.exe \ 26 | ptest.exe rain.exe worm.exe 27 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/makedist.mif: -------------------------------------------------------------------------------- 1 | # Makefile include: build a binary archive with Info-ZIP 2 | # under DOS, OS/2 or Win32 3 | 4 | dist: $(PDCLIBS) 5 | echo PDCurses $(VERDOT) for $(PLATFORM1) > file_id.diz 6 | echo ------------------------------------------ >> file_id.diz 7 | echo Public Domain Curses library for >> file_id.diz 8 | echo $(PLATFORM2). >> file_id.diz 9 | echo Source available in PDCURS$(VER).ZIP >> file_id.diz 10 | echo Public Domain. >> file_id.diz 11 | echo $(PDCURSES_SRCDIR)\README > flist 12 | echo $(PDCURSES_SRCDIR)\HISTORY >> flist 13 | echo $(PDCURSES_SRCDIR)\curses.h >> flist 14 | echo $(PDCURSES_SRCDIR)\panel.h >> flist 15 | echo $(PDCURSES_SRCDIR)\term.h >> flist 16 | echo $(LIBCURSES) >> flist 17 | echo file_id.diz >> flist 18 | zip -9jX $(ARCNAME) -@ $@ 97 | echo DESCRIPTION 'PDCurses 3.4 Dynamic Linking library' >> $@ 98 | echo PROTMODE >>$@ 99 | echo DATA MULTIPLE READWRITE LOADONCALL >> $@ 100 | echo CODE LOADONCALL >> $@ 101 | echo EXPORTS >> $@ 102 | type $(BASEDEF) >> $@ 103 | 104 | $(LIBCURSES) : $(LIBDEPS) 105 | $(LIBEXE) $(LIBFLAGS) $@ $? 106 | -copy $(LIBCURSES) panel.a 107 | 108 | $(DLLTARGET) : $(LIBDEPS) 109 | $(LINK) $(DLLFLAGS) -o $(DLLTARGET) $? $(DEFFILE) 110 | # lxlite $(DLLTARGET) 111 | emximp -o $(LIBCURSES) $(DEFFILE) 112 | 113 | $(LIBOBJS) $(PDCOBJS) $(DEMOOBJS) : $(PDCURSES_HEADERS) 114 | $(PDCOBJS) : $(PDCURSES_OS2_H) 115 | $(DEMOS) : $(LIBCURSES) 116 | panel.o ptest.o: $(PANEL_HEADER) 117 | terminfo.o: $(TERM_HEADER) 118 | 119 | $(LIBOBJS) : %.o: $(srcdir)/%.c 120 | $(CC) -c $(CFLAGS) -o$@ $< 121 | 122 | $(PDCOBJS) : %.o: $(osdir)/%.c 123 | $(CC) -c $(CFLAGS) -o$@ $< 124 | 125 | firework.exe newdemo.exe rain.exe testcurs.exe worm.exe xmas.exe \ 126 | ptest.exe: %.exe: %.o 127 | $(LINK) $(LDFLAGS) -o $* $< $(LIBCURSES) $(CCLIBS) 128 | $(EXEPOST) 129 | 130 | tuidemo.exe: tuidemo.o tui.o 131 | $(LINK) $(LDFLAGS) -o tuidemo tuidemo.o tui.o $(LIBCURSES) $(CCLIBS) 132 | $(TUIPOST) 133 | 134 | firework.o newdemo.o ptest.o rain.o testcurs.o worm.o xmas.o: %.o: \ 135 | $(demodir)/%.c 136 | $(CC) $(CFLAGS) -o$@ $< 137 | 138 | tui.o: $(demodir)\tui.c $(demodir)\tui.h 139 | $(CC) $(CFLAGS) -I$(demodir) -o $@ $< 140 | 141 | tuidemo.o: $(demodir)\tuidemo.c 142 | $(CC) $(CFLAGS) -I$(demodir) -o $@ $< 143 | 144 | PLATFORM1 = EMX OS/2 145 | PLATFORM2 = EMX 0.9d for OS/2 146 | ARCNAME = pdc$(VER)_emx_os2 147 | 148 | include $(PDCURSES_SRCDIR)/makedist.mif 149 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/os2/iccos2.lrf: -------------------------------------------------------------------------------- 1 | -+addch.obj & 2 | -+addchstr.obj & 3 | -+addstr.obj & 4 | -+attr.obj & 5 | -+beep.obj & 6 | -+bkgd.obj & 7 | -+border.obj & 8 | -+clear.obj & 9 | -+color.obj & 10 | -+delch.obj & 11 | -+deleteln.obj & 12 | -+deprec.obj & 13 | -+getch.obj & 14 | -+getstr.obj & 15 | -+getyx.obj & 16 | -+inch.obj & 17 | -+inchstr.obj & 18 | -+initscr.obj & 19 | -+inopts.obj & 20 | -+insch.obj & 21 | -+insstr.obj & 22 | -+instr.obj & 23 | -+kernel.obj & 24 | -+keyname.obj & 25 | -+mouse.obj & 26 | -+move.obj & 27 | -+outopts.obj & 28 | -+overlay.obj & 29 | -+pad.obj & 30 | -+panel.obj & 31 | -+printw.obj & 32 | -+refresh.obj & 33 | -+scanw.obj & 34 | -+scr_dump.obj & 35 | -+scroll.obj & 36 | -+slk.obj & 37 | -+termattr.obj & 38 | -+terminfo.obj & 39 | -+touch.obj & 40 | -+util.obj & 41 | -+window.obj & 42 | -+debug.obj & 43 | -+pdcclip.obj & 44 | -+pdcdisp.obj & 45 | -+pdcgetsc.obj & 46 | -+pdckbd.obj & 47 | -+pdcscrn.obj & 48 | -+pdcsetsc.obj & 49 | -+pdcutil.obj & 50 | ,lib.map; 51 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/os2/pdcdisp.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcos2.h" 4 | 5 | RCSID("$Id: pdcdisp.c,v 1.49 2008/07/14 04:24:51 wmcbrine Exp $") 6 | 7 | /* ACS definitions originally by jshumate@wrdis01.robins.af.mil -- these 8 | match code page 437 and compatible pages (CP850, CP852, etc.) */ 9 | 10 | #ifdef CHTYPE_LONG 11 | 12 | # define A(x) ((chtype)x | A_ALTCHARSET) 13 | 14 | chtype acs_map[128] = 15 | { 16 | A(0), A(1), A(2), A(3), A(4), A(5), A(6), A(7), A(8), A(9), 17 | A(10), A(11), A(12), A(13), A(14), A(15), A(16), A(17), A(18), 18 | A(19), A(20), A(21), A(22), A(23), A(24), A(25), A(26), A(27), 19 | A(28), A(29), A(30), A(31), ' ', '!', '"', '#', '$', '%', '&', 20 | '\'', '(', ')', '*', 21 | 22 | A(0x1a), A(0x1b), A(0x18), A(0x19), 23 | 24 | '/', 25 | 26 | 0xdb, 27 | 28 | '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', 29 | '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 30 | 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 31 | 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', 32 | 33 | A(0x04), 0xb1, 34 | 35 | 'b', 'c', 'd', 'e', 36 | 37 | 0xf8, 0xf1, 0xb0, A(0x0f), 0xd9, 0xbf, 0xda, 0xc0, 0xc5, 0x2d, 38 | 0x2d, 0xc4, 0x2d, 0x5f, 0xc3, 0xb4, 0xc1, 0xc2, 0xb3, 0xf3, 39 | 0xf2, 0xe3, 0xd8, 0x9c, 0xf9, 40 | 41 | A(127) 42 | }; 43 | 44 | # undef A 45 | 46 | #endif 47 | 48 | /* position hardware cursor at (y, x) */ 49 | 50 | void PDC_gotoyx(int row, int col) 51 | { 52 | PDC_LOG(("PDC_gotoyx() - called: row %d col %d\n", row, col)); 53 | 54 | #ifdef EMXVIDEO 55 | v_gotoxy(col, row); 56 | #else 57 | VioSetCurPos(row, col, 0); 58 | #endif 59 | } 60 | 61 | /* update the given physical line to look like the corresponding line in 62 | curscr */ 63 | 64 | void PDC_transform_line(int lineno, int x, int len, const chtype *srcp) 65 | { 66 | /* this should be enough for the maximum width of a screen. */ 67 | 68 | struct {unsigned char text, attr;} temp_line[256]; 69 | int j; 70 | 71 | PDC_LOG(("PDC_transform_line() - called: line %d\n", lineno)); 72 | 73 | /* replace the attribute part of the chtype with the 74 | actual color value for each chtype in the line */ 75 | 76 | for (j = 0; j < len; j++) 77 | { 78 | chtype ch = srcp[j]; 79 | 80 | temp_line[j].attr = pdc_atrtab[ch >> PDC_ATTR_SHIFT]; 81 | 82 | #ifdef CHTYPE_LONG 83 | if (ch & A_ALTCHARSET && !(ch & 0xff80)) 84 | ch = acs_map[ch & 0x7f]; 85 | #endif 86 | temp_line[j].text = ch & 0xff; 87 | } 88 | 89 | #ifdef EMXVIDEO 90 | v_putline((char *)temp_line, x, lineno, len); 91 | #else 92 | VioWrtCellStr((PCH)temp_line, (USHORT)(len * sizeof(unsigned short)), 93 | (USHORT)lineno, (USHORT)x, 0); 94 | #endif 95 | } 96 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/os2/pdcgetsc.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcos2.h" 4 | 5 | RCSID("$Id: pdcgetsc.c,v 1.39 2008/07/14 04:24:51 wmcbrine Exp $") 6 | 7 | /* return width of screen/viewport */ 8 | 9 | int PDC_get_columns(void) 10 | { 11 | #ifdef EMXVIDEO 12 | int rows = 0; 13 | #else 14 | VIOMODEINFO modeInfo = {0}; 15 | #endif 16 | int cols = 0; 17 | const char *env_cols; 18 | 19 | PDC_LOG(("PDC_get_columns() - called\n")); 20 | 21 | #ifdef EMXVIDEO 22 | v_dimen(&cols, &rows); 23 | #else 24 | modeInfo.cb = sizeof(modeInfo); 25 | VioGetMode(&modeInfo, 0); 26 | cols = modeInfo.col; 27 | #endif 28 | env_cols = getenv("COLS"); 29 | 30 | if (env_cols) 31 | cols = min(atoi(env_cols), cols); 32 | 33 | PDC_LOG(("PDC_get_columns() - returned: cols %d\n", cols)); 34 | 35 | return cols; 36 | } 37 | 38 | /* get the cursor size/shape */ 39 | 40 | int PDC_get_cursor_mode(void) 41 | { 42 | #ifdef EMXVIDEO 43 | int curstart = 0, curend = 0; 44 | #else 45 | VIOCURSORINFO cursorInfo; 46 | #endif 47 | PDC_LOG(("PDC_get_cursor_mode() - called\n")); 48 | 49 | #ifdef EMXVIDEO 50 | v_getctype(&curstart, &curend); 51 | return (curstart << 8) | curend; 52 | #else 53 | VioGetCurType (&cursorInfo, 0); 54 | 55 | return (cursorInfo.yStart << 8) | cursorInfo.cEnd; 56 | #endif 57 | } 58 | 59 | /* return number of screen rows */ 60 | 61 | int PDC_get_rows(void) 62 | { 63 | #ifdef EMXVIDEO 64 | int cols = 0; 65 | #else 66 | VIOMODEINFO modeInfo = {0}; 67 | #endif 68 | int rows = 0; 69 | const char *env_rows; 70 | 71 | PDC_LOG(("PDC_get_rows() - called\n")); 72 | 73 | /* use the value from LINES environment variable, if set. MH 10-Jun-92 */ 74 | /* and use the minimum of LINES and *ROWS. MH 18-Jun-92 */ 75 | 76 | #ifdef EMXVIDEO 77 | v_dimen(&cols, &rows); 78 | #else 79 | modeInfo.cb = sizeof(modeInfo); 80 | VioGetMode(&modeInfo, 0); 81 | rows = modeInfo.row; 82 | #endif 83 | env_rows = getenv("LINES"); 84 | 85 | if (env_rows) 86 | rows = min(atoi(env_rows), rows); 87 | 88 | PDC_LOG(("PDC_get_rows() - returned: rows %d\n", rows)); 89 | 90 | return rows; 91 | } 92 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/os2/pdcos2.h: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | /* $Id: pdcos2.h,v 1.9 2008/08/14 06:38:35 wmcbrine Exp $ */ 4 | 5 | #ifdef _MSC_VER 6 | # define USE_OS2_H 1 /* Use the os2.h for the compiler */ 7 | # define APIRET USHORT 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | #ifdef EMXVIDEO 14 | # include 15 | #else 16 | # define INCL_DOS 17 | # define INCL_DOSMISC 18 | # define INCL_WIN 19 | # define INCL_VIO 20 | # define INCL_KBD 21 | # define INCL_MOU 22 | # include 23 | #endif 24 | 25 | #include 26 | 27 | #ifdef __WATCOMC__ 28 | # define PDCTHUNK(x) ((ptr_16)(x)) 29 | # ifdef __386__ 30 | # define SEG16 _Seg16 31 | # else 32 | # define SEG16 33 | # endif 34 | 35 | typedef void * SEG16 ptr_16; 36 | 37 | #else 38 | # ifdef __EMX__ 39 | # ifdef __INNOTEK_LIBC__ 40 | # define PDCTHUNK(x) ((PCH)_libc_32to16(x)) 41 | # else 42 | # define PDCTHUNK(x) ((PCH)_emx_32to16(x)) 43 | # endif 44 | # endif 45 | #endif 46 | 47 | extern unsigned char *pdc_atrtab; 48 | extern int pdc_font; 49 | 50 | extern void PDC_get_keyboard_info(void); 51 | extern void PDC_set_keyboard_default(void); 52 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/os2/pdcsetsc.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcos2.h" 4 | 5 | RCSID("$Id: pdcsetsc.c,v 1.44 2008/07/14 04:24:51 wmcbrine Exp $") 6 | 7 | /*man-start************************************************************** 8 | 9 | Name: pdcsetsc 10 | 11 | Synopsis: 12 | int PDC_set_blink(bool blinkon); 13 | void PDC_set_title(const char *title); 14 | 15 | Description: 16 | PDC_set_blink() toggles whether the A_BLINK attribute sets an 17 | actual blink mode (TRUE), or sets the background color to high 18 | intensity (FALSE). The default is platform-dependent (FALSE in 19 | most cases). It returns OK if it could set the state to match 20 | the given parameter, ERR otherwise. Current platforms also 21 | adjust the value of COLORS according to this function -- 16 for 22 | FALSE, and 8 for TRUE. 23 | 24 | PDC_set_title() sets the title of the window in which the curses 25 | program is running. This function may not do anything on some 26 | platforms. (Currently it only works in Win32 and X11.) 27 | 28 | Portability X/Open BSD SYS V 29 | PDC_set_blink - - - 30 | PDC_set_title - - - 31 | 32 | **man-end****************************************************************/ 33 | 34 | int PDC_curs_set(int visibility) 35 | { 36 | #ifndef EMXVIDEO 37 | VIOCURSORINFO pvioCursorInfo; 38 | #endif 39 | int ret_vis, hidden = 0, start = 0, end = 0; 40 | 41 | PDC_LOG(("PDC_curs_set() - called: visibility=%d\n", visibility)); 42 | 43 | ret_vis = SP->visibility; 44 | SP->visibility = visibility; 45 | 46 | switch(visibility) 47 | { 48 | case 0: /* invisible */ 49 | #ifdef EMXVIDEO 50 | start = end = 0; 51 | #else 52 | start = pdc_font / 4; 53 | end = pdc_font; 54 | hidden = -1; 55 | #endif 56 | break; 57 | 58 | case 2: /* highly visible */ 59 | start = 2; /* almost full-height block */ 60 | end = pdc_font - 1; 61 | break; 62 | 63 | default: /* normal visibility */ 64 | start = (SP->orig_cursor >> 8) & 0xff; 65 | end = SP->orig_cursor & 0xff; 66 | } 67 | 68 | #ifdef EMXVIDEO 69 | if (!visibility) 70 | v_hidecursor(); 71 | else 72 | v_ctype(start, end); 73 | #else 74 | pvioCursorInfo.yStart = (USHORT)start; 75 | pvioCursorInfo.cEnd = (USHORT)end; 76 | pvioCursorInfo.cx = (USHORT)1; 77 | pvioCursorInfo.attr = hidden; 78 | VioSetCurType((PVIOCURSORINFO)&pvioCursorInfo, 0); 79 | #endif 80 | return ret_vis; 81 | } 82 | 83 | void PDC_set_title(const char *title) 84 | { 85 | PDC_LOG(("PDC_set_title() - called:<%s>\n", title)); 86 | } 87 | 88 | int PDC_set_blink(bool blinkon) 89 | { 90 | #ifndef EMXVIDEO 91 | USHORT statebuf[3], result; 92 | 93 | statebuf[0] = 6; /* length */ 94 | statebuf[1] = 2; /* blink/intensity */ 95 | statebuf[2] = !blinkon; 96 | 97 | result = VioSetState(&statebuf, 0); 98 | VioGetState(&statebuf, 0); /* needed? */ 99 | 100 | if (pdc_color_started) 101 | COLORS = statebuf[2] ? 16 : 8; 102 | 103 | return (result == 0) ? OK : ERR; 104 | #else 105 | if (pdc_color_started) 106 | COLORS = 16; 107 | 108 | return blinkon ? ERR : OK; 109 | #endif 110 | } 111 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/os2/pdcutil.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcos2.h" 4 | 5 | RCSID("$Id: pdcutil.c,v 1.14 2008/07/14 04:24:51 wmcbrine Exp $") 6 | 7 | #if defined(OS2) && !defined(__EMX__) 8 | APIRET APIENTRY DosSleep(ULONG ulTime); 9 | #endif 10 | 11 | void PDC_beep(void) 12 | { 13 | PDC_LOG(("PDC_beep() - called\n")); 14 | 15 | #ifdef EMXVIDEO 16 | putchar('\007'); 17 | #else 18 | DosBeep(1380, 100); 19 | #endif 20 | } 21 | 22 | void PDC_napms(int ms) 23 | { 24 | PDC_LOG(("PDC_napms() - called: ms=%d\n", ms)); 25 | 26 | #ifdef __EMX__ 27 | _sleep2(ms); 28 | #else 29 | DosSleep(ms); 30 | #endif 31 | } 32 | 33 | const char *PDC_sysname(void) 34 | { 35 | return "OS/2"; 36 | } 37 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/os2/wccos2.mak: -------------------------------------------------------------------------------- 1 | # Watcom WMAKE Makefile for PDCurses library - OS/2 Open Watcom 1.1+ 2 | # 3 | # Usage: wmake -f [path\]wccos2.mak [DEBUG=Y] [target] 4 | # 5 | # where target can be any of: 6 | # [all|demos|pdcurses.lib|testcurs.exe...] 7 | 8 | !ifdef %PDCURSES_SRCDIR 9 | PDCURSES_SRCDIR = $(%PDCURSES_SRCDIR) 10 | !else 11 | PDCURSES_SRCDIR = .. 12 | !endif 13 | 14 | !include $(PDCURSES_SRCDIR)\version.mif 15 | 16 | osdir = $(PDCURSES_SRCDIR)\os2 17 | 18 | CC = wcc386 19 | TARGET = os2v2 20 | 21 | CFLAGS = /bt=$(TARGET) /wx /s /zq /i=$(PDCURSES_SRCDIR) 22 | 23 | !ifeq DEBUG Y 24 | CFLAGS += /d2 /DPDCDEBUG 25 | LDFLAGS = D A op q sys $(TARGET) 26 | !else 27 | CFLAGS += /oneatx 28 | LDFLAGS = op q sys $(TARGET) 29 | !endif 30 | 31 | LIBEXE = wlib /q /n /b /c /t 32 | 33 | !include $(PDCURSES_SRCDIR)\watcom.mif 34 | 35 | $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS) 36 | $(LIBEXE) $@ $(LIBOBJS) $(PDCOBJS) 37 | -copy $(LIBCURSES) panel.lib 38 | 39 | PLATFORM1 = Watcom C++ OS/2 40 | PLATFORM2 = Open Watcom 1.6 for OS/2 41 | ARCNAME = pdc$(VER)_wcc_os2 42 | 43 | !include $(PDCURSES_SRCDIR)\makedist.mif 44 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/panel.h: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | /* $Id: panel.h,v 1.19 2008/07/13 16:08:16 wmcbrine Exp $ */ 4 | 5 | /*----------------------------------------------------------------------* 6 | * Panels for PDCurses * 7 | *----------------------------------------------------------------------*/ 8 | 9 | #ifndef __PDCURSES_PANEL_H__ 10 | #define __PDCURSES_PANEL_H__ 1 11 | 12 | #include 13 | 14 | #if defined(__cplusplus) || defined(__cplusplus__) || defined(__CPLUSPLUS) 15 | extern "C" 16 | { 17 | #endif 18 | 19 | typedef struct panelobs 20 | { 21 | struct panelobs *above; 22 | struct panel *pan; 23 | } PANELOBS; 24 | 25 | typedef struct panel 26 | { 27 | WINDOW *win; 28 | int wstarty; 29 | int wendy; 30 | int wstartx; 31 | int wendx; 32 | struct panel *below; 33 | struct panel *above; 34 | const void *user; 35 | struct panelobs *obscure; 36 | } PANEL; 37 | 38 | int bottom_panel(PANEL *pan); 39 | int del_panel(PANEL *pan); 40 | int hide_panel(PANEL *pan); 41 | int move_panel(PANEL *pan, int starty, int startx); 42 | PANEL *new_panel(WINDOW *win); 43 | PANEL *panel_above(const PANEL *pan); 44 | PANEL *panel_below(const PANEL *pan); 45 | int panel_hidden(const PANEL *pan); 46 | const void *panel_userptr(const PANEL *pan); 47 | WINDOW *panel_window(const PANEL *pan); 48 | int replace_panel(PANEL *pan, WINDOW *win); 49 | int set_panel_userptr(PANEL *pan, const void *uptr); 50 | int show_panel(PANEL *pan); 51 | int top_panel(PANEL *pan); 52 | void update_panels(void); 53 | 54 | #if defined(__cplusplus) || defined(__cplusplus__) || defined(__CPLUSPLUS) 55 | } 56 | #endif 57 | 58 | #endif /* __PDCURSES_PANEL_H__ */ 59 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/pdcurses/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(pdcurses 2 | addch.c 3 | addchstr.c 4 | addstr.c 5 | border.c 6 | delch.c 7 | getstr.c 8 | initscr.c 9 | instr.c 10 | move.c 11 | panel.c 12 | scr_dump.c 13 | terminfo.c 14 | attr.c 15 | clear.c 16 | deleteln.c 17 | getyx.c 18 | inopts.c 19 | kernel.c 20 | outopts.c 21 | printw.c 22 | scroll.c 23 | touch.c 24 | addch.c 25 | beep.c 26 | color.c 27 | deprec.c 28 | inch.c 29 | insch.c 30 | keyname.c 31 | overlay.c 32 | refresh.c 33 | slk.c 34 | util.c 35 | addchstr.c 36 | bkgd.c 37 | debug.c 38 | getch.c 39 | inchstr.c 40 | insstr.c 41 | mouse.c 42 | pad.c 43 | scanw.c 44 | termattr.c 45 | window.c 46 | ) 47 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/pdcurses/README: -------------------------------------------------------------------------------- 1 | PDCurses Portable Core 2 | ====================== 3 | 4 | This directory contains core PDCurses source code files common to all 5 | platforms. 6 | 7 | 8 | Building 9 | -------- 10 | 11 | These modules are built by the platform-specific makefiles, in the 12 | platform directories. 13 | 14 | 15 | Distribution Status 16 | ------------------- 17 | 18 | The files in this directory are released to the Public Domain. 19 | 20 | 21 | Acknowledgements 22 | ---------------- 23 | 24 | The panel library was originally provided by 25 | Warren Tucker 26 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/pdcurses/beep.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include 4 | 5 | RCSID("$Id: beep.c,v 1.34 2008/07/13 16:08:17 wmcbrine Exp $") 6 | 7 | /*man-start************************************************************** 8 | 9 | Name: beep 10 | 11 | Synopsis: 12 | int beep(void); 13 | int flash(void); 14 | 15 | Description: 16 | beep() sounds the audible bell on the terminal, if possible; 17 | if not, it calls flash(). 18 | 19 | flash() "flashes" the screen, by inverting the foreground and 20 | background of every cell, pausing, and then restoring the 21 | original attributes. 22 | 23 | Return Value: 24 | These functions return OK. 25 | 26 | Portability X/Open BSD SYS V 27 | beep Y Y Y 28 | flash Y Y Y 29 | 30 | **man-end****************************************************************/ 31 | 32 | int beep(void) 33 | { 34 | PDC_LOG(("beep() - called\n")); 35 | 36 | if (SP->audible) 37 | PDC_beep(); 38 | else 39 | flash(); 40 | 41 | return OK; 42 | } 43 | 44 | int flash(void) 45 | { 46 | int z, y, x; 47 | 48 | PDC_LOG(("flash() - called\n")); 49 | 50 | /* Reverse each cell; wait; restore the screen */ 51 | 52 | for (z = 0; z < 2; z++) 53 | { 54 | for (y = 0; y < LINES; y++) 55 | for (x = 0; x < COLS; x++) 56 | curscr->_y[y][x] ^= A_REVERSE; 57 | 58 | wrefresh(curscr); 59 | 60 | if (!z) 61 | napms(50); 62 | } 63 | 64 | return OK; 65 | } 66 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/pdcurses/debug.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include 4 | 5 | RCSID("$Id: debug.c,v 1.7 2008/07/13 16:08:18 wmcbrine Exp $") 6 | 7 | /*man-start************************************************************** 8 | 9 | Name: debug 10 | 11 | Synopsis: 12 | void traceon(void); 13 | void traceoff(void); 14 | void PDC_debug(const char *, ...); 15 | 16 | Description: 17 | traceon() and traceoff() toggle the recording of debugging 18 | information to the file "trace". Although not standard, similar 19 | functions are in some other curses implementations. 20 | 21 | PDC_debug() is the function that writes to the file, based on 22 | whether traceon() has been called. It's used from the PDC_LOG() 23 | macro. 24 | 25 | Portability X/Open BSD SYS V 26 | traceon - - - 27 | traceoff - - - 28 | PDC_debug - - - 29 | 30 | **man-end****************************************************************/ 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | bool pdc_trace_on = FALSE; 37 | 38 | void PDC_debug(const char *fmt, ...) 39 | { 40 | va_list args; 41 | FILE *dbfp; 42 | char hms[9]; 43 | time_t now; 44 | 45 | if (!pdc_trace_on) 46 | return; 47 | 48 | /* open debug log file append */ 49 | 50 | dbfp = fopen("trace", "a"); 51 | if (!dbfp) 52 | { 53 | fprintf(stderr, 54 | "PDC_debug(): Unable to open debug log file\n"); 55 | return; 56 | } 57 | 58 | time(&now); 59 | strftime(hms, 9, "%H:%M:%S", localtime(&now)); 60 | fprintf(dbfp, "At: %8.8ld - %s ", (long) clock(), hms); 61 | 62 | va_start(args, fmt); 63 | vfprintf(dbfp, fmt, args); 64 | va_end(args); 65 | 66 | fclose(dbfp); 67 | } 68 | 69 | void traceon(void) 70 | { 71 | PDC_LOG(("traceon() - called\n")); 72 | 73 | pdc_trace_on = TRUE; 74 | } 75 | 76 | void traceoff(void) 77 | { 78 | PDC_LOG(("traceoff() - called\n")); 79 | 80 | pdc_trace_on = FALSE; 81 | } 82 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/pdcurses/delch.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include 4 | 5 | RCSID("$Id: delch.c,v 1.33 2008/07/13 16:08:18 wmcbrine Exp $") 6 | 7 | /*man-start************************************************************** 8 | 9 | Name: delch 10 | 11 | Synopsis: 12 | int delch(void); 13 | int wdelch(WINDOW *win); 14 | int mvdelch(int y, int x); 15 | int mvwdelch(WINDOW *win, int y, int x); 16 | 17 | Description: 18 | The character under the cursor in the window is deleted. All 19 | characters to the right on the same line are moved to the left 20 | one position and the last character on the line is filled with 21 | a blank. The cursor position does not change (after moving to 22 | y, x if coordinates are specified). 23 | 24 | Return Value: 25 | All functions return OK on success and ERR on error. 26 | 27 | Portability X/Open BSD SYS V 28 | delch Y Y Y 29 | wdelch Y Y Y 30 | mvdelch Y Y Y 31 | mvwdelch Y Y Y 32 | 33 | **man-end****************************************************************/ 34 | 35 | #include 36 | 37 | int wdelch(WINDOW *win) 38 | { 39 | int y, x, maxx; 40 | chtype *temp1; 41 | 42 | PDC_LOG(("wdelch() - called\n")); 43 | 44 | if (!win) 45 | return ERR; 46 | 47 | y = win->_cury; 48 | x = win->_curx; 49 | maxx = win->_maxx - 1; 50 | temp1 = &win->_y[y][x]; 51 | 52 | memmove(temp1, temp1 + 1, (maxx - x) * sizeof(chtype)); 53 | 54 | /* wrs (4/10/93) account for window background */ 55 | 56 | win->_y[y][maxx] = win->_bkgd; 57 | 58 | win->_lastch[y] = maxx; 59 | 60 | if ((win->_firstch[y] == _NO_CHANGE) || (win->_firstch[y] > x)) 61 | win->_firstch[y] = x; 62 | 63 | PDC_sync(win); 64 | 65 | return OK; 66 | } 67 | 68 | int delch(void) 69 | { 70 | PDC_LOG(("delch() - called\n")); 71 | 72 | return wdelch(stdscr); 73 | } 74 | 75 | int mvdelch(int y, int x) 76 | { 77 | PDC_LOG(("mvdelch() - called\n")); 78 | 79 | if (move(y, x) == ERR) 80 | return ERR; 81 | 82 | return wdelch(stdscr); 83 | } 84 | 85 | int mvwdelch(WINDOW *win, int y, int x) 86 | { 87 | PDC_LOG(("mvwdelch() - called\n")); 88 | 89 | if (wmove(win, y, x) == ERR) 90 | return ERR; 91 | 92 | return wdelch(win); 93 | } 94 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/pdcurses/deprec.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include 4 | 5 | RCSID("$Id: deprec.c,v 1.6 2008/07/13 16:08:18 wmcbrine Exp $") 6 | 7 | /* Deprecated functions. These should not be used, and will eventually 8 | be removed. They're here solely for the benefit of applications that 9 | linked to them in older versions of PDCurses. */ 10 | 11 | bool PDC_check_bios_key(void) 12 | { 13 | return PDC_check_key(); 14 | } 15 | 16 | int PDC_get_bios_key(void) 17 | { 18 | return PDC_get_key(); 19 | } 20 | 21 | bool PDC_get_ctrl_break(void) 22 | { 23 | return !SP->raw_inp; 24 | } 25 | 26 | int PDC_set_ctrl_break(bool setting) 27 | { 28 | return setting ? noraw() : raw(); 29 | } 30 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/pdcurses/inch.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include 4 | 5 | RCSID("$Id: inch.c,v 1.33 2008/07/13 16:08:18 wmcbrine Exp $") 6 | 7 | /*man-start************************************************************** 8 | 9 | Name: inch 10 | 11 | Synopsis: 12 | chtype inch(void); 13 | chtype winch(WINDOW *win); 14 | chtype mvinch(int y, int x); 15 | chtype mvwinch(WINDOW *win, int y, int x); 16 | 17 | int in_wch(cchar_t *wcval); 18 | int win_wch(WINDOW *win, cchar_t *wcval); 19 | int mvin_wch(int y, int x, cchar_t *wcval); 20 | int mvwin_wch(WINDOW *win, int y, int x, cchar_t *wcval); 21 | 22 | Description: 23 | The inch() functions retrieve the character and attribute from 24 | the current or specified window position, in the form of a 25 | chtype. If a NULL window is specified, (chtype)ERR is returned. 26 | 27 | The in_wch() functions are the wide-character versions; instead 28 | of returning a chtype, they store a cchar_t at the address 29 | specified by wcval, and return OK or ERR. (No value is stored 30 | when ERR is returned.) Note that in PDCurses, chtype and cchar_t 31 | are the same. 32 | 33 | Portability X/Open BSD SYS V 34 | inch Y Y Y 35 | winch Y Y Y 36 | mvinch Y Y Y 37 | mvwinch Y Y Y 38 | in_wch Y 39 | win_wch Y 40 | mvin_wch Y 41 | mvwin_wch Y 42 | 43 | **man-end****************************************************************/ 44 | 45 | chtype winch(WINDOW *win) 46 | { 47 | PDC_LOG(("winch() - called\n")); 48 | 49 | if (!win) 50 | return (chtype)ERR; 51 | 52 | return win->_y[win->_cury][win->_curx]; 53 | } 54 | 55 | chtype inch(void) 56 | { 57 | PDC_LOG(("inch() - called\n")); 58 | 59 | return winch(stdscr); 60 | } 61 | 62 | chtype mvinch(int y, int x) 63 | { 64 | PDC_LOG(("mvinch() - called\n")); 65 | 66 | if (move(y, x) == ERR) 67 | return (chtype)ERR; 68 | 69 | return stdscr->_y[stdscr->_cury][stdscr->_curx]; 70 | } 71 | 72 | chtype mvwinch(WINDOW *win, int y, int x) 73 | { 74 | PDC_LOG(("mvwinch() - called\n")); 75 | 76 | if (wmove(win, y, x) == ERR) 77 | return (chtype)ERR; 78 | 79 | return win->_y[win->_cury][win->_curx]; 80 | } 81 | 82 | #ifdef PDC_WIDE 83 | int win_wch(WINDOW *win, cchar_t *wcval) 84 | { 85 | PDC_LOG(("win_wch() - called\n")); 86 | 87 | if (!win || !wcval) 88 | return ERR; 89 | 90 | *wcval = win->_y[win->_cury][win->_curx]; 91 | 92 | return OK; 93 | } 94 | 95 | int in_wch(cchar_t *wcval) 96 | { 97 | PDC_LOG(("in_wch() - called\n")); 98 | 99 | return win_wch(stdscr, wcval); 100 | } 101 | 102 | int mvin_wch(int y, int x, cchar_t *wcval) 103 | { 104 | PDC_LOG(("mvin_wch() - called\n")); 105 | 106 | if (!wcval || (move(y, x) == ERR)) 107 | return ERR; 108 | 109 | *wcval = stdscr->_y[stdscr->_cury][stdscr->_curx]; 110 | 111 | return OK; 112 | } 113 | 114 | int mvwin_wch(WINDOW *win, int y, int x, cchar_t *wcval) 115 | { 116 | PDC_LOG(("mvwin_wch() - called\n")); 117 | 118 | if (!wcval || (wmove(win, y, x) == ERR)) 119 | return ERR; 120 | 121 | *wcval = win->_y[win->_cury][win->_curx]; 122 | 123 | return OK; 124 | } 125 | #endif 126 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/pdcurses/move.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include 4 | 5 | RCSID("$Id: move.c,v 1.28 2008/07/13 16:08:18 wmcbrine Exp $") 6 | 7 | /*man-start************************************************************** 8 | 9 | Name: move 10 | 11 | Synopsis: 12 | int move(int y, int x); 13 | int wmove(WINDOW *win, int y, int x); 14 | 15 | Description: 16 | The cursor associated with the window is moved to the given 17 | location. This does not move the physical cursor of the 18 | terminal until refresh() is called. The position specified is 19 | relative to the upper left corner of the window, which is (0,0). 20 | 21 | Return Value: 22 | All functions return OK on success and ERR on error. 23 | 24 | Portability X/Open BSD SYS V 25 | move Y Y Y 26 | wmove Y Y Y 27 | 28 | **man-end****************************************************************/ 29 | 30 | int move(int y, int x) 31 | { 32 | PDC_LOG(("move() - called: y=%d x=%d\n", y, x)); 33 | 34 | if (!stdscr || x < 0 || y < 0 || x >= stdscr->_maxx || y >= stdscr->_maxy) 35 | return ERR; 36 | 37 | stdscr->_curx = x; 38 | stdscr->_cury = y; 39 | 40 | return OK; 41 | } 42 | 43 | int wmove(WINDOW *win, int y, int x) 44 | { 45 | PDC_LOG(("wmove() - called: y=%d x=%d\n", y, x)); 46 | 47 | if (!win || x < 0 || y < 0 || x >= win->_maxx || y >= win->_maxy) 48 | return ERR; 49 | 50 | win->_curx = x; 51 | win->_cury = y; 52 | 53 | return OK; 54 | } 55 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/pdcurses/printw.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include 4 | 5 | RCSID("$Id: printw.c,v 1.40 2008/07/13 16:08:18 wmcbrine Exp $") 6 | 7 | /*man-start************************************************************** 8 | 9 | Name: printw 10 | 11 | Synopsis: 12 | int printw(const char *fmt, ...); 13 | int wprintw(WINDOW *win, const char *fmt, ...); 14 | int mvprintw(int y, int x, const char *fmt, ...); 15 | int mvwprintw(WINDOW *win, int y, int x, const char *fmt,...); 16 | int vwprintw(WINDOW *win, const char *fmt, va_list varglist); 17 | int vw_printw(WINDOW *win, const char *fmt, va_list varglist); 18 | 19 | Description: 20 | The printw() functions add a formatted string to the window at 21 | the current or specified cursor position. The format strings are 22 | the same as used in the standard C library's printf(). (printw() 23 | can be used as a drop-in replacement for printf().) 24 | 25 | Return Value: 26 | All functions return the number of characters printed, or 27 | ERR on error. 28 | 29 | Portability X/Open BSD SYS V 30 | printw Y Y Y 31 | wprintw Y Y Y 32 | mvprintw Y Y Y 33 | mvwprintw Y Y Y 34 | vwprintw Y - 4.0 35 | vw_printw Y 36 | 37 | **man-end****************************************************************/ 38 | 39 | #include 40 | 41 | int vwprintw(WINDOW *win, const char *fmt, va_list varglist) 42 | { 43 | char printbuf[513]; 44 | int len; 45 | 46 | PDC_LOG(("vwprintw() - called\n")); 47 | 48 | #ifdef HAVE_VSNPRINTF 49 | len = vsnprintf(printbuf, 512, fmt, varglist); 50 | #else 51 | len = vsprintf(printbuf, fmt, varglist); 52 | #endif 53 | return (waddstr(win, printbuf) == ERR) ? ERR : len; 54 | } 55 | 56 | int printw(const char *fmt, ...) 57 | { 58 | va_list args; 59 | int retval; 60 | 61 | PDC_LOG(("printw() - called\n")); 62 | 63 | va_start(args, fmt); 64 | retval = vwprintw(stdscr, fmt, args); 65 | va_end(args); 66 | 67 | return retval; 68 | } 69 | 70 | int wprintw(WINDOW *win, const char *fmt, ...) 71 | { 72 | va_list args; 73 | int retval; 74 | 75 | PDC_LOG(("wprintw() - called\n")); 76 | 77 | va_start(args, fmt); 78 | retval = vwprintw(win, fmt, args); 79 | va_end(args); 80 | 81 | return retval; 82 | } 83 | 84 | int mvprintw(int y, int x, const char *fmt, ...) 85 | { 86 | va_list args; 87 | int retval; 88 | 89 | PDC_LOG(("mvprintw() - called\n")); 90 | 91 | if (move(y, x) == ERR) 92 | return ERR; 93 | 94 | va_start(args, fmt); 95 | retval = vwprintw(stdscr, fmt, args); 96 | va_end(args); 97 | 98 | return retval; 99 | } 100 | 101 | int mvwprintw(WINDOW *win, int y, int x, const char *fmt, ...) 102 | { 103 | va_list args; 104 | int retval; 105 | 106 | PDC_LOG(("mvwprintw() - called\n")); 107 | 108 | if (wmove(win, y, x) == ERR) 109 | return ERR; 110 | 111 | va_start(args, fmt); 112 | retval = vwprintw(win, fmt, args); 113 | va_end(args); 114 | 115 | return retval; 116 | } 117 | 118 | int vw_printw(WINDOW *win, const char *fmt, va_list varglist) 119 | { 120 | PDC_LOG(("vw_printw() - called\n")); 121 | 122 | return vwprintw(win, fmt, varglist); 123 | } 124 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/pdcurses/scroll.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include 4 | 5 | RCSID("$Id: scroll.c,v 1.36 2008/07/13 16:08:18 wmcbrine Exp $") 6 | 7 | /*man-start************************************************************** 8 | 9 | Name: scroll 10 | 11 | Synopsis: 12 | int scroll(WINDOW *win); 13 | int scrl(int n); 14 | int wscrl(WINDOW *win, int n); 15 | 16 | Description: 17 | scroll() causes the window to scroll up one line. This involves 18 | moving the lines in the window data strcture. 19 | 20 | With a positive n, scrl() and wscrl() scroll the window up n 21 | lines (line i + n becomes i); otherwise they scroll the window 22 | down n lines. 23 | 24 | For these functions to work, scrolling must be enabled via 25 | scrollok(). Note also that scrolling is not allowed if the 26 | supplied window is a pad. 27 | 28 | Return Value: 29 | All functions return OK on success and ERR on error. 30 | 31 | Portability X/Open BSD SYS V 32 | scroll Y Y Y 33 | scrl Y - 4.0 34 | wscrl Y - 4.0 35 | 36 | **man-end****************************************************************/ 37 | 38 | int wscrl(WINDOW *win, int n) 39 | { 40 | int i, l, dir, start, end; 41 | chtype blank, *temp; 42 | 43 | /* Check if window scrolls. Valid for window AND pad */ 44 | 45 | if (!win || !win->_scroll || !n) 46 | return ERR; 47 | 48 | blank = win->_bkgd; 49 | 50 | if (n > 0) 51 | { 52 | start = win->_tmarg; 53 | end = win->_bmarg; 54 | dir = 1; 55 | } 56 | else 57 | { 58 | start = win->_bmarg; 59 | end = win->_tmarg; 60 | dir = -1; 61 | } 62 | 63 | for (l = 0; l < (n * dir); l++) 64 | { 65 | temp = win->_y[start]; 66 | 67 | /* re-arrange line pointers */ 68 | 69 | for (i = start; i != end; i += dir) 70 | win->_y[i] = win->_y[i + dir]; 71 | 72 | win->_y[end] = temp; 73 | 74 | /* make a blank line */ 75 | 76 | for (i = 0; i < win->_maxx; i++) 77 | *temp++ = blank; 78 | } 79 | 80 | touchline(win, win->_tmarg, win->_bmarg - win->_tmarg + 1); 81 | 82 | PDC_sync(win); 83 | return OK; 84 | } 85 | 86 | int scrl(int n) 87 | { 88 | PDC_LOG(("scrl() - called\n")); 89 | 90 | return wscrl(stdscr, n); 91 | } 92 | 93 | int scroll(WINDOW *win) 94 | { 95 | PDC_LOG(("scroll() - called\n")); 96 | 97 | return wscrl(win, 1); 98 | } 99 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/sdl1/Makefile.mng: -------------------------------------------------------------------------------- 1 | # Makefile for PDCurses library for SDL 2 | 3 | O = o 4 | 5 | ifndef PDCURSES_SRCDIR 6 | PDCURSES_SRCDIR = .. 7 | endif 8 | 9 | include $(PDCURSES_SRCDIR)/libobjs.mif 10 | 11 | osdir = $(PDCURSES_SRCDIR)/sdl1 12 | 13 | PDCURSES_SDL_H = $(osdir)/pdcsdl.h 14 | 15 | ifeq ($(DEBUG),Y) 16 | CFLAGS = -g -Wall -DPDCDEBUG 17 | else 18 | CFLAGS = -O2 -Wall 19 | endif 20 | 21 | CC = gcc 22 | BUILD = $(CC) $(CFLAGS) -I$(PDCURSES_SRCDIR) 23 | LDFLAGS = -mwindows $(LIBCURSES) 24 | 25 | BASEDEF = $(PDCURSES_SRCDIR)\exp-base.def 26 | 27 | DEFDEPS = $(BASEDEF) 28 | 29 | DEFFILE = pdcurses.def 30 | 31 | ifeq ($(DLL),Y) 32 | BUILD += -DPDC_DLL_BUILD 33 | LIBEXE = gcc $(DEFFILE) 34 | LIBFLAGS = -Wl,--out-implib,libpdcurses.a -shared -o 35 | LIBCURSES = pdcurses.dll 36 | CLEAN = $(LIBCURSES) *.a $(DEFFILE) 37 | POST = -lSDL 38 | else 39 | LIBEXE = ar 40 | LIBFLAGS = rcv 41 | LIBCURSES = libpdcurses.a 42 | CLEAN = *.a 43 | LDFLAGS += -lSDL 44 | endif 45 | 46 | DEMOS += sdltest.exe 47 | 48 | .PHONY: all libs clean demos 49 | 50 | all: libs demos 51 | 52 | libs: $(LIBCURSES) 53 | 54 | clean: 55 | -del *.o $(CLEAN) *.exe 56 | 57 | demos: $(DEMOS) 58 | strip *.exe 59 | 60 | pdcurses.dll: $(DEFFILE) 61 | 62 | $(DEFFILE): $(DEFDEPS) 63 | echo LIBRARY pdcurses > $@ 64 | echo EXPORTS >> $@ 65 | type $(BASEDEF) >> $@ 66 | echo pdc_screen >> $@ 67 | echo pdc_font >> $@ 68 | echo pdc_icon >> $@ 69 | echo pdc_back >> $@ 70 | echo pdc_sheight >> $@ 71 | echo pdc_swidth >> $@ 72 | echo pdc_yoffset >> $@ 73 | echo pdc_xoffset >> $@ 74 | 75 | $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS) 76 | $(LIBEXE) $(LIBFLAGS) $@ $? $(POST) 77 | 78 | $(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS) 79 | $(PDCOBJS) : $(PDCURSES_SDL_H) 80 | $(DEMOS) : $(PDCURSES_CURSES_H) $(LIBCURSES) 81 | tui.o tuidemo.o : $(PDCURSES_CURSES_H) 82 | terminfo.o: $(TERM_HEADER) 83 | panel.o ptest.exe: $(PANEL_HEADER) 84 | 85 | $(LIBOBJS) : %.o: $(srcdir)/%.c 86 | $(BUILD) -c $< 87 | 88 | $(PDCOBJS) : %.o: $(osdir)/%.c 89 | $(BUILD) -c $< 90 | 91 | firework.exe newdemo.exe rain.exe testcurs.exe worm.exe xmas.exe \ 92 | ptest.exe: %.exe: $(demodir)/%.c 93 | $(BUILD) -o $@ $< $(LDFLAGS) 94 | 95 | tuidemo.exe: tuidemo.o tui.o 96 | $(CC) -o $@ tuidemo.o tui.o $(LDFLAGS) 97 | 98 | tui.o: $(demodir)/tui.c $(demodir)/tui.h 99 | $(BUILD) -c $< 100 | 101 | tuidemo.o: $(demodir)/tuidemo.c $(demodir)/tui.h 102 | $(BUILD) -c $< 103 | 104 | sdltest.exe: $(osdir)/sdltest.c 105 | $(BUILD) -o $@ $< -mwindows $(LIBCURSES) -lmingw32 -lSDLmain -lSDL 106 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/sdl1/README: -------------------------------------------------------------------------------- 1 | PDCurses for SDL 2 | ================ 3 | 4 | This is a port of PDCurses for SDL. 5 | 6 | 7 | Building 8 | -------- 9 | 10 | . On *nix (including Linux and Mac OS X), run "make" in the sdl1 11 | directory. There is no configure script (yet?) for this port. This 12 | assumes a working sdl-config, and GNU make. It builds the library 13 | libpdcurses.a (dynamic lib not implemented). 14 | 15 | With MinGW, run "make -f Makefile.mng". This assumes SDL is installed 16 | in the standard directories. The MinGW makefile accepts the optional 17 | parameters "DLL=Y" and "DEBUG=Y", as with the console version. (Wide- 18 | character support is not yet implemented for SDL.) Both makefiles 19 | recognize the optional PDCURSES_SRCDIR environment variable, as with 20 | the console ports. Makefile.mng builds libpdcurses.a, along with 21 | pdcurses.dll, if specified. 22 | 23 | 24 | Distribution Status 25 | ------------------- 26 | 27 | The files in this directory are released to the Public Domain. 28 | 29 | 30 | Acknowledgements 31 | ---------------- 32 | 33 | SDL port was provided by William McBrine 34 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/sdl1/deficon.h: -------------------------------------------------------------------------------- 1 | /* The PDCurses logo as #include'able BMP (from ../x11/little_icon.xbm) */ 2 | 3 | unsigned char deficon[] = 4 | { 5 | 0x42, 0x4d, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 6 | 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 7 | 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 8 | 0x00, 0x80, 0x00, 0x00, 0x00, 0x13, 0x0b, 0x00, 0x00, 0x13, 0x0b, 9 | 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 10 | 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 11 | 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xce, 0x6f, 0x9c, 12 | 0xe7, 0xb5, 0xaf, 0x6b, 0x5b, 0xbd, 0xaf, 0xeb, 0xfb, 0xbd, 0xaf, 13 | 0x98, 0xe7, 0xbd, 0xaf, 0x7b, 0x5f, 0xb5, 0xa5, 0x6b, 0x5b, 0xcd, 14 | 0xab, 0x9c, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 15 | 0xff, 0xcf, 0x03, 0xff, 0xff, 0xce, 0x03, 0xff, 0xff, 0xcc, 0x73, 16 | 0xff, 0xff, 0xcc, 0xf3, 0xff, 0xff, 0xcc, 0xf3, 0xff, 0xff, 0xcc, 17 | 0x73, 0xff, 0xff, 0xc6, 0x33, 0xff, 0xff, 0xc3, 0x13, 0xff, 0xff, 18 | 0xc1, 0x83, 0xff, 0xff, 0xc8, 0xc3, 0xff, 0xff, 0xcc, 0x63, 0xff, 19 | 0xff, 0xce, 0x33, 0xff, 0xff, 0xcf, 0x33, 0xff, 0xff, 0xcf, 0x33, 20 | 0xff, 0xff, 0xce, 0x33, 0xff, 0xff, 0xc0, 0x73, 0xff, 0xff, 0xc0, 21 | 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 22 | 0xff, 0xff, 0xff 23 | }; 24 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/sdl1/pdcgetsc.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcsdl.h" 4 | 5 | RCSID("$Id: pdcgetsc.c,v 1.8 2008/07/14 04:24:52 wmcbrine Exp $") 6 | 7 | /* get the cursor size/shape */ 8 | 9 | int PDC_get_cursor_mode(void) 10 | { 11 | PDC_LOG(("PDC_get_cursor_mode() - called\n")); 12 | 13 | return 0; 14 | } 15 | 16 | /* return number of screen rows */ 17 | 18 | int PDC_get_rows(void) 19 | { 20 | PDC_LOG(("PDC_get_rows() - called\n")); 21 | 22 | return pdc_sheight / pdc_fheight; 23 | } 24 | 25 | /* return width of screen/viewport */ 26 | 27 | int PDC_get_columns(void) 28 | { 29 | PDC_LOG(("PDC_get_columns() - called\n")); 30 | 31 | return pdc_swidth / pdc_fwidth; 32 | } 33 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/sdl1/pdcsdl.h: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | /* $Id: pdcsdl.h,v 1.17 2008/07/14 04:24:52 wmcbrine Exp $ */ 4 | 5 | #include 6 | 7 | #include 8 | 9 | PDCEX SDL_Surface *pdc_screen, *pdc_font, *pdc_icon, *pdc_back; 10 | PDCEX int pdc_sheight, pdc_swidth, pdc_yoffset, pdc_xoffset; 11 | 12 | extern SDL_Surface *pdc_tileback; /* used to regenerate the background 13 | of "transparent" cells */ 14 | extern SDL_Color pdc_color[16]; /* colors for font palette */ 15 | extern Uint32 pdc_mapped[16]; /* colors for FillRect(), as 16 | used in _highlight() */ 17 | extern int pdc_fheight, pdc_fwidth; /* font height and width */ 18 | extern int pdc_flastc; /* font palette's last color 19 | (treated as the foreground) */ 20 | extern bool pdc_own_screen; /* if pdc_screen was not set 21 | before initscr(), PDCurses is 22 | responsible for (owns) it */ 23 | extern Uint32 pdc_lastupdate; /* time of last update, in ticks */ 24 | 25 | void PDC_update_rects(void); 26 | void PDC_retile(void); 27 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/sdl1/pdcsetsc.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcsdl.h" 4 | 5 | RCSID("$Id: pdcsetsc.c,v 1.7 2008/07/14 04:24:52 wmcbrine Exp $") 6 | 7 | /*man-start************************************************************** 8 | 9 | Name: pdcsetsc 10 | 11 | Synopsis: 12 | int PDC_set_blink(bool blinkon); 13 | void PDC_set_title(const char *title); 14 | 15 | Description: 16 | PDC_set_blink() toggles whether the A_BLINK attribute sets an 17 | actual blink mode (TRUE), or sets the background color to high 18 | intensity (FALSE). The default is platform-dependent (FALSE in 19 | most cases). It returns OK if it could set the state to match 20 | the given parameter, ERR otherwise. Current platforms also 21 | adjust the value of COLORS according to this function -- 16 for 22 | FALSE, and 8 for TRUE. 23 | 24 | PDC_set_title() sets the title of the window in which the curses 25 | program is running. This function may not do anything on some 26 | platforms. (Currently it only works in Win32 and X11.) 27 | 28 | Portability X/Open BSD SYS V 29 | PDC_set_blink - - - 30 | PDC_set_title - - - 31 | 32 | **man-end****************************************************************/ 33 | 34 | int PDC_curs_set(int visibility) 35 | { 36 | int ret_vis; 37 | 38 | PDC_LOG(("PDC_curs_set() - called: visibility=%d\n", visibility)); 39 | 40 | ret_vis = SP->visibility; 41 | 42 | SP->visibility = visibility; 43 | 44 | PDC_gotoyx(SP->cursrow, SP->curscol); 45 | 46 | return ret_vis; 47 | } 48 | 49 | void PDC_set_title(const char *title) 50 | { 51 | PDC_LOG(("PDC_set_title() - called:<%s>\n", title)); 52 | 53 | SDL_WM_SetCaption(title, title); 54 | } 55 | 56 | int PDC_set_blink(bool blinkon) 57 | { 58 | if (pdc_color_started) 59 | COLORS = 16; 60 | 61 | return blinkon ? ERR : OK; 62 | } 63 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/sdl1/pdcutil.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcsdl.h" 4 | 5 | RCSID("$Id: pdcutil.c,v 1.6 2008/07/14 04:24:52 wmcbrine Exp $") 6 | 7 | void PDC_beep(void) 8 | { 9 | PDC_LOG(("PDC_beep() - called\n")); 10 | } 11 | 12 | void PDC_napms(int ms) 13 | { 14 | PDC_LOG(("PDC_napms() - called: ms=%d\n", ms)); 15 | 16 | PDC_update_rects(); 17 | SDL_Delay(ms); 18 | } 19 | 20 | const char *PDC_sysname(void) 21 | { 22 | return "SDL"; 23 | } 24 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/sdl1/sdltest.c: -------------------------------------------------------------------------------- 1 | /* Here's a simple example of combining SDL and PDCurses functionality. 2 | The top portion of the window is devoted to SDL, with a four-line 3 | (assuming the default 8x16 font) stdscr at the bottom. 4 | 5 | $Id: sdltest.c,v 1.2 2008/07/14 04:24:52 wmcbrine Exp $ 6 | */ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | /* You could #include pdcsdl.h, or just add the relevant declarations 14 | here: */ 15 | 16 | PDCEX SDL_Surface *pdc_screen; 17 | PDCEX int pdc_yoffset; 18 | 19 | int main(int argc, char **argv) 20 | { 21 | char inp[60]; 22 | int i, j, seed; 23 | 24 | seed = time((time_t *)0); 25 | srand(seed); 26 | 27 | /* Initialize SDL */ 28 | 29 | if (SDL_Init(SDL_INIT_VIDEO) < 0) 30 | exit(1); 31 | 32 | atexit(SDL_Quit); 33 | 34 | pdc_screen = SDL_SetVideoMode(640, 480, 0, SDL_SWSURFACE|SDL_ANYFORMAT); 35 | 36 | /* Initialize PDCurses */ 37 | 38 | pdc_yoffset = 416; /* 480 - 4 * 16 */ 39 | 40 | initscr(); 41 | start_color(); 42 | scrollok(stdscr, TRUE); 43 | 44 | PDC_set_title("PDCurses for SDL"); 45 | 46 | /* Do some SDL stuff */ 47 | 48 | for (i = 640, j = 416; j; i -= 2, j -= 2) 49 | { 50 | SDL_Rect dest; 51 | 52 | dest.x = (640 - i) / 2; 53 | dest.y = (416 - j) / 2; 54 | dest.w = i; 55 | dest.h = j; 56 | 57 | SDL_FillRect(pdc_screen, &dest, 58 | SDL_MapRGB(pdc_screen->format, rand() % 256, 59 | rand() % 256, rand() % 256)); 60 | } 61 | 62 | SDL_UpdateRect(pdc_screen, 0, 0, 640, 416); 63 | 64 | /* Do some curses stuff */ 65 | 66 | init_pair(1, COLOR_WHITE + 8, COLOR_BLUE); 67 | bkgd(COLOR_PAIR(1)); 68 | 69 | addstr("This is a demo of "); 70 | attron(A_UNDERLINE); 71 | addstr("PDCurses for SDL"); 72 | attroff(A_UNDERLINE); 73 | addstr(".\nYour comments here: "); 74 | getnstr(inp, 59); 75 | addstr("Press any key to exit."); 76 | 77 | getch(); 78 | endwin(); 79 | 80 | return 0; 81 | } 82 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/term.h: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | /* $Id: term.h,v 1.16 2008/07/13 16:08:16 wmcbrine Exp $ */ 4 | 5 | /* PDCurses doesn't operate with terminfo, but we need these functions for 6 | compatibility, to allow some things (notably, interface libraries for 7 | other languages) to be compiled. Anyone who tries to actually _use_ 8 | them will be disappointed, since they only return ERR. */ 9 | 10 | #ifndef __PDCURSES_TERM_H__ 11 | #define __PDCURSES_TERM_H__ 1 12 | 13 | #include 14 | 15 | #if defined(__cplusplus) || defined(__cplusplus__) || defined(__CPLUSPLUS) 16 | extern "C" 17 | { 18 | #endif 19 | 20 | typedef struct 21 | { 22 | const char *_termname; 23 | } TERMINAL; 24 | 25 | #ifdef PDC_DLL_BUILD 26 | # ifndef CURSES_LIBRARY 27 | __declspec(dllimport) TERMINAL *cur_term; 28 | # else 29 | __declspec(dllexport) extern TERMINAL *cur_term; 30 | # endif 31 | #else 32 | extern TERMINAL *cur_term; 33 | #endif 34 | 35 | int del_curterm(TERMINAL *); 36 | int putp(const char *); 37 | int restartterm(const char *, int, int *); 38 | TERMINAL *set_curterm(TERMINAL *); 39 | int setterm(const char *); 40 | int setupterm(const char *, int, int *); 41 | int tgetent(char *, const char *); 42 | int tgetflag(const char *); 43 | int tgetnum(const char *); 44 | char *tgetstr(const char *, char **); 45 | char *tgoto(const char *, int, int); 46 | int tigetflag(const char *); 47 | int tigetnum(const char *); 48 | char *tigetstr(const char *); 49 | char *tparm(const char *, long, long, long, long, long, 50 | long, long, long, long); 51 | int tputs(const char *, int, int (*)(int)); 52 | 53 | #if defined(__cplusplus) || defined(__cplusplus__) || defined(__CPLUSPLUS) 54 | } 55 | #endif 56 | 57 | #endif /* __PDCURSES_TERM_H__ */ 58 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/version.mif: -------------------------------------------------------------------------------- 1 | # Version number macros for inclusion from makefiles 2 | 3 | VER = 34 4 | VERDOT = 3.4 5 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/watcom.mif: -------------------------------------------------------------------------------- 1 | # Common elements for the Watcom makefiles 2 | 3 | srcdir = $(PDCURSES_SRCDIR)\pdcurses 4 | demodir = $(PDCURSES_SRCDIR)\demos 5 | 6 | LIBOBJS = addch.obj addchstr.obj addstr.obj attr.obj beep.obj bkgd.obj & 7 | border.obj clear.obj color.obj delch.obj deleteln.obj deprec.obj & 8 | getch.obj getstr.obj getyx.obj inch.obj inchstr.obj initscr.obj inopts.obj & 9 | insch.obj insstr.obj instr.obj kernel.obj keyname.obj mouse.obj move.obj & 10 | outopts.obj overlay.obj pad.obj panel.obj printw.obj refresh.obj & 11 | scanw.obj scr_dump.obj scroll.obj slk.obj termattr.obj terminfo.obj & 12 | touch.obj util.obj window.obj debug.obj 13 | 14 | PDCOBJS = pdcclip.obj pdcdisp.obj pdcgetsc.obj pdckbd.obj pdcscrn.obj & 15 | pdcsetsc.obj pdcutil.obj 16 | 17 | DEMOS = testcurs.exe newdemo.exe xmas.exe tuidemo.exe firework.exe & 18 | ptest.exe rain.exe worm.exe 19 | 20 | LIBCURSES = pdcurses.lib 21 | 22 | LINK = wlink 23 | 24 | !ifdef __LOADDLL__ 25 | ! loaddll wcc wccd 26 | ! loaddll wcc386 wccd386 27 | ! loaddll wlink wlink 28 | ! loaddll wlib wlibd 29 | !endif 30 | 31 | all: $(LIBCURSES) $(DEMOS) 32 | 33 | clean 34 | -del *.obj 35 | -del *.lib 36 | -del *.exe 37 | -del *.err 38 | 39 | demos: $(DEMOS) 40 | 41 | .c: $(srcdir);$(osdir);$(demodir) 42 | .c.obj: .autodepend 43 | $(CC) $(CFLAGS) $< 44 | 45 | .obj.exe: 46 | $(LINK) $(LDFLAGS) n $@ f $*.obj l $(LIBCURSES) 47 | 48 | testcurs.exe: testcurs.obj $(LIBCURSES) 49 | newdemo.exe: newdemo.obj $(LIBCURSES) 50 | xmas.exe: xmas.obj $(LIBCURSES) 51 | firework.exe: firework.obj $(LIBCURSES) 52 | rain.exe: rain.obj $(LIBCURSES) 53 | worm.exe: worm.obj $(LIBCURSES) 54 | ptest.exe: ptest.obj $(LIBCURSES) 55 | 56 | tuidemo.exe: tuidemo.obj tui.obj $(LIBCURSES) 57 | $(LINK) $(LDFLAGS) n $@ f tuidemo.obj f tui.obj l $(LIBCURSES) 58 | 59 | dist: .symbolic 60 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/win32/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(pdcurses-win32 2 | pdcclip.c 3 | pdcdisp.c 4 | pdcgetsc.c 5 | pdckbd.c 6 | pdcscrn.c 7 | pdcsetsc.c 8 | pdcutil.c 9 | ) -------------------------------------------------------------------------------- /libs/pdcurses-3.4/win32/README: -------------------------------------------------------------------------------- 1 | PDCurses for Win32 2 | ================== 3 | 4 | This directory contains PDCurses source code files specific to Win32 5 | console mode (Win9x/Me/NT/2k/XP/Vista). 6 | 7 | 8 | Building 9 | -------- 10 | 11 | . Choose the appropriate makefile for your compiler: 12 | 13 | bccwin32.mak - Borland C++ 4.0.2+ 14 | dmcwin32.mak - Digital Mars 15 | gccwin32.mak - Cygnus GNU Compiler 16 | lccwin32.mak - LCC-Win32 17 | mingwin32.mak - MinGW 18 | vcwin32.mak - Microsoft Visual C++ 2.0+ 19 | wccwin32.mak - Watcom 10.6+ 20 | 21 | . Optionally, you can build in a different directory than the platform 22 | directory by setting PDCURSES_SRCDIR to point to the directory where 23 | you unpacked PDCurses, and changing to your target directory: 24 | 25 | set PDCURSES_SRCDIR=c:\pdcurses 26 | 27 | This won't work with the LCC or Digital Mars makefiles, nor will the 28 | options described below. 29 | 30 | . Build it: 31 | 32 | make -f makefilename 33 | 34 | (For Watcom, use "wmake" instead of "make"; for MSVC, "nmake".) You'll 35 | get the libraries (pdcurses.lib or .a, depending on your compiler; and 36 | panel.lib or .a), the demos (*.exe), and a lot of object files. Note 37 | that the panel library is just a copy of the main library, provided 38 | for convenience; both panel and curses functions are in the main 39 | library. 40 | 41 | You can also give the optional parameter "WIDE=Y", to build the 42 | library with wide-character (Unicode) support: 43 | 44 | make -f mingwin32.mak WIDE=Y 45 | 46 | When built this way, the library is not compatible with Windows 9x, 47 | unless you also link with the Microsoft Layer for Unicode (not 48 | tested). 49 | 50 | Another option, "UTF8=Y", makes PDCurses ignore the system locale, and 51 | treat all narrow-character strings as UTF-8. This option has no effect 52 | unless WIDE=Y is also set. Use it to get around the poor support for 53 | UTF-8 in the Win32 console: 54 | 55 | make -f mingwin32.mak WIDE=Y UTF8=Y 56 | 57 | You can also use the optional parameter "DLL=Y" with Visual C++, 58 | MinGW or Cygwin, to build the library as a DLL: 59 | 60 | nmake -f vcwin32.mak WIDE=Y DLL=Y 61 | 62 | When you build the library as a Windows DLL, you must always define 63 | PDCURSES_DLL_BUILD when linking against it. (Or, if you only want to 64 | use the DLL, you could add this definition to your curses.h.) 65 | 66 | 67 | Distribution Status 68 | ------------------- 69 | 70 | The files in this directory are released to the Public Domain. 71 | 72 | 73 | Acknowledgements 74 | ---------------- 75 | 76 | Generic Win32 port was provided by Chris Szurgot 77 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/win32/bccwin32.mak: -------------------------------------------------------------------------------- 1 | # Borland MAKE Makefile for PDCurses library - Win32 BC++ 4.0+ 2 | # 3 | # Usage: make -f [path\]bccwin32.mak [DEBUG=] [WIDE=] [UTF8=] [target] 4 | # 5 | # where target can be any of: 6 | # [all|demos|pdcurses.lib|testcurs.exe...] 7 | 8 | O = obj 9 | 10 | !ifndef PDCURSES_SRCDIR 11 | PDCURSES_SRCDIR = .. 12 | !endif 13 | 14 | !include $(PDCURSES_SRCDIR)\version.mif 15 | !include $(PDCURSES_SRCDIR)\libobjs.mif 16 | 17 | osdir = $(PDCURSES_SRCDIR)\win32 18 | 19 | CC = bcc32 -q 20 | 21 | !ifdef DEBUG 22 | CFLAGS = -N -v -y -DPDCDEBUG 23 | !else 24 | CFLAGS = -O 25 | !endif 26 | 27 | !ifdef WIDE 28 | WIDEOPT = -DPDC_WIDE 29 | !endif 30 | 31 | !ifdef UTF8 32 | UTF8OPT = -DPDC_FORCE_UTF8 33 | !endif 34 | 35 | BUILD = $(CC) -I$(PDCURSES_SRCDIR) -c -Tpe -w32 $(CFLAGS) -w-par \ 36 | $(WIDEOPT) $(UTF8OPT) 37 | 38 | LIBEXE = tlib /C /E /0 /a 39 | 40 | LIBCURSES = pdcurses.lib 41 | 42 | all: $(LIBCURSES) $(DEMOS) 43 | 44 | clean: 45 | -del *.obj 46 | -del *.lib 47 | -del *.tds 48 | -del *.exe 49 | 50 | $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS) 51 | -del $@ 52 | $(LIBEXE) $@ $(LIBOBJS) $(PDCOBJS) 53 | -copy $(LIBCURSES) panel.lib 54 | 55 | .autodepend 56 | 57 | {$(srcdir)\}.c.obj: 58 | $(BUILD) $< 59 | 60 | {$(osdir)\}.c.obj: 61 | $(BUILD) $< 62 | 63 | {$(demodir)\}.c.obj: 64 | $(BUILD) $< 65 | 66 | .c.obj: 67 | $(BUILD) $< 68 | 69 | .obj.exe: 70 | $(CC) -e$@ $** $(LIBCURSES) 71 | 72 | tuidemo.exe: tuidemo.obj tui.obj $(LIBCURSES) 73 | $(CC) -e$@ $** 74 | 75 | tui.obj: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H) 76 | $(BUILD) -I$(demodir) $(demodir)\tui.c 77 | 78 | tuidemo.obj: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H) 79 | $(BUILD) -I$(demodir) $(demodir)\tuidemo.c 80 | 81 | PLATFORM1 = Borland C++ Win32 82 | PLATFORM2 = Borland C/C++ 5.5 for Win32 83 | ARCNAME = pdc$(VER)_bcc_w32 84 | 85 | !include $(PDCURSES_SRCDIR)\makedist.mif 86 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/win32/gccwin32.mak: -------------------------------------------------------------------------------- 1 | # GNU MAKE Makefile for PDCurses library - WIN32 Cygnus GCC 2 | # 3 | # Usage: make -f [path\]gccwin32.mak [DEBUG=Y] [DLL=Y] [WIDE=Y] [UTF8=Y] [tgt] 4 | # 5 | # where tgt can be any of: 6 | # [all|demos|pdcurses.a|testcurs.exe...] 7 | 8 | O = o 9 | 10 | ifndef PDCURSES_SRCDIR 11 | PDCURSES_SRCDIR = .. 12 | endif 13 | 14 | include $(PDCURSES_SRCDIR)/version.mif 15 | include $(PDCURSES_SRCDIR)/libobjs.mif 16 | 17 | osdir = $(PDCURSES_SRCDIR)/win32 18 | 19 | PDCURSES_WIN_H = $(osdir)/pdcwin.h 20 | 21 | CC = gcc 22 | 23 | ifeq ($(DEBUG),Y) 24 | CFLAGS = -g -Wall -DPDCDEBUG 25 | LDFLAGS = -g 26 | else 27 | CFLAGS = -O2 -Wall 28 | LDFLAGS = 29 | endif 30 | 31 | CFLAGS += -I$(PDCURSES_SRCDIR) 32 | 33 | BASEDEF = $(PDCURSES_SRCDIR)/exp-base.def 34 | WIDEDEF = $(PDCURSES_SRCDIR)/exp-wide.def 35 | 36 | DEFDEPS = $(BASEDEF) 37 | 38 | ifeq ($(WIDE),Y) 39 | CFLAGS += -DPDC_WIDE 40 | DEFDEPS += $(WIDEDEF) 41 | endif 42 | 43 | ifeq ($(UTF8),Y) 44 | CFLAGS += -DPDC_FORCE_UTF8 45 | endif 46 | 47 | DEFFILE = pdcurses.def 48 | 49 | LINK = gcc 50 | 51 | ifeq ($(DLL),Y) 52 | CFLAGS += -DPDC_DLL_BUILD 53 | LIBEXE = gcc $(DEFFILE) 54 | LIBFLAGS = -Wl,--out-implib,pdcurses.a -shared -o 55 | LIBCURSES = pdcurses.dll 56 | LIBDEPS = $(LIBOBJS) $(PDCOBJS) $(DEFFILE) 57 | CLEAN = $(LIBCURSES) *.a $(DEFFILE) 58 | else 59 | LIBEXE = ar 60 | LIBFLAGS = rcv 61 | LIBCURSES = pdcurses.a 62 | LIBDEPS = $(LIBOBJS) $(PDCOBJS) 63 | CLEAN = *.a 64 | endif 65 | 66 | .PHONY: all libs clean demos dist 67 | 68 | all: libs demos 69 | 70 | libs: $(LIBCURSES) 71 | 72 | clean: 73 | -rm -f *.o 74 | -rm -f *.exe 75 | -rm -f $(CLEAN) 76 | 77 | demos: $(DEMOS) 78 | strip *.exe 79 | 80 | $(DEFFILE): $(DEFDEPS) 81 | echo LIBRARY pdcurses > $@ 82 | echo EXPORTS >> $@ 83 | cat $(BASEDEF) >> $@ 84 | ifeq ($(WIDE),Y) 85 | cat $(WIDEDEF) >> $@ 86 | endif 87 | 88 | $(LIBCURSES) : $(LIBDEPS) 89 | $(LIBEXE) $(LIBFLAGS) $@ $? 90 | -cp pdcurses.a panel.a 91 | 92 | $(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS) 93 | $(PDCOBJS) : $(PDCURSES_WIN_H) 94 | $(DEMOS) : $(PDCURSES_CURSES_H) $(LIBCURSES) 95 | panel.o : $(PANEL_HEADER) 96 | terminfo.o: $(TERM_HEADER) 97 | 98 | $(LIBOBJS) : %.o: $(srcdir)/%.c 99 | $(CC) -c $(CFLAGS) $< 100 | 101 | $(PDCOBJS) : %.o: $(osdir)/%.c 102 | $(CC) -c $(CFLAGS) $< 103 | 104 | firework.exe newdemo.exe rain.exe testcurs.exe worm.exe xmas.exe \ 105 | ptest.exe: %.exe: $(demodir)/%.c 106 | $(CC) $(CFLAGS) -o$@ $< $(LIBCURSES) 107 | 108 | tuidemo.exe: tuidemo.o tui.o 109 | $(LINK) $(LDFLAGS) -o$@ tuidemo.o tui.o $(LIBCURSES) 110 | 111 | tui.o: $(demodir)/tui.c $(demodir)/tui.h $(PDCURSES_CURSES_H) 112 | $(CC) -c $(CFLAGS) -I$(demodir) -o$@ $< 113 | 114 | tuidemo.o: $(demodir)/tuidemo.c $(PDCURSES_CURSES_H) 115 | $(CC) -c $(CFLAGS) -I$(demodir) -o$@ $< 116 | 117 | dist: $(PDCLIBS) 118 | echo PDCurses $(VERDOT) for Cygnus Win32 > file_id.diz 119 | echo ------------------------------------------ >> file_id.diz 120 | echo Public Domain Curses library for >> file_id.diz 121 | echo Cygnus GCC for Win32. >> file_id.diz 122 | echo Source available in PDCURS$(VER).ZIP >> file_id.diz 123 | echo Public Domain. >> file_id.diz 124 | zip -9jX pdc$(VER)_cyg_w32 \ 125 | $(PDCURSES_SRCDIR)/README $(PDCURSES_SRCDIR)/HISTORY \ 126 | $(PDCURSES_SRCDIR)/curses.h $(PDCURSES_SRCDIR)/panel.h \ 127 | $(LIBCURSES) $(LIBPANEL) file_id.diz 128 | rm file_id.diz 129 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/win32/mingwin32.mak: -------------------------------------------------------------------------------- 1 | # GNU MAKE Makefile for PDCurses library - WIN32 MinGW GCC 2 | # 3 | # Usage: make -f [path\]mingwin32.mak [DEBUG=Y] [DLL=Y] [WIDE=Y] [UTF8=Y] [tgt] 4 | # 5 | # where tgt can be any of: 6 | # [all|demos|pdcurses.a|testcurs.exe...] 7 | 8 | O = o 9 | 10 | ifndef PDCURSES_SRCDIR 11 | PDCURSES_SRCDIR = .. 12 | endif 13 | 14 | include $(PDCURSES_SRCDIR)/version.mif 15 | include $(PDCURSES_SRCDIR)/libobjs.mif 16 | 17 | osdir = $(PDCURSES_SRCDIR)/win32 18 | 19 | PDCURSES_WIN_H = $(osdir)/pdcwin.h 20 | 21 | CC = gcc 22 | 23 | ifeq ($(DEBUG),Y) 24 | CFLAGS = -g -Wall -DPDCDEBUG 25 | LDFLAGS = -g 26 | else 27 | CFLAGS = -O2 -Wall 28 | LDFLAGS = 29 | endif 30 | 31 | CFLAGS += -I$(PDCURSES_SRCDIR) 32 | 33 | BASEDEF = $(PDCURSES_SRCDIR)\exp-base.def 34 | WIDEDEF = $(PDCURSES_SRCDIR)\exp-wide.def 35 | 36 | DEFDEPS = $(BASEDEF) 37 | 38 | ifeq ($(WIDE),Y) 39 | CFLAGS += -DPDC_WIDE 40 | DEFDEPS += $(WIDEDEF) 41 | endif 42 | 43 | ifeq ($(UTF8),Y) 44 | CFLAGS += -DPDC_FORCE_UTF8 45 | endif 46 | 47 | DEFFILE = pdcurses.def 48 | 49 | LINK = gcc 50 | 51 | ifeq ($(DLL),Y) 52 | CFLAGS += -DPDC_DLL_BUILD 53 | LIBEXE = gcc $(DEFFILE) 54 | LIBFLAGS = -Wl,--out-implib,pdcurses.a -shared -o 55 | LIBCURSES = pdcurses.dll 56 | LIBDEPS = $(LIBOBJS) $(PDCOBJS) $(DEFFILE) 57 | CLEAN = $(LIBCURSES) *.a $(DEFFILE) 58 | else 59 | LIBEXE = ar 60 | LIBFLAGS = rcv 61 | LIBCURSES = pdcurses.a 62 | LIBDEPS = $(LIBOBJS) $(PDCOBJS) 63 | CLEAN = *.a 64 | endif 65 | 66 | .PHONY: all libs clean demos dist 67 | 68 | all: libs demos 69 | 70 | libs: $(LIBCURSES) 71 | 72 | clean: 73 | -del *.o 74 | -del *.exe 75 | -del $(CLEAN) 76 | 77 | demos: $(DEMOS) 78 | strip *.exe 79 | 80 | $(DEFFILE): $(DEFDEPS) 81 | echo LIBRARY pdcurses > $@ 82 | echo EXPORTS >> $@ 83 | type $(BASEDEF) >> $@ 84 | ifeq ($(WIDE),Y) 85 | type $(WIDEDEF) >> $@ 86 | endif 87 | 88 | $(LIBCURSES) : $(LIBDEPS) 89 | $(LIBEXE) $(LIBFLAGS) $@ $? 90 | -copy pdcurses.a panel.a 91 | 92 | $(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS) 93 | $(PDCOBJS) : $(PDCURSES_WIN_H) 94 | $(DEMOS) : $(PDCURSES_CURSES_H) $(LIBCURSES) 95 | panel.o : $(PANEL_HEADER) 96 | terminfo.o: $(TERM_HEADER) 97 | 98 | $(LIBOBJS) : %.o: $(srcdir)/%.c 99 | $(CC) -c $(CFLAGS) $< 100 | 101 | $(PDCOBJS) : %.o: $(osdir)/%.c 102 | $(CC) -c $(CFLAGS) $< 103 | 104 | firework.exe newdemo.exe rain.exe testcurs.exe worm.exe xmas.exe \ 105 | ptest.exe: %.exe: $(demodir)/%.c 106 | $(CC) $(CFLAGS) -o$@ $< $(LIBCURSES) 107 | 108 | tuidemo.exe: tuidemo.o tui.o 109 | $(LINK) $(LDFLAGS) -o$@ tuidemo.o tui.o $(LIBCURSES) 110 | 111 | tui.o: $(demodir)/tui.c $(demodir)/tui.h $(PDCURSES_CURSES_H) 112 | $(CC) -c $(CFLAGS) -I$(demodir) -o$@ $< 113 | 114 | tuidemo.o: $(demodir)/tuidemo.c $(PDCURSES_CURSES_H) 115 | $(CC) -c $(CFLAGS) -I$(demodir) -o$@ $< 116 | 117 | PLATFORM1 = MinGW Win32 118 | PLATFORM2 = MinGW for Win32 119 | ARCNAME = pdc$(VER)_ming_w32 120 | 121 | include $(PDCURSES_SRCDIR)/makedist.mif 122 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/win32/pdcdisp.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcwin.h" 4 | 5 | RCSID("$Id: pdcdisp.c,v 1.47 2008/07/14 04:24:52 wmcbrine Exp $") 6 | 7 | #include 8 | #include 9 | 10 | #ifdef CHTYPE_LONG 11 | 12 | # define A(x) ((chtype)x | A_ALTCHARSET) 13 | 14 | chtype acs_map[128] = 15 | { 16 | A(0), A(1), A(2), A(3), A(4), A(5), A(6), A(7), A(8), A(9), A(10), 17 | A(11), A(12), A(13), A(14), A(15), A(16), A(17), A(18), A(19), 18 | A(20), A(21), A(22), A(23), A(24), A(25), A(26), A(27), A(28), 19 | A(29), A(30), A(31), ' ', '!', '"', '#', '$', '%', '&', '\'', '(', 20 | ')', '*', 21 | 22 | # ifdef PDC_WIDE 23 | 0x2192, 0x2190, 0x2191, 0x2193, 24 | # else 25 | A(0x1a), A(0x1b), A(0x18), A(0x19), 26 | # endif 27 | 28 | '/', 29 | 30 | # ifdef PDC_WIDE 31 | 0x2588, 32 | # else 33 | 0xdb, 34 | # endif 35 | 36 | '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', 37 | '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 38 | 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 39 | 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', 40 | 41 | # ifdef PDC_WIDE 42 | 0x2666, 0x2592, 43 | # else 44 | A(0x04), 0xb1, 45 | # endif 46 | 47 | 'b', 'c', 'd', 'e', 48 | 49 | # ifdef PDC_WIDE 50 | 0x00b0, 0x00b1, 0x2591, 0x00a4, 0x2518, 0x2510, 0x250c, 0x2514, 51 | 0x253c, 0x23ba, 0x23bb, 0x2500, 0x23bc, 0x23bd, 0x251c, 0x2524, 52 | 0x2534, 0x252c, 0x2502, 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3, 53 | 0x00b7, 54 | # else 55 | 0xf8, 0xf1, 0xb0, A(0x0f), 0xd9, 0xbf, 0xda, 0xc0, 0xc5, 0x2d, 0x2d, 56 | 0xc4, 0x2d, 0x5f, 0xc3, 0xb4, 0xc1, 0xc2, 0xb3, 0xf3, 0xf2, 0xe3, 57 | 0xd8, 0x9c, 0xf9, 58 | # endif 59 | 60 | A(127) 61 | }; 62 | 63 | # undef A 64 | 65 | #endif 66 | 67 | /* position hardware cursor at (y, x) */ 68 | 69 | void PDC_gotoyx(int row, int col) 70 | { 71 | COORD coord; 72 | 73 | PDC_LOG(("PDC_gotoyx() - called: row %d col %d from row %d col %d\n", 74 | row, col, SP->cursrow, SP->curscol)); 75 | 76 | coord.X = col; 77 | coord.Y = row; 78 | 79 | SetConsoleCursorPosition(pdc_con_out, coord); 80 | } 81 | 82 | /* update the given physical line to look like the corresponding line in 83 | curscr */ 84 | 85 | void PDC_transform_line(int lineno, int x, int len, const chtype *srcp) 86 | { 87 | CHAR_INFO ci[512]; 88 | int j; 89 | COORD bufSize, bufPos; 90 | SMALL_RECT sr; 91 | 92 | PDC_LOG(("PDC_transform_line() - called: lineno=%d\n", lineno)); 93 | 94 | bufPos.X = bufPos.Y = 0; 95 | 96 | bufSize.X = len; 97 | bufSize.Y = 1; 98 | 99 | sr.Top = lineno; 100 | sr.Bottom = lineno; 101 | sr.Left = x; 102 | sr.Right = x + len - 1; 103 | 104 | for (j = 0; j < len; j++) 105 | { 106 | chtype ch = srcp[j]; 107 | 108 | ci[j].Attributes = pdc_atrtab[ch >> PDC_ATTR_SHIFT]; 109 | #ifdef CHTYPE_LONG 110 | if (ch & A_ALTCHARSET && !(ch & 0xff80)) 111 | ch = acs_map[ch & 0x7f]; 112 | #endif 113 | ci[j].Char.UnicodeChar = ch & A_CHARTEXT; 114 | } 115 | 116 | WriteConsoleOutput(pdc_con_out, ci, bufSize, bufPos, &sr); 117 | } 118 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/win32/pdcgetsc.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcwin.h" 4 | 5 | RCSID("$Id: pdcgetsc.c,v 1.36 2008/07/14 04:24:52 wmcbrine Exp $") 6 | 7 | /* get the cursor size/shape */ 8 | 9 | int PDC_get_cursor_mode(void) 10 | { 11 | CONSOLE_CURSOR_INFO ci; 12 | 13 | PDC_LOG(("PDC_get_cursor_mode() - called\n")); 14 | 15 | GetConsoleCursorInfo(pdc_con_out, &ci); 16 | 17 | return ci.dwSize; 18 | } 19 | 20 | /* return number of screen rows */ 21 | 22 | int PDC_get_rows(void) 23 | { 24 | CONSOLE_SCREEN_BUFFER_INFO scr; 25 | 26 | PDC_LOG(("PDC_get_rows() - called\n")); 27 | 28 | GetConsoleScreenBufferInfo(pdc_con_out, &scr); 29 | 30 | return scr.srWindow.Bottom - scr.srWindow.Top + 1; 31 | } 32 | 33 | /* return number of buffer rows */ 34 | 35 | int PDC_get_buffer_rows(void) 36 | { 37 | CONSOLE_SCREEN_BUFFER_INFO scr; 38 | 39 | PDC_LOG(("PDC_get_buffer_rows() - called\n")); 40 | 41 | GetConsoleScreenBufferInfo(pdc_con_out, &scr); 42 | 43 | return scr.dwSize.Y; 44 | } 45 | 46 | /* return width of screen/viewport */ 47 | 48 | int PDC_get_columns(void) 49 | { 50 | CONSOLE_SCREEN_BUFFER_INFO scr; 51 | 52 | PDC_LOG(("PDC_get_columns() - called\n")); 53 | 54 | GetConsoleScreenBufferInfo(pdc_con_out, &scr); 55 | 56 | return scr.srWindow.Right - scr.srWindow.Left + 1; 57 | } 58 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/win32/pdcsetsc.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcwin.h" 4 | 5 | RCSID("$Id: pdcsetsc.c,v 1.40 2008/07/14 04:24:52 wmcbrine Exp $") 6 | 7 | /*man-start************************************************************** 8 | 9 | Name: pdcsetsc 10 | 11 | Synopsis: 12 | int PDC_set_blink(bool blinkon); 13 | void PDC_set_title(const char *title); 14 | 15 | Description: 16 | PDC_set_blink() toggles whether the A_BLINK attribute sets an 17 | actual blink mode (TRUE), or sets the background color to high 18 | intensity (FALSE). The default is platform-dependent (FALSE in 19 | most cases). It returns OK if it could set the state to match 20 | the given parameter, ERR otherwise. Current platforms also 21 | adjust the value of COLORS according to this function -- 16 for 22 | FALSE, and 8 for TRUE. 23 | 24 | PDC_set_title() sets the title of the window in which the curses 25 | program is running. This function may not do anything on some 26 | platforms. (Currently it only works in Win32 and X11.) 27 | 28 | Portability X/Open BSD SYS V 29 | PDC_set_blink - - - 30 | PDC_set_title - - - 31 | 32 | **man-end****************************************************************/ 33 | 34 | int PDC_curs_set(int visibility) 35 | { 36 | CONSOLE_CURSOR_INFO cci; 37 | int ret_vis; 38 | 39 | PDC_LOG(("PDC_curs_set() - called: visibility=%d\n", visibility)); 40 | 41 | ret_vis = SP->visibility; 42 | 43 | if (GetConsoleCursorInfo(pdc_con_out, &cci) == FALSE) 44 | return ERR; 45 | 46 | switch(visibility) 47 | { 48 | case 0: /* invisible */ 49 | cci.bVisible = FALSE; 50 | break; 51 | case 2: /* highly visible */ 52 | cci.bVisible = TRUE; 53 | cci.dwSize = 95; 54 | break; 55 | default: /* normal visibility */ 56 | cci.bVisible = TRUE; 57 | cci.dwSize = SP->orig_cursor; 58 | break; 59 | } 60 | 61 | if (SetConsoleCursorInfo(pdc_con_out, &cci) == FALSE) 62 | return ERR; 63 | 64 | SP->visibility = visibility; 65 | return ret_vis; 66 | } 67 | 68 | void PDC_set_title(const char *title) 69 | { 70 | #ifdef PDC_WIDE 71 | wchar_t wtitle[512]; 72 | #endif 73 | PDC_LOG(("PDC_set_title() - called:<%s>\n", title)); 74 | 75 | #ifdef PDC_WIDE 76 | PDC_mbstowcs(wtitle, title, 511); 77 | SetConsoleTitleW(wtitle); 78 | #else 79 | SetConsoleTitleA(title); 80 | #endif 81 | } 82 | 83 | int PDC_set_blink(bool blinkon) 84 | { 85 | if (pdc_color_started) 86 | COLORS = 16; 87 | 88 | return blinkon ? ERR : OK; 89 | } 90 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/win32/pdcurses.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/kconfig-frontends/b351923f4a6b1ae87bd5b222a349d74e68803f1f/libs/pdcurses-3.4/win32/pdcurses.ico -------------------------------------------------------------------------------- /libs/pdcurses-3.4/win32/pdcurses.rc: -------------------------------------------------------------------------------- 1 | #include "winver.h" 2 | 3 | 1 VERSIONINFO 4 | FILEVERSION 3,4,0,0 5 | PRODUCTVERSION 3,4,0,0 6 | FILEFLAGSMASK 0x3fL 7 | FILEFLAGS 0x0L 8 | FILEOS VOS_UNKNOWN 9 | FILETYPE VFT_DLL 10 | FILESUBTYPE 0x0L 11 | BEGIN 12 | BLOCK "StringFileInfo" 13 | BEGIN 14 | BLOCK "040904b0" 15 | BEGIN 16 | VALUE "Maintainer", "William McBrine\0" 17 | VALUE "FileDescription", "Public Domain Curses\0" 18 | VALUE "FileVersion", "3.4.0\0" 19 | VALUE "InternalName", "PDCurses\0" 20 | VALUE "LegalCopyright", "Public Domain\0" 21 | VALUE "OriginalFilename", "PDCURSES.DLL\0" 22 | VALUE "ProductName", "Public Domain Curses Library\0" 23 | VALUE "ProductVersion", "3.4.0\0" 24 | END 25 | END 26 | END 27 | 28 | 1 ICON DISCARDABLE "PDCURSES.ico" 29 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/win32/pdcutil.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcwin.h" 4 | 5 | RCSID("$Id: pdcutil.c,v 1.14 2008/07/14 04:24:52 wmcbrine Exp $") 6 | 7 | void PDC_beep(void) 8 | { 9 | PDC_LOG(("PDC_beep() - called\n")); 10 | 11 | /* MessageBeep(MB_OK); */ 12 | MessageBeep(0XFFFFFFFF); 13 | } 14 | 15 | void PDC_napms(int ms) 16 | { 17 | PDC_LOG(("PDC_napms() - called: ms=%d\n", ms)); 18 | 19 | Sleep(ms); 20 | } 21 | 22 | const char *PDC_sysname(void) 23 | { 24 | return "Win32"; 25 | } 26 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/win32/pdcwin.h: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | /* $Id: pdcwin.h,v 1.6 2008/07/13 06:36:32 wmcbrine Exp $ */ 4 | 5 | #ifdef PDC_WIDE 6 | # define UNICODE 7 | #endif 8 | 9 | #include 10 | #undef MOUSE_MOVED 11 | #include 12 | 13 | extern unsigned char *pdc_atrtab; 14 | extern HANDLE pdc_con_out, pdc_con_in; 15 | extern DWORD pdc_quick_edit; 16 | 17 | extern int PDC_get_buffer_rows(void); 18 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/win32/vcwin32.mak: -------------------------------------------------------------------------------- 1 | # Visual C++ NMakefile for PDCurses library - Win32 VC++ 2.0+ 2 | # 3 | # Usage: nmake -f [path\]vcwin32.mak [DEBUG=] [DLL=] [WIDE=] [UTF8=] [target] 4 | # 5 | # where target can be any of: 6 | # [all|demos|pdcurses.lib|testcurs.exe...] 7 | 8 | O = obj 9 | 10 | !ifndef PDCURSES_SRCDIR 11 | PDCURSES_SRCDIR = .. 12 | !endif 13 | 14 | !include $(PDCURSES_SRCDIR)\version.mif 15 | !include $(PDCURSES_SRCDIR)\libobjs.mif 16 | 17 | osdir = $(PDCURSES_SRCDIR)\win32 18 | 19 | PDCURSES_WIN_H = $(osdir)\pdcwin.h 20 | 21 | CC = cl.exe -nologo 22 | 23 | !ifdef DEBUG 24 | CFLAGS = -Z7 -DPDCDEBUG 25 | LDFLAGS = -debug -pdb:none 26 | !else 27 | CFLAGS = -O1 28 | LDFLAGS = 29 | !endif 30 | 31 | BASEDEF = $(PDCURSES_SRCDIR)\exp-base.def 32 | WIDEDEF = $(PDCURSES_SRCDIR)\exp-wide.def 33 | 34 | DEFDEPS = $(BASEDEF) 35 | 36 | !ifdef WIDE 37 | WIDEOPT = -DPDC_WIDE 38 | DEFDEPS = $(DEFDEPS) $(WIDEDEF) 39 | !endif 40 | 41 | !ifdef UTF8 42 | UTF8OPT = -DPDC_FORCE_UTF8 43 | !endif 44 | 45 | DEFFILE = pdcurses.def 46 | SHL_LD = link $(LDFLAGS) /NOLOGO /DLL /OUT:pdcurses.dll /DEF:$(DEFFILE) 47 | 48 | LINK = link.exe -nologo 49 | 50 | CCLIBS = user32.lib advapi32.lib 51 | # may need to add msvcrt.lib for VC 2.x, VC 5.0 doesn't want it 52 | #CCLIBS = msvcrt.lib user32.lib advapi32.lib 53 | 54 | LIBEXE = lib -nologo 55 | 56 | LIBCURSES = pdcurses.lib 57 | CURSESDLL = pdcurses.dll 58 | 59 | !ifdef DLL 60 | DLLOPT = -DPDC_DLL_BUILD 61 | PDCLIBS = $(CURSESDLL) 62 | !else 63 | PDCLIBS = $(LIBCURSES) 64 | !endif 65 | 66 | BUILD = $(CC) -I$(PDCURSES_SRCDIR) -c $(CFLAGS) $(DLLOPT) \ 67 | $(WIDEOPT) $(UTF8OPT) 68 | 69 | all: $(PDCLIBS) $(DEMOS) 70 | 71 | clean: 72 | -del *.obj 73 | -del *.lib 74 | -del *.exe 75 | -del *.dll 76 | -del *.exp 77 | -del *.res 78 | -del *.def 79 | 80 | DEMOOBJS = $(DEMOS:.exe=.obj) tui.obj 81 | 82 | $(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS) 83 | $(PDCOBJS) : $(PDCURSES_WIN_H) 84 | $(DEMOOBJS) : $(PDCURSES_CURSES_H) 85 | $(DEMOS) : $(LIBCURSES) 86 | panel.obj : $(PANEL_HEADER) 87 | terminfo.obj: $(TERM_HEADER) 88 | 89 | !ifndef DLL 90 | $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS) 91 | $(LIBEXE) -out:$@ $(LIBOBJS) $(PDCOBJS) 92 | -copy $(LIBCURSES) panel.lib 93 | !endif 94 | 95 | $(DEFFILE) : $(DEFDEPS) 96 | echo LIBRARY pdcurses > $(DEFFILE) 97 | echo EXPORTS >> $(DEFFILE) 98 | type $(BASEDEF) >> $(DEFFILE) 99 | !ifdef WIDE 100 | type $(WIDEDEF) >> $(DEFFILE) 101 | !endif 102 | 103 | $(CURSESDLL) : $(LIBOBJS) $(PDCOBJS) $(DEFFILE) pdcurses.obj 104 | $(SHL_LD) $(LIBOBJS) $(PDCOBJS) pdcurses.obj $(CCLIBS) 105 | -copy $(LIBCURSES) panel.lib 106 | 107 | pdcurses.res pdcurses.obj: $(osdir)\pdcurses.rc $(osdir)\pdcurses.ico 108 | rc /r /fopdcurses.res $(osdir)\pdcurses.rc 109 | cvtres /MACHINE:IX86 /NOLOGO /OUT:pdcurses.obj pdcurses.res 110 | 111 | {$(srcdir)\}.c{}.obj:: 112 | $(BUILD) $< 113 | 114 | {$(osdir)\}.c{}.obj:: 115 | $(BUILD) $< 116 | 117 | {$(demodir)\}.c{}.obj:: 118 | $(BUILD) $< 119 | 120 | .obj.exe: 121 | $(LINK) $(LDFLAGS) $< $(LIBCURSES) $(CCLIBS) 122 | 123 | tuidemo.exe: tuidemo.obj tui.obj 124 | $(LINK) $(LDFLAGS) $*.obj tui.obj $(LIBCURSES) $(CCLIBS) 125 | 126 | tui.obj: $(demodir)\tui.c $(demodir)\tui.h 127 | $(BUILD) -I$(demodir) $(demodir)\tui.c 128 | 129 | tuidemo.obj: $(demodir)\tuidemo.c 130 | $(BUILD) -I$(demodir) $(demodir)\tuidemo.c 131 | 132 | PLATFORM1 = Visual C++ 133 | PLATFORM2 = Microsoft Visual C/C++ for Win32 134 | ARCNAME = pdc$(VER)_vc_w32 135 | 136 | !include $(PDCURSES_SRCDIR)\makedist.mif 137 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/win32/wccwin32.mak: -------------------------------------------------------------------------------- 1 | # Watcom WMAKE Makefile for PDCurses library - Win32 Watcom C/C++ 10.6+ 2 | # 3 | # Usage: wmake -f [win32\]wccwin32.mak [DEBUG=Y] [WIDE=Y] [UTF8=Y] [target] 4 | # 5 | # where target can be any of: 6 | # [all|demos|pdcurses.lib|testcurs.exe...] 7 | 8 | !ifdef %PDCURSES_SRCDIR 9 | PDCURSES_SRCDIR = $(%PDCURSES_SRCDIR) 10 | !else 11 | PDCURSES_SRCDIR = .. 12 | !endif 13 | 14 | !include $(PDCURSES_SRCDIR)\version.mif 15 | 16 | osdir = $(PDCURSES_SRCDIR)\win32 17 | 18 | CC = wcc386 19 | TARGET = nt 20 | 21 | CFLAGS = /ei /zq /wx /i=$(PDCURSES_SRCDIR) 22 | 23 | !ifeq DEBUG Y 24 | CFLAGS += /d2 /DPDCDEBUG 25 | LDFLAGS = D W A op q sys $(TARGET) 26 | !else 27 | CFLAGS += /oneatx 28 | LDFLAGS = op q sys $(TARGET) 29 | !endif 30 | 31 | !ifeq WIDE Y 32 | CFLAGS += /DPDC_WIDE 33 | !endif 34 | 35 | !ifeq UTF8 Y 36 | CFLAGS += /DPDC_FORCE_UTF8 37 | !endif 38 | 39 | LIBEXE = wlib /q /n /t 40 | 41 | !include $(PDCURSES_SRCDIR)\watcom.mif 42 | 43 | $(LIBCURSES) : $(LIBOBJS) $(PDCOBJS) 44 | $(LIBEXE) $@ $(LIBOBJS) $(PDCOBJS) 45 | -copy $(LIBCURSES) panel.lib 46 | 47 | PLATFORM1 = Watcom C++ Win32 48 | PLATFORM2 = Open Watcom 1.6 for Win32 49 | ARCNAME = pdc$(VER)_wcc_w32 50 | 51 | !include $(PDCURSES_SRCDIR)\makedist.mif 52 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/x11/README: -------------------------------------------------------------------------------- 1 | PDCurses for X11 2 | ================ 3 | 4 | This is a port of PDCurses for X11, aka XCurses. It is designed to 5 | allow existing curses programs to be re-compiled with PDCurses, 6 | resulting in native X11 programs. 7 | 8 | 9 | Building 10 | -------- 11 | 12 | . Run "./configure" in the top-level directory. 13 | 14 | To build the wide-character version of the library, specify 15 | "--enable-widec" as a parameter. To use X Input Methods, add 16 | "--enable-xim". I recommend these options, but I haven't yet made 17 | them the defaults, for the sake of backwards compatibility and due to 18 | their new and relatively untested status. 19 | 20 | If your system is lacking in UTF-8 support, you can force the use of 21 | UTF-8 instead of the system locale via "--enable-force-utf8". This is 22 | generally more useful in Windows. 23 | 24 | If configure can't find your X include files or X libraries, you can 25 | specify the paths with the arguments "--x-includes=inc_path" and/or 26 | "--x-libraries=lib_path". 27 | 28 | By default, the library and demo programs are built with the optimizer 29 | switch -O2. You can turn this off, and turn on debugging (-g), by 30 | adding "--with-debug" to the configure command. 31 | 32 | . Run "make". This should build libXCurses and all the demo programs. 33 | 34 | . Optionally, run "make install". curses.h and panel.h will be renamed 35 | when installed (to xcurses.h and xpanel.h), to avoid conflicts with 36 | any existing curses installations. Unrenamed copies of curses.h and 37 | panel.h are installed in (by default) /usr/local/include/xcurses. 38 | 39 | libXpanel is just a symlink to libXCurses. Both curses and panel 40 | functions are in the main library. 41 | 42 | 43 | Distribution Status 44 | ------------------- 45 | 46 | As of April 13, 2006, the files in this directory are released to the 47 | Public Domain, except for ScrollBox*, which are under essentially the 48 | MIT X License. 49 | 50 | 51 | To be Done 52 | ---------- 53 | 54 | - have newterm() create a new X window 55 | 56 | - provide a command line parsing function to enable X command line 57 | arguments to be parsed and stripped from the arguments passed back 58 | to the calling procedure. 59 | 60 | 61 | Acknowledgements 62 | ---------------- 63 | 64 | X11 port was provided by Mark Hessling 65 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/x11/ScrollBox.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1989 O'Reilly and Associates, Inc. 3 | 4 | The X Consortium, and any party obtaining a copy of these files from 5 | the X Consortium, directly or indirectly, is granted, free of charge, a 6 | full and unrestricted irrevocable, world-wide, paid up, royalty-free, 7 | nonexclusive right and license to deal in this software and 8 | documentation files (the "Software"), including without limitation the 9 | rights to use, copy, modify, merge, publish, distribute, sublicense, 10 | and/or sell copies of the Software, and to permit persons who receive 11 | copies from any such party to do so. This license includes without 12 | limitation a license to do the foregoing actions under any patents of 13 | the party supplying this software to the X Consortium. 14 | 15 | $Id: ScrollBox.h,v 1.4 2008/07/14 04:24:52 wmcbrine Exp $ 16 | */ 17 | 18 | #ifndef _XORAscrollBox_h 19 | #define _XORAscrollBox_h 20 | 21 | /************************************************************************ 22 | * * 23 | * scrollBox Widget (subclass of CompositeClass) * 24 | * * 25 | ************************************************************************/ 26 | 27 | /* Parameters: 28 | 29 | Name Class RepType Default Value 30 | ---- ----- ------- ------------- 31 | background Background Pixel XtDefaultBackground 32 | border BorderColor Pixel XtDefaultForeground 33 | borderWidth BorderWidth Dimension 1 34 | destroyCallback Callback Pointer NULL 35 | hSpace HSpace Dimension 4 36 | height Height Dimension 0 37 | mappedWhenManaged MappedWhenManaged Boolean True 38 | vSpace VSpace Dimension 4 39 | width Width Dimension 0 40 | x Position Position 0 41 | y Position Position 0 42 | 43 | */ 44 | 45 | 46 | /* Class record constants */ 47 | 48 | extern WidgetClass scrollBoxWidgetClass; 49 | 50 | typedef struct _ScrollBoxClassRec *ScrollBoxWidgetClass; 51 | typedef struct _ScrollBoxRec *ScrollBoxWidget; 52 | 53 | #endif /* _XORAscrollBox_h */ 54 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/x11/ScrollBoxP.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 1989 O'Reilly and Associates, Inc. 3 | 4 | The X Consortium, and any party obtaining a copy of these files from 5 | the X Consortium, directly or indirectly, is granted, free of charge, a 6 | full and unrestricted irrevocable, world-wide, paid up, royalty-free, 7 | nonexclusive right and license to deal in this software and 8 | documentation files (the "Software"), including without limitation the 9 | rights to use, copy, modify, merge, publish, distribute, sublicense, 10 | and/or sell copies of the Software, and to permit persons who receive 11 | copies from any such party to do so. This license includes without 12 | limitation a license to do the foregoing actions under any patents of 13 | the party supplying this software to the X Consortium. 14 | 15 | $Id: ScrollBoxP.h,v 1.5 2008/07/14 04:24:52 wmcbrine Exp $ 16 | */ 17 | 18 | /* 19 | * scrollBoxP.h - Private definitions for scrollBox widget 20 | * 21 | */ 22 | 23 | #ifndef _XORAscrollBoxP_h 24 | #define _XORAscrollBoxP_h 25 | 26 | /************************************************************************ 27 | * * 28 | * scrollBox Widget Private Data * 29 | * * 30 | ************************************************************************/ 31 | 32 | #include "x11/ScrollBox.h" 33 | 34 | #include 35 | 36 | /* New fields for the scrollBox widget class record */ 37 | typedef struct _ScrollBoxClass { 38 | int empty; 39 | } ScrollBoxClassPart; 40 | 41 | /* Full class record declaration */ 42 | typedef struct _ScrollBoxClassRec { 43 | CoreClassPart core_class; 44 | CompositeClassPart composite_class; 45 | ScrollBoxClassPart scrollBox_class; 46 | } ScrollBoxClassRec; 47 | 48 | extern ScrollBoxClassRec scrollBoxClassRec; 49 | 50 | /* New fields for the scrollBox widget record */ 51 | typedef struct { 52 | Dimension h_space, v_space; 53 | Dimension preferred_width, preferred_height; 54 | Dimension last_query_width, last_query_height; 55 | Dimension increment_width, increment_height; 56 | XtGeometryMask last_query_mode; 57 | } ScrollBoxPart; 58 | 59 | 60 | /************************************************************************ 61 | * * 62 | * Full instance record declaration * 63 | * * 64 | ************************************************************************/ 65 | 66 | typedef struct _ScrollBoxRec { 67 | CorePart core; 68 | CompositePart composite; 69 | ScrollBoxPart scrollBox; 70 | } ScrollBoxRec; 71 | 72 | #endif /* _XORAscrollBoxP_h */ 73 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/x11/big_icon.xbm: -------------------------------------------------------------------------------- 1 | #define big_icon_width 64 2 | #define big_icon_height 64 3 | static unsigned char big_icon_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 5 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 6 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 7 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 8 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 9 | 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xc1, 0x03, 0x00, 0x00, 10 | 0x00, 0x00, 0xf0, 0xff, 0xc3, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 11 | 0xc3, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xc0, 0xc7, 0x03, 0x00, 0x00, 12 | 0x00, 0x00, 0xf0, 0x80, 0xc7, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x80, 13 | 0xc7, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x80, 0xc7, 0x03, 0x00, 0x00, 14 | 0x00, 0x00, 0xf0, 0x80, 0xc7, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xc0, 15 | 0xc7, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xe0, 0xc3, 0x03, 0x00, 0x00, 16 | 0x00, 0x00, 0xf0, 0xf0, 0xe3, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf8, 17 | 0xf1, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xfc, 0xf8, 0x03, 0x00, 0x00, 18 | 0x00, 0x00, 0xf0, 0x7e, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 19 | 0xfe, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0xff, 0x03, 0x00, 0x00, 20 | 0x00, 0x00, 0xf0, 0x8f, 0xdf, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xc7, 21 | 0xcf, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xe3, 0xc7, 0x03, 0x00, 0x00, 22 | 0x00, 0x00, 0xf0, 0xf1, 0xc3, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 23 | 0xc1, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf8, 0xc0, 0x03, 0x00, 0x00, 24 | 0x00, 0x00, 0xf0, 0x78, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x78, 25 | 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x78, 0xc0, 0x03, 0x00, 0x00, 26 | 0x00, 0x00, 0xf0, 0x78, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf8, 27 | 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf0, 0xff, 0x03, 0x00, 0x00, 28 | 0x00, 0x00, 0xf0, 0xf0, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xe0, 29 | 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xc0, 0xff, 0x03, 0x00, 0x00, 30 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 31 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 32 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x23, 0x50, 0x1e, 33 | 0x7c, 0xf0, 0xe0, 0x03, 0x60, 0x26, 0x50, 0x33, 0xc6, 0x98, 0x31, 0x06, 34 | 0x30, 0x2c, 0xd0, 0x61, 0x83, 0x0d, 0x1b, 0x0c, 0x10, 0x28, 0xd0, 0x40, 35 | 0x01, 0x05, 0x0a, 0x08, 0x10, 0x20, 0x50, 0x00, 0x01, 0x05, 0x0a, 0x08, 36 | 0x10, 0x20, 0x50, 0x00, 0x03, 0x04, 0x1a, 0x00, 0x10, 0x20, 0x50, 0x00, 37 | 0x06, 0x04, 0x32, 0x00, 0x10, 0x20, 0x50, 0x00, 0x7c, 0xfc, 0xe3, 0x03, 38 | 0x10, 0x20, 0x50, 0x00, 0xc0, 0x04, 0x00, 0x06, 0x10, 0x20, 0x50, 0x00, 39 | 0x80, 0x05, 0x00, 0x0c, 0x10, 0x20, 0x50, 0x00, 0x01, 0x05, 0x0a, 0x08, 40 | 0x10, 0x28, 0x50, 0x00, 0x01, 0x05, 0x0a, 0x08, 0x30, 0x6c, 0x58, 0x00, 41 | 0x83, 0x0d, 0x1b, 0x0c, 0x60, 0xc6, 0x4c, 0x00, 0xc6, 0x98, 0x31, 0x06, 42 | 0xc0, 0x83, 0x47, 0x00, 0x7c, 0xf0, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 43 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 45 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 47 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/x11/little_icon.xbm: -------------------------------------------------------------------------------- 1 | #define little_icon_width 32 2 | #define little_icon_height 32 3 | static unsigned char little_icon_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 5 | 0x00, 0xfc, 0x30, 0x00, 0x00, 0xfc, 0x31, 0x00, 0x00, 0x8c, 0x33, 0x00, 6 | 0x00, 0x0c, 0x33, 0x00, 0x00, 0x0c, 0x33, 0x00, 0x00, 0x8c, 0x33, 0x00, 7 | 0x00, 0xcc, 0x39, 0x00, 0x00, 0xec, 0x3c, 0x00, 0x00, 0x7c, 0x3e, 0x00, 8 | 0x00, 0x3c, 0x37, 0x00, 0x00, 0x9c, 0x33, 0x00, 0x00, 0xcc, 0x31, 0x00, 9 | 0x00, 0xcc, 0x30, 0x00, 0x00, 0xcc, 0x30, 0x00, 0x00, 0xcc, 0x31, 0x00, 10 | 0x00, 0x8c, 0x3f, 0x00, 0x00, 0x0c, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 11 | 0x00, 0x00, 0x00, 0x00, 0x4c, 0x2a, 0xc6, 0x18, 0x52, 0x5a, 0x29, 0x25, 12 | 0x42, 0x0a, 0x21, 0x05, 0x42, 0x0a, 0xe6, 0x18, 0x42, 0x0a, 0x28, 0x20, 13 | 0x52, 0x0a, 0x29, 0x25, 0x8c, 0x09, 0xc6, 0x18, 0x00, 0x00, 0x00, 0x00, 14 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; 15 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/x11/ncurses_cfg.h: -------------------------------------------------------------------------------- 1 | /* $Id: ncurses_cfg.h,v 1.8 2006/12/28 01:02:03 wmcbrine Exp $ 2 | * 3 | * This file is only used with the ncurses test programs. 4 | * 5 | * Have ncurses-5.6 unpacked in your $(HOME) (you don't need to build 6 | * it), or edit ncurses_testdir appropriately in the Makefile. Configure 7 | * and build PDCurses for X11. (Sorry, other ports won't work yet.) 8 | * Change to this directory, and: 9 | * 10 | * "make ncurses_tests" to start. 11 | * "make ncurses_clean" when you're done. 12 | * 13 | * Builds: bs gdc hanoi knight tclock ncurses 14 | */ 15 | 16 | #define NCURSES_MOUSE_VERSION 2 17 | 18 | #include "../config.h" 19 | #include 20 | 21 | #define ExitProgram exit 22 | 23 | #define HAVE_CURSES_VERSION 1 24 | #define HAVE_GETBEGX 1 25 | #define HAVE_GETCURX 1 26 | #define HAVE_GETMAXX 1 27 | #define HAVE_GETNSTR 1 28 | #define HAVE_GETTIMEOFDAY 1 29 | #define HAVE_GETWIN 1 30 | #define HAVE_LIBPANEL 1 31 | #define HAVE_LOCALE_H 1 32 | #define HAVE_NAPMS 1 33 | #define HAVE_PANEL_H 1 34 | #define HAVE_PUTWIN 1 35 | #define HAVE_SLK_COLOR 1 36 | #define HAVE_SLK_INIT 1 37 | #define HAVE_WRESIZE 1 38 | 39 | #ifdef PDC_WIDE 40 | # define USE_WIDEC_SUPPORT 1 41 | #endif 42 | 43 | /* Fool ncurses.c so it gives us all the tests, and doesn't redefine 44 | ACS_ chars 45 | */ 46 | 47 | #define NCURSES_VERSION PDCURSES 48 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/x11/pdcdisp.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcx11.h" 4 | 5 | RCSID("$Id: pdcdisp.c,v 1.46 2008/07/14 04:24:52 wmcbrine Exp $") 6 | 7 | #include 8 | 9 | #ifdef CHTYPE_LONG 10 | 11 | # define A(x) ((chtype)x | A_ALTCHARSET) 12 | 13 | chtype acs_map[128] = 14 | { 15 | A(0), A(1), A(2), A(3), A(4), A(5), A(6), A(7), A(8), A(9), A(10), 16 | A(11), A(12), A(13), A(14), A(15), A(16), A(17), A(18), A(19), 17 | A(20), A(21), A(22), A(23), A(24), A(25), A(26), A(27), A(28), 18 | A(29), A(30), A(31), ' ', '!', '"', '#', '$', '%', '&', '\'', '(', 19 | ')', '*', 20 | 21 | # ifdef PDC_WIDE 22 | 0x2192, 0x2190, 0x2191, 0x2193, 23 | # else 24 | '>', '<', '^', 'v', 25 | # endif 26 | 27 | '/', 28 | 29 | # ifdef PDC_WIDE 30 | 0x2588, 31 | # else 32 | A(0), 33 | # endif 34 | 35 | '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', 36 | '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 37 | 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 38 | 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', 39 | 40 | # ifdef PDC_WIDE 41 | 0x2666, 0x2592, 42 | # else 43 | A(1), A(2), 44 | # endif 45 | 46 | 'b', 'c', 'd', 'e', 47 | 48 | # ifdef PDC_WIDE 49 | 0x00b0, 0x00b1, 0x2591, 0x00a4, 0x2518, 0x2510, 0x250c, 0x2514, 50 | 0x253c, 0x23ba, 0x23bb, 0x2500, 0x23bc, 0x23bd, 0x251c, 0x2524, 51 | 0x2534, 0x252c, 0x2502, 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3, 52 | 0x00b7, 53 | # else 54 | A(7), A(8), '#', 0xa4, A(11), A(12), A(13), A(14), A(15), A(16), 55 | A(17), A(18), A(19), A(20), A(21), A(22), A(23), A(24), A(25), 56 | A(26), A(27), A(28), A(29), A(30), 0xb7, 57 | # endif 58 | 59 | A(127) 60 | }; 61 | 62 | # undef A 63 | 64 | #endif 65 | 66 | int PDC_display_cursor(int oldrow, int oldcol, int newrow, int newcol, 67 | int visibility) 68 | { 69 | char buf[30]; 70 | int idx, pos; 71 | 72 | PDC_LOG(("%s:PDC_display_cursor() - called: NEW row %d col %d, vis %d\n", 73 | XCLOGMSG, newrow, newcol, visibility)); 74 | 75 | if (visibility == -1) 76 | { 77 | /* Only send the CURSES_DISPLAY_CURSOR message, no data */ 78 | 79 | idx = CURSES_DISPLAY_CURSOR; 80 | memcpy(buf, &idx, sizeof(int)); 81 | idx = sizeof(int); 82 | } 83 | else 84 | { 85 | idx = CURSES_CURSOR; 86 | memcpy(buf, &idx, sizeof(int)); 87 | 88 | idx = sizeof(int); 89 | pos = oldrow + (oldcol << 8); 90 | memcpy(buf + idx, &pos, sizeof(int)); 91 | 92 | idx += sizeof(int); 93 | pos = newrow + (newcol << 8); 94 | memcpy(buf + idx, &pos, sizeof(int)); 95 | 96 | idx += sizeof(int); 97 | } 98 | 99 | if (XC_write_socket(xc_display_sock, buf, idx) < 0) 100 | XCursesExitCursesProcess(1, "exiting from PDC_display_cursor"); 101 | 102 | return OK; 103 | } 104 | 105 | /* position hardware cursor at (y, x) */ 106 | 107 | void PDC_gotoyx(int row, int col) 108 | { 109 | PDC_LOG(("PDC_gotoyx() - called: row %d col %d\n", row, col)); 110 | 111 | PDC_display_cursor(SP->cursrow, SP->curscol, row, col, SP->visibility); 112 | } 113 | 114 | /* update the given physical line to look like the corresponding line in 115 | curscr */ 116 | 117 | void PDC_transform_line(int lineno, int x, int len, const chtype *srcp) 118 | { 119 | PDC_LOG(("PDC_transform_line() - called: line %d\n", lineno)); 120 | 121 | XC_get_line_lock(lineno); 122 | 123 | memcpy(Xcurscr + XCURSCR_Y_OFF(lineno) + (x * sizeof(chtype)), srcp, 124 | len * sizeof(chtype)); 125 | 126 | *(Xcurscr + XCURSCR_START_OFF + lineno) = x; 127 | *(Xcurscr + XCURSCR_LENGTH_OFF + lineno) = len; 128 | 129 | XC_release_line_lock(lineno); 130 | 131 | XCursesInstructAndWait(CURSES_REFRESH); 132 | } 133 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/x11/pdcgetsc.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcx11.h" 4 | 5 | RCSID("$Id: pdcgetsc.c,v 1.26 2008/07/14 04:24:52 wmcbrine Exp $") 6 | 7 | /* return width of screen/viewport */ 8 | 9 | int PDC_get_columns(void) 10 | { 11 | PDC_LOG(("PDC_get_columns() - called\n")); 12 | 13 | return XCursesCOLS; 14 | } 15 | 16 | /* get the cursor size/shape */ 17 | 18 | int PDC_get_cursor_mode(void) 19 | { 20 | return 0; 21 | } 22 | 23 | /* return number of screen rows */ 24 | 25 | int PDC_get_rows(void) 26 | { 27 | PDC_LOG(("PDC_get_rows() - called\n")); 28 | 29 | return XCursesLINES; 30 | } 31 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/x11/pdckbd.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcx11.h" 4 | 5 | RCSID("$Id: pdckbd.c,v 1.62 2008/07/14 04:24:52 wmcbrine Exp $") 6 | 7 | /*man-start************************************************************** 8 | 9 | Name: pdckbd 10 | 11 | Synopsis: 12 | unsigned long PDC_get_input_fd(void); 13 | 14 | Description: 15 | PDC_get_input_fd() returns the file descriptor that PDCurses 16 | reads its input from. It can be used for select(). 17 | 18 | Portability X/Open BSD SYS V 19 | PDC_get_input_fd - - - 20 | 21 | **man-end****************************************************************/ 22 | 23 | /* check if a key or mouse event is waiting */ 24 | 25 | bool PDC_check_key(void) 26 | { 27 | struct timeval socket_timeout = {0}; 28 | int s; 29 | 30 | /* Is something ready to be read on the socket ? Must be a key. */ 31 | 32 | FD_ZERO(&xc_readfds); 33 | FD_SET(xc_key_sock, &xc_readfds); 34 | 35 | if ((s = select(FD_SETSIZE, (FD_SET_CAST)&xc_readfds, NULL, 36 | NULL, &socket_timeout)) < 0) 37 | XCursesExitCursesProcess(3, "child - exiting from " 38 | "PDC_check_key select failed"); 39 | 40 | PDC_LOG(("%s:PDC_check_key() - returning %s\n", XCLOGMSG, 41 | s ? "TRUE" : "FALSE")); 42 | 43 | return !!s; 44 | } 45 | 46 | /* return the next available key or mouse event */ 47 | 48 | int PDC_get_key(void) 49 | { 50 | unsigned long newkey = 0; 51 | int key = 0; 52 | 53 | if (XC_read_socket(xc_key_sock, &newkey, sizeof(unsigned long)) < 0) 54 | XCursesExitCursesProcess(2, "exiting from PDC_get_key"); 55 | 56 | pdc_key_modifiers = (newkey >> 24) & 0xFF; 57 | key = (int)(newkey & 0x00FFFFFF); 58 | 59 | if (key == KEY_MOUSE && SP->key_code) 60 | { 61 | if (XC_read_socket(xc_key_sock, &pdc_mouse_status, 62 | sizeof(MOUSE_STATUS)) < 0) 63 | XCursesExitCursesProcess(2, "exiting from PDC_get_key"); 64 | } 65 | 66 | PDC_LOG(("%s:PDC_get_key() - key %d returned\n", XCLOGMSG, key)); 67 | 68 | return key; 69 | } 70 | 71 | unsigned long PDC_get_input_fd(void) 72 | { 73 | PDC_LOG(("PDC_get_input_fd() - called\n")); 74 | 75 | return xc_key_sock; 76 | } 77 | 78 | void PDC_set_keyboard_binary(bool on) 79 | { 80 | PDC_LOG(("PDC_set_keyboard_binary() - called\n")); 81 | } 82 | 83 | /* discard any pending keyboard or mouse input -- this is the core 84 | routine for flushinp() */ 85 | 86 | void PDC_flushinp(void) 87 | { 88 | PDC_LOG(("PDC_flushinp() - called\n")); 89 | 90 | while (PDC_check_key()) 91 | PDC_get_key(); 92 | } 93 | 94 | int PDC_mouse_set(void) 95 | { 96 | return OK; 97 | } 98 | 99 | int PDC_modifiers_set(void) 100 | { 101 | return OK; 102 | } 103 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/x11/pdcscrn.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcx11.h" 4 | 5 | RCSID("$Id: pdcscrn.c,v 1.55 2008/07/14 04:24:52 wmcbrine Exp $") 6 | 7 | /* COLOR_PAIR to attribute encoding table. */ 8 | 9 | short *xc_atrtab = (short *)NULL; 10 | 11 | /* close the physical screen */ 12 | 13 | void PDC_scr_close(void) 14 | { 15 | PDC_LOG(("PDC_scr_close() - called\n")); 16 | } 17 | 18 | void PDC_scr_free(void) 19 | { 20 | XCursesExit(); 21 | 22 | xc_atrtab = (short *)NULL; 23 | } 24 | 25 | /* open the physical screen -- allocate SP, miscellaneous intialization */ 26 | 27 | int PDC_scr_open(int argc, char **argv) 28 | { 29 | extern bool sb_started; 30 | 31 | PDC_LOG(("PDC_scr_open() - called\n")); 32 | 33 | if ((XCursesInitscr(argc, argv) == ERR) || !SP) 34 | return ERR; 35 | 36 | SP->cursrow = SP->curscol = 0; 37 | SP->orig_attr = FALSE; 38 | SP->sb_on = sb_started; 39 | SP->sb_total_y = 0; 40 | SP->sb_viewport_y = 0; 41 | SP->sb_cur_y = 0; 42 | SP->sb_total_x = 0; 43 | SP->sb_viewport_x = 0; 44 | SP->sb_cur_x = 0; 45 | 46 | return OK; 47 | } 48 | 49 | /* the core of resize_term() */ 50 | 51 | int PDC_resize_screen(int nlines, int ncols) 52 | { 53 | PDC_LOG(("PDC_resize_screen() - called. Lines: %d Cols: %d\n", 54 | nlines, ncols)); 55 | 56 | if (nlines || ncols || !SP->resized) 57 | return ERR; 58 | 59 | shmdt((char *)Xcurscr); 60 | XCursesInstructAndWait(CURSES_RESIZE); 61 | 62 | if ((shmid_Xcurscr = shmget(shmkey_Xcurscr, 63 | SP->XcurscrSize + XCURSESSHMMIN, 0700)) < 0) 64 | { 65 | perror("Cannot allocate shared memory for curscr"); 66 | kill(xc_otherpid, SIGKILL); 67 | return ERR; 68 | } 69 | 70 | XCursesLINES = SP->lines; 71 | XCursesCOLS = SP->cols; 72 | 73 | PDC_LOG(("%s:shmid_Xcurscr %d shmkey_Xcurscr %d SP->lines %d " 74 | "SP->cols %d\n", XCLOGMSG, shmid_Xcurscr, 75 | shmkey_Xcurscr, SP->lines, SP->cols)); 76 | 77 | Xcurscr = (unsigned char*)shmat(shmid_Xcurscr, 0, 0); 78 | xc_atrtab = (short *)(Xcurscr + XCURSCR_ATRTAB_OFF); 79 | 80 | SP->resized = FALSE; 81 | 82 | return OK; 83 | } 84 | 85 | void PDC_reset_prog_mode(void) 86 | { 87 | PDC_LOG(("PDC_reset_prog_mode() - called.\n")); 88 | } 89 | 90 | void PDC_reset_shell_mode(void) 91 | { 92 | PDC_LOG(("PDC_reset_shell_mode() - called.\n")); 93 | } 94 | 95 | void PDC_restore_screen_mode(int i) 96 | { 97 | } 98 | 99 | void PDC_save_screen_mode(int i) 100 | { 101 | } 102 | 103 | void PDC_init_pair(short pair, short fg, short bg) 104 | { 105 | xc_atrtab[pair * 2] = fg; 106 | xc_atrtab[pair * 2 + 1] = bg; 107 | } 108 | 109 | int PDC_pair_content(short pair, short *fg, short *bg) 110 | { 111 | *fg = xc_atrtab[pair * 2]; 112 | *bg = xc_atrtab[pair * 2 + 1]; 113 | 114 | return OK; 115 | } 116 | 117 | bool PDC_can_change_color(void) 118 | { 119 | return TRUE; 120 | } 121 | 122 | int PDC_color_content(short color, short *red, short *green, short *blue) 123 | { 124 | XColor *tmp = (XColor *)(Xcurscr + XCURSCR_XCOLOR_OFF); 125 | 126 | tmp->pixel = color; 127 | 128 | XCursesInstructAndWait(CURSES_GET_COLOR); 129 | 130 | *red = ((double)(tmp->red) * 1000 / 65535) + 0.5; 131 | *green = ((double)(tmp->green) * 1000 / 65535) + 0.5; 132 | *blue = ((double)(tmp->blue) * 1000 / 65535) + 0.5; 133 | 134 | return OK; 135 | } 136 | 137 | int PDC_init_color(short color, short red, short green, short blue) 138 | { 139 | XColor *tmp = (XColor *)(Xcurscr + XCURSCR_XCOLOR_OFF); 140 | 141 | tmp->pixel = color; 142 | 143 | tmp->red = ((double)red * 65535 / 1000) + 0.5; 144 | tmp->green = ((double)green * 65535 / 1000) + 0.5; 145 | tmp->blue = ((double)blue * 65535 / 1000) + 0.5; 146 | 147 | XCursesInstructAndWait(CURSES_SET_COLOR); 148 | 149 | return OK; 150 | } 151 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/x11/pdcsetsc.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcx11.h" 4 | 5 | RCSID("$Id: pdcsetsc.c,v 1.33 2008/07/14 04:24:52 wmcbrine Exp $") 6 | 7 | #include 8 | 9 | /*man-start************************************************************** 10 | 11 | Name: pdcsetsc 12 | 13 | Synopsis: 14 | int PDC_set_blink(bool blinkon); 15 | void PDC_set_title(const char *title); 16 | 17 | Description: 18 | PDC_set_blink() toggles whether the A_BLINK attribute sets an 19 | actual blink mode (TRUE), or sets the background color to high 20 | intensity (FALSE). The default is platform-dependent (FALSE in 21 | most cases). It returns OK if it could set the state to match 22 | the given parameter, ERR otherwise. Current platforms also 23 | adjust the value of COLORS according to this function -- 16 for 24 | FALSE, and 8 for TRUE. 25 | 26 | PDC_set_title() sets the title of the window in which the curses 27 | program is running. This function may not do anything on some 28 | platforms. (Currently it only works in Win32 and X11.) 29 | 30 | Portability X/Open BSD SYS V 31 | PDC_set_blink - - - 32 | PDC_set_title - - - 33 | 34 | **man-end****************************************************************/ 35 | 36 | int PDC_curs_set(int visibility) 37 | { 38 | int ret_vis = SP->visibility; 39 | 40 | PDC_LOG(("PDC_curs_set() - called: visibility=%d\n", visibility)); 41 | 42 | if (visibility != -1) 43 | SP->visibility = visibility; 44 | 45 | PDC_display_cursor(SP->cursrow, SP->curscol, SP->cursrow, 46 | SP->curscol, visibility); 47 | 48 | return ret_vis; 49 | } 50 | 51 | void PDC_set_title(const char *title) 52 | { 53 | int len; 54 | 55 | PDC_LOG(("PDC_set_title() - called:<%s>\n", title)); 56 | 57 | len = strlen(title) + 1; /* write nul character */ 58 | 59 | XCursesInstruct(CURSES_TITLE); 60 | 61 | if (XC_write_display_socket_int(len) >= 0) 62 | if (XC_write_socket(xc_display_sock, title, len) >= 0) 63 | return; 64 | 65 | XCursesExitCursesProcess(1, "exiting from PDC_set_title"); 66 | } 67 | 68 | int PDC_set_blink(bool blinkon) 69 | { 70 | if (pdc_color_started) 71 | COLORS = 16; 72 | 73 | return blinkon ? ERR : OK; 74 | } 75 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/x11/pdcutil.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcx11.h" 4 | 5 | RCSID("$Id: pdcutil.c,v 1.10 2008/07/14 04:24:52 wmcbrine Exp $") 6 | 7 | #if defined(HAVE_POLL) && !defined(HAVE_USLEEP) 8 | # include 9 | #endif 10 | 11 | void PDC_beep(void) 12 | { 13 | PDC_LOG(("PDC_beep() - called\n")); 14 | 15 | XCursesInstruct(CURSES_BELL); 16 | } 17 | 18 | void PDC_napms(int ms) 19 | { 20 | PDC_LOG(("PDC_napms() - called: ms=%d\n", ms)); 21 | 22 | #if defined(HAVE_USLEEP) 23 | 24 | usleep(1000 * ms); 25 | 26 | #elif defined(HAVE_POLL) 27 | { 28 | struct pollfd fd; 29 | fd.fd = -1; 30 | fd.events = 0; 31 | poll(&fd, 1, ms); 32 | } 33 | #endif 34 | } 35 | 36 | const char *PDC_sysname(void) 37 | { 38 | return "X11"; 39 | } 40 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/x11/sb.c: -------------------------------------------------------------------------------- 1 | /* Public Domain Curses */ 2 | 3 | #include "pdcx11.h" 4 | 5 | RCSID("$Id: sb.c,v 1.27 2008/07/14 04:24:52 wmcbrine Exp $") 6 | 7 | /*man-start************************************************************** 8 | 9 | Name: sb 10 | 11 | Synopsis: 12 | int sb_init(void) 13 | int sb_set_horz(int total, int viewport, int cur) 14 | int sb_set_vert(int total, int viewport, int cur) 15 | int sb_get_horz(int *total, int *viewport, int *cur) 16 | int sb_get_vert(int *total, int *viewport, int *cur) 17 | int sb_refresh(void); 18 | 19 | Description: 20 | These functions manipulate the scrollbar. 21 | 22 | Return Value: 23 | All functions return OK on success and ERR on error. 24 | 25 | Portability X/Open BSD SYS V 26 | sb_init - - - 27 | sb_set_horz - - - 28 | sb_set_vert - - - 29 | sb_get_horz - - - 30 | sb_get_vert - - - 31 | sb_refresh - - - 32 | 33 | **man-end****************************************************************/ 34 | 35 | bool sb_started = FALSE; 36 | 37 | /* sb_init() is the sb initialization routine. 38 | This must be called before initscr(). */ 39 | 40 | int sb_init(void) 41 | { 42 | PDC_LOG(("sb_init() - called\n")); 43 | 44 | if (SP) 45 | return ERR; 46 | 47 | sb_started = TRUE; 48 | 49 | return OK; 50 | } 51 | 52 | /* sb_set_horz() - Used to set horizontal scrollbar. 53 | 54 | total = total number of columns 55 | viewport = size of viewport in columns 56 | cur = current column in total */ 57 | 58 | int sb_set_horz(int total, int viewport, int cur) 59 | { 60 | PDC_LOG(("sb_set_horz() - called: total %d viewport %d cur %d\n", 61 | total, viewport, cur)); 62 | 63 | if (!SP) 64 | return ERR; 65 | 66 | SP->sb_total_x = total; 67 | SP->sb_viewport_x = viewport; 68 | SP->sb_cur_x = cur; 69 | 70 | return OK; 71 | } 72 | 73 | /* sb_set_vert() - Used to set vertical scrollbar. 74 | 75 | total = total number of columns on line 76 | viewport = size of viewport in columns 77 | cur = current column in total */ 78 | 79 | int sb_set_vert(int total, int viewport, int cur) 80 | { 81 | PDC_LOG(("sb_set_vert() - called: total %d viewport %d cur %d\n", 82 | total, viewport, cur)); 83 | 84 | if (!SP) 85 | return ERR; 86 | 87 | SP->sb_total_y = total; 88 | SP->sb_viewport_y = viewport; 89 | SP->sb_cur_y = cur; 90 | 91 | return OK; 92 | } 93 | 94 | /* sb_get_horz() - Used to get horizontal scrollbar. 95 | 96 | total = total number of lines 97 | viewport = size of viewport in lines 98 | cur = current line in total */ 99 | 100 | int sb_get_horz(int *total, int *viewport, int *cur) 101 | { 102 | PDC_LOG(("sb_get_horz() - called\n")); 103 | 104 | if (!SP) 105 | return ERR; 106 | 107 | if (total) 108 | *total = SP->sb_total_x; 109 | if (viewport) 110 | *viewport = SP->sb_viewport_x; 111 | if (cur) 112 | *cur = SP->sb_cur_x; 113 | 114 | return OK; 115 | } 116 | 117 | /* sb_get_vert() - Used to get vertical scrollbar. 118 | 119 | total = total number of lines 120 | viewport = size of viewport in lines 121 | cur = current line in total */ 122 | 123 | int sb_get_vert(int *total, int *viewport, int *cur) 124 | { 125 | PDC_LOG(("sb_get_vert() - called\n")); 126 | 127 | if (!SP) 128 | return ERR; 129 | 130 | if (total) 131 | *total = SP->sb_total_y; 132 | if (viewport) 133 | *viewport = SP->sb_viewport_y; 134 | if (cur) 135 | *cur = SP->sb_cur_y; 136 | 137 | return OK; 138 | } 139 | 140 | /* sb_refresh() - Used to draw the scrollbars. */ 141 | 142 | int sb_refresh(void) 143 | { 144 | PDC_LOG(("sb_refresh() - called\n")); 145 | 146 | if (!SP) 147 | return ERR; 148 | 149 | XCursesInstruct(CURSES_REFRESH_SCROLLBAR); 150 | 151 | return OK; 152 | } 153 | 154 | -------------------------------------------------------------------------------- /libs/pdcurses-3.4/x11/xcurses-config.in: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | # The idea to this kind of setup info script was stolen from numerous 4 | # other packages, such as neon, libxml and gnome. 5 | # 6 | # $Id: xcurses-config.in,v 1.6 2007/11/07 23:33:07 wmcbrine Exp $ 7 | # 8 | 9 | verdot=3.4 10 | 11 | prefix=@prefix@ 12 | exec_prefix=@exec_prefix@ 13 | includedir=@includedir@/xcurses 14 | 15 | usage() 16 | { 17 | echo "Usage: xcurses-config [OPTION]" 18 | echo "" 19 | echo "Available values for OPTION include:" 20 | echo "" 21 | echo " --help display this help and exit" 22 | echo " --cflags pre-processor and compiler flags" 23 | echo " [-I$includedir]" 24 | echo " --libs library linking information" 25 | echo " [-L$prefix/lib -lXCurses @LDFLAGS@ @MH_XLIBS@ @MH_EXTRA_LIBS@" 26 | echo " --prefix PDCurses install prefix" 27 | echo " [$prefix]" 28 | echo " --version output version information" 29 | echo " [$verdot]" 30 | exit $1 31 | } 32 | 33 | if test $# -eq 0; then 34 | usage 1 35 | fi 36 | 37 | while test $# -gt 0; do 38 | case "$1" in 39 | # this deals with options in the style 40 | # --option=value and extracts the value part 41 | # [not currently used] 42 | -*=*) value=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; 43 | *) value= ;; 44 | esac 45 | 46 | case "$1" in 47 | --prefix) 48 | echo $prefix 49 | ;; 50 | 51 | --version) 52 | echo $verdot 53 | exit 0 54 | ;; 55 | 56 | --help) 57 | usage 0 58 | ;; 59 | 60 | --cflags) 61 | echo -I$includedir 62 | ;; 63 | 64 | --libs) 65 | echo -L$prefix/lib -lXCurses @LDFLAGS@ @MH_XLIBS@ @MH_EXTRA_LIBS@ 66 | ;; 67 | 68 | *) 69 | usage 70 | exit 1 71 | ;; 72 | esac 73 | shift 74 | done 75 | 76 | exit 0 77 | -------------------------------------------------------------------------------- /scripts/.autostuff/m4/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/kconfig-frontends/b351923f4a6b1ae87bd5b222a349d74e68803f1f/scripts/.autostuff/m4/.empty -------------------------------------------------------------------------------- /scripts/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = ksync.sh ksync.list version.sh 2 | -------------------------------------------------------------------------------- /scripts/ksync.list: -------------------------------------------------------------------------------- 1 | tools/kconfig/conf.c --> frontends/conf/conf.c 2 | tools/kconfig/gconf.c --> frontends/gconf/gconf.c 3 | tools/kconfig/gconf.glade --> frontends/gconf/gconf.glade 4 | tools/kconfig/mconf.c --> frontends/mconf/mconf.c 5 | tools/kconfig/nconf.c --> frontends/nconf/nconf.c 6 | tools/kconfig/nconf.gui.c --> frontends/nconf/nconf.gui.c 7 | tools/kconfig/nconf.h --> frontends/nconf/nconf.h 8 | tools/kconfig/qconf.cc --> frontends/qconf/qconf.cc 9 | tools/kconfig/qconf.h --> frontends/qconf/qconf.h 10 | tools/kconfig/images.c --> libs/images/images.c_orig 11 | tools/kconfig/lxdialog/BIG.FAT.WARNING --> libs/lxdialog/BIG.FAT.WARNING 12 | tools/kconfig/lxdialog/checklist.c --> libs/lxdialog/checklist.c 13 | tools/kconfig/lxdialog/dialog.h --> libs/lxdialog/dialog.h 14 | tools/kconfig/lxdialog/inputbox.c --> libs/lxdialog/inputbox.c 15 | tools/kconfig/lxdialog/menubox.c --> libs/lxdialog/menubox.c 16 | tools/kconfig/lxdialog/textbox.c --> libs/lxdialog/textbox.c 17 | tools/kconfig/lxdialog/util.c --> libs/lxdialog/util.c 18 | tools/kconfig/lxdialog/yesno.c --> libs/lxdialog/yesno.c 19 | tools/kconfig/confdata.c --> libs/parser/confdata.c 20 | tools/kconfig/expr.c --> libs/parser/expr.c 21 | tools/kconfig/expr.h --> libs/parser/expr.h 22 | tools/kconfig/zconf.gperf --> libs/parser/hconf.gperf 23 | tools/kconfig/zconf.l --> libs/parser/lconf.l 24 | tools/kconfig/list.h --> libs/parser/list.h 25 | tools/kconfig/lkc.h --> libs/parser/lkc.h 26 | tools/kconfig/lkc_proto.h --> libs/parser/lkc_proto.h 27 | tools/kconfig/menu.c --> libs/parser/menu.c 28 | tools/kconfig/symbol.c --> libs/parser/symbol.c 29 | tools/kconfig/util.c --> libs/parser/util.c 30 | tools/kconfig/zconf.y --> libs/parser/yconf.y 31 | tools/config --> utils/tweak.in 32 | tools/diffconfig --> utils/diff 33 | tools/kconfig/merge_config.sh --> utils/merge 34 | tools/kconfig/kxgettext.c --> utils/gettext.c 35 | -------------------------------------------------------------------------------- /scripts/ksync.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | my_name="${0##*/}" 4 | 5 | if [ -z "$IDF_PATH" ]; then 6 | echo "please set IDF_PATH" 7 | exit 1 8 | fi 9 | 10 | k_dir=$IDF_PATH 11 | 12 | # Sync-up the files 13 | k_files="" 14 | while read k_file trash kf_file; do 15 | k_files="${k_files} ${k_file}" 16 | echo "Syncing ${k_files} -> ${kf_file}" 17 | mkdir -p "${kf_file%/*}" 18 | cp -v "${k_dir}/${k_file}" "${kf_file}" 19 | if [ -f "${kf_file}.patch" ]; then 20 | patch --no-backup-if-mismatch -g0 -F1 -p1 -f <"${kf_file}.patch" 21 | fi 22 | done &2; exit 1;; 10 | esac 11 | if [ ${plain} -ne 0 -a ${internal} -ne 0 ]; then 12 | printf "Can't print both plain and internal" >&2 13 | printf " versions at the same time\n" >&2 14 | exit 1 15 | fi 16 | 17 | ver_file="${0%/*}/../.version" 18 | k_ver="$( head -n 1 "${ver_file}" |cut -d ' ' -f 1 )" 19 | k_cset="$( head -n 1 "${ver_file}" |cut -d ' ' -f 2 )" 20 | k_name="$( head -n 1 "${ver_file}" |cut -d ' ' -f 3- )" 21 | kf_ver="$( tail -n 1 "${ver_file}" )" 22 | 23 | if [ ${internal} -ne 0 ]; then 24 | printf "%s\n" "${kf_ver}" 25 | exit 0 26 | fi 27 | 28 | k_ver_plain="$( printf "%s" "${k_ver}" \ 29 | |sed -e 's/-rc.*//;' )" 30 | 31 | case "${kf_ver}" in 32 | git) kf_ver="-$( git rev-parse --short HEAD )" 33 | k_ver_extra="$( printf "_%-7.7s" "${k_cset}" )" 34 | ;; 35 | *) k_ver_extra="";; 36 | esac 37 | 38 | if [ "${plain}" -eq 1 ]; then 39 | echo "${k_ver_plain}" 40 | else 41 | echo "${k_ver}${k_ver_extra}.${kf_ver}" 42 | fi 43 | 44 | -------------------------------------------------------------------------------- /utils/Makefile.am: -------------------------------------------------------------------------------- 1 | bin_SCRIPTS = tweak 2 | dist_bin_SCRIPTS = diff merge 3 | 4 | if COND_utils_gettext 5 | MAYBE_utils_gettext = gettext 6 | endif 7 | bin_PROGRAMS = $(MAYBE_utils_gettext) 8 | 9 | gettext_SOURCES = gettext.c 10 | gettext_CPPFLAGS = $(AM_CPPFLAGS) \ 11 | -I$(top_srcdir)/libs/parser 12 | gettext_CFLAGS = $(AM_CFLAGS) $(kf_CFLAGS) 13 | gettext_LDADD = $(top_builddir)/libs/parser/libkconfig-parser.la \ 14 | $(intl_LIBS) 15 | CLEANFILES = tweak 16 | EXTRA_DIST = tweak.in tweak.in.patch 17 | 18 | tweak: tweak.in 19 | $(AM_V_GEN)$(SED) -e "s/@CONFIG_@/$(config_prefix)/g" \ 20 | $< >$@ 21 | @chmod +x $@ 22 | -------------------------------------------------------------------------------- /utils/tweak.in.patch: -------------------------------------------------------------------------------- 1 | diff --git a/utils/tweak.in b/utils/tweak.in 2 | --- a/utils/tweak.in 3 | +++ b/utils/tweak.in 4 | @@ -3,8 +3,8 @@ 5 | 6 | myname=${0##*/} 7 | 8 | -# If no prefix forced, use the default CONFIG_ 9 | -CONFIG_="${CONFIG_-CONFIG_}" 10 | +# If no prefix forced, use the default @CONFIG_@ 11 | +CONFIG_="${CONFIG_-@CONFIG_@}" 12 | 13 | usage() { 14 | cat >&2 <