mirror of
https://github.com/tLDP/LDP.git
synced 2025-11-30 23:16:02 +07:00
Merge pull request #117 from tkurtbond/ncurses_programs_update
Ncurses programs update to compile with present day C compilers.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
<article id="index">
|
||||
<articleinfo>
|
||||
<title> NCURSES Programming HOWTO </title>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<firstname> Pradeep </firstname>
|
||||
<surname> Padala </surname>
|
||||
@@ -16,8 +17,27 @@
|
||||
<address><email>ppadala@gmail.com</email></address>
|
||||
</affiliation>
|
||||
</author>
|
||||
|
||||
<othercredit>
|
||||
<firstname>T.</firstname>
|
||||
<othername>Kurt</othername>
|
||||
<surname>Bond</surname>
|
||||
<contrib>Changed C example programs to compile with present day C
|
||||
compilers.</contrib>
|
||||
</othercredit>
|
||||
</authorgroup>
|
||||
|
||||
<revhistory>
|
||||
|
||||
|
||||
<revision>
|
||||
<revnumber>1.10</revnumber>
|
||||
<date>2025-01-29</date>
|
||||
<authorinitials>tkb</authorinitials>
|
||||
<revremark>The C example programs have been changed to compile
|
||||
with present day GCC and Clang compilers by adding the required
|
||||
headers and other minor changes.</revremark>
|
||||
</revision>
|
||||
|
||||
<revision>
|
||||
<revnumber>1.9</revnumber>
|
||||
<date>2005-06-20</date>
|
||||
@@ -114,7 +134,7 @@
|
||||
</revision>
|
||||
|
||||
</revhistory>
|
||||
<pubdate>v1.9, 2005-06-20</pubdate>
|
||||
<pubdate>v1.10, 2025-01-29</pubdate>
|
||||
<abstract>
|
||||
<para>
|
||||
<emphasis>
|
||||
|
||||
Binary file not shown.
@@ -20,7 +20,7 @@ ${EXE_DIR}/%: %.o
|
||||
${CC} -o $@ $< ${LIBS}
|
||||
|
||||
%.o: ${SRC_DIR}/%.c
|
||||
${CC} -o $@ -c $<
|
||||
${CC} ${CFLAGS} -o $@ -c $<
|
||||
|
||||
all: ${EXES}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <curses.h>
|
||||
|
||||
#define POSX 10
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <stdlib.h>
|
||||
#include <curses.h>
|
||||
|
||||
int STARTX = 0;
|
||||
|
||||
@@ -42,7 +42,7 @@ int main(int argc, char *argv[])
|
||||
getch();
|
||||
endwin();
|
||||
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void magic(int **a, int n)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <curses.h>
|
||||
|
||||
@@ -5,7 +6,7 @@
|
||||
|
||||
int *nqueens(int num);
|
||||
int place(int current, int *position);
|
||||
int print(int *positions, int num_queens);
|
||||
void print(int *positions, int num_queens);
|
||||
void board(WINDOW *win, int starty, int startx, int lines, int cols,
|
||||
int tile_width, int tile_height);
|
||||
|
||||
@@ -70,7 +71,7 @@ int place(int current, int *position)
|
||||
return(1);
|
||||
}
|
||||
|
||||
int print(int *positions, int num_queens)
|
||||
void print(int *positions, int num_queens)
|
||||
{ int count;
|
||||
int y = 2, x = 2, w = 4, h = 2;
|
||||
static int solution = 1;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <curses.h>
|
||||
|
||||
#define STARTX 9
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
int print_menu();
|
||||
void print_byebye();
|
||||
void create_test_string();
|
||||
void create_test_string(char *test_array, int choice);
|
||||
void print_time(time_t startt, time_t endt, int mistakes);
|
||||
void print_in_middle(int startx, int starty, int width, char *string, WINDOW *win);
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <string.h>
|
||||
#include <ncurses.h>
|
||||
|
||||
#define WIDTH 30
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ncurses.h>
|
||||
|
||||
void print_in_middle(WINDOW *win, int starty, int startx, int width, char *string);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <stdlib.h>
|
||||
#include <ncurses.h>
|
||||
|
||||
int main()
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <string.h>
|
||||
#include <form.h>
|
||||
|
||||
void print_in_middle(WINDOW *win, int starty, int startx, int width, char *string, chtype color);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <stdlib.h>
|
||||
#include <menu.h>
|
||||
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <stdlib.h>
|
||||
#include <curses.h>
|
||||
#include <menu.h>
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <stdlib.h>
|
||||
#include <curses.h>
|
||||
#include <menu.h>
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <curses.h>
|
||||
#include <menu.h>
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <stdlib.h>
|
||||
#include <curses.h>
|
||||
#include <menu.h>
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <curses.h>
|
||||
#include <menu.h>
|
||||
|
||||
@@ -69,7 +71,7 @@ int main()
|
||||
}
|
||||
move(20, 0);
|
||||
clrtoeol();
|
||||
mvprintw(20, 0, temp);
|
||||
mvprintw(20, 0, "%s", temp);
|
||||
refresh();
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <stdlib.h>
|
||||
#include <curses.h>
|
||||
#include <menu.h>
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <menu.h>
|
||||
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <string.h>
|
||||
#include <panel.h>
|
||||
|
||||
#define NLINES 10
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <string.h>
|
||||
#include <panel.h>
|
||||
|
||||
typedef struct _PANEL_DATA {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <panel.h>
|
||||
|
||||
typedef struct _PANEL_DATA {
|
||||
|
||||
Reference in New Issue
Block a user