diff --git a/README.md b/README.md index 325b23b..0567cd0 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ ## 2. external functions : --- +(extracts of manuals) ### readline : - **readline** : `char *readline (const char *prompt);` will read a line from the terminal and return it, using prompt as a prompt - **rl_clear_history** : ` ` @@ -99,26 +100,31 @@ ### errors : - **strerror** : `char *strerror(int errnum);` returns a pointer to a string that describes the error code passed in the argument errnum - **perror** : `void perror(const char *s);` produces a message on standard error describing the last error encountered during a call to a system or library function +### termcap : +The termcap data base describes the capabilities of hundreds of different display terminals in great detail The termcap library is provided for easy access this data base in programs that want to do terminal-independent character-based display output +- **tgetent** : `int tgetent (char *buffer, char *termtype);` finds the description of the terminal type and remembers it internally so that you can interrogate it about specific terminal capabilities +Each piece of information recorded in a terminal description is called a capability +There are three functions to use to get the value of a capability : +- **tgetflag** : `int tgetflag (char *name);` get a boolean value +- **tgetnum** : `int tgetnum (char *name);` get a capability value that is numeric +- **tgetstr** : `char *tgetstr (char *name, char **area);` get a string value +- **tgoto** : `char *tgoto (char *cstring, int hpos, int vpos)` encoding numeric parameters such as cursor positions into the terminal-specific form required for display commands +- **tputs** : `int tputs (char *string, int nlines, int (*outfun) ());` output a string containing an optional padding spec ### other : - **printf** : `int printf(const char *format, ...);` produce output to stdout according to a specified format - **malloc** : `void *malloc(size_t size);` allocates size bytes and returns a pointer to the allocated memory. The memory is not initialized - **free** : `void free(void *ptr);` frees the memory space pointed to by ptr, which must have been returned by a previous call to malloc() - **write** : `ssize_t write(int fd, const void *buf, size_t count);` writes up to bytes from the buffer starting at to the file referred to by the file descriptor +- **isatty** : `int isatty(int fd);` tests whether fd is an open file descriptor referring to a terminal +- **ttyname** : `char *ttyname(int fd);` returns a pointer to the null-terminated pathname of the terminal device that is open on the file descriptor fd, or NULL on error (for example, if fd is not connected to a terminal) +- **ttyslot** : `int ttyslot(void);` returns the index of the current user's entry in some file +- **ioctl** : `int ioctl(int fd, unsigned long request, ...);` manipulates the underlying device parameters of special files. In particular, many operating characteristics of character special files (e.g., terminals) may be controlled with ioctl() requests. The argument fd must be an open file descriptor +- **getenv** : `char *getenv(const char *name);` searches the environment list to find the environment variable name, and returns a pointer to the corresponding value string +- **tcsetattr** : `int tcsetattr(int fd, int optional_actions, const struct termios *termios_p);` tcsetattr() only works in an environment where either a controlling terminal exists, or stdin and stderr refer to tty devices. Specifically, it does not work in a TSO environment. Changes the attributes associated with a terminal. New attributes are specified with a termios control structure. Programs should always issue a tcgetattr() first, modify the desired fields, and then issue a tcsetattr(). tcsetattr() should never be issued using a termios structure that was not obtained using tcgetattr(). tcsetattr() should use only a termios structure that was obtained by tcgetattr() +- **tcgetattr** : `int tcgetattr(int fildes, struct termios *termptr);` Gets a termios structure, which contains control information for a terminal associated with fildes. It stores that information in a memory location that termptr points to. The contents of a termios structure are described in tcsetattr() -- **isatty** : ` ` -- **ttyname** : ` ` -- **ttyslot** : ` ` -- **ioctl** : ` ` -- **getenv** : ` ` -- **tcsetattr** : ` ` -- **tcgetattr** : ` ` -- **tgetent** : ` ` -- **tgetflag** : ` ` -- **tgetnum** : ` ` -- **tgetstr** : ` ` -- **tgoto** : ` ` -- **tputs** : ` ` +*[\go to sommaire](#markdown-header-sommaire)* ## 3. parsing : ---