Current File : //proc/self/root/usr/local/lib/python3.6/site-packages/ptrace/__pycache__/terminal.cpython-36.pyc
3

�d��@spdZddlmZmZmZmZmZddlmZm	Z	ddl
mZddlm
Z
ddlZdZdd	�Zd
d�Zdd
�ZdS)z
Terminal functions.
�)�	tcgetattr�	tcsetattr�ECHO�	TCSADRAIN�
TIOCGWINSZ)�stdin�stdout)�ioctl)�unpackN�cCs*tj�}t|td�}td|�\}}||fS)N�1234�hh)r�filenor	rr
)�fd�size�height�width�r�8/tmp/pip-build-in2aja_b/python-ptrace/ptrace/terminal.py�
_terminalSizesrcCs
t�dS)z/
    Get the terminal width in characters.
    r)rrrrr�
terminalWidthsrcCsNtj�}tj|�sdSt|�}|tt@r.dS|ttB|t<t|t|�dS)z�
    Enable echo mode in the terminal. Return True if the echo mode is set
    correctly, or False if the mode was already set.
    FT)	rr�os�isattyr�
TERMIO_LFLAGSrrr)r�staterrr�enableEchoModes
r)�__doc__�termiosrrrrr�sysrr�fcntlr	�structr
rrrrrrrrr�<module>s