Merge pull request #117 from tkurtbond/ncurses_programs_update

Ncurses programs update to compile with present day C compilers.
This commit is contained in:
Peter Bieringer
2025-01-29 20:59:26 +00:00
committed by GitHub
24 changed files with 54 additions and 8 deletions

View File

@@ -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>

View File

@@ -20,7 +20,7 @@ ${EXE_DIR}/%: %.o
${CC} -o $@ $< ${LIBS}
%.o: ${SRC_DIR}/%.c
${CC} -o $@ -c $<
${CC} ${CFLAGS} -o $@ -c $<
all: ${EXES}

View File

@@ -1,3 +1,5 @@
#include <stdlib.h>
#include <string.h>
#include <curses.h>
#define POSX 10

View File

@@ -1,3 +1,4 @@
#include <stdlib.h>
#include <curses.h>
int STARTX = 0;

View File

@@ -42,7 +42,7 @@ int main(int argc, char *argv[])
getch();
endwin();
return;
return 0;
}
void magic(int **a, int n)

View File

@@ -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;

View File

@@ -1,3 +1,5 @@
#include <stdlib.h>
#include <time.h>
#include <curses.h>
#define STARTX 9

View File

@@ -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);

View File

@@ -1,3 +1,4 @@
#include <string.h>
#include <ncurses.h>
#define WIDTH 30

View File

@@ -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);

View File

@@ -1,3 +1,4 @@
#include <stdlib.h>
#include <ncurses.h>
int main()

View File

@@ -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);

View File

@@ -1,3 +1,4 @@
#include <stdlib.h>
#include <menu.h>
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))

View File

@@ -1,3 +1,4 @@
#include <stdlib.h>
#include <curses.h>
#include <menu.h>

View File

@@ -1,3 +1,4 @@
#include <stdlib.h>
#include <curses.h>
#include <menu.h>

View File

@@ -1,3 +1,5 @@
#include <stdlib.h>
#include <string.h>
#include <curses.h>
#include <menu.h>

View File

@@ -1,3 +1,4 @@
#include <stdlib.h>
#include <curses.h>
#include <menu.h>

View File

@@ -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;

View File

@@ -1,3 +1,4 @@
#include <stdlib.h>
#include <curses.h>
#include <menu.h>

View File

@@ -1,3 +1,5 @@
#include <stdlib.h>
#include <string.h>
#include <menu.h>
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))

View File

@@ -1,3 +1,4 @@
#include <string.h>
#include <panel.h>
#define NLINES 10

View File

@@ -1,3 +1,4 @@
#include <string.h>
#include <panel.h>
typedef struct _PANEL_DATA {

View File

@@ -1,3 +1,5 @@
#include <stdlib.h>
#include <string.h>
#include <panel.h>
typedef struct _PANEL_DATA {