Linux node5458.myfcloud.com 6.10.2-x86_64-linode165 #1 SMP PREEMPT_DYNAMIC Tue Jul 30 15:03:21 EDT 2024 x86_64
Apache
: 45.79.123.194 | : 18.188.175.197
16 Domain
7.4.33
addify5
shells.trxsecurity.org
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
Backdoor Scanner
Backdoor Create
Alfa Webshell
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
ncurses-devel-5.9 /
test /
[ HOME SHELL ]
Name
Size
Permission
Action
package
[ DIR ]
drwxr-xr-x
Makefile.in
4.92
KB
-rw-r--r--
README
35.89
KB
-rw-r--r--
aclocal.m4
108.83
KB
-rw-r--r--
background.c
6.84
KB
-rw-r--r--
blue.c
12.4
KB
-rw-r--r--
bs.6
3.91
KB
-rw-r--r--
bs.c
29.95
KB
-rw-r--r--
bulgarian-utf8.txt
340
B
-rw-r--r--
cardfile.c
13.26
KB
-rw-r--r--
cardfile.dat
394
B
-rw-r--r--
chgat.c
9.03
KB
-rw-r--r--
clip_printw.c
9.1
KB
-rw-r--r--
color_name.h
3.32
KB
-rw-r--r--
color_set.c
3.25
KB
-rw-r--r--
configure
449.42
KB
-rw-r--r--
configure.in
9.57
KB
-rw-r--r--
demo_altkeys.c
4.77
KB
-rw-r--r--
demo_defkey.c
7.4
KB
-rw-r--r--
demo_forms.c
13.01
KB
-rw-r--r--
demo_keyok.c
3.24
KB
-rw-r--r--
demo_menus.c
18.74
KB
-rw-r--r--
demo_panels.c
16.89
KB
-rw-r--r--
demo_termcap.c
10.09
KB
-rw-r--r--
demo_terminfo.c
10.05
KB
-rw-r--r--
ditto.c
11.04
KB
-rw-r--r--
dots.c
4.52
KB
-rw-r--r--
dots_mvcur.c
4.66
KB
-rw-r--r--
echochar.c
4.35
KB
-rw-r--r--
edit_field.c
11.21
KB
-rw-r--r--
edit_field.h
2.57
KB
-rw-r--r--
filter.c
4.97
KB
-rw-r--r--
firework.c
5.53
KB
-rw-r--r--
firstlast.c
3.72
KB
-rw-r--r--
foldkeys.c
7.44
KB
-rw-r--r--
gdc.6
3.03
KB
-rw-r--r--
gdc.c
8.74
KB
-rw-r--r--
hanoi.c
8.58
KB
-rw-r--r--
hashtest.c
6.58
KB
-rw-r--r--
inch_wide.c
7.21
KB
-rw-r--r--
inchs.c
7.15
KB
-rw-r--r--
ins_wide.c
12.25
KB
-rw-r--r--
insdelln.c
9.16
KB
-rw-r--r--
inserts.c
10.62
KB
-rw-r--r--
install-sh
6.96
KB
-rw-r--r--
key_names.c
3.22
KB
-rw-r--r--
keynames.c
3.07
KB
-rw-r--r--
knight.c
18.54
KB
-rw-r--r--
linedata.h
3.16
KB
-rw-r--r--
linux-color.dat
2.56
KB
-rw-r--r--
listused.sh
5.46
KB
-rw-r--r--
lrtest.c
5.24
KB
-rw-r--r--
make-tar.sh
4.8
KB
-rw-r--r--
mk-test.awk
4.42
KB
-rw-r--r--
modules
5.07
KB
-rw-r--r--
movewindow.c
16.44
KB
-rw-r--r--
ncurses.c
154.98
KB
-rw-r--r--
ncurses_tst.hin
2.88
KB
-rw-r--r--
newdemo.c
7.38
KB
-rw-r--r--
programs
5.28
KB
-rw-r--r--
railroad.c
5.66
KB
-rw-r--r--
rain.c
8.44
KB
-rw-r--r--
redraw.c
4.66
KB
-rw-r--r--
savescreen.c
7.49
KB
-rw-r--r--
savescreen.sh
2.66
KB
-rw-r--r--
tclock.c
5.26
KB
-rw-r--r--
test.priv.h
19.55
KB
-rw-r--r--
test_add_wchstr.c
14.08
KB
-rw-r--r--
test_addchstr.c
12.14
KB
-rw-r--r--
test_addstr.c
10.3
KB
-rw-r--r--
test_addwstr.c
12.37
KB
-rw-r--r--
test_arrays.c
3.83
KB
-rw-r--r--
test_get_wstr.c
8.94
KB
-rw-r--r--
test_getstr.c
8.88
KB
-rw-r--r--
test_instr.c
6.49
KB
-rw-r--r--
test_inwstr.c
6.69
KB
-rw-r--r--
test_opaque.c
10.42
KB
-rw-r--r--
test_vid_puts.c
3.97
KB
-rw-r--r--
test_vidputs.c
3.92
KB
-rw-r--r--
testaddch.c
3.46
KB
-rw-r--r--
testcurs.c
16.69
KB
-rw-r--r--
testscanw.c
2.88
KB
-rw-r--r--
tracemunch
5.01
KB
-rw-r--r--
view.c
13.84
KB
-rw-r--r--
widechars-utf8.txt
389
B
-rw-r--r--
widechars.h
3.19
KB
-rw-r--r--
worm.c
14.01
KB
-rw-r--r--
xmas.c
33.47
KB
-rw-r--r--
xterm-16color.dat
2.99
KB
-rw-r--r--
xterm-256color.dat
6.88
KB
-rw-r--r--
xterm-88color.dat
4.11
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : newdemo.c
/* * newdemo.c - A demo program using PDCurses. The program illustrate * the use of colours for text output. * * $Id: newdemo.c,v 1.40 2013/04/27 19:46:53 tom Exp $ */ #include <test.priv.h> #include <time.h> /* * The Australian map */ static CONST_MENUS char *AusMap[16] = { " A A ", " N.T. AAAAA AAAA ", " AAAAAAAAAAA AAAAAAAA ", " AAAAAAAAAAAAAAAAAAAAAAAAA Qld.", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAA ", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ", " AAAAAAAAAAAAAAAAAAAAAAAAAAAA ", " AAAAAAAAAAAAAAAAAAAAAAAAA N.S.W.", "W.A. AAAAAAAAA AAAAAA Vic.", " AAA S.A. AA", " A Tas.", "" }; /* * Funny messages */ #define NMESSAGES 6 static const char *messages[] = { "Hello from the Land Down Under", "The Land of crocs. and a big Red Rock", "Where the sunflower runs along the highways", "the dusty red roads lead one to loneliness", "Blue sky in the morning and", "freezing nights and twinkling stars", "" }; /* * Trap interrupt */ static void trap(int sig GCC_UNUSED) { endwin(); ExitProgram(EXIT_FAILURE); } /* * Wait for user */ static int WaitForUser(WINDOW *win) { time_t t; chtype key; nodelay(win, TRUE); t = time((time_t *) 0); while (1) { if ((int) (key = (chtype) wgetch(win)) != ERR) { if (key == 'q' || key == 'Q') return 1; else return 0; } if (time((time_t *) 0) - t > 5) return 0; } } static void set_colors(WINDOW *win, int pair, int foreground, int background) { if (has_colors()) { if (pair > COLOR_PAIRS) pair = COLOR_PAIRS; init_pair((short) pair, (short) foreground, (short) background); (void) wattrset(win, (int) COLOR_PAIR(pair)); } } static chtype use_colors(WINDOW *win, int pair, chtype attrs) { if (has_colors()) { if (pair > COLOR_PAIRS) pair = COLOR_PAIRS; attrs |= (chtype) COLOR_PAIR(pair); } (void) wattrset(win, (int) attrs); return attrs; } /* * Test sub windows */ static int SubWinTest(WINDOW *win) { int w, h, sw, sh, bx, by; WINDOW *swin1, *swin2, *swin3; getmaxyx(win, h, w); getbegyx(win, by, bx); sw = w / 3; sh = h / 3; if ((swin1 = subwin(win, sh, sw, by + 3, bx + 5)) == NULL) { return 1; } if ((swin2 = subwin(win, sh, sw, by + 4, bx + 8)) == NULL) { delwin(swin1); return 1; } if ((swin3 = subwin(win, sh, sw, by + 5, bx + 11)) == NULL) { delwin(swin1); delwin(swin2); return 1; } set_colors(swin1, 8, COLOR_RED, COLOR_BLUE); werase(swin1); MvWAddStr(swin1, 0, 3, "Sub-window 1"); wrefresh(swin1); set_colors(swin2, 9, COLOR_CYAN, COLOR_MAGENTA); werase(swin2); MvWAddStr(swin2, 0, 3, "Sub-window 2"); wrefresh(swin2); set_colors(swin3, 10, COLOR_YELLOW, COLOR_GREEN); werase(swin3); MvWAddStr(swin3, 0, 3, "Sub-window 3"); wrefresh(swin3); delwin(swin1); delwin(swin2); delwin(swin3); WaitForUser(win); return 0; } static int bounce(int n, int *dir, int len) { if (*dir > 0) ++n; else --n; if (n <= 1 || n >= len - 2) *dir = *dir ? 0 : 1; return n; } /* * Bouncing balls */ static int BouncingBalls(WINDOW *win) { int w, h; int x1, y1, xd1, yd1; int x2, y2, xd2, yd2; int x3, y3, xd3, yd3; getmaxyx(win, h, w); x1 = 2 + rand() % (w - 4); y1 = 2 + rand() % (h - 4); x2 = 2 + rand() % (w - 4); y2 = 2 + rand() % (h - 4); x3 = 2 + rand() % (w - 4); y3 = 2 + rand() % (h - 4); xd1 = 1; yd1 = 1; xd2 = 1; yd2 = 0; xd3 = 0; yd3 = 1; nodelay(win, TRUE); while (wgetch(win) == ERR) { x1 = bounce(x1, &xd1, w); y1 = bounce(y1, &yd1, h); x2 = bounce(x2, &xd2, w); y2 = bounce(y2, &yd2, h); x3 = bounce(x3, &xd3, w); y3 = bounce(y3, &yd3, h); set_colors(win, 11, COLOR_RED, COLOR_BLUE); MvWAddCh(win, y1, x1, 'O'); set_colors(win, 12, COLOR_BLUE, COLOR_RED); MvWAddCh(win, y2, x2, '*'); set_colors(win, 13, COLOR_YELLOW, COLOR_WHITE); MvWAddCh(win, y3, x3, '@'); wmove(win, 0, 0); wrefresh(win); delay_output(100); } return 0; } /* * Main driver */ int main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) { WINDOW *win; int w, x, y, i, j, k; char buffer[SIZEOF(messages) * 80]; const char *message; int width, height; chtype save[80]; chtype c; setlocale(LC_ALL, ""); CATCHALL(trap); initscr(); if (has_colors()) start_color(); cbreak(); curs_set(0); width = 48; height = 14; /* Create a drawing window */ win = newwin(height, width, (LINES - height) / 2, (COLS - width) / 2); if (win == NULL) { endwin(); ExitProgram(EXIT_FAILURE); } while (1) { set_colors(win, 1, COLOR_WHITE, COLOR_BLUE); werase(win); set_colors(win, 2, COLOR_RED, COLOR_RED); box(win, ACS_VLINE, ACS_HLINE); wrefresh(win); /* Do ramdom output of a character */ use_colors(win, 1, A_NORMAL); c = 'a'; for (i = 0; i < 5000; ++i) { x = rand() % (width - 2) + 1; y = rand() % (height - 2) + 1; MvWAddCh(win, y, x, c); wrefresh(win); nodelay(win, TRUE); if (wgetch(win) != ERR) break; if (i == 2000) { c = 'b'; set_colors(win, 3, COLOR_CYAN, COLOR_YELLOW); } } SubWinTest(win); /* Erase and draw green window */ set_colors(win, 4, COLOR_YELLOW, COLOR_GREEN); wbkgd(win, use_colors(win, 4, A_BOLD)); werase(win); wrefresh(win); /* Draw RED bounding box */ use_colors(win, 2, A_NORMAL); box(win, ' ', ' '); wrefresh(win); /* Display Australia map */ use_colors(win, 4, A_BOLD); i = 0; while (*AusMap[i]) { MvWAddStr(win, i + 1, 8, AusMap[i]); wrefresh(win); delay_output(50); ++i; } set_colors(win, 5, COLOR_BLUE, COLOR_WHITE); use_colors(win, 5, A_BLINK); MvWAddStr(win, height - 2, 6, " PDCurses 2.1 for DOS, OS/2 and Unix"); wrefresh(win); /* Draw running messages */ set_colors(win, 6, COLOR_YELLOW, COLOR_WHITE); message = messages[j = 0]; i = 1; w = width - 2; strcpy(buffer, message); while (j < NMESSAGES) { while ((int) strlen(buffer) < w) { strcat(buffer, " ... "); strcat(buffer, messages[++j % NMESSAGES]); } if (i < w) (void) mvwaddnstr(win, height / 2, w - i, buffer, i); else (void) mvwaddnstr(win, height / 2, 1, buffer, w); wrefresh(win); nodelay(win, TRUE); if (wgetch(win) != ERR) { flushinp(); break; } if (i++ >= w) { for (k = 0; (buffer[k] = buffer[k + 1]) != '\0'; k++) ; } delay_output(100); } j = 0; /* Draw running As across in RED */ set_colors(win, 7, COLOR_RED, COLOR_GREEN); memset(save, ' ', sizeof(save)); for (i = 2; i < width - 4; ++i) { k = (int) mvwinch(win, 4, i); if (k == ERR) break; save[j++] = c = (chtype) k; c &= A_CHARTEXT; MvWAddCh(win, 4, i, c); } wrefresh(win); /* Put a message up wait for a key */ i = height - 2; use_colors(win, 5, A_NORMAL); MvWAddStr(win, i, 5, " Type a key to continue or 'Q' to quit "); wrefresh(win); if (WaitForUser(win) == 1) break; j = 0; /* Restore the old line */ for (i = 2; i < width - 4; ++i) MvWAddCh(win, 4, i, save[j++]); wrefresh(win); BouncingBalls(win); /* Put a message up wait for a key */ i = height - 2; use_colors(win, 5, A_NORMAL); MvWAddStr(win, i, 5, " Type a key to continue or 'Q' to quit "); wrefresh(win); if (WaitForUser(win) == 1) break; } endwin(); ExitProgram(EXIT_SUCCESS); }
Close