2 curses library IO processing-Input/Output Functions

Source: Internet
Author: User

2.3 Input/Output Functions

============================


2.3.1 character, string output

----------------------

/** @ Brief outputs the characters at the cursor position, but does not automatically refresh the characters to be output by @ param ch @ return OK @ return ERR failed @ note chtype is a signed long integer, its low position can contain the character information, which is similar to the char type. @ note curses defines some constants and queues. These constants start with ACS _: ACS_ULCORNER, ACS_LLCORNER, metrics, metrics, ACS_HLINE, ACS_VLINE, ACS_PLUS, ACS_S1, metrics, ACS_DIAMOND, ACS_CKBOARD, metrics, metrics, ACS_BULLET, ACS_LARROW, metrics, metrics, ACS_DAROW, ACS_BOARD, ACS_LANTERN, ACS_BLOCK @ see waddch (), mvaddch (), mvwaddch () */int addch (chtype ch);/** @ brief output characters, and automatically refresh the @ note and addch types, however, the window is automatically refreshed */int echochar (chtype ch);/** @ brief output string str @ note if the string length exceeds the screen size, the string will be truncated @ see waddstr (), mvwaddstr (), mvaddstr () */int addstr (char * str ); /** @ brief format and output one or more values on the screen */int printw (char * fmt, arg1, arg2 ...); /** @ brief insert a character at the current position @ note after the character is inserted, the cursor will automatically move to the right I a position, if the rightmost character exceeds the terminal screen range, it will be truncated @ see mvprintw (), mvwprintw (), wprintw () */int insch (chtype ch ); /** @ brief Delete the function */int delch () at the current cursor;/** @ brief insert a blank line on the screen */int insertln (); /** @ brief: Delete the current row, move all rows under the current row up a row, and use spaces in the last row instead of */int deleteln ();



2.3.2 character, string Input

----------------------

/** @ Brief reads a character from the terminal keyboard and returns the integer @ return of the character. If return succeeds, return the integer @ return. If return fails, returns ERR */int getch ();/** @ brief receives strings from the terminal keyboard, and stored in str @ param str points to the location of the stored string @ note when the string is stored, '\ n' is replaced by Spaces */int getstr (char * str ); /** @ brief format the input data and copy them to the specified position */int scanw (char * fmt, argptr1, argptr2 ...);


This article is from the "dark day" blog, please be sure to keep this source http://darksun.blog.51cto.com/3874064/1286554

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.