📄 s
字号:
int wsetstat (wn, wstatp) short wn; WSTAT *wstatp; int wslk (wn, 0, slong1, slong2, sshort) short wn; char *slong1, *slong2, *sshort; int wslk (wn, kn, llabel, slabel) short wn, kn; char *llabel, *slabel; int wuser (wn, cp) short wn; char *cp; Description =========== aaddddcchh-- mmaanniippuullaattee tteexxtt iinn wwiinnddoowwss aaddddssttrr-- wwrriittee oonn ggiivveenn wwiinnddooww aaddff__ggttttookk-- ccoonnvveerrtt wwoorrdd ttoo ttookkeenn aaddff__ggttwwrrdd-- ggeett nneexxtt wwoorrdd ffrroomm ssttrriinngg aanndd ccooppyy ttoo bbuuffffeerr aaddff__ggttxxccdd-- ggeett nneexxtt tteexxtt ccooddee ffrroomm ssttrriinngg aanndd ccooppyy ttoo bbuuffffeerr aattttrrooffff-- mmaanniippuullaattee ccuurrrreenntt aattttrriibbuutteess ooff nnaammeedd wwiinnddooww aattttrroonn-- mmaanniippuullaattee ccuurrrreenntt aattttrriibbuutteess ooff nnaammeedd wwiinnddooww bbaauuddrraattee-- rreettuurrnn oouuttppuutt ssppeeeedd ooff tthhee tteerrmmiinnaall bbeeeepp-- ssiiggnnaall tthhee tteerrmmiinnaall uusseerr ccbbrreeaakk-- ppuutt tteerrmmiinnaall iinnttoo CCBBRREEAAKK mmooddee cclleeaarr-- cclleeaarr ssccrreeeenn ccoommpplleetteellyy cclleeaarrookk-- cclleeaarr ssccrreeeenn ccoommpplleetteellyy ccllrrttoobboott-- eerraassee aallll lliinneess bbeellooww ccuurrssoorr iinn ccuurrrreenntt wwiinnddooww ccllrrttooeeooll-- eerraassee ccuurrrreenntt lliinnee ttoo rriigghhtt ooff ccuurrssoorr iinncclluussiivvee ccrrmmooddee-- ppuutt tteerrmmiinnaall iinnttoo CCBBRREEAAKK mmooddee ddeellcchh-- ddeelleettee cchhaarraacctteerr uunnddeerr ccuurrssoorr iinn wwiinnddooww ddeelleetteellnn-- ddeelleettee lliinnee uunnddeerr ccuurrssoorr iinn wwiinnddooww eecchhoo-- ccoonnttrrooll wwhheetthheerr cchhaarraacctteerrss aarree eecchhooeedd aass tthheeyy aarree ttyyppeedd eennddwwiinn-- rreesseett tteerrmmiinnaall ttoo nnoonn--vviissuuaall mmooddee eerraassee-- ccooppyy bbllaannkkss ttoo eevveerryy ppoossiittiioonn iinn tthhee wwiinnddooww eexxhheellpp-- eexxeeccuuttee hheellpp pprroocceessss aanndd bblloocckk uunnttiill rreettuurrnn ffiixxtteerrmm-- rreessttoorree tteerrmmiinnaall ttoo pprrooggrraamm ssttaattee ffllaasshh-- uusseedd ttoo ssiiggnnaall tthhee tteerrmmiinnaall uusseerr fflluusshhiinnpp-- tthhrrooww aawwaayy ttyyppeeaahheeaadd nnoott yyeett rreeaadd bbyy tthhee pprrooggrraamm ffoorrmm-- ccrreeaattee aanndd ddiissppllaayy aa ffoorrmm ggeettcchh-- rreeaadd cchhaarraacctteerr ffrroomm tteerrmmiinnaall aassssoocciiaatteedd wwiitthh aa wwiinnddooww ggeettyyxx-- ppllaaccee ccuurrssoorr ppoossiittiioonn ooff tthhee wwiinnddooww iinn ttwwoo iinntteeggeerr vvaarriiaabblleess iinniittssccrr-- iinniittiiaalliizzee aallll ccuurrsseess ddaattaa ssttrruuccttuurreess iinnsscchh-- iinnsseerrtt cchhaarraacctteerr _c_h bbeeffoorree tthhee cchhaarraacctteerr uunnddeerr ccuurrssoorr iinnsseerrttllnn-- iinnsseerrtt bbllaannkk lliinnee aabboovvee ccuurrrreenntt lliinnee iisswwiinndd-- ddeetteerrmmiinnee iiff tteerrmmiinnaall iiss llooccaall oorr rreemmoottee kkccooddeemmaapp-- rreettuurrnn 77--bbiitt eessccaappee sseeqquueennccee tthhaatt mmaappss oonnttoo 88--bbiitt vvaalluuee kkeeyyppaadd-- oobbttaaiinn iinnffoorrmmaattiioonn ffrroomm kkeeyyppaadd ooff uusseerr''ss tteerrmmiinnaall lleeaavveeookk-- lleeaavvee ccuurrssoorr aatt llooccaattiioonn ooff tthhee wwiinnddooww ccuurrssoorr bbeeiinngg rreeffrreesshheedd mmeennuu-- ccrreeaattee aanndd ddiissppllaayy aa mmeennuu mmeessssaaggee-- oouuttppuutt hheellpp oorr eerrrroorr mmeessssaaggee aanndd wwaaiitt ffoorr rreessppoonnssee mmoovvee-- mmoovvee ccuurrssoorr ttoo rrooww _r,, ccoolluummnn _c mmvvaaddddcchh-- mmaanniippuullaattee tteexxtt iinn wwiinnddoowwss mmvvaaddddssttrr-- wwrriittee aallll cchhaarraacctteerrss ooff nnuullll--tteerrmmiinnaatteedd cchhaarraacctteerr ssttrriinngg _s_t_r oonn ggiivveenn wwiinnddooww mmvviinncchh-- rreettuurrnn cchhaarraacctteerr aatt ccuurrrreenntt ppoossiittiioonn iinn nnaammeedd wwiinnddooww nnll-- ccoonnttrrooll wwhheetthheerr ccaarrrriiaaggee rreettuurrnn iiss ttrraannssllaatteedd iinnttoo nneewwlliinnee nnooccbbrreeaakk-- ppuutt tteerrmmiinnaall oouutt ooff CCBBRREEAAKK mmooddee nnooccrrmmooddee-- ppuutt tteerrmmiinnaall oouutt ooff CCBBRREEAAKK mmooddee nnooddeellaayy-- ccaauussee wwggeettcchh(()) ttoo bbee aa nnoonn--bblloocckkiinngg ccaallll nnooeecchhoo-- ccoonnttrrooll wwhheetthheerr cchhaarraacctteerrss aarree eecchhooeedd aass tthheeyy aarree ttyyppeedd nnoonnll-- ccoonnttrrooll wwhheetthheerr ccaarrrriiaaggee rreettuurrnn iiss ttrraannssllaatteedd iinnttoo nneewwlliinnee ppbb__cchheecckk-- cchheecckk iiff ppaassttee bbuuffffeerr ccoonnttaaiinnss aannyytthhiinngg ppbb__eemmppttyy-- cclleeaarr oouutt ppaassttee bbuuffffeerr aanndd cclloossee iitt ppbb__ggbbuuff-- rreeaadd ppaassttee bbuuffffeerr ffiillee ttoo bbuuffffeerr ppbb__ggeettss-- rreeaadd ppaassttee bbuuffffeerr ffiillee aanndd ccoonnvveerrtt ttoo tteexxtt ppbb__nnaammee-- ggeett nnaammee ffoorr ppaassttee bbuuffffeerr ffiillee ppbb__ooppeenn-- ooppeenn oorr ccrreeaattee aa ppaassttee bbuuffffeerr ffiillee ppbb__ppuuttss-- oouuttppuutt ssttrriinngg ttoo ppaassttee bbuuffffeerr iinn AADDFF ffoorrmmaatt ppbb__sseeeekk-- sseeeekk ttoo eenndd ooff ppaassttee bbuuffffeerr aanndd sseett ffoorr aappppeennddiinngg ppbb__wweeooff-- oouuttppuutt EEOOFF ttoo ppaassttee bbuuffffeerr aanndd cclloossee ffiillee pprriinnttww-- ccoorrrreessppoonnddss ttoo pprriinnttff((SS)) rreeffrreesshh-- ccooppyy nnaammeedd wwiinnddooww ttoo tteerrmmiinnaall ssccrreeeenn uussiinngg ssttddssccrr aass ddeeffaauulltt rreesseettttyy-- rreessttoorree tteerrmmiinnaall ttoo pprreevviioouuss ssttaattee ssaavveettttyy-- ssaavvee ccuurrrreenntt ssttaattee ooff tteerrmmiinnaall ttoo aa bbuuffffeerr ttrraacckk-- ttrraacckk mmoouussee mmoottiioonn wwccmmdd-- oouuttppuutt nnuullll--tteerrmmiinnaatteedd ssttrriinngg ttoo ccoommmmaanndd eennttrryy//eecchhoo lliinnee wwccrreeaattee-- ccrreeaattee aa wwiinnddooww wwddeelleettee-- ddeelleettee aa wwiinnddooww wweexxiitt-- rreesseett ppaarraammeetteerrss sseett bbyy wwiinniitt aanndd eexxiitt wwggeettcc-- ggeett cchhaarraacctteerr ffrroomm wwiinnddooww wwggeettmmoouussee-- rreettuurrnn mmoouussee ssttaattuuss wwggeettppooss-- ggeett ccuurrrreenntt ccuurrssoorr ppoossiittiioonn iinn ssppeecciiffiieedd wwiinnddooww wwggeettsseell-- rreettuurrnn ccuurrrreennttllyy sseelleecctteedd wwiinnddooww wwggeettssttaatt-- rreettuurrnn iinnffoorrmmaattiioonn iinn WWSSTTAATT ffoorr ssppeecciiffiieedd wwiinnddooww wwggoottoo-- mmoovvee wwiinnddooww''ss ccuurrssoorr ttoo ssppeecciiffiicc rrooww aanndd ccoolluummnn wwiiccooffff-- ttuurrnn iiccoonn ooffff wwiiccoonn-- ttuurrnn iiccoonn oonn wwiinndd-- ppllaaccee wwiinnddooww oonn ssccrreeeenn wwiinniitt-- sseett uupp pprroocceessss ffoorr wwiinnddooww aacccceessss wwllaabbeell-- oouuttppuutt nnuullll--tteerrmmiinnaatteedd ssttrriinngg ttoo wwiinnddooww llaabbeell lliinnee wwnnddeellaayy-- sseett nnoo ddeellaayy iinnppuutt mmooddee wwnnll-- ttuurrnn oonn//ooffff mmaappppiinngg NNLL iinnttoo CCRR//NNLL oonn oouuttppuutt wwppoossttwwaaiitt-- ccaalllleedd bbyy aa ppaarreenntt pprroocceessss ttoo rreevveerrssee eeffffeeccttss ooff wwpprreexxeecc wwpprreexxeecc-- ccaalllleedd bbyy cchhiilldd pprroocceessss ttoo pprreeppaarree ttoo ttaakkee wwiinnddooww aafftteerr ffoorrkk wwpprriinnttff-- pprriinntt ttoo ssppeecciiffiieedd wwiinnddooww wwpprroommpptt-- oouuttppuutt nnuullll--tteerrmmiinnaatteedd ssttrriinngg ttoo pprroommpptt lliinnee wwppuuttcc-- oouuttppuutt ssppeecciiffiieedd cchhaarraacctteerr ttoo ssppeecciiffiieedd wwiinnddooww wwppuuttss-- oouuttppuutt ssppeecciiffiieedd cchhaarraacctteerr ssttrriinngg ttoo ssppeecciiffiieedd wwiinnddooww wwrraassttoopp-- ppiixxeell rraasstteerr ooppeerraattiioonnss wwrreeaaddmmoouussee-- ggeett mmoouussee ssttaattee wwrreeffrreesshh-- ccooppyy tthhee nnaammeedd wwiinnddooww ttoo tthhee pphhyyssiiccaall tteerrmmiinnaall ssccrreeeenn wwsseelleecctt-- sseelleecctt ssppeecciiffiieedd wwiinnddooww aass ccuurrrreenntt wwiinnddooww wwsseettmmoouussee-- sseett uupp ppaarraammeetteerrss aassssoocciiaatteedd wwiitthh mmoouussee wwsseettssttaatt-- cchhaannggee ppaarraammeetteerrss iinn WWSSTTAATT ffoorr ssppeecciiffiieedd wwiinnddooww wwssllkk-- oouuttppuutt aa nnuullll--tteerrmmiinnaatteedd ssttrriinngg ttoo aa ssccrreeeenn llaabbeelleedd kkeeyy wwuusseerr-- wwrriittee tthhee uusseerr lliinnee ooff tthhee wwiinnddooww You use these routines to run character-mode applications under the Terminal Access Method (TAM) on any display device supported by the ccuurrsseess library. Once you change a TAM program to remove machine-specific code, you can then recompile it including the standard TAM header file _t_a_m_._h and link it with the ttaamm and ccuurrsseess libraries. The TAM transition library translates between TAM function calls and ccuurrsseess (S) functions. For example, the TAM function wwccrreeaattee(S) is mapped to the conversion library function TTAAMMwwccrreeaattee(), which consists of a series of ccuurrsseess calls, such as nneewwwwiinn(S) and ssuubbwwiinn(S). To enable the code in your TAM application program to run smoothly under ccuurrsseess( ), you should do the following: o remove code that would be executed if a low-level iisswwiinndd(S) function call returned a non-zero value, i.e., TTRRUUEE. Under the TAM transition library, iisswwiinndd( ) always returns FFAALLSSEE. o remove all TAM calls to mouse management routines and the calls wwiiccoonn(S), wwiiccooffff(S), and wwrraassttoopp(S). because they will translate to null operations. o remove all machine-specific code, because the TAM transition library does not translate system calls specifically tailored to the UNIX System PC or calls (such as iiooccttll(S)) that have no meaning under ccuurrsseess( ). These calls fail under the TAM transition library on all machines except the UNIX System PC. o note that all calls to ttrraacckk(S) map to the low-level function wwggeettcc( ). o remove all references to TAM calls that bear the same name as ccuurrsseess calls because calls that have the same names in both systems have different effects. o remove all arbitrary ANSI escape sequences for display output. For example, the TAM transition library does not recognize the escape sequence used on the UNIX System PC in the command eecchhoo "" 3333[[JJ", which clears the screen. Instead, you should use equivalent ccuurrsseess( ) routines (here, cclleeaarr(())). Eliminating the superfluous code in the first three cases reduces your program's size and execution time. Functions +++++++++ The following table summarizes the translation of TAM function calls to ccuurrsseess functions. You can use this table as a guide if you want to rewrite your TAM application to make ccuurrsseess calls directly and run more efficiently. Routines marked with a dagger (+) are macros and don't return any value. ---------------------------------------------------- TAM Function ccuurrsseess(S) Equivalent ---------------------------------------------------- addch()+ Calls aaddddcchh(()). addstr()+ Calls aaddddssttrr(()). attron() Calls aattttrroonn(()). attroff() Calls aattttrrooffff(()). baudrate() Calls bbaauuddrraattee(()). beep() Calls bbeeeepp(()). cbreak() Calls ccbbrreeaakk(()). clear() Calls cclleeaarr(()). clearok()+ Null operation.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -