#include "util.h"

void get_term_dimensions(struct winsize *ws)
{
	char *s = getenv("LINES");

	if (s != NULL) {
		ws->ws_row = atoi(s);
		s = getenv("COLUMNS");
		if (s != NULL) {
			ws->ws_col = atoi(s);
			if (ws->ws_row && ws->ws_col)
				return;
		}
	}
#ifdef TIOCGWINSZ
	if (ioctl(1, TIOCGWINSZ, ws) == 0 &&
	    ws->ws_row && ws->ws_col)
		return;
#endif
	ws->ws_row = 25;
	ws->ws_col = 80;
}

void set_term_quiet_input(struct termios *old)
{
	struct termios tc;

	tcgetattr(0, old);
	tc = *old;
	tc.c_lflag &= ~(ICANON | ECHO);
	tc.c_cc[VMIN] = 0;
	tc.c_cc[VTIME] = 0;
	tcsetattr(0, TCSANOW, &tc);
}
'logo' rowspan='2'><a href='/cgit.cgi/'><img src='/cgit.png' alt='cgit logo'/></a></td>
<td class='main'><a href='/cgit.cgi/'>index</a> : <a href='/cgit.cgi/linux/net-next.git/'>net-next.git</a></td><td class='form'><form method='get'>
<input type='hidden' name='id' value='e7fe9491261ee07b0c7456df42c34ca6a8538804'/><select name='h' onchange='this.form.submit();'>
<option value='emaclite-cleanup'>emaclite-cleanup</option>
<option value='master' selected='selected'>master</option>
<option value='nds-private-remove'>nds-private-remove</option>
<option value='packet-loop-back'>packet-loop-back</option>
<option value='packet-rx-pump-back'>packet-rx-pump-back</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>net-next plumbings</td><td class='sub right'>Tobias Klauser</td></tr></table>
<table class='tabs'><tr><td>
<a href='/cgit.cgi/linux/net-next.git/'>summary</a><a href='/cgit.cgi/linux/net-next.git/refs/?id=e7fe9491261ee07b0c7456df42c34ca6a8538804'>refs</a><a class='active' href='/cgit.cgi/linux/net-next.git/log/tools/perf/ui/setup.c'>log</a><a href='/cgit.cgi/linux/net-next.git/tree/tools/perf/ui/setup.c?id=e7fe9491261ee07b0c7456df42c34ca6a8538804'>tree</a><a href='/cgit.cgi/linux/net-next.git/commit/tools/perf/ui/setup.c?id=e7fe9491261ee07b0c7456df42c34ca6a8538804'>commit</a><a href='/cgit.cgi/linux/net-next.git/diff/tools/perf/ui/setup.c?id=e7fe9491261ee07b0c7456df42c34ca6a8538804'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/tools/perf/ui/setup.c'>
<input type='hidden' name='id' value='e7fe9491261ee07b0c7456df42c34ca6a8538804'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/cgit.cgi/linux/net-next.git/log/?id=e7fe9491261ee07b0c7456df42c34ca6a8538804'>root</a>/<a href='/cgit.cgi/linux/net-next.git/log/tools?id=e7fe9491261ee07b0c7456df42c34ca6a8538804'>tools</a>/<a href='/cgit.cgi/linux/net-next.git/log/tools/perf?id=e7fe9491261ee07b0c7456df42c34ca6a8538804'>perf</a>/<a href='/cgit.cgi/linux/net-next.git/log/tools/perf/ui?id=e7fe9491261ee07b0c7456df42c34ca6a8538804'>ui</a>/<a href='/cgit.cgi/linux/net-next.git/log/tools/perf/ui/setup.c?id=e7fe9491261ee07b0c7456df42c34ca6a8538804'>setup.c</a></div><div class='content'><table class='list nowrap'><tr class='nohover'><th class='left'>Age</th><th class='left'>Commit message (<a href='/cgit.cgi/linux/net-next.git/log/tools/perf/ui/setup.c?id=e7fe9491261ee07b0c7456df42c34ca6a8538804&amp;showmsg=1'>Expand</a>)</th><th class='left'>Author</th><th class='left'>Files</th><th class='left'>Lines</th></tr>