diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-12-05 17:57:54 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-12-05 17:57:54 +0000 |
commit | 26ef5b7ef4733c2c39296c6488e99ce27cd790ff (patch) | |
tree | e06d2362bbc45b2d5e84da570cf94509141c26f7 | |
parent | 02dfdb859cedbfc87d5a0b2fe040abc742f82f15 (diff) |
We haven't used this in years, remove it.
45 files changed, 0 insertions, 4852 deletions
diff --git a/lib/libtermlib/Capabilities b/lib/libtermlib/Capabilities deleted file mode 100644 index d5874c19eb4..00000000000 --- a/lib/libtermlib/Capabilities +++ /dev/null @@ -1,565 +0,0 @@ -# $OpenBSD: Capabilities,v 1.1 1996/05/31 05:40:02 tholo Exp $ -# -# Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -# must display the following acknowledgement: -# This product includes software developed by SigmaSoft, Th. Lockert. -# 4. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -# THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# -# The following is a list of terminfo capabilities with their -# corresponding termcap alias. All entries up to the marker -# "#endbinary" are found in compiled terminfo files IN THE ORDER -# SPECIFIED. Do NOT reorder or add capabilities before the -# marker. -# -# type variable capname termcap -# -# Standard terminfo capabilities: -# -bool auto_left_margin bw bw -bool auto_right_margin am am -bool no_esc_ctlc xsb xb -bool ceol_standout_glitch xhp xs -bool eat_newline_glitch xenl xn -bool erase_overstrike eo eo -bool generic_type gn gn -bool hard_copy hc hc -bool has_meta_key km km -bool has_status_line hs hs -bool insert_null_glitch in in -bool memory_above da da -bool memory_below db db -bool move_insert_mode mir mi -bool move_standout_mode msgr ms -bool over_strike os os -bool status_line_esc_ok eslok es -bool dest_tabs_magic_smso xt xt -bool tilde_glitch hz hz -bool transparent_underline ul ul -bool xon_xoff xon xo -bool needs_xon_xoff nxon nx -bool prtr_silent mc5i 5i -bool hard_cursor chts HC -bool non_rev_rmcup nrrmc NR -bool no_pad_char npc NP -bool non_dest_scroll_region ndscr ND -bool can_change ccc cc -bool back_color_erase bce ut -bool hue_lightness_saturation hls hl -bool cool_addr_glitch xhpa YA -bool cr_cancels_micro_mode crxm YB -bool has_print_wheel daisy YC -bool row_addr_glitch xvpa YD -bool semi_auto_right_margin sam YE -bool cpi_changes_res cpix YF -bool lpi_changes_res lpix YG -# -num columns cols co -num init_tabs it it -num lines lines li -num lines_of_memory lm lm -num magic_cookie_glitch xmc sg -num padding_baud_rate pb pb -num virtual_terminal vt vt -num width_status_line wsl ws -num num_labels nlab Nl -num label_height lh lh -num label_width lw lw -num max_attributes ma ma -num maximum_windows wnum MW -num max_colors colors Co -num max_pairs pairs pa -num no_color_video ncv NC -# -str back_tab cbt bt -str bell bel bl -str carriage_return cr cr -str change_scroll_region csr cs -str clear_all_tabs tbc ct -str clear_screen clear cl -str clr_eol el ce -str clr_eos ed cd -str column_address hpa ch -str command_character cmdch CC -str cursor_address cup cm -str cursor_down cud1 do -str cursor_home home ho -str cursor_invisible civis vi -str cursor_left cub1 le -str cursor_mem_address mrcup CM -str cursor_normal cnorm ve -str cursor_right cuf1 nd -str cursor_to_ll ll ll -str cursor_up cuu1 up -str cursor_visible cvvis vs -str delete_character dch1 dc -str delete_line dl1 dl -str dis_status_line dsl ds -str down_half_line hd hd -str enter_alt_charset_mode smacs as -str enter_blink_mode blink mb -str enter_bold_mode bold md -str enter_ca_mode smcup ti -str enter_delete_mode smdc dm -str enter_dim_mode dim mh -str enter_insert_mode smir im -str enter_secure_mode invis mk -str enter_protected_mode prot mp -str enter_reverse_mode rev mr -str enter_standout_mode smso so -str enter_underline_mode smul us -str erase_chars ech ec -str exit_alt_charset_mode rmacs ae -str exit_attribute_mode sgr0 me -str exit_ca_mode rmcup te -str exit_delete_mode rmdc ed -str exit_insert_mode rmir ei -str exit_standout_mode rmso se -str exit_underline_mode rmul ue -str flash_screen flash vb -str form_feed ff ff -str from_status_line fsl fs -str init_1string is1 i1 -str init_2string is2 is -str init_3string is3 i3 -str init_file if if -str insert_character ich1 ic -str insert_line il1 al -str insert_padding ip ip -str key_backspace kbs kb -str key_catab ktbc ka -str key_clear kclr kC -str key_ctab kctab kt -str key_dc kdch1 kD -str key_dl kdl1 kL -str key_down kcud1 kd -str key_eic krmir kM -str key_eol kel kE -str key_eos ked kS -str key_f0 kf0 k0 -str key_f1 kf1 k1 -str key_f10 kf10 k; -str key_f2 kf2 k2 -str key_f3 kf3 k3 -str key_f4 kf4 k4 -str key_f5 kf5 k5 -str key_f6 kf6 k6 -str key_f7 kf7 k7 -str key_f8 kf8 k8 -str key_f9 kf9 k9 -str key_home khome kh -str key_ic kich1 kI -str key_il kil1 kA -str key_left kcub1 kl -str key_ll kll kH -str key_npage knp kN -str key_ppage kpp kP -str key_right kcuf1 kr -str key_sf kind kF -str key_sr kri kR -str key_stab khts kT -str key_up kcuu1 ku -str keypad_local rmkx ke -str keypad_xmit smkx ks -str lab_f0 lf0 l0 -str lab_f1 lf1 l1 -str lab_f10 lf10 la -str lab_f2 lf2 l2 -str lab_f3 lf3 l3 -str lab_f4 lf4 l4 -str lab_f5 lf5 l5 -str lab_f6 lf6 l6 -str lab_f7 lf7 l7 -str lab_f8 lf8 l8 -str lab_f9 lf9 l9 -str meta_off rmm mo -str meta_on smm mm -str newline nel nw -str pad_char pad pc -str parm_dch dch DC -str parm_delete_line dl DL -str parm_down_cursor cud DO -str parm_ich ich IC -str parm_index indn SF -str parm_insert_line il AL -str parm_left_cursor cub LE -str parm_right_cursor cuf RI -str parm_rindex rin SR -str parm_up_cursor cuu UP -str pkey_key pfkey pk -str pkey_local pfloc pl -str pkey_xmit pfx px -str print_screen mc0 ps -str prtr_off mc4 pf -str prtr_on mc5 po -str repeat_char rep rp -str reset_1string rs1 r1 -str reset_2string rs2 r2 -str reset_3string rs3 r3 -str reset_file rf rf -str restore_cursor rc rc -str row_address vpa cv -str save_cursor sc sc -str scroll_forward ind sf -str scroll_reverse ri sr -str set_attributes sgr sa -str set_tab hts st -str set_window wind wi -str tab ht ta -str to_status_line tsl ts -str underline_char uc uc -str up_half_line hu hu -str init_prog iprog iP -str key_a1 ka1 K1 -str key_a3 ka3 K3 -str key_b2 kb2 K2 -str key_c1 kc1 K4 -str key_c3 kc3 K5 -str prtr_non mc5p pO -# -# Release 4 capabilities -# -num buffer_capacity bufsz Ya -num dot_vert_spacing spinv Yb -num dot_horz_spacing spinh Yc -num max_micro_address maddr Yd -num max_micro_jump mjump Ye -num micro_char_size mcs Yf -num micro_line_size mls Yg -num number_of_pins npins Yh -num output_res_char orc Yi -num output_res_line orl Yj -num output_res_horz_inch orhi Yk -num output_res_vert_inch orvi Yl -num print_rate cps Ym -num wide_char_size widcs Yn -num buttons btns BT -num bit_image_entwining bitwin Yo -num bit_image_type bitype Yp -# -str char_padding rmp rP -str acs_chars acsc ac -str plab_norm pln pn -str key_btab kcbt kB -str enter_xon_mode smxon SX -str exit_xon_mode rmxon RX -str enter_am_mode smam SA -str exit_am_mode rmam RA -str xon_character xonc XN -str xoff_character xoffc XF -str ena_acs enacs eA -str label_on smln LO -str label_off rmln LF -str key_beg kbeg @1 -str key_cancel kcan @2 -str key_close kclo @3 -str key_command kcmd @4 -str key_copy kcpy @5 -str key_create kcrt @6 -str key_end kend @7 -str key_enter kent @8 -str key_exit kext @9 -str key_find kfnd @0 -str key_help khlp %1 -str key_mark kmrk %2 -str key_message kmsg %3 -str key_move kmov %4 -str key_next knxt %5 -str key_open kopn %6 -str key_options kopt %7 -str key_previous kprv %8 -str key_print kprt %9 -str key_redo krdo %0 -str key_reference kref &1 -str key_refresh krfr &2 -str key_replace krpl &3 -str key_restart krst &4 -str key_resume kres &5 -str key_save ksav &6 -str key_suspend kspd &7 -str key_undo kund &8 -str key_sbeg kBEG &9 -str key_scancel kCAN &0 -str key_scommand kCMD *1 -str key_scopy kCPY *2 -str key_screate kCRT *3 -str key_sdc kDC *4 -str key_sdl kDL *5 -str key_select kslt *6 -str key_send kEND *7 -str key_seol kEOL *8 -str key_sexit kEXT *9 -str key_sfind kFND *0 -str key_shelp kHLP #1 -str key_shome kHOM #2 -str key_sic kIC #3 -str key_sleft kLFT #4 -str key_smessage kMSG %a -str key_smove kMOV %b -str key_snext kNXT %c -str key_soptions kOPT %d -str key_sprevious kPRV %e -str key_sprint kPRT %f -str key_sredo kRDO %g -str key_sreplace kRPL %h -str key_sright kRIT %i -str key_srsume kRES %j -str key_ssave kSAV !1 -str key_ssuspend kSPD !2 -str key_sundo kUND !3 -str req_for_input rfi RF -str key_f11 kf11 F1 -str key_f12 kf12 F2 -str key_f13 kf13 F3 -str key_f14 kf14 F4 -str key_f15 kf15 F5 -str key_f16 kf16 F6 -str key_f17 kf17 F7 -str key_f18 kf18 F8 -str key_f19 kf19 F9 -str key_f20 kf20 FA -str key_f21 kf21 FB -str key_f22 kf22 FC -str key_f23 kf23 FD -str key_f24 kf24 FE -str key_f25 kf25 FF -str key_f26 kf26 FG -str key_f27 kf27 FH -str key_f28 kf28 FI -str key_f29 kf29 FJ -str key_f30 kf30 FK -str key_f31 kf31 FL -str key_f32 kf32 FM -str key_f33 kf33 FN -str key_f34 kf34 FO -str key_f35 kf35 FP -str key_f36 kf36 FQ -str key_f37 kf37 FR -str key_f38 kf38 FS -str key_f39 kf39 FT -str key_f40 kf40 FU -str key_f41 kf41 FV -str key_f42 kf42 FW -str key_f43 kf43 FX -str key_f44 kf44 FY -str key_f45 kf45 FZ -str key_f46 kf46 Fa -str key_f47 kf47 Fb -str key_f48 kf48 Fc -str key_f49 kf49 Fd -str key_f50 kf50 Fe -str key_f51 kf51 Ff -str key_f52 kf52 Fg -str key_f53 kf53 Fh -str key_f54 kf54 Fi -str key_f55 kf55 Fj -str key_f56 kf56 Fk -str key_f57 kf57 Fl -str key_f58 kf58 Fm -str key_f59 kf59 Fn -str key_f60 kf60 Fo -str key_f61 kf61 Fp -str key_f62 kf62 Fq -str key_f63 kf63 Fr -str clr_bol el1 cb -str clear_margins mgc MC -str set_left_margin smgl ML -str set_right_margin smgr MR -str label_format fln Lf -str set_clock sclk SC -str display_clock dclk DK -str remove_clock rmclk RC -str create_window cwin CW -str goto_window wingo WG -str hangup hup HU -str dial_phone dial DI -str quick_dial qdial QD -str tone tone TO -str pulse pulse PU -str flash_hook hook fh -str fixed_pause pause PA -str wait_tone wait WA -str user0 u0 u0 -str user1 u1 u1 -str user2 u2 u2 -str user3 u3 u3 -str user4 u4 u4 -str user5 u5 u5 -str user6 u6 u6 -str user7 u7 u7 -str user8 u8 u8 -str user9 u9 u9 -str orig_colors oc oc -str orig_pair op op -str initialize_color initc Ic -str initialize_pair initp Ip -str set_color_pair scp sp -str set_foreground setf Sf -str set_background setb Sb -str change_char_pitch cpi ZA -str change_line_pitch lpi ZB -str change_res_horz chr ZC -str change_res_vert cvr ZD -str define_char defc ZE -str enter_doublewide_mode swidm ZF -str enter_draft_quality sdrfq ZG -str enter_italics_mode sitm ZH -str enter_leftward_mode slm ZI -str enter_micro_mode smicm ZJ -str enter_near_letter_quality snlq ZK -str enter_normal_quality snrmq ZL -str enter_shadow_mode sshm ZM -str enter_subscript_mode ssubm ZN -str enter_superscript_mode ssupm ZO -str enter_upward_mode sum ZP -str exit_doublewide_mode rwidm ZQ -str exit_italics_mode ritm ZR -str exit_leftward_mode rlm ZS -str exit_micro_mode rmicm ZT -str exit_shadow_mode rshm ZU -str exit_subscript_mode rsubm ZV -str exit_superscript_mode rsupm ZW -str exit_upward_mode rum ZX -str micro_column_address mhpa ZY -str micro_down mcud1 ZZ -str micro_left mcub1 Za -str micro_right mcuf1 Zb -str micro_row_address mvpa Zc -str micro_up mcuu1 Zd -str order_of_pins porder Ze -str parm_down_micro mcud Zf -str parm_left_micro mcub Zg -str parm_right_micro mcuf Zh -str parm_up_micro mcuu Zi -str select_char_set scs Zj -str set_bottom_margin smgb Zk -str set_bottom_margin_parm smgbp Zl -str set_left_margin_parm smglp Zm -str set_right_margin_parm smgrp Zn -str set_top_margin smgt Zo -str set_top_margin_parm smgtp Zp -str start_bit_image sbim Zq -str start_char_set_def scsd Zr -str stop_bit_image rbim Zs -str stop_char_set_def rcsd Zt -str subscript_characters subcs Zu -str superscript_characters supcs Zv -str these_cause_cr docr Zw -str zero_motion zerom Zx -str char_set_names csnm Zy -str key_mouse kmous Km -str mouse_info minfo Mi -str req_mouse_pos reqmp RQ -str get_mouse getm Gm -str set_a_foreground setaf AF -str set_a_background setab AB -str pkey_plab pfxl xl -str device_type devt dv -str code_set_init csin ci -str set0_des_seq s0ds s0 -str set1_des_seq s1ds s1 -str set2_des_seq s2ds s2 -str set3_des_seq s3ds s3 -str set_lr_margin smglr ML -str set_tb_margin smgtb MT -str bit_image_repeat birep Xy -str bit_image_newline binel Zz -str bit_image_carriage_return bicr Yv -str color_names colornm Yw -str define_bit_image_region defbi Yx -str end_bit_image_region endbi Yy -str set_color_band setcolor Yz -str set_page_length slines YZ -str display_pc_char dispc S1 -str enter_pc_charset_mode smpch S2 -str exit_pc_charset_mode rmpch S3 -str enter_scancode_mode smsc S4 -str exit_scancode_mode rmsc S5 -str pc_term_options pctrm S6 -str scancode_escape scesc S7 -str alt_scancode_esc scesa S8 -# -#endbinary -# -# XSI Curses capabilities -# -str enter_horizontal_hl_mode ehhlm Xh -str enter_left_hl_mode elhlm Xl -str enter_low_hl_mode elohlm Xo -str enter_right_hl_mode erhlm Xr -str enter_top_hl_mode ethlm Xt -str enter_vertical_hl_mode evhlm Xv -# -# Termcap capabilities with no Terminfo equivalent, for compatibility -# -bool backspaces_with_bs OTbs bs -bool crt_no_scrolling OTns ns -bool no_correctly_working_cr OTnc nc -# -num carriage_return_delay OTdC dC -num magic_cookie_glitch_ul OTug ug -num new_line_delay OTdN dN -# -str backspace_if_not_bs OTbc bc -str linefeed_if_not_lf OTnl nl -str termcap_init2 OTi2 i2 -str termcap_reset OTrs rs -# -# GNU Termcap capabilities with no Terminfo equivalent, for compatability -# -bool gnu_has_meta_key OTMT MT -# -# Ancient Termcap capabilites; should not be in use -# -bool has_hardware_tabs OTpt pt -bool linefeed_is_newline OTNL NL -bool return_does_clr_eol OTxr xr -# -num backspace_delay OTdB dB -num horizontal_tab_delay OTdT dT -num number_of_function_keys OTkn kn -num other_non_function_keys OTko ko -# -str arrow_key_map OTma ma -# -# Xenix Termcap capabilities -# -str acs_btee OTGU GU -str acs_hline OTGH GH -str acs_llcorner OTG3 G3 -str acs_lrcorner OTG4 G4 -str acs_ltee OTGR GR -str acs_plus OTGC GC -str acs_rtee OTGL GL -str acs_ttee OTGD GD -str acs_ulcorner OTG2 G2 -str acs_urcorner OTG1 G1 -str acs_vline OTGV GV -# -# HP Terminfo extensions -# -str memory_lock meml ml -str memory_unlock memu mu diff --git a/lib/libtermlib/Makefile b/lib/libtermlib/Makefile deleted file mode 100644 index a1745a6b694..00000000000 --- a/lib/libtermlib/Makefile +++ /dev/null @@ -1,95 +0,0 @@ -# $OpenBSD: Makefile,v 1.8 1997/11/29 01:22:49 millert Exp $ -# -# Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -# must display the following acknowledgement: -# This product includes software developed by SigmaSoft, Th. Lockert. -# 4. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -# THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -LIB= termlib -SRCS= captoinfo.c def_prog_mode.c def_shell_mode.c del_curterm.c \ - fillcap.c findcap.c findinfo.c getterm.c globals.c \ - mvcur.c _mvcur.c \ - outc.c putp.c reset_prog_mode.c reset_shell_mode.c \ - restartterm.c setterm.c setupterm.c set_curterm.c tgetent.c \ - tgetflag.c tgetnum.c tgetstr.c tgoto.c tigetflag.c tigetnum.c \ - tigetstr.c tparm.c tputs.c tty_init.c \ - vidattr.c _vidattr.c \ - vidputs.c _vidputs.c \ - captoidx.c infotoidx.c \ - boolnames.c boolcodes.c boolfnames.c \ - numnames.c numcodes.c numfnames.c \ - strnames.c strcodes.c strfnames.c -HDRS= term.h -MAN= terminfo.3 -MLINKS+= terminfo.3 setupterm.3 \ - terminfo.3 setterm.3 \ - terminfo.3 set_curterm.3 \ - terminfo.3 del_curterm.3 \ - terminfo.3 restartterm.3 \ - terminfo.3 tparm.3 \ - terminfo.3 tparam.3 \ - terminfo.3 tputs.3 \ - terminfo.3 putp.3 \ - terminfo.3 vidputs.3 \ - terminfo.3 vidattr.3 \ - terminfo.3 mvcur.3 \ - terminfo.3 tigetflag.3 \ - terminfo.3 tigetnum.3 \ - terminfo.3 tigetstr.3 -CLEANFILES+= ${HDRS} binaries.h captoidx.c infotoidx.c mkinfo \ - boolnames.c boolcodes.c boolfnames.c \ - numnames.c numcodes.c numfnames.c \ - strnames.c strcodes.c strfnames.c -CFLAGS+= -I. -I${.CURDIR} - -beforedepend: ${HDRS} binaries.h - -term.h: mkcaps.sh term.h.head Capabilities term.h.tail - sh ${.CURDIR}/mkcaps.sh ${.CURDIR}/term.h.head \ - ${.CURDIR}/Capabilities \ - ${.CURDIR}/term.h.tail >$@ - -boolnames.c boolcodes.c boolfnames.c \ -numnames.c numcodes.c numfnames.c \ -strnames.c strcodes.c strfnames.c \ -captoidx.c infotoidx.c \ -binaries.h: mkinfo Capabilities - ./mkinfo ${.CURDIR}/Capabilities - -includes: ${HDRS} - @for i in ${HDRS}; do \ - cmp -s $$i ${DESTDIR}/usr/include/$$i || \ - ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 $$i \ - ${DESTDIR}/usr/include; \ - done - -.include <bsd.lib.mk> - -mkinfo: mkinfo.c - ${HOSTCC} ${CFLAGS} -I${.CURDIR} -o mkinfo $> - -.depend: mkinfo.c diff --git a/lib/libtermlib/TODO b/lib/libtermlib/TODO deleted file mode 100644 index 80039fa1c40..00000000000 --- a/lib/libtermlib/TODO +++ /dev/null @@ -1,7 +0,0 @@ -Make mvcur() work on terminals without cursor_address - look in curses -color support in vidputs() - look in ncurses - -Code to read from compiled terminfo files -Code to read from terminfo source? - -Manual pages diff --git a/lib/libtermlib/_mvcur.c b/lib/libtermlib/_mvcur.c deleted file mode 100644 index 848337a20ff..00000000000 --- a/lib/libtermlib/_mvcur.c +++ /dev/null @@ -1,127 +0,0 @@ -/* $OpenBSD: _mvcur.c,v 1.1 1996/10/12 03:08:25 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: _mvcur.c,v 1.1 1996/10/12 03:08:25 tholo Exp $"; -#endif - -#include <string.h> -#include <unistd.h> -#include <termios.h> -#include "term.h" - -static int -rawmode() -{ - struct termios ti; - - if (tcgetattr(STDIN_FILENO, &ti) < 0) - return 1; - if (ti.c_oflag & OPOST) - if (ti.c_oflag & ONLCR) - return 0; - return 1; -} - -/* - * Optimized cursor movement, assume cursor is currently - * located at (oldx,oldy), output what is needed for the - * cursor to be relocated to (newx,newy) - */ -int -_mvcur(oldy, oldx, newy, newx) - int oldy; - int oldx; - int newy; - int newx; -{ - int l, c, raw; - char *p; - - if (newx >= columns) { - newy += newx / columns; - newx %= columns; - } - if (oldx >= columns) { - l = (oldx + 1) / columns; - oldy += l; - oldx %= columns; - if (!auto_right_margin) { - raw = rawmode(); - while (l > 0) { - if (raw) - if (carriage_return != NULL) - tputs(carriage_return, 0, _ti_outc); - else - _ti_outc('\r'); - if (linefeed_if_not_lf != NULL) - tputs(linefeed_if_not_lf, 0, _ti_outc); - else - _ti_outc('\n'); - l--; - } - oldx = 0; - } - if (oldy >= lines - 1) { - newy -= oldy - (lines - 1); - oldy = lines - 1; - } - } - if (newy >= lines) { - l = newy; - newy = lines - 1; - if (oldy < lines - 1) { - c = newx; - if (cursor_address == NULL) - newx = 0; - mvcur(oldy, oldx, newy, newx); - newx = c; - } - while (l >= lines) { - if (linefeed_if_not_lf != NULL) - tputs(linefeed_if_not_lf, 0, _ti_outc); - else - _ti_outc('\n'); - l--; - oldx = 0; - } - } - if (newy < oldy && !(cursor_address != NULL || cursor_up != NULL)) - newy = oldy; - if (cursor_address != NULL) { - p = tparm(cursor_address, newx, newy); - tputs(p, 0, _ti_outc); - } - else - return ERR; - return OK; -} diff --git a/lib/libtermlib/_vidattr.c b/lib/libtermlib/_vidattr.c deleted file mode 100644 index 3c73b66f14e..00000000000 --- a/lib/libtermlib/_vidattr.c +++ /dev/null @@ -1,45 +0,0 @@ -/* $OpenBSD: _vidattr.c,v 1.1 1996/09/21 19:22:26 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: _vidattr.c,v 1.1 1996/09/21 19:22:26 tholo Exp $"; -#endif - -#include <stdlib.h> -#include "term.h" - -int -_vidattr(attrs) - chtype attrs; -{ - return vidputs(attrs, _ti_outc); -} diff --git a/lib/libtermlib/_vidputs.c b/lib/libtermlib/_vidputs.c deleted file mode 100644 index 1ae3d6f3225..00000000000 --- a/lib/libtermlib/_vidputs.c +++ /dev/null @@ -1,127 +0,0 @@ -/* $OpenBSD: _vidputs.c,v 1.1 1996/09/21 19:22:27 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: _vidputs.c,v 1.1 1996/09/21 19:22:27 tholo Exp $"; -#endif - -#include <stdlib.h> -#include "term.h" - -int -_vidputs(attr, outc) - chtype attr; - int (*outc) __P((int)); -{ - static chtype old_attr; - chtype attr_on, attr_off; - - if (attr == old_attr) - return OK; - - attr_on = (~attr & old_attr) & (chtype)(~A_COLOR); - attr_off = (attr & ~old_attr) & (chtype)(~A_COLOR); - - if (attr == A_NORMAL) { - if ((old_attr & A_ALTCHARSET) && exit_alt_charset_mode != NULL) { - tputs(exit_alt_charset_mode, 1, outc); - old_attr &= ~A_ALTCHARSET; - } - if (old_attr) - tputs(exit_attribute_mode, 1, outc); - } - else if (set_attributes) { - if (attr_on || attr_off) { - tputs(tparm(set_attributes, - attr_on & A_STANDOUT, - attr_on & A_UNDERLINE, - attr_on & A_REVERSE, - attr_on & A_BLINK, - attr_on & A_DIM, - attr_on & A_BOLD, - attr_on & A_INVIS, - attr_on & A_PROTECT, - attr_on & A_ALTCHARSET), - 1, outc); - } - } - else { - if ((attr_off & A_ALTCHARSET) && exit_alt_charset_mode != NULL) { - tputs(exit_alt_charset_mode, 1, outc); - attr_off &= ~A_ALTCHARSET; - } - if ((attr_off & A_UNDERLINE) && exit_underline_mode != NULL) { - tputs(exit_underline_mode, 1, outc); - attr_off &= ~A_UNDERLINE; - } - if ((attr_off & A_STANDOUT) && exit_standout_mode != NULL) { - tputs(exit_standout_mode, 1, outc); - attr_off &= ~A_STANDOUT; - } - if (attr_off && exit_attribute_mode != NULL) { - tputs(exit_attribute_mode, 1, outc); - attr_on |= (attr & (chtype)(~A_COLOR)); - } - if ((attr_on & A_ALTCHARSET) && enter_alt_charset_mode != NULL) - tputs(enter_alt_charset_mode, 1, outc); - if ((attr_on & A_BLINK) && enter_blink_mode != NULL) - tputs(enter_blink_mode, 1, outc); - if ((attr_on & A_BOLD) && enter_bold_mode != NULL) - tputs(enter_bold_mode, 1, outc); - if ((attr_on & A_DIM) && enter_dim_mode != NULL) - tputs(enter_dim_mode, 1, outc); - if ((attr_on & A_REVERSE) && enter_reverse_mode != NULL) - tputs(enter_reverse_mode, 1, outc); - if ((attr_on & A_STANDOUT) && enter_standout_mode != NULL) - tputs(enter_standout_mode, 1, outc); - if ((attr_on & A_PROTECT) && enter_protected_mode != NULL) - tputs(enter_protected_mode, 1, outc); - if ((attr_on & A_INVIS) && enter_secure_mode != NULL) - tputs(enter_secure_mode, 1, outc); - if ((attr_on & A_UNDERLINE) && enter_underline_mode != NULL) - tputs(enter_underline_mode, 1, outc); - if ((attr_on & A_HORIZONTAL) && enter_horizontal_hl_mode != NULL) - tputs(enter_horizontal_hl_mode, 1, outc); - if ((attr_on & A_LEFT) && enter_left_hl_mode != NULL) - tputs(enter_left_hl_mode, 1, outc); - if ((attr_on & A_LOW) && enter_low_hl_mode != NULL) - tputs(enter_low_hl_mode, 1, outc); - if ((attr_on & A_RIGHT) && enter_right_hl_mode != NULL) - tputs(enter_right_hl_mode, 1, outc); - if ((attr_on & A_TOP) && enter_top_hl_mode != NULL) - tputs(enter_top_hl_mode, 1, outc); - if ((attr_on & A_VERTICAL) && enter_vertical_hl_mode != NULL) - tputs(enter_vertical_hl_mode, 1, outc); - } - old_attr = attr; - return OK; -} diff --git a/lib/libtermlib/captoinfo.c b/lib/libtermlib/captoinfo.c deleted file mode 100644 index 02e51f69edd..00000000000 --- a/lib/libtermlib/captoinfo.c +++ /dev/null @@ -1,322 +0,0 @@ -/* $OpenBSD: captoinfo.c,v 1.2 1996/06/02 23:47:01 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: captoinfo.c,v 1.2 1996/06/02 23:47:01 tholo Exp $"; -#endif - -#include <stdlib.h> -#include <string.h> -#include <ctype.h> -#include "term.private.h" - -#define STKSIZ 64 - -static int stack[STKSIZ]; -static int stkidx; -static int nflag; -static int rflag; -static int param; -static int onstack; -static char *d; - -static void -pop() -{ - if (stkidx > 0) - onstack = stack[--stkidx]; - else - onstack = 0; - param++; -} - -static void -push() -{ - if (stkidx < STKSIZ) - stack[stkidx++] = onstack; -} - -static void -getparam(p, n) - int p; - int n; -{ - if (rflag) - if (p == 1) - p++; - else if (p == 2) - p--; - if (onstack == p) { - if (n > 1) { - *d++ = '%'; - *d++ = 'P'; - *d++ = 'a'; - while (n--) { - *d++ = '%'; - *d++ = 'g'; - *d++ = 'a'; - } - } - return; - } - if (onstack) - push(); - onstack = p; - while (n--) { - *d++ = '%'; - *d++ = 'p'; - *d++ = '0' + p; - } - if (nflag && p < 3) { - *d++ = '%'; - *d++ = '{'; - *d++ = '9'; - *d++ = '6'; - *d++ = '}'; - *d++ = '%'; - *d++ = '^'; - } -} - -static int -cvtchar(p) - const char *p; -{ - unsigned char ch = 0; - int len; - - switch (*p) { - case '\\': - switch (*++p) { - case '\'': - case '$': - case '\\': - case '%': - ch = *p; - len = 2; - break; - case '\0': - ch = '\\'; - len = 1; - break; - case '0': - case '1': - case '2': - case '3': - len = 1; - while (isdigit(*p)) { - ch = ch * 8 + (*p++ - '0'); - len++; - } - break; - default: - ch = *p; - len = 2; - break; - } - break; - case '^': - ch = (*++p & 0x1F); - len = 2; - break; - default: - ch = *p; - len = 1; - break; - } - - if (isgraph(ch) && ch != ',' && ch != '\'' && ch != '\\' && ch != ':') { - *d++ = '%'; - *d++ = '\''; - *d++ = ch; - *d++ = '\''; - } - else { - *d++ = '%'; - *d++ = '{'; - if (ch > 99) - *d++ = ch / 100 + '0'; - if (ch > 9) - *d++ = ((int)ch / 10) % 10 + '0'; - *d++ = ch % 10 + '0'; - *d++ = '}'; - } - return len; -} - -char * -_ti_captoinfo(cap) - const char *cap; -{ - char ch, new[4096]; - const char *cost; - - if (cap == NULL) - return NULL; - stkidx = 0; - onstack = 0; - nflag = 0; - rflag = 0; - param = 1; - d = new; - cost = NULL; - if (isdigit(*cap)) - for (cost = cap; isdigit(*cap) || *cap == '*' || *cap == '.'; cap++) - ; - - while (*cap) { - switch (*cap) { - case '%': - cap++; - switch (ch = *cap++) { - case '%': - *d++ = '%'; - break; - case 'r': - rflag++; - break; - case 'n': - nflag++; - break; - case 'i': - *d++ = '%'; - *d++ = 'i'; - break; - case '6': - case 'B': - getparam(param, 2); - *d++ = '%'; - *d++ = '{'; - *d++ = '6'; - *d++ = '}'; - *d++ = '%'; - *d++ = '*'; - *d++ = '%'; - *d++ = '+'; - break; - case '8': - case 'D': - getparam(param, 2); - *d++ = '%'; - *d++ = '{'; - *d++ = '2'; - *d++ = '}'; - *d++ = '%'; - *d++ = '*'; - *d++ = '%'; - *d++ = '-'; - break; - case '>': - getparam(param, 2); - *d++ = '%'; - *d++ = '?'; - cap += cvtchar(cap); - *d++ = '%'; - *d++ = '>'; - *d++ = '%'; - *d++ = 't'; - cap += cvtchar(cap); - *d++ = '%'; - *d++ = '+'; - *d++ = '%'; - *d++ = ';'; - break; - case 'a': - getparam(param, 1); - cap += cvtchar(cap); - *d++ = '%'; - *d++ = '+'; - break; - case 'd': - case 's': - getparam(param, 1); - *d++ = '%'; - *d++ = ch; - pop(); - break; - case '+': - case '-': - getparam(param, 1); - cap += cvtchar(cap); - *d++ = '%'; - *d++ = ch; - *d++ = '%'; - *d++ = 'c'; - pop(); - break; - case '.': - getparam(param, 1); - *d++ = '%'; - *d++ = 'c'; - pop(); - break; - case '2': - case '3': - getparam(param, 1); - *d++ = '%'; - *d++ = ch; - *d++ = 'd'; - pop(); - break; - case '\\': - *d++ = '%'; - *d++ = '\\'; - break; - default: - *d++ = '%'; - cap--; - break; - } - break; - default: - *d++ = *cap++; - break; - } - } - - if (cost) { - *d++ = '$'; - *d++ = '<'; - for (cap = cost;; cap++) - if (isdigit(*cap) || *cap == '*' || *cap == '.') - *d++ = *cap; - else - break; - *d++ = '/'; - *d++ = '>'; - } - - *d = '\0'; - - return strdup(new); -} diff --git a/lib/libtermlib/def_prog_mode.c b/lib/libtermlib/def_prog_mode.c deleted file mode 100644 index 63bdbc5c2d5..00000000000 --- a/lib/libtermlib/def_prog_mode.c +++ /dev/null @@ -1,49 +0,0 @@ -/* $OpenBSD: def_prog_mode.c,v 1.1 1996/05/31 05:40:02 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: def_prog_mode.c,v 1.1 1996/05/31 05:40:02 tholo Exp $"; -#endif - -#include <unistd.h> -#include <sys/ioctl.h> -#include "term.h" - -/* - * Save current mode as "program" mode, so that it can later be - * restored using reset_prog_mode() - */ -int -def_prog_mode() -{ - return (tcgetattr(cur_term->fd, &cur_term->pmode) == 0) ? OK : ERR; -} diff --git a/lib/libtermlib/def_shell_mode.c b/lib/libtermlib/def_shell_mode.c deleted file mode 100644 index f202ec26057..00000000000 --- a/lib/libtermlib/def_shell_mode.c +++ /dev/null @@ -1,49 +0,0 @@ -/* $OpenBSD: def_shell_mode.c,v 1.1 1996/05/31 05:40:02 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: def_shell_mode.c,v 1.1 1996/05/31 05:40:02 tholo Exp $"; -#endif - -#include <unistd.h> -#include <sys/ioctl.h> -#include "term.h" - -/* - * Save current mode as default "shell" mode so that it can later - * be restored with reset_shell_mode() - */ -int -def_shell_mode() -{ - return (tcgetattr(cur_term->fd, &cur_term->smode) == 0) ? OK : ERR; -} diff --git a/lib/libtermlib/del_curterm.c b/lib/libtermlib/del_curterm.c deleted file mode 100644 index bc55d8897fe..00000000000 --- a/lib/libtermlib/del_curterm.c +++ /dev/null @@ -1,70 +0,0 @@ -/* $OpenBSD: del_curterm.c,v 1.2 1996/08/31 02:40:30 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: del_curterm.c,v 1.2 1996/08/31 02:40:30 tholo Exp $"; -#endif - -#include <stdlib.h> -#include "term.h" - -extern TERMINAL _ti_empty; - -/* - * Free storage associated with the terminal description - * passed in. Note that it is legal to free cur_term in - * this manner. If this is done, we also set cur_term - * to NULL so that any references to that will cause an - * error unless it is reinitialized with a call to - * set_curterm() or setupterm() - */ -int -del_curterm(term) - TERMINAL *term; -{ - int i; - - if (term == &_ti_empty) - return OK; - for (i = 0; i < _tStrCnt; i++) - if (term->strs[i] != NULL) - free(term->strs[i]); - free(term->name); - free(term); - /* - * If the terminal description just freed was the current - * one, set cur_term to NULL - */ - if (term == cur_term) - cur_term = &_ti_empty; - return OK; -} diff --git a/lib/libtermlib/fillcap.c b/lib/libtermlib/fillcap.c deleted file mode 100644 index 0b3ce2b26ff..00000000000 --- a/lib/libtermlib/fillcap.c +++ /dev/null @@ -1,124 +0,0 @@ -/* $OpenBSD: fillcap.c,v 1.4 1998/01/17 16:35:05 millert Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: fillcap.c,v 1.4 1998/01/17 16:35:05 millert Exp $"; -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "term.h" -#include "term.private.h" - -void -_ti_fillcap(term) - struct _terminal *term; -{ - TERMINAL *save = cur_term; - char buf[4096]; - - cur_term = term; - if (carriage_return == NULL) - if (carriage_return_delay > 0) { - sprintf(buf, "\r$<%d>", carriage_return_delay); - carriage_return = strdup(buf); - } - else - carriage_return = strdup("\r"); - if (cursor_left == NULL) - if (backspace_delay > 0) { - sprintf(buf, "\b$<%d>", backspace_delay); - cursor_left = strdup(buf); - } - else if (backspaces_with_bs) - cursor_left = strdup("\b"); - else if (backspace_if_not_bs != NULL) - cursor_left = strdup(backspace_if_not_bs); - if (cursor_down == NULL) - if (linefeed_if_not_lf != NULL) - cursor_down = strdup(linefeed_if_not_lf); - else if (linefeed_is_newline != 1) - if (new_line_delay > 0) { - sprintf(buf, "\n$<%d>", new_line_delay); - cursor_down = strdup(buf); - } - else - cursor_down = strdup("\n"); - if (newline == NULL) - if (linefeed_is_newline == 1) { - if (new_line_delay > 0) { - sprintf(buf, "\n$<%d>", new_line_delay); - newline = strdup(buf); - } - else - newline = strdup("\n"); - } - else if (carriage_return != NULL && carriage_return_delay <= 0) { - if (linefeed_if_not_lf != NULL) { - strncpy(buf, carriage_return, (sizeof(buf) >> 1) -1); - buf[(sizeof(buf) >> 1) -1] = '\0'; - strncat(buf, linefeed_if_not_lf, sizeof(buf) - strlen(buf)); - } - else if (new_line_delay > 0) - sprintf(buf, "%s\n$<%d>", carriage_return, new_line_delay); - else { - strncpy(buf, carriage_return, sizeof(buf) >> 1); - buf[(sizeof(buf) >> 1) - 1] = '\0'; - strncat(buf, "\n", sizeof(buf) - strlen(buf)); - } - newline = strdup(buf); - } - if (return_does_clr_eol || no_correctly_working_cr) { - if (carriage_return != NULL) - free(carriage_return); - carriage_return = NULL; - } - if (tab == NULL) - if (horizontal_tab_delay > 0) { - sprintf(buf, "\t$<%d>", horizontal_tab_delay); - tab = strdup(buf); - } - else - tab = strdup("\t"); - if (init_tabs == 0 && has_hardware_tabs == 1) - init_tabs = 8; - if (key_backspace == NULL) - key_backspace = strdup("\b"); - if (key_left == NULL) - key_left = strdup("\b"); - if (key_down == NULL) - key_down = strdup("\n"); - if (gnu_has_meta_key == 1 && has_meta_key == 0) - has_meta_key = 1; - cur_term = save; -} diff --git a/lib/libtermlib/findcap.c b/lib/libtermlib/findcap.c deleted file mode 100644 index 848625b7506..00000000000 --- a/lib/libtermlib/findcap.c +++ /dev/null @@ -1,64 +0,0 @@ -/* $OpenBSD: findcap.c,v 1.1 1996/05/31 05:40:02 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: findcap.c,v 1.1 1996/05/31 05:40:02 tholo Exp $"; -#endif - -#include <stdlib.h> -#include <string.h> -#include "term.private.h" - -static int compare __P((const void *, const void *)); - -/* - * Compare routine for bsearch(); see if the current entry matches - * the one we want - */ -static int -compare(p1, p2) - const void *p1; - const void *p2; -{ - return strcmp((const char *)p1, ((const struct xtoidx *)p2)->name); -} - -/* - * Given a termcap capability name, find the structure describing it. - * Note that the capability list _must_ be sorted - */ -struct xtoidx * -_ti_findcap(capname) - const char *capname; -{ - return bsearch(capname, _ti_captoidx, _ti_numcaps, sizeof(struct xtoidx), compare); -} diff --git a/lib/libtermlib/findinfo.c b/lib/libtermlib/findinfo.c deleted file mode 100644 index 909e87db91b..00000000000 --- a/lib/libtermlib/findinfo.c +++ /dev/null @@ -1,64 +0,0 @@ -/* $OpenBSD: findinfo.c,v 1.1 1996/05/31 05:40:02 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: findinfo.c,v 1.1 1996/05/31 05:40:02 tholo Exp $"; -#endif - -#include <stdlib.h> -#include <string.h> -#include "term.private.h" - -static int compare __P((const void *, const void *)); - -/* - * Compare routine for bsearch(); see if the current entry matches - * the one we want - */ -static int -compare(p1, p2) - const void *p1; - const void *p2; -{ - return strcmp((const char *)p1, ((const struct xtoidx *)p2)->name); -} - -/* - * Given a terminfo capability name, find the structure describing it. - * Note that the capability list _must_ be sorted - */ -struct xtoidx * -_ti_findinfo(capname) - const char *capname; -{ - return bsearch(capname, _ti_infotoidx, _ti_numinfos, sizeof(struct xtoidx), compare); -} diff --git a/lib/libtermlib/getterm.c b/lib/libtermlib/getterm.c deleted file mode 100644 index d9b6ee77376..00000000000 --- a/lib/libtermlib/getterm.c +++ /dev/null @@ -1,448 +0,0 @@ -/* $OpenBSD: getterm.c,v 1.16 1998/01/17 16:35:06 millert Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: getterm.c,v 1.16 1998/01/17 16:35:06 millert Exp $"; -#endif - -#include <err.h> -#include <stdlib.h> -#include <string.h> -#include <sys/param.h> -#include <sys/ioctl.h> -#include "term.h" -#include "term.private.h" -#include "pathnames.h" - -#define PVECSIZ 32 -#define MAXSIZE 256 /* Maximum allowed size of a terminal name field */ - -TERMINAL *cur_term; -char *_ti_buf; -char *UP; -char *BC; -char PC; -int LINES, COLS, TABSIZE; -char ttytype[MAXSIZE]; - -static int _ti_use_env = TRUE; - -/* - * Internal routine to read in a terminal description. - * Currently supports reading from termcap files and databases - * only; should be extended to also support reading from binary - * terminfo files - * - * Will also set up global variables for compatibility with old - * termcap routines, as well as populate cur_term's capability - * variables. If called from the termcap tgetent() compatibility - * routine, it will copy the termcap entry into the buffer - * provided to that routine. Note that no other code in this - * library depends on the termcap entry being kept - */ -int -_ti_gettermcap(name) - const char *name; -{ - register char *p; - register char *cp; - char *dummy; - char **fname; - char *home; - int i; - char pathbuf[MAXPATHLEN+1]; /* holds raw path of filenames */ - char *pathvec[PVECSIZ]; /* to point to names in pathbuf */ - char *termpath; - long num; - - fname = pathvec; - p = pathbuf; - cp = getenv("TERMCAP"); - /* - * TERMCAP can have one of two things in it. It can be the - * name of a file to use instead of /etc/termcap. In this - * case it better start with a "/". Or it can be an entry to - * use so we don't have to read the file. In this case it - * has to already have the newlines crunched out. If TERMCAP - * does not hold a file name then a path of names is searched - * instead. The path is found in the TERMPATH variable, or - * becomes "$HOME/.termcap /etc/termcap" if no TERMPATH exists. - */ - if (!cp || *cp != '/') { /* no TERMCAP or it holds an entry */ - if ((termpath = getenv("TERMPATH")) != NULL) - strncpy(pathbuf, termpath, sizeof(pathbuf)-1); - else { - if ((home = getenv("HOME")) != NULL) { - /* set up default */ - /* $HOME first */ - strncpy(pathbuf, home, sizeof(pathbuf) - 1 - - strlen(_PATH_CAPDEF) - 1); - pathbuf[sizeof(pathbuf) - 1 - strlen(_PATH_CAPDEF) - 1] = '\0'; - p += strlen(pathbuf); /* path, looking in */ - *p++ = '/'; - } /* if no $HOME look in current directory */ - strncpy(p, _PATH_CAPDEF, sizeof(pathbuf) - 1 - (p - pathbuf)); - } - } - else /* user-defined name in TERMCAP */ - strncpy(pathbuf, cp, sizeof(pathbuf)-1); /* still can be tokenized */ - pathbuf[sizeof(pathbuf)-1] = '\0'; - - *fname++ = pathbuf; /* tokenize path into vector of names */ - while (*++p) - if (*p == ' ' || *p == ':') { - *p = '\0'; - while (*++p) - if (*p != ' ' && *p != ':') - break; - if (*p == '\0') - break; - *fname++ = p; - if (fname >= pathvec + PVECSIZ) { - fname--; - break; - } - } - *fname = (char *) 0; /* mark end of vector */ - if (cp && *cp && *cp != '/') - if (cgetset(cp) < 0) - return (-2); - - dummy = NULL; - i = cgetent(&dummy, pathvec, (char *)name); - - if (i == 0) { - char *s; - - if ((s = home = strchr(dummy, ':')) == NULL) { - cur_term->name = cur_term->names = strdup(name); - strncpy(ttytype, name, MAXSIZE - 1); - ttytype[MAXSIZE - 1] = '\0'; - } - else { - size_t n; - - n = s - dummy - (dummy[2] == '|' ? 3 : 0); - cur_term->names = malloc(n + 1); - strncpy(cur_term->names, dummy + (dummy[2] == '|' ? 3 : 0), n); - cur_term->names[n] = '\0'; - strncpy(ttytype, dummy + (dummy[2] == '|' ? 3 : 0), - (size_t)MIN(MAXSIZE - 1, s - dummy)); - ttytype[MAXSIZE - 1] = '\0'; - *home = '\0'; - while (s > dummy && *s != '|') - s--; - if (s > dummy) - s++; - cur_term->name = strdup(s); - *home = ':'; - } - for (i = 0; i < _ti_numcaps; i++) { - switch (_ti_captoidx[i].type) { - case TYPE_BOOL: - if (cgetcap(dummy, (char *)_ti_captoidx[i].name, ':') == NULL) - cur_term->bools[_ti_captoidx[i].idx] = 0; - else - cur_term->bools[_ti_captoidx[i].idx] = 1; - break; - case TYPE_NUM: - if (cgetnum(dummy, (char *)_ti_captoidx[i].name, &num) < 0) - cur_term->nums[_ti_captoidx[i].idx] = 0; - else - cur_term->nums[_ti_captoidx[i].idx] = (int)num; - break; - case TYPE_STR: - if (cgetstr(dummy, (char *)_ti_captoidx[i].name, &s) < 0) - cur_term->strs[_ti_captoidx[i].idx] = NULL; - else { - cur_term->strs[_ti_captoidx[i].idx] = _ti_captoinfo(s); - free(s); - } - break; - } - } - if (_ti_buf) { - strncpy(_ti_buf, dummy, 1023); - _ti_buf[1023] = '\0'; - if ((cp = strrchr(_ti_buf, ':')) != NULL) - if (cp[1] != '\0') - cp[1] = '\0'; - } - i = 0; - } - - /* We are done with the returned termcap buffer now; free it */ - if (dummy) - free(dummy); - - /* we found a "tc" reference loop, return error */ - if (i == -3) - return (-1); - - return (i + 1); -} - -/* - * Internal routine to read in a terminal description. - * Currently supports reading from termcap files and databases - * only; should be extended to also support reading from binary - * terminfo files - * - * Will also set up global variables for compatibility with old - * termcap routines, as well as populate cur_term's capability - * variables. If called from the termcap tgetent() compatibility - * routine, it will copy the termcap entry into the buffer - * provided to that routine. Note that no other code in this - * library depends on the termcap entry being kept - */ -int -_ti_getterminfo(name) - const char *name; -{ - register char *p; - register char *cp; - char *dummy; - char **fname; - char *home; - int i; - char pathbuf[MAXPATHLEN+1]; /* holds raw path of filenames */ - char *pathvec[PVECSIZ]; /* to point to names in pathbuf */ - char *termpath; - long num; - - fname = pathvec; - p = pathbuf; - /* - * TERMCAP can have one of two things in it. It can be the - * name of a file to use instead of /etc/termcap. In this - * case it better start with a "/". Or it can be an entry to - * use so we don't have to read the file. In this case it - * has to already have the newlines crunched out. If TERMCAP - * does not hold a file name then a path of names is searched - * instead. The path is found in the TERMINFO variable, or - * becomes "$HOME/.terminfo /usr/share/misc/terminfo" if no - * TERMINFO exists. - */ - if ((termpath = getenv("TERMINFO")) != NULL) - strncpy(pathbuf, termpath, sizeof(pathbuf) - 1); - else { - if ((home = getenv("HOME")) != NULL) { - /* set up default */ - /* $HOME first */ - strncpy(pathbuf, home, sizeof(pathbuf) - 1 - - strlen(_PATH_INFODEF) - 1); - pathbuf[sizeof(pathbuf) - 1 - strlen(_PATH_INFODEF) - 1] = '\0'; - p += strlen(home); /* path, looking in */ - *p++ = '/'; - } /* if no $HOME look in current directory */ - strncpy(p, _PATH_INFODEF, sizeof(pathbuf) - 1 - (p - pathbuf)); - } - pathbuf[sizeof(pathbuf) - 1] = '\0'; - - *fname++ = pathbuf; /* tokenize path into vector of names */ - while (*++p) - if (*p == ' ' || *p == ':') { - *p = '\0'; - while (*++p) - if (*p != ' ' && *p != ':') - break; - if (*p == '\0') - break; - *fname++ = p; - if (fname >= pathvec + PVECSIZ) { - fname--; - break; - } - } - *fname = (char *) 0; /* mark end of vector */ - (void) cgetset(NULL); - - dummy = NULL; - i = cgetent(&dummy, pathvec, (char *)name); - - if (i == 0) { - char *s; - - if ((s = home = strchr(dummy, ':')) == NULL) { - cur_term->name = cur_term->names = strdup(name); - strncpy(ttytype, name, MAXSIZE - 1); - ttytype[MAXSIZE - 1] = '\0'; - } - else { - size_t n; - - n = s - dummy - (dummy[2] == '|' ? 3 : 0); - cur_term->names = malloc(n + 1); - strncpy(cur_term->names, dummy + (dummy[2] == '|' ? 3 : 0), n); - cur_term->names[n] = '\0'; - strncpy(ttytype, dummy + (dummy[2] == '|' ? 3 : 0), - (size_t)MIN(MAXSIZE - 1, s - dummy)); - ttytype[MAXSIZE - 1] = '\0'; - *home = '\0'; - while (s > dummy && *s != '|') - s--; - if (s > dummy) - s++; - cur_term->name = strdup(s); - *home = ':'; - } - for (i = 0 ; i < _tBoolCnt ; i++) { - if (cgetcap(dummy, (char *)boolcodes[i], ':') == NULL) - cur_term->bools[i] = 0; - else - cur_term->bools[i] = 1; - } - for (i = 0 ; i < _tNumCnt ; i++) { - if (cgetnum(dummy, (char *)numcodes[i], &num) < 0) - cur_term->nums[i] = 0; - else - cur_term->nums[i] = (int)num; - } - for (i = 0 ; i < _tStrCnt ; i++) { - if (cgetstr(dummy, (char *)strcodes[i], &s) < 0) - cur_term->strs[i] = NULL; - else - cur_term->strs[i] = s; - } - if (_ti_buf) { - strncpy(_ti_buf, dummy, 1023); - _ti_buf[1023] = '\0'; - if ((cp = strrchr(_ti_buf, ':')) != NULL) - if (cp[1] != '\0') - cp[1] = '\0'; - } - i = 0; - } - - /* We are done with the returned termcap buffer now; free it */ - if (dummy) - free(dummy); - - /* we found a "tc" reference loop, return error */ - if (i == -3) - return (-1); - - return (i + 1); -} - -void -_ti_get_screensize(linep, colp, tabp) - int *linep; - int *colp; - int *tabp; -{ - char *s; -#ifdef TIOCGWINSZ - struct winsize winsz; -#endif - - *linep = lines; - *colp = columns; - if (tabp != NULL) { - if (init_tabs == 0) - init_tabs = *tabp = 8; - else - *tabp = init_tabs; - } - if (_ti_use_env) { -#ifdef TIOCGWINSZ - /* - * get the current window size, overrides entries in termcap - */ - if (ioctl(cur_term->fd, TIOCGWINSZ, &winsz) >= 0) { - if (winsz.ws_row > 0) - *linep = winsz.ws_row; - if (winsz.ws_col > 0) - *colp = winsz.ws_col; - } -#endif - /* - * LINES and COLS environment variables overrides any other - * method of getting the terminal window size - */ - if ((s = getenv("LINES")) != NULL) - *linep = atoi(s); - if ((s = getenv("COLUMNS")) != NULL) - *colp = atoi(s); - } - lines = *linep; - columns = *colp; -} - -int -_ti_getterm(name) - const char *name; -{ - int ret = 1; - char *s; - - s = getenv("TERMCAP"); - if (s && *s == '/') - s = NULL; - if (_ti_buf || s) { - if (_ti_gettermcap(name) != 1) { - del_curterm(cur_term); - if ((cur_term = calloc(sizeof(TERMINAL), 1)) == NULL) - errx(1, "No memory for terminal description"); - ret = _ti_getterminfo(name); - } - } - else { - if (_ti_getterminfo(name) != 1) { - del_curterm(cur_term); - if ((cur_term = calloc(sizeof(TERMINAL), 1)) == NULL) - errx(1, "No memory for terminal description"); - ret = _ti_gettermcap(name); - } - } - - if (ret == 1) { - _ti_fillcap(cur_term); - UP = cursor_up; - BC = backspace_if_not_bs; - PC = pad_char ? pad_char[0] : '\0'; - _ti_get_screensize(&LINES, &COLS, &TABSIZE); - } - return ret; -} - -/* - * Allows the calling program to not have the window size or - * environment variables LINES and COLS override the termcap - * or terminfo lines/columns specifications - */ -void -use_env(flag) - int flag; -{ - _ti_use_env = flag; -} diff --git a/lib/libtermlib/globals.c b/lib/libtermlib/globals.c deleted file mode 100644 index 2d5b6f5dcb2..00000000000 --- a/lib/libtermlib/globals.c +++ /dev/null @@ -1,43 +0,0 @@ -/* $OpenBSD: globals.c,v 1.4 1996/12/09 01:18:17 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: globals.c,v 1.4 1996/12/09 01:18:17 tholo Exp $"; -#endif - -#include "term.h" - -TERMINAL _ti_empty = { - -1, 9600, { 0 }, { 0 }, "dumb", "dumb", { 0 }, { 80, 0, 24 }, { 0 } - }; - -TERMINAL *cur_term = &_ti_empty; diff --git a/lib/libtermlib/mkcaps.sh b/lib/libtermlib/mkcaps.sh deleted file mode 100644 index 0387a871599..00000000000 --- a/lib/libtermlib/mkcaps.sh +++ /dev/null @@ -1,54 +0,0 @@ -#! /bin/sh -# -# $OpenBSD: mkcaps.sh,v 1.1 1996/05/31 05:40:02 tholo Exp $ -# -# Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -# must display the following acknowledgement: -# This product includes software developed by SigmaSoft, Th. Lockert. -# 4. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -# THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -cat $1 -awk -- ' -$1 == "bool" { - printf "#define\t%-30s\t(cur_term->bools[%d])\n", $2, boolcnt++ - } -$1 == "num" { - printf "#define\t%-30s\t(cur_term->nums[%d])\n", $2, numcnt++ - } -$1 == "str" { - printf "#define\t%-30s\t(cur_term->strs[%d])\n", $2, strcnt++ - } - -END { - printf "\n#define\t_tBoolCnt\t%d\n", boolcnt - printf "#define\t_tNumCnt\t%d\n", numcnt - printf "#define\t_tStrCnt\t%d\n", strcnt - } -' < $2 -cat $3 - -exit 0 diff --git a/lib/libtermlib/mkinfo.c b/lib/libtermlib/mkinfo.c deleted file mode 100644 index acb019d45de..00000000000 --- a/lib/libtermlib/mkinfo.c +++ /dev/null @@ -1,269 +0,0 @@ -/* $OpenBSD: mkinfo.c,v 1.1 1996/05/31 05:40:02 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: mkinfo.c,v 1.1 1996/05/31 05:40:02 tholo Exp $"; -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <err.h> -#include "term.private.h" - -int main __P((int, char *[])); -int caporder __P((const void *, const void *)); -int infoorder __P((const void *, const void *)); - -struct caps { - int type; - int index; - char *name; - char *info; - char *cap; -}; - -/* - * Create sorted capability lists and other data files needed - * for the terminfo library - */ -int -main(argc, argv) - int argc; - char *argv[]; -{ - char *line, *type, *name, *info, *cap; - int numbool, numnum, numstr; - int binbool, binnum, binstr; - int i, maxcaps, numcaps; - struct caps *cp; - size_t len; - FILE *fp; - - if (argc != 2) - errx(1, "Usage: mkinfo Capabilities"); - if ((fp = fopen(argv[1], "r")) == NULL) - err(1, "Could not open '%s' for read", argv[1]); - numbool = numnum = numstr = numcaps = 0; - binbool = binnum = binstr = -1; - cp = calloc(sizeof(struct caps), maxcaps = 32); - while ((line = fgetln(fp, &len)) != NULL && len > 0) { - if (line[len - 1] != '\n') { - warnx("Last input line bad"); - continue; - } - line[len - 1] = '\0'; - if (strncmp(line, "#endbinary", 10) == 0) { - binbool = numbool; - binnum = numnum; - binstr = numstr; - } - if (line[0] == '\0' || line[0] == '#') - continue; - if ((type = strtok(line, " \t")) == NULL) { - warnx("Bad input line"); - continue; - } - if ((name = strtok(NULL, " \t")) == NULL) { - warnx("Bad input line"); - continue; - } - if ((info = strtok(NULL, " \t")) == NULL) { - warnx("Bad input line"); - continue; - } - if ((cap = strtok(NULL, " \t")) == NULL) { - warnx("Bad input line"); - continue; - } - if (strcmp(type, "bool") == 0) { - cp[numcaps].type = TYPE_BOOL; - cp[numcaps].index = numbool++; - } - else if (strcmp(type, "num") == 0) { - cp[numcaps].type = TYPE_NUM; - cp[numcaps].index = numnum++; - } - else if (strcmp(type, "str") == 0) { - cp[numcaps].type = TYPE_STR; - cp[numcaps].index = numstr++; - } - else { - warnx("Bad type '%s' encountered", type); - continue; - } - cp[numcaps].name = strdup(name); - cp[numcaps].info = strdup(info); - cp[numcaps++].cap = strdup(cap); - if (numcaps == maxcaps) { - maxcaps <<= 1; - if ((cp = realloc(cp, maxcaps * sizeof(struct caps))) == NULL) - errx(1, "Out of memory"); - } - } - fclose(fp); - - if ((fp = fopen("boolnames.c", "w")) == NULL) - err(1, "Could not open 'boolnames.c' for writing"); - fprintf(fp, "/* This file automatically generated. Do not edit. */\n\n"); - fprintf(fp, "const char * const boolnames[] = {\n"); - for (i = 0; i < numcaps; i++) - if (cp[i].type == TYPE_BOOL) - fprintf(fp, "\t\"%s\",\n", cp[i].name); - fprintf(fp, "};\n"); - fclose(fp); - if ((fp = fopen("boolcodes.c", "w")) == NULL) - err(1, "Could not open 'boolcodes.c' for writing"); - fprintf(fp, "/* This file automatically generated. Do not edit. */\n\n"); - fprintf(fp, "const char * const boolcodes[] = {\n"); - for (i = 0; i < numcaps; i++) - if (cp[i].type == TYPE_BOOL) - fprintf(fp, "\t\"%s\",\n", cp[i].info); - fprintf(fp, "};\n"); - fclose(fp); - if ((fp = fopen("boolfnames.c", "w")) == NULL) - err(1, "Could not open 'boolfnames.c' for writing"); - fprintf(fp, "/* This file automatically generated. Do not edit. */\n\n"); - fprintf(fp, "const char * const boolfnames[] = {\n"); - for (i = 0; i < numcaps; i++) - if (cp[i].type == TYPE_BOOL) - fprintf(fp, "\t\"%s\",\n", cp[i].cap); - fprintf(fp, "};\n"); - fclose(fp); - - if ((fp = fopen("numnames.c", "w")) == NULL) - err(1, "Could not open 'numnames.c' for writing"); - fprintf(fp, "/* This file automatically generated. Do not edit. */\n\n"); - fprintf(fp, "const char * const numnames[] = {\n"); - for (i = 0; i < numcaps; i++) - if (cp[i].type == TYPE_NUM) - fprintf(fp, "\t\"%s\",\n", cp[i].name); - fprintf(fp, "};\n"); - fclose(fp); - if ((fp = fopen("numcodes.c", "w")) == NULL) - err(1, "Could not open 'numcodes.c' for writing"); - fprintf(fp, "/* This file automatically generated. Do not edit. */\n\n"); - fprintf(fp, "const char * const numcodes[] = {\n"); - for (i = 0; i < numcaps; i++) - if (cp[i].type == TYPE_NUM) - fprintf(fp, "\t\"%s\",\n", cp[i].info); - fprintf(fp, "};\n"); - fclose(fp); - if ((fp = fopen("numfnames.c", "w")) == NULL) - err(1, "Could not open 'numfnames.c' for writing"); - fprintf(fp, "/* This file automatically generated. Do not edit. */\n\n"); - fprintf(fp, "const char * const numfnames[] = {\n"); - for (i = 0; i < numcaps; i++) - if (cp[i].type == TYPE_NUM) - fprintf(fp, "\t\"%s\",\n", cp[i].cap); - fprintf(fp, "};\n"); - fclose(fp); - - if ((fp = fopen("strnames.c", "w")) == NULL) - err(1, "Could not open 'strnames.c' for writing"); - fprintf(fp, "/* This file automatically generated. Do not edit. */\n\n"); - fprintf(fp, "const char * const strnames[] = {\n"); - for (i = 0; i < numcaps; i++) - if (cp[i].type == TYPE_STR) - fprintf(fp, "\t\"%s\",\n", cp[i].name); - fprintf(fp, "};\n"); - fclose(fp); - if ((fp = fopen("strcodes.c", "w")) == NULL) - err(1, "Could not open 'strcodes.c' for writing"); - fprintf(fp, "/* This file automatically generated. Do not edit. */\n\n"); - fprintf(fp, "const char * const strcodes[] = {\n"); - for (i = 0; i < numcaps; i++) - if (cp[i].type == TYPE_STR) - fprintf(fp, "\t\"%s\",\n", cp[i].info); - fprintf(fp, "};\n"); - fclose(fp); - if ((fp = fopen("strfnames.c", "w")) == NULL) - err(1, "Could not open 'strfnames.c' for writing"); - fprintf(fp, "/* This file automatically generated. Do not edit. */\n\n"); - fprintf(fp, "const char * const strfnames[] = {\n"); - for (i = 0; i < numcaps; i++) - if (cp[i].type == TYPE_STR) - fprintf(fp, "\t\"%s\",\n", cp[i].cap); - fprintf(fp, "};\n"); - fclose(fp); - - qsort(cp, numcaps, sizeof(struct caps), caporder); - if ((fp = fopen("captoidx.c", "w")) == NULL) - err(1, "Could not open 'captoidx.c' for writing"); - fprintf(fp, "/* This file automatically generated. Do not edit. */\n\n"); - fprintf(fp, "#include <stdlib.h>\n\n"); - fprintf(fp, "#include \"term.private.h\"\n\n"); - fprintf(fp, "const struct xtoidx _ti_captoidx[] = {\n"); - for (i = 0; i < numcaps; i++) - fprintf(fp, "\t{ \"%s\",\t%d,\t%d },\n", cp[i].cap, cp[i].index, cp[i].type); - fprintf(fp, "};\n\n"); - fprintf(fp, "size_t _ti_numcaps = %d;\n", numcaps); - fclose(fp); - - qsort(cp, numcaps, sizeof(struct caps), infoorder); - if ((fp = fopen("infotoidx.c", "w")) == NULL) - err(1, "Could not open 'infotoidx.c' for writing"); - fprintf(fp, "/* This file automatically generated. Do not edit. */\n\n"); - fprintf(fp, "#include <stdlib.h>\n\n"); - fprintf(fp, "#include \"term.private.h\"\n\n"); - fprintf(fp, "const struct xtoidx _ti_infotoidx[] = {\n"); - for (i = 0; i < numcaps; i++) - fprintf(fp, "\t{ \"%s\",\t%d,\t%d },\n", cp[i].info, cp[i].index, cp[i].type); - fprintf(fp, "};\n\n"); - fprintf(fp, "size_t _ti_numinfos = %d;\n", numcaps); - fclose(fp); - - if ((fp = fopen("binaries.h", "w")) == NULL) - err(1, "Could not open 'binaries.h' for writing"); - fprintf(fp, "/* This file automatically generated. Do not edit. */\n\n"); - fprintf(fp, "#define BIN_BOOL_CNT\t%d\n", binbool); - fprintf(fp, "#define BIN_NUM_CNT\t%d\n", binnum); - fprintf(fp, "#define BIN_STR_CNT\t%d\n", binstr); - fclose(fp); - exit(0); -} - -int -caporder(p1, p2) - const void *p1; - const void *p2; -{ - return strcmp(((struct caps *)p1)->cap, ((struct caps *)p2)->cap); -} - -int -infoorder(p1, p2) - const void *p1; - const void *p2; -{ - return strcmp(((struct caps *)p1)->info, ((struct caps *)p2)->info); -} diff --git a/lib/libtermlib/mvcur.c b/lib/libtermlib/mvcur.c deleted file mode 100644 index 4d5e6b480ba..00000000000 --- a/lib/libtermlib/mvcur.c +++ /dev/null @@ -1,50 +0,0 @@ -/* $OpenBSD: mvcur.c,v 1.3 1996/10/12 03:08:25 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: mvcur.c,v 1.3 1996/10/12 03:08:25 tholo Exp $"; -#endif - -#include <sys/cdefs.h> - -#ifdef __indr_reference -__indr_reference(_mvcur, mvcur); -#else - -#include <stdlib.h> -#include "term.h" - -#define _mvcur mvcur -#define rcsid _rcsid -#include "_mvcur.c" - -#endif diff --git a/lib/libtermlib/outc.c b/lib/libtermlib/outc.c deleted file mode 100644 index e4d0f2af9bc..00000000000 --- a/lib/libtermlib/outc.c +++ /dev/null @@ -1,55 +0,0 @@ -/* $OpenBSD: outc.c,v 1.1 1996/05/31 05:40:02 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: outc.c,v 1.1 1996/05/31 05:40:02 tholo Exp $"; -#endif - -#include <stdio.h> -#include "term.h" -#include "term.private.h" - -/* - * Character output routine suitable for use as argument to - * tputs() and vidputs() routines - * - * Always uses standard out as output - */ -int -_ti_outc(c) - int c; -{ - putc(c, stdout); - if (ferror(stdout)) - return ERR; - return OK; -} diff --git a/lib/libtermlib/pathnames.h b/lib/libtermlib/pathnames.h deleted file mode 100644 index 72c44d3d89b..00000000000 --- a/lib/libtermlib/pathnames.h +++ /dev/null @@ -1,34 +0,0 @@ -/* $OpenBSD: pathnames.h,v 1.2 1996/07/22 03:13:54 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#define _PATH_CAPDEF ".termcap /usr/share/misc/termcap" -#define _PATH_INFODEF ".terminfo /usr/share/misc/terminfo" diff --git a/lib/libtermlib/putp.c b/lib/libtermlib/putp.c deleted file mode 100644 index e8ee8ce9fe8..00000000000 --- a/lib/libtermlib/putp.c +++ /dev/null @@ -1,51 +0,0 @@ -/* $OpenBSD: putp.c,v 1.1 1996/05/31 05:40:02 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: putp.c,v 1.1 1996/05/31 05:40:02 tholo Exp $"; -#endif - -#include <stdlib.h> -#include "term.h" -#include "term.private.h" - -#undef putp - -/* - * Simple wrapper for the most common usage of tputs() - */ -int -putp(str) - const char *str; -{ - return tputs(str, 1, _ti_outc); -} diff --git a/lib/libtermlib/reset_prog_mode.c b/lib/libtermlib/reset_prog_mode.c deleted file mode 100644 index 9154fe3488d..00000000000 --- a/lib/libtermlib/reset_prog_mode.c +++ /dev/null @@ -1,51 +0,0 @@ -/* $OpenBSD: reset_prog_mode.c,v 1.2 1997/12/09 01:23:02 millert Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: reset_prog_mode.c,v 1.2 1997/12/09 01:23:02 millert Exp $"; -#endif - -#include <unistd.h> -#include <sys/ioctl.h> -#include "term.h" - -int reset_prog_mode __P((void)) - __attribute__((weak)); - -/* - * Reset program mode as previously saved with def_prog_mode() - */ -int -reset_prog_mode() -{ - return (tcsetattr(cur_term->fd, TCSADRAIN, &cur_term->pmode) == 0) ? OK : ERR; -} diff --git a/lib/libtermlib/reset_shell_mode.c b/lib/libtermlib/reset_shell_mode.c deleted file mode 100644 index 10f19633425..00000000000 --- a/lib/libtermlib/reset_shell_mode.c +++ /dev/null @@ -1,51 +0,0 @@ -/* $OpenBSD: reset_shell_mode.c,v 1.2 1997/12/09 01:23:03 millert Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: reset_shell_mode.c,v 1.2 1997/12/09 01:23:03 millert Exp $"; -#endif - -#include <unistd.h> -#include <sys/ioctl.h> -#include "term.h" - -int reset_shell_mode __P((void)) - __attribute__((weak)); - -/* - * Reset shell mode as previously saved with def_shell_mode() - */ -int -reset_shell_mode() -{ - return (tcsetattr(cur_term->fd, TCSADRAIN, &cur_term->smode) == 0) ? OK : ERR; -} diff --git a/lib/libtermlib/restartterm.c b/lib/libtermlib/restartterm.c deleted file mode 100644 index 4c9801632e5..00000000000 --- a/lib/libtermlib/restartterm.c +++ /dev/null @@ -1,67 +0,0 @@ -/* $OpenBSD: restartterm.c,v 1.1 1996/05/31 05:40:02 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: restartterm.c,v 1.1 1996/05/31 05:40:02 tholo Exp $"; -#endif - -#include "term.h" - -/* - * Reinitialize terminal setup after a restart, eg. with the use - * of undump - * - * The terminal and speed may have changed, but it is assumed that - * the size of the terminal remain constant - */ -int -restartterm(name, fd, errret) - const char *name; - int fd; - int *errret; -{ - struct termios pmode, smode; - int r, l, c; - - pmode = cur_term->pmode; - smode = cur_term->smode; - l = lines; - c = columns; - r = setupterm(name, fd, errret); - cfsetspeed(&pmode, cur_term->baudrate); - cfsetspeed(&smode, cur_term->baudrate); - cur_term->pmode = pmode; - cur_term->smode = smode; - lines = l; - columns = c; - return r; -} diff --git a/lib/libtermlib/set_curterm.c b/lib/libtermlib/set_curterm.c deleted file mode 100644 index 4e67496cab0..00000000000 --- a/lib/libtermlib/set_curterm.c +++ /dev/null @@ -1,51 +0,0 @@ -/* $OpenBSD: set_curterm.c,v 1.1 1996/05/31 05:40:02 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: set_curterm.c,v 1.1 1996/05/31 05:40:02 tholo Exp $"; -#endif - -#include "term.h" - -/* - * Set the current terminal description being used. Return - * the one that was in use prior to us being called - */ -TERMINAL * -set_curterm(term) - TERMINAL *term; -{ - TERMINAL *oterm = cur_term; - - cur_term = term; - return oterm; -} diff --git a/lib/libtermlib/setterm.c b/lib/libtermlib/setterm.c deleted file mode 100644 index d54eef2247c..00000000000 --- a/lib/libtermlib/setterm.c +++ /dev/null @@ -1,50 +0,0 @@ -/* $OpenBSD: setterm.c,v 1.1 1996/05/31 05:40:02 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: setterm.c,v 1.1 1996/05/31 05:40:02 tholo Exp $"; -#endif - -#include <stdlib.h> -#include "term.h" - -#undef setterm - -/* - * Compatibility routine; just calls setupterm() - */ -int -setterm(name) - const char *name; -{ - return setupterm(name, 1, NULL); -} diff --git a/lib/libtermlib/setupterm.c b/lib/libtermlib/setupterm.c deleted file mode 100644 index 39a264573be..00000000000 --- a/lib/libtermlib/setupterm.c +++ /dev/null @@ -1,82 +0,0 @@ -/* $OpenBSD: setupterm.c,v 1.2 1996/06/02 20:19:29 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: setupterm.c,v 1.2 1996/06/02 20:19:29 tholo Exp $"; -#endif - -#include <stdlib.h> -#include <unistd.h> -#include <err.h> -#include "term.h" -#include "term.private.h" - -extern char *_ti_buf; - -/* - * Called to set up a terminal description for the named - * terminal. If no terminal is named, attempt to use the - * one named in the TERM environment variable - * - * If an error is encountered, return it in *errstat if - * set. If not set, abort with an error message - */ -int -setupterm(name, fd, errstat) - const char *name; - int fd; - int *errstat; -{ - int ret; - - if (name == NULL) - name = getenv("TERM"); - _ti_buf = NULL; - if (cur_term != NULL) - del_curterm(cur_term); - if ((cur_term = calloc(sizeof(TERMINAL), 1)) == NULL) - errx(1, "No memory for terminal description"); - if (fd == STDOUT_FILENO && !isatty(fd)) - fd = STDERR_FILENO; - cur_term->fd = fd; - ret = _ti_getterm(name); - if (errstat == NULL && ret < 1) { - if (ret < 0) - errx(1, "Terminal description database could not be found"); - else - errx(1, "Terminal '%s' not found", name); - } - else if (errstat != NULL) - *errstat = ret; - (void) _ti_tty_init(); - return ret; -} diff --git a/lib/libtermlib/shlib_version b/lib/libtermlib/shlib_version deleted file mode 100644 index 012c14171d3..00000000000 --- a/lib/libtermlib/shlib_version +++ /dev/null @@ -1,2 +0,0 @@ -major=3 -minor=0 diff --git a/lib/libtermlib/term.h.head b/lib/libtermlib/term.h.head deleted file mode 100644 index 16b457ca301..00000000000 --- a/lib/libtermlib/term.h.head +++ /dev/null @@ -1,38 +0,0 @@ -/* $OpenBSD: term.h.head,v 1.1 1996/05/31 05:40:02 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _TERM_H_ -#define _TERM_H_ - -#include <termios.h> -#include <sys/ioctl.h> - diff --git a/lib/libtermlib/term.h.tail b/lib/libtermlib/term.h.tail deleted file mode 100644 index dccac8931ec..00000000000 --- a/lib/libtermlib/term.h.tail +++ /dev/null @@ -1,126 +0,0 @@ - -/* $OpenBSD: term.h.tail,v 1.3 1996/12/09 01:18:18 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - */ - -typedef struct _terminal { - int fd; - speed_t baudrate; - struct termios pmode; - struct termios smode; - char *name; - char *names; - char bools[_tBoolCnt]; - short nums[_tNumCnt]; - char *strs[_tStrCnt]; -} TERMINAL; - -#define Filedes fd -#define Ottyb smode -#define Nttyb pmode -#define TTY struct termios - -#ifndef _CHTYPE_T_ -#define _CHTYPE_T_ unsigned long -typedef _CHTYPE_T_ chtype; -#endif - -#undef fixterm -#undef putp -#undef resetterm -#undef setterm -#undef vidattr - -__BEGIN_DECLS -extern const char * const boolnames[]; -extern const char * const boolcodes[]; -extern const char * const boolfnames[]; -extern const char * const numnames[]; -extern const char * const numcodes[]; -extern const char * const numfnames[]; -extern const char * const strnames[]; -extern const char * const strcodes[]; -extern const char * const strfnames[]; - -extern int LINES; -extern int COLS; -extern int TABSIZE; -extern TERMINAL *cur_term; -extern char ttytype[]; - -int def_prog_mode __P((void)); -int def_shell_mode __P((void)); -int del_curterm __P((TERMINAL *)); -int mvcur __P((int, int, int, int)); -int putp __P((const char *)); -int reset_prog_mode __P((void)); -int reset_shell_mode __P((void)); -int restartterm __P((const char *, int, int *)); -int setupterm __P((const char *, int, int *)); -int setterm __P((const char *)); -TERMINAL *set_curterm __P((TERMINAL *)); -int tigetflag __P((const char *)); -int tigetnum __P((const char *)); -char *tigetstr __P((const char *)); -char *tparm __P((const char *, ...)); -int tputs __P((const char *, int, int (*)(int))); -int tgetent __P((char *, const char *)); -int tgetflag __P((const char *)); -int tgetnum __P((const char *)); -char *tgetstr __P((const char *, char **)); -char *tgoto __P((const char *, int, int)); -void use_env __P((int)); -int vidattr __P((chtype)); -int vidputs __P((chtype, int (*)(int))); - -int _ti_outc __P((int)); -__END_DECLS - -#define fixterm() reset_prog_mode() -#define putp(s) tputs(s, 1, _ti_outc) -#define resetterm() reset_shell_mode() -#define setterm(term) setupterm(term, 1, (int *)0) -#define vidattr(s) vidputs(s, _ti_outc) - -#ifndef OK -#define OK (0) -#endif /* OK */ - -#ifndef ERR -#define ERR (-1) -#endif /* ERR */ - -#ifndef TRUE -#define TRUE (1) -#endif - -#ifndef FALSE -#define FALSE (0) -#endif - -#ifndef A_ATTRIBUTES -#define A_ATTRIBUTES 0xffffff00 -#define A_NORMAL 0x00000000 -#define A_STANDOUT 0x00010000 -#define A_UNDERLINE 0x00020000 -#define A_REVERSE 0x00040000 -#define A_BLINK 0x00080000 -#define A_DIM 0x00100000 -#define A_BOLD 0x00200000 -#define A_ALTCHARSET 0x00400000 -#define A_INVIS 0x00800000 -#define A_PROTECT 0x01000000 -#define A_HORIZONTAL 0x02000000 -#define A_LEFT 0x04000000 -#define A_LOW 0x08000000 -#define A_RIGHT 0x10000000 -#define A_TOP 0x20000000 -#define A_VERTICAL 0x40000000 -#define A_CHARTEXT 0x000000ff -#define A_COLOR 0x0000ff00 -#endif - -#endif /* _TERM_H_ */ diff --git a/lib/libtermlib/term.private.h b/lib/libtermlib/term.private.h deleted file mode 100644 index 3cd828c3ca5..00000000000 --- a/lib/libtermlib/term.private.h +++ /dev/null @@ -1,57 +0,0 @@ -/* $OpenBSD: term.private.h,v 1.1 1996/05/31 05:40:02 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -struct xtoidx { - const char *name; - int idx; - int type; -}; - -struct _terminal; - -#define TYPE_BOOL 0 -#define TYPE_NUM 1 -#define TYPE_STR 2 - -__BEGIN_DECLS -extern const struct xtoidx _ti_captoidx[]; -extern const struct xtoidx _ti_infotoidx[]; -extern size_t _ti_numcaps; -extern size_t _ti_numinfos; - -struct xtoidx *_ti_findcap __P((const char *)); -struct xtoidx *_ti_findinfo __P((const char *)); -int _ti_getterm __P((const char *)); -int _ti_tty_init __P((void)); -char *_ti_captoinfo __P((const char *)); -void _ti_fillcap __P((struct _terminal *)); -__END_DECLS diff --git a/lib/libtermlib/terminfo.3 b/lib/libtermlib/terminfo.3 deleted file mode 100644 index a40a8f6b23b..00000000000 --- a/lib/libtermlib/terminfo.3 +++ /dev/null @@ -1,445 +0,0 @@ -.\" $OpenBSD: terminfo.3,v 1.6 1999/07/09 13:35:28 aaron Exp $ -.\" -.\" Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -.\" THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -.\" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -.\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.\" -.Dd November 28, 1997 -.Dt TERMINFO 3 -.Os -.Sh NAME -.Nm setupterm , -.Nm setterm , -.Nm set_curterm , -.Nm del_curterm , -.Nm restartterm , -.Nm tparm , -.Nm tputs , -.Nm putp , -.Nm vidputs , -.Nm vidattr , -.Nm mvcur , -.Nm tigetflag , -.Nm tigetnum , -.Nm tigetstr -.Nd interfaces to the terminfo database -.Sh SYNOPSIS -.Fd #include <term.h> -.Ft int -.Fn setupterm "const char *term" "int fildes" "int *errret" -.Ft int -.Fn setterm "const char *term" -.Ft TERMINAL * -.Fn set_curterm "TERMINAL *nterm" -.Ft int -.Fn del_curterm "TERMINAL *oterm" -.Ft int -.Fn restartterm "const char *term" "int fildes" "int *errret" -.Ft char * -.Fn tparm "const char *str" "..." -.Ft int -.Fn tputs "const char *str" "int affcnt" "int (*putc)(int))" -.Ft int -.Fn putp "const char *str" -.Ft int -.Fn vidputs "chtype attrs" "int (*putc)(char))" -.Ft int -.Fn vidattr "chtype attrs" -.Ft int -.Fn mvcur "int oldrow" "int oldcol" "int newrow" "int newcol" -.Ft int -.Fn tigetflag "const char *capname" -.Ft int -.Fn tigetnum "const char *capname" -.Ft char * -.Fn tigetstr "const char *capname" -.Sh DESCRIPTION -These low-level routines must be called by programs that have -to deal directly with the -.Nm terminfo -database to handle certain terminal capabilities, such as -programming function keys. For all other functionality, -.Xr curses 3 -routines are more suitable and their use is recommended. -.Pp -Initially, -.Fn setupterm -should be called. Note that -.Fn setupterm -is automatically called by -.Fn initscr -and -.Fn newterm . -This defines the set of terminal-dependent variables [listed in -.Xr terminfo 5 ]. -The -.Fn terminfo -variables -.Dv lines -and -.Dv columns -are initialized by -.Fn setupterm -as follows: If -.Fn use_env FALSE -has been called, values for -.Dv lines -and -.Dv columns -specified in -.Nm terminfo -are used. Otherwise, if the environment variables -.Ev LINES -and -.Ev COLUMNS -exist, their values are used. If these environment variables do not -exist and the program is running in a window, the current window size -is used. Otherwise, if the environment variables do not exist, the -values for -.Dv lines -and -.Dv columns -specified in the -.Nm terminfo -database are used. -.Pp -The header file -.Nm term.h -should be included to get the definitions for these strings, numbers, -and flags. Parameterized strings should be passed through -.Fn tparm -to instantiate them. All -.Nm terminfo -strings [including the output of -.Fn tparm ] -should be printed with -.Fn tputs -or -.Fn putp . -Call the -.Fn reset_shell_mode -function to restore the tty modes before exiting [see -.Xr curs_kernel 3 ]. -Programs which use cursor addressing should output -.Nm enter_ca_mode -upon startup and should output -.Nm exit_ca_mode -before exiting. Programs desiring shell escapes should call -.Fn reset_shell_mode -and output -.Nm exit_ca_mode -before the shell is called and should output -.Nm enter_ca_mode -and call -.Fn reset_prog_mode -after returning from the shell. -.Pp -The -.Fn setupterm -routine reads in the -.Nm terminfo -database, initializing the -.Nm terminfo -structures, but does not set up the output virtualization structures -used by -.Xr curses 3 . -The terminal type is the character string -.Ar term ; -if -.Ar term -is null, the environment variable -.Ev TERM -is used. All output is to file descriptor -.Ar fildes -which is initialized for output. If -.Ar errret -is not null, then -.Fn setupterm -returns -.Dv OK -or -.Dv ERR -and stores a status value in the integer pointed to by -.Ar errret . -A status of -.Li 1 -in -.Ar errret -is normal, -.Li 0 -means that the terminal could not be found, and -.Li -1 -means that the -.Nm terminfo -database could not be found. If -.Ar errret -is null, -.Fn setupterm -prints an error message upon finding an error and exits. Thus, -the simplest call is: -.Bd -literal -offset indent -setupterm((char *)0, 1, (int *)0); - -.Ed -which uses all the defaults and sends the output to -.Dv stdout . -.Pp -The -.Fn setterm -routine is being replaced by -.Fn setupterm . -The call: -.Bd -literal -offset indent -setupterm(term, 1, (int *)0); - -.Ed -provides the same functionality as: -.Bd -literal -offset indent -setterm(term); - -.Ed -The -.Fn setterm -routine is included here for BSD compatibility, and is not recommended -for new programs. -.Pp -The -.Fn set_curterm -routine sets the variable -.Dv cur_term -to -.Ar nterm , -and makes all of the -.Nm terminfo -boolean, numeric, and string variables use the values from -.Ar nterm . -It returns the old value of -.Dv cur_term . -.Pp -The -.Fn del_curterm -routine frees the space pointed to by -.Ar oterm -and makes it available for further use. If -.Ar oterm -is the same as -.Dv cur_term , -references to any of the -.Nm terminfo -boolean, numeric, and string variables thereafter may refer to -invalid memory locations until another -.Fn setupterm -has been called. -.Pp -The -.Fn restartterm -routine is similar to -.Fn setupterm -and -.Fn initscr , -except that it is called after restoring memory to a previous state (for -example, when reloading a game saved as a core image dump). It assumes that -the windows and the input and output options are the same as when memory was -saved, but the terminal type and baud rate may be different. Accordingly, -it saves various tty state bits, does a setupterm, and then restores the bits. -.Pp -The -.Fn tparm -routine instantiates the string -.Ar str , -substituting the parameters %p1 through %p9 -with the values of -.Ar p1 -through -.Ar p9 . -A pointer is returned to the result of -.Ar str -with the parameters applied. -.Pp -The -.Fn tputs -routine applies padding information to the string -.Ar str -and outputs it. The -.Ar str -must be a terminfo string variable or the return value from -.Fn tparm , -.Fn tgetstr , -or -.Fn tgoto . -.Ar affcnt -is the number of lines affected, or 1 if not applicable. -.Ar putc -is a \fBputchar\fR-like routine to which the characters are -passed, one at a time. -.Pp -The -.Fn putp -routine calls: -.Bd -literal -offset indent -tputs(str, 1, putchar) - -.Ed -Note that the output of -.Fn putp -always goes to -.Dv stdout , -not to the -.Ar fildes -specified in -.Fn setupterm . -.Pp -The -.Fn vidputs -routine displays the string on the terminal in the video -attribute mode -.Ar attrs , -which is any combination of the attributes listed in -.Xr curses 3 . -The characters are passed to the -\fBputchar\fR-like routine -.Ar putc . -.Pp -The -.Fn vidattr -routine is like the -.Fn vidputs -routine, except that it outputs through -.Fn putchar . -.Pp -The -.Fn mvcur -routine provides low-level cursor motion. It takes -effect immediately (rather than at the next refresh). -.Pp -The -.Fn tigetflag , -.Fn tigetnum -and -.Fn tigetstr -routines return the value of the capability corresponding to the -.Fn terminfo -.Ar capname -passed to them, such as -.Dv xenl . -.Pp -The -.Fn tigetflag -routine returns the value -.Li -1 -if -.Ar capname -is not a boolean capability. -.Pp -The -.Fn tigetnum -routine returns the value -.Li -2 -if -.Ar capname -is not a numeric capability. -.Pp -The -.Fn tigetstr -routine returns the value -.Li (char *)-1 -if -.Ar capname -is not a string capability. -.Pp -The -.Ar capname -for each capability is given in the table column entitled -.Ar capname -code in the capabilities section of -.Xr terminfo 5 . -.Pp -.\" XXX - finish converting these -\fBchar *boolnames\fR, \fB*boolcodes\fR, \fB*boolfnames\fR -.Pp -\fBchar *numnames\fR, \fB*numcodes\fR, \fB*numfnames\fR -.Pp -\fBchar *strnames\fR, \fB*strcodes\fR, \fB*strfnames\fR -.Pp -These null-terminated arrays contain the \fIcapnames\fR, the -\fBtermcap\fR codes, and the full C names, for each of the -\fBterminfo\fR variables. -.Sh RETURN VALUE -Routines that return an integer return -.Dv ERR -upon failure and -.Dv OK -(SVr4 only specifies -.Dq "an integer value other than ERR" ) -upon successful completion, unless otherwise noted in the -preceding routine descriptions. -.Pp -Routines that return pointers always return -.Dv NULL -on error. -.Sh NOTES -The -.Fn setupterm -routine should be used in place of -.Fn setterm . -It may be useful when you want to test for terminal capabilities without -committing to the allocation of storage involved in -.Fn initscr . -.Pp -Note that -.Fn vidattr -and -.Fn vidputs -may be macros. -.Sh PORTABILITY -The function -.Fn setterm -is not described in the XSI Curses standard and must be considered -non-portable. All other functions are as described in the XSI curses standard. -.Pp -In System V Release 4, -.Fn set_curterm -has an -.Dv int -return type and returns -.Dv OK -or -.Dv ERR . -We have chosen to implement the XSI Curses semantics. -.Pp -In System V Release 4, the third argument of -.Fn tputs -has the type -\fBint (*putc)(char)\fR. -.Pp -The XSI Curses standard prototypes -.Fn tparm -with a fixed number of parameters, rather than a variable argument list. -.Sh SEE ALSO -.Xr curs_initscr 3 , -.Xr curs_kernel 3 , -.Xr curs_termcap 3 , -.Xr curses 3 , -.Xr putc 3 , -.Xr terminfo 5 diff --git a/lib/libtermlib/tgetent.c b/lib/libtermlib/tgetent.c deleted file mode 100644 index 91a3ea8ddec..00000000000 --- a/lib/libtermlib/tgetent.c +++ /dev/null @@ -1,68 +0,0 @@ -/* $OpenBSD: tgetent.c,v 1.3 1996/12/09 01:18:19 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: tgetent.c,v 1.3 1996/12/09 01:18:19 tholo Exp $"; -#endif - -#include <stdlib.h> -#include <string.h> -#include <unistd.h> -#include <err.h> -#include "term.h" -#include "term.private.h" - -extern char *_ti_buf; - -int -tgetent(bp, name) - char *bp; - const char *name; -{ - char *n; - - _ti_buf = bp; - if (cur_term != NULL) { - for (n = strtok(cur_term->names, "|"); n != NULL; n = strtok(NULL, "|")) - if (strcmp(name, n) == 0) - return 1; - del_curterm(cur_term); - } - if ((cur_term = calloc(sizeof(TERMINAL), 1)) == NULL) - errx(1, "No memory for terminal description"); - if (isatty(STDOUT_FILENO)) - cur_term->fd = STDOUT_FILENO; - else - cur_term->fd = STDERR_FILENO; - (void)_ti_tty_init(); - return _ti_getterm(name); -} diff --git a/lib/libtermlib/tgetflag.c b/lib/libtermlib/tgetflag.c deleted file mode 100644 index 0be4e6e9fae..00000000000 --- a/lib/libtermlib/tgetflag.c +++ /dev/null @@ -1,52 +0,0 @@ -/* $OpenBSD: tgetflag.c,v 1.1 1996/05/31 05:40:02 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: tgetflag.c,v 1.1 1996/05/31 05:40:02 tholo Exp $"; -#endif - -#include <stdlib.h> -#include "term.h" -#include "term.private.h" - -int -tgetflag(entry) - const char *entry; -{ - struct xtoidx *p = _ti_findcap(entry); - - if (p != NULL && p->type != TYPE_BOOL) - return -1; - if (p == NULL) - return 0; - return cur_term->bools[p->idx]; -} diff --git a/lib/libtermlib/tgetnum.c b/lib/libtermlib/tgetnum.c deleted file mode 100644 index 3029c2ce344..00000000000 --- a/lib/libtermlib/tgetnum.c +++ /dev/null @@ -1,52 +0,0 @@ -/* $OpenBSD: tgetnum.c,v 1.1 1996/05/31 05:40:02 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: tgetnum.c,v 1.1 1996/05/31 05:40:02 tholo Exp $"; -#endif - -#include <stdlib.h> -#include "term.h" -#include "term.private.h" - -int -tgetnum(entry) - const char *entry; -{ - struct xtoidx *p = _ti_findcap(entry); - - if (p != NULL && p->type != TYPE_NUM) - return -2; - if (p == NULL) - return -1; - return cur_term->nums[p->idx]; -} diff --git a/lib/libtermlib/tgetstr.c b/lib/libtermlib/tgetstr.c deleted file mode 100644 index d4a12607612..00000000000 --- a/lib/libtermlib/tgetstr.c +++ /dev/null @@ -1,59 +0,0 @@ -/* $OpenBSD: tgetstr.c,v 1.2 1997/12/16 03:23:02 millert Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: tgetstr.c,v 1.2 1997/12/16 03:23:02 millert Exp $"; -#endif - -#include <string.h> -#include "term.h" -#include "term.private.h" - -char * -tgetstr(entry, area) - const char *entry; - char **area; -{ - struct xtoidx *p; - char *s; - - if (area == NULL || *area == NULL) - return NULL; - p = _ti_findcap(entry); - if (p == NULL || p->type != TYPE_STR) - return NULL; - if ((s = cur_term->strs[p->idx]) == NULL) - return NULL; - strcpy(*area, s); - *area += strlen(s) + 1; - return s; -} diff --git a/lib/libtermlib/tgoto.c b/lib/libtermlib/tgoto.c deleted file mode 100644 index b61b0a099d5..00000000000 --- a/lib/libtermlib/tgoto.c +++ /dev/null @@ -1,47 +0,0 @@ -/* $OpenBSD: tgoto.c,v 1.2 1996/06/16 08:56:56 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: tgoto.c,v 1.2 1996/06/16 08:56:56 tholo Exp $"; -#endif - -#include <stdlib.h> -#include <string.h> -#include "term.h" - -char * -tgoto(CM, col, line) - const char *CM; - int col, line; -{ - return tparm(CM, line, col); -} diff --git a/lib/libtermlib/tigetflag.c b/lib/libtermlib/tigetflag.c deleted file mode 100644 index 85fffa45319..00000000000 --- a/lib/libtermlib/tigetflag.c +++ /dev/null @@ -1,52 +0,0 @@ -/* $OpenBSD: tigetflag.c,v 1.1 1996/05/31 05:40:02 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: tigetflag.c,v 1.1 1996/05/31 05:40:02 tholo Exp $"; -#endif - -#include <stdlib.h> -#include "term.h" -#include "term.private.h" - -int -tigetflag(entry) - const char *entry; -{ - struct xtoidx *p = _ti_findinfo(entry); - - if (p != NULL && p->type != TYPE_BOOL) - return -1; - if (p == NULL) - return 0; - return cur_term->bools[p->idx]; -} diff --git a/lib/libtermlib/tigetnum.c b/lib/libtermlib/tigetnum.c deleted file mode 100644 index b5826378bb6..00000000000 --- a/lib/libtermlib/tigetnum.c +++ /dev/null @@ -1,52 +0,0 @@ -/* $OpenBSD: tigetnum.c,v 1.1 1996/05/31 05:40:02 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: tigetnum.c,v 1.1 1996/05/31 05:40:02 tholo Exp $"; -#endif - -#include <stdlib.h> -#include "term.h" -#include "term.private.h" - -int -tigetnum(entry) - const char *entry; -{ - struct xtoidx *p = _ti_findinfo(entry); - - if (p != NULL && p->type != TYPE_NUM) - return -2; - if (p == NULL) - return -1; - return cur_term->nums[p->idx]; -} diff --git a/lib/libtermlib/tigetstr.c b/lib/libtermlib/tigetstr.c deleted file mode 100644 index 699d2e4191e..00000000000 --- a/lib/libtermlib/tigetstr.c +++ /dev/null @@ -1,52 +0,0 @@ -/* $OpenBSD: tigetstr.c,v 1.1 1996/05/31 05:40:02 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: tigetstr.c,v 1.1 1996/05/31 05:40:02 tholo Exp $"; -#endif - -#include <stdlib.h> -#include "term.h" -#include "term.private.h" - -char * -tigetstr(entry) - const char *entry; -{ - struct xtoidx *p = _ti_findinfo(entry); - - if (p != NULL && p->type != TYPE_STR) - return (char *)-1; - if (p == NULL) - return NULL; - return cur_term->strs[p->idx]; -} diff --git a/lib/libtermlib/tparm.c b/lib/libtermlib/tparm.c deleted file mode 100644 index 082c480543e..00000000000 --- a/lib/libtermlib/tparm.c +++ /dev/null @@ -1,394 +0,0 @@ -/* $OpenBSD: tparm.c,v 1.6 1997/12/16 03:10:05 millert Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: tparm.c,v 1.6 1997/12/16 03:10:05 millert Exp $"; -#endif - -#include <stdio.h> -#include <stdlib.h> -#ifdef __STDC__ -#include <stdarg.h> -#else -#include <varargs.h> -#endif -#include <string.h> -#include <ctype.h> - -#ifdef MAX -#undef MAX -#endif - -#define MAX(a, b) ((a) < (b) ? (b) : (a)) - -#define STKSIZ 32 -#define MAXRETURNSIZE 256 - -static __inline void push __P((int)); -static __inline int popnum __P((void)); -static __inline char *popstr __P((void)); - -static char *_tparm __P((const char *, char *, size_t, va_list)); - -static union { - unsigned int num; - char *str; -} stack[STKSIZ]; - -static int stackidx; - -static __inline void -push(value) - int value; -{ - if (stackidx < STKSIZ) - stack[stackidx++].num = value; -} - -static __inline int -popnum() -{ - return stackidx > 0 ? stack[--stackidx].num : 0; -} - -static __inline char * -popstr() -{ - return stackidx > 0 ? stack[--stackidx].str : NULL; -} - -/* - * This function is identical to the GNU tparam() but we don't - * advertise it as such since it confuses emacs (and perhaps others). - */ -static char * -_tparm(str, buf, siz, ap) - const char *str; - char *buf; - size_t siz; - va_list ap; -{ - int param[10], variable[26]; - int pops, num, i, level; - char scratch[64]; - char *bufp, len; - const char *p; - - if (str == NULL) - return NULL; - - for (p = str, pops = 0, num = 0; *p != '\0'; p++) - if (*p == '%' && *(p + 1) != '\0') { - switch (p[1]) { - case '%': - p++; - break; - case 'i': - if (pops < 2) - pops = 2; - break; - case 'p': - p++; - if (isdigit(p[1])) { - int n = p[1] - '0'; - - if (n > pops) - pops = n; - } - break; - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - case 'c': - case 'd': - case 's': - num++; - break; - } - } - - for (i = 0; i < MAX(pops, num); i++) - param[i] = va_arg(ap, int); /* XXX arg size might be different than int */ - - stackidx = 0; - bufp = buf; - - while (*str) { - if (*str != '%') { - if (bufp >= buf + siz) - return(NULL); - *bufp++ = *str; - } - else { - switch (*++str) { - case '%': - if (bufp >= buf + siz) - return(NULL); - *bufp++ = '%'; - break; - case 'd': - sprintf(scratch, "%d", popnum()); - if (bufp + strlen(scratch) >= buf + siz) - return(NULL); - strcpy(bufp, scratch); - bufp += strlen(bufp); - break; - case '0': - len = *++str; - if (len == '2' || len == '3') { - if (*++str == 'd') { - if (len == '2') - sprintf(scratch, "%02d", popnum()); - else - sprintf(scratch, "%03d", popnum()); - if (bufp + strlen(scratch) >= buf + siz) - return(NULL); - strcpy(bufp, scratch); - bufp += strlen(bufp); - } - else if (*str == 'x') { - if (len == '2') - sprintf(scratch, "%02x", popnum()); - else - sprintf(scratch, "%03x", popnum()); - if (bufp + strlen(scratch) >= buf + siz) - return(NULL); - strcpy(bufp, scratch); - bufp += strlen(bufp); - } - } - break; - case '2': - if (*++str == 'd') { - sprintf(scratch, "%2d", popnum()); - if (bufp + strlen(scratch) >= buf + siz) - return(NULL); - strcpy(bufp, scratch); - bufp += strlen(bufp); - } - else if (*str == 'x') { - sprintf(scratch, "%2x", popnum()); - if (bufp + strlen(scratch) >= buf + siz) - return(NULL); - strcpy(bufp, scratch); - bufp += strlen(bufp); - } - break; - case '3': - if (*++str == 'd') { - sprintf(scratch, "%3d", popnum()); - if (bufp + strlen(scratch) >= buf + siz) - return(NULL); - strcpy(bufp, scratch); - bufp += strlen(bufp); - } - else if (*str == 'x') { - sprintf(scratch, "%3x", popnum()); - if (bufp + strlen(scratch) >= buf + siz) - return(NULL); - strcpy(bufp, scratch); - bufp += strlen(bufp); - } - break; - case 'c': - if (bufp >= buf + siz) - return(NULL); - *bufp++ = (char)popnum(); - break; - case 's': - if (bufp + strlen(p = popstr()) >= buf + siz) - return(NULL); - strcpy(bufp, p); - bufp += strlen(bufp); - break; - case 'p': - str++; - if (*str != '0' && isdigit(*str)) - push(param[*str - '1']); - break; - case 'P': - str++; - if (islower(*str)) - variable[*str - 'a'] = popnum(); - break; - case 'g': - str++; - if (islower(*str)) - push(variable[*str - 'a']); - break; - case '\'': - push(*++str & 0xFF); - str++; - break; - case '{': - num = 0; - str++; - while (isdigit(*str)) - num = num * 10 + (*str++ - '0'); - push(num); - break; - case '+': - push(popnum() + popnum()); - break; - case '-': - num = popnum(); - push(popnum() - num); - break; - case '*': - push(popnum() * popnum()); - break; - case '/': - num = popnum(); - push(popnum() / num); - break; - case 'm': - num = popnum(); - push(popnum() % num); - break; - case 'A': - num = popnum(); - push(popnum() && num); - break; - case 'O': - num = popnum(); - push(popnum() || num); - break; - case '&': - push(popnum() & popnum()); - break; - case '|': - push(popnum() | popnum()); - break; - case '^': - push(popnum() ^ popnum()); - break; - case '=': - push(popnum() == popnum()); - break; - case '<': - push(popnum() > popnum()); - break; - case '>': - push(popnum() < popnum()); - break; - case '!': - push(!popnum()); - break; - case '~': - push(~popnum()); - break; - case 'i': - param[0]++; - param[1]++; - break; - case '?': - break; - case 't': - if (!popnum()) { - str++; - level = 0; - while (*str) { - if (*str == '%') { - if (*++str == '?') - level++; - else if (*str == ';') { - if (level > 0) - level--; - else - break; - } - else if (*str == 'e' && level == 0) - break; - } - if (*str) - str++; - } - } - break; - case 'e': - str++; - level = 0; - while (*str) { - if (*str == '%') { - if (*++str == '?') - level++; - else if (*str == ';') { - if (level > 0) - level--; - else - break; - } - } - if (*str) - str++; - } - break; - case ';': - break; - default: - break; - } - } - if (*str != '\0') - str++; - } - - if (bufp >= buf + siz) - return(NULL); - *bufp = '\0'; - return(buf); -} - -char * -#ifdef __STDC__ -tparm(const char *str, ...) -#else -tparm(va_alist) - va_dcl -#endif -{ - static char buf[MAXRETURNSIZE]; - va_list ap; - char *p; -#ifndef __STDC__ - const char *str; - - va_start(ap); - str = va_arg(ap, const char *); -#else - /* LINTED pointer casts may be troublesome */ - va_start(ap, str); -#endif - p = _tparm(str, buf, sizeof(buf), ap); - /* LINTED expression has no effect */ - va_end(ap); - return(p); -} diff --git a/lib/libtermlib/tputs.c b/lib/libtermlib/tputs.c deleted file mode 100644 index 025d16c47be..00000000000 --- a/lib/libtermlib/tputs.c +++ /dev/null @@ -1,125 +0,0 @@ -/* $OpenBSD: tputs.c,v 1.3 1996/08/07 03:23:07 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: tputs.c,v 1.3 1996/08/07 03:23:07 tholo Exp $"; -#endif - -#include <stdlib.h> -#include <string.h> -#include <ctype.h> -#include "term.h" - -#undef ospeed -extern short ospeed; - -static short tmspc10[] = { - 0, 2000, 1333, 909, 743, 666, 500, 333, 166, 83, 55, 41, 20, 10, 5 -}; - -int -tputs(cp, count, outc) - const char *cp; - int count; - int (*outc) __P((int)); -{ - register int mspc10; - float i = 0.0; - char pc; - - if (cp == 0) - return ERR; - - /* - * The guts of the string. - */ - while (*cp) { - if (*cp != '$') - (*outc)(*cp++); - else { - if (*++cp != '<') { - (*outc)('$'); - (*outc)(*cp); - } - else { - cp++; - if ((!isdigit(*cp) && *cp != '.') || strchr(cp, '>') == NULL) { - (*outc)('$'); - (*outc)('<'); - continue; - } - while (isdigit(*cp)) { - i *= 10; - i += *cp++ - '0'; - } - if (*cp == '.') { - if (isdigit(*++cp)) - i += (float)(*cp - '0') / 10.0; - while (isdigit(*cp)) - cp++; - } - if (*cp == '*') { - i *= count; - cp++; - } - if (*cp == '/') - cp++; - } - if (*cp) - cp++; - } - } - - /* - * If no delay needed, or output speed is - * not comprehensible, then don't try to delay. - */ - if (i > 0.0 || - (padding_baud_rate != 0 && cur_term->baudrate < padding_baud_rate)) - return OK; - if (ospeed <= 0 || ospeed >= (sizeof tmspc10 / sizeof tmspc10[0])) - return OK; - - /* - * Round up by a half a character frame, - * and then do the delay. - * Too bad there are no user program accessible programmed delays. - * Transmitting pad characters slows many - * terminals down and also loads the system. - */ - mspc10 = tmspc10[ospeed]; - i += mspc10 / 2.0; - pc = (pad_char && *pad_char) ? *pad_char : '\0'; - for (i /= mspc10; i > 0; i -= 1.0) - (*outc)(pc); - return OK; -} diff --git a/lib/libtermlib/tty_init.c b/lib/libtermlib/tty_init.c deleted file mode 100644 index f9ef46b445b..00000000000 --- a/lib/libtermlib/tty_init.c +++ /dev/null @@ -1,68 +0,0 @@ -/* $OpenBSD: tty_init.c,v 1.1 1996/05/31 05:40:02 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: tty_init.c,v 1.1 1996/05/31 05:40:02 tholo Exp $"; -#endif - -#include <termios.h> -#include <unistd.h> -#include <sys/ioctl.h> -#include "term.h" -#include "term.private.h" - -static unsigned int tspeed[] = { - B0, B50, B75, B110, B134, B150, B200, B300, B600, B1200, B1800, - B2400, B4800, B9600, B19200, B38400 -}; - -#undef ospeed -short ospeed; - -/* - * Low lever terminal initialization; get current terminal parameters - * and save current speed in cur_term and ospeed - */ -int -_ti_tty_init() -{ - struct termios ti; - int speed, i; - - tcgetattr(cur_term->fd, &ti); - cur_term->baudrate = cfgetospeed(&ti); - speed = cur_term->baudrate; - for (i = 0; i < sizeof(tspeed) / sizeof(tspeed[0]) && speed > tspeed[i] ; i++) - ; - ospeed = i < sizeof(tspeed) / sizeof(tspeed[0]) ? i : 0; - return OK; -} diff --git a/lib/libtermlib/vidattr.c b/lib/libtermlib/vidattr.c deleted file mode 100644 index 58f1d89b04a..00000000000 --- a/lib/libtermlib/vidattr.c +++ /dev/null @@ -1,52 +0,0 @@ -/* $OpenBSD: vidattr.c,v 1.4 1996/09/21 22:06:55 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: vidattr.c,v 1.4 1996/09/21 22:06:55 tholo Exp $"; -#endif - -#include <sys/cdefs.h> - -#ifdef __indr_reference -__indr_reference(_vidattr, vidattr); -#else - -#include <stdlib.h> -#include "term.h" - -#undef vidattr - -#define _vidattr vidattr -#define rcsid _rcsid -#include "_vidattr.c" - -#endif diff --git a/lib/libtermlib/vidputs.c b/lib/libtermlib/vidputs.c deleted file mode 100644 index 51a79b8f014..00000000000 --- a/lib/libtermlib/vidputs.c +++ /dev/null @@ -1,47 +0,0 @@ -/* $OpenBSD: vidputs.c,v 1.3 1996/09/21 19:22:29 tholo Exp $ */ - -/* - * Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by SigmaSoft, Th. Lockert. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static char rcsid[] = "$OpenBSD: vidputs.c,v 1.3 1996/09/21 19:22:29 tholo Exp $"; -#endif - -#include <sys/cdefs.h> - -#ifdef __indr_reference -__indr_reference(_vidputs, vidputs); -#else - -#define _vidputs vidputs -#define rcsid _rcsid -#include "_vidputs.c" - -#endif |