Code

wreadln: use memcpy() for both cases
[ncmpc.git] / src / ncu.c
1 /* ncmpc
2  * (c) 2004 by Kalle Wallin <kaw@linux.se>
3  * Copyright (C) 2008 Max Kellermann <max@duempel.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
19 #include "ncu.h"
21 #ifdef ENABLE_COLORS
22 #include "colors.h"
23 #endif
25 #ifdef HAVE_GETMOUSE
26 #include "options.h"
27 #endif
29 #include <ncurses.h>
31 void
32 ncu_init(void)
33 {
34         /* initialize the curses library */
35         initscr();
37         /* initialize color support */
38 #ifdef ENABLE_COLORS
39         colors_start();
40 #endif
42         /* tell curses not to do NL->CR/NL on output */
43         nonl();
45         /* don't echo input */
46         noecho();
48         /* set cursor invisible */
49         curs_set(0);
51         /* enable extra keys */
52         keypad(stdscr, TRUE);
54         /* initialize mouse support */
55 #ifdef HAVE_GETMOUSE
56         if (options.enable_mouse)
57                 mousemask(ALL_MOUSE_EVENTS, NULL);
58 #endif
59 }
61 void
62 ncu_deinit(void)
63 {
64         endwin();
65 }