diff --git a/curses.h b/curses.h index a5d39bef..884facf9 100644 --- a/curses.h +++ b/curses.h @@ -41,8 +41,8 @@ Defined by this header: #define PDC_VER_MINOR 4 #define PDC_VER_CHANGE 0 #define PDC_VER_YEAR 2024 -#define PDC_VER_MONTH 06 -#define PDC_VER_DAY 19 +#define PDC_VER_MONTH 07 +#define PDC_VER_DAY 29 #define PDC_STRINGIZE( x) #x #define PDC_stringize( x) PDC_STRINGIZE( x) diff --git a/demos/curses.priv.h b/demos/curses.priv.h new file mode 100644 index 00000000..5601152a --- /dev/null +++ b/demos/curses.priv.h @@ -0,0 +1,25 @@ +#include + +#define NCURSES_SP_NAME(name) name +#define NCURSES_API +#define T(a) +#define returnAttr(code) return code +#define returnBool(code) return code +#define returnCode(code) return code +#define returnCPtr(code) return code +#define returnPtr(code) return code +#define returnVoidPtr(code) return code +#define returnWin(code) return code +#define CURRENT_SCREEN SP +#define NCURSES_INLINE inline +#define Min(a,b) ((a) > (b) ? (b) : (a)) +#define TR_FUNC_BFR(max) +#define NCURSES_SP_DCLx + +#define StdScreen(sp) stdscr +#define UChar(c) ((unsigned char)(c)) +#define ChCharOf(c) ((chtype)(c) & (chtype)A_CHARTEXT) +#define CharOf(c) ChCharOf(c) +#define BLANK ' ' +#define ZEROS '\0' + diff --git a/demos/nctests.mif b/demos/nctests.mif index b9185047..481c3f30 100644 --- a/demos/nctests.mif +++ b/demos/nctests.mif @@ -1,6 +1,8 @@ # This provides for compiling and linking the ncurses test programs. ncurses_testdir = $(HOME)/ncurses-6.5/test +menudir = $(HOME)/ncurses-6.5/menu +formdir = $(HOME)/ncurses-6.5/form NCURSES_TESTS = back_ground$(E) background$(E) blue$(E) \ bs$(E) cardfile$(E) chgat$(E) clip_printw$(E) color_content$(E) \ @@ -13,7 +15,7 @@ filter$(E) firstlast$(E) foldkeys$(E) form_driver_w$(E) gdc$(E) \ hanoi$(E) hashtest$(E) inchs$(E) inch_wide$(E) insdelln$(E) \ inserts$(E) ins_wide$(E) key_names$(E) keynames$(E) knight$(E) \ list_keys$(E) lrtest$(E) move_field$(E) \ -movewindow$(E) ncurses$(E) newdemo$(E) padview$(E) pair_content$(E) \ +movewindow$(E) newdemo$(E) padview$(E) pair_content$(E) \ picsmap$(E) railroad$(E) redraw$(E) savescreen$(E) sp_tinfo$(E) \ tclock$(E) testaddch$(E) test_addchstr$(E) test_addstr$(E) \ test_add_wchstr$(E) test_addwstr$(E) test_arrays$(E) \ @@ -21,6 +23,41 @@ test_delwin$(E) test_getstr$(E) test_get_wstr$(E) test_instr$(E) \ test_opaque$(E) testscanw$(E) test_setupterm$(E) test_sgr$(E) test_termattrs$(E) \ test_tparm$(E) test_vid_puts$(E) test_vidputs$(E) view$(E) +MENUOBJS = m_attribs.$(O) m_cursor.$(O) m_driver.$(O) m_format.$(O) \ + m_global.$(O) m_hook.$(O) m_item_cur.$(O) m_item_nam.$(O) m_item_new.$(O) \ + m_item_opt.$(O) m_items.$(O) m_item_top.$(O) m_item_use.$(O) m_item_val.$(O) \ + m_item_vis.$(O) m_new.$(O) m_opts.$(O) m_pad.$(O) m_pattern.$(O) m_post.$(O) \ + m_req_name.$(O) m_scale.$(O) m_spacing.$(O) m_sub.$(O) m_trace.$(O) \ + m_userptr.$(O) m_win.$(O) + +FORMOBJS = fld_arg.$(O) fld_link.$(O) fld_user.$(O) frm_req_name.$(O) \ + fty_generic.$(O) fld_attr.$(O) fld_max.$(O) frm_cursor.$(O) frm_scale.$(O) \ + fty_int.$(O) fld_current.$(O) fld_move.$(O) frm_data.$(O) frm_sub.$(O) \ + fty_ipv4.$(O) fld_def.$(O) fld_newftyp.$(O) frm_def.$(O) frm_user.$(O) \ + fty_num.$(O) fld_dup.$(O) fld_opts.$(O) frm_driver.$(O) frm_win.$(O) \ + fty_regex.$(O) fld_ftchoice.$(O) fld_pad.$(O) frm_hook.$(O) f_trace.$(O) \ + fld_ftlink.$(O) fld_page.$(O) frm_opts.$(O) fty_alnum.$(O) \ + fld_info.$(O) fld_stat.$(O) frm_page.$(O) fty_alpha.$(O) \ + fld_just.$(O) fld_type.$(O) frm_post.$(O) fty_enum.$(O) \ + +LIBMENUNAME=libmenu +LIBMENU = $(LIBMENUNAME).a + +$(LIBMENU) : $(MENUOBJS) + $(LIBEXE) $(LIBFLAGS) $@ $? + +$(MENUOBJS) : %.o: $(menudir)/%.c + $(BUILD) $(SFLAGS) -DBUILDING_MENU -I $(demodir) -c $< + +LIBFORMNAME=libform +LIBFORM = $(LIBFORMNAME).a + +$(LIBFORM) : $(FORMOBJS) + $(LIBEXE) $(LIBFLAGS) $@ $? + +$(FORMOBJS) : %.o: $(formdir)/%.c + $(BUILD) $(SFLAGS) -DBUILDING_FORM -I $(demodir) -I $(menudir) -c $< + ncurses_tests: $(NCURSES_TESTS) ncurses_clean: @@ -67,8 +104,8 @@ demo_forms$(E): $(ncurses_testdir)/demo_forms.c demo_keyok$(E): $(ncurses_testdir)/demo_keyok.c $(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS) -demo_menus$(E): $(ncurses_testdir)/demo_menus.c - $(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS) +demo_menus$(E): $(ncurses_testdir)/demo_menus.c libmenu.a + $(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS) libmenu.a demo_new_pair$(E): $(ncurses_testdir)/demo_new_pair.c $(ncurses_testdir)/popup_msg.c $(srcdir)/terminfo.c $(BUILD) $(NCFLAGS) -o $@ $^ $(LDFLAGS) @@ -139,8 +176,8 @@ inchs$(E): $(ncurses_testdir)/inchs.c $(ncurses_testdir)/popup_msg.c inch_wide$(E): $(ncurses_testdir)/inch_wide.c $(ncurses_testdir)/popup_msg.c $(BUILD) $(NCFLAGS) -o $@ $^ $(LDFLAGS) -insdelln$(E): $(ncurses_testdir)/insdelln.c - $(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS) +insdelln$(E): $(ncurses_testdir)/insdelln.c $(ncurses_testdir)/popup_msg.c + $(BUILD) $(NCFLAGS) -o $@ $^ $(LDFLAGS) inserts$(E): $(ncurses_testdir)/inserts.c $(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS) @@ -169,8 +206,8 @@ move_field$(E): $(ncurses_testdir)/move_field.c movewindow$(E): $(ncurses_testdir)/movewindow.c $(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS) -ncurses$(E): $(ncurses_testdir)/ncurses.c - $(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS) +ncurses$(E): $(ncurses_testdir)/ncurses.c $(ncurses_testdir)/popup_msg.c $(LIBFORM) $(LIBMENU) + $(BUILD) $(NCFLAGS) -o $@ $^ $(LDFLAGS) $(LIBFORM) $(LIBMENU) newdemo$(E): $(ncurses_testdir)/newdemo.c $(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS) @@ -191,7 +228,7 @@ redraw$(E): $(ncurses_testdir)/redraw.c $(ncurses_testdir)/popup_msg.c $(BUILD) $(NCFLAGS) -o $@ $^ $(LDFLAGS) savescreen$(E): $(ncurses_testdir)/savescreen.c $(ncurses_testdir)/popup_msg.c - $(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS) + $(BUILD) $(NCFLAGS) -o $@ $^ $(LDFLAGS) sp_tinfo$(E): $(ncurses_testdir)/sp_tinfo.c $(BUILD) $(NCFLAGS) -o $@ $< $(LDFLAGS) diff --git a/demos/ncurses_cfg.h b/demos/ncurses_cfg.h index d900c25b..541a1ba2 100644 --- a/demos/ncurses_cfg.h +++ b/demos/ncurses_cfg.h @@ -7,24 +7,22 @@ * "make ncurses_tests" to start. * "make ncurses_clean" when you're done. * - * Builds: bs gdc hanoi knight tclock ncurses (many others) + * Builds: bs gdc hanoi knight tclock ncurses (many others, see + * nctests.mif for the full list... many tests are still not built; + * many are not really relevant to PDCurses.) */ #define PDC_NCMOUSE #define DATA_DIR "." -#define NCURSES_CONST -#define NCURSES_EXPORT(foo) foo -#define RETSIGTYPE void +// #define RETSIGTYPE void #define TIME_WITH_SYS_TIME 1 #define HAVE_SYS_TIME_H 1 #define HAVE_SYS_TIME_SELECT 1 #define HAVE_UNISTD_H 1 #define HAVE_TERMATTRS 1 -#include - -#define ExitProgram exit +#include #define HAVE_ALLOC_PAIR 1 #define HAVE_ASSUME_DEFAULT_COLORS 1 @@ -32,6 +30,7 @@ #define HAVE_COLOR_CONTENT 1 #define HAVE_COPYWIN 1 #define HAVE_CURSES_VERSION 1 +#define HAVE_DELSCREEN 1 #define HAVE_GETBEGX 1 #define HAVE_GETCURX 1 #define HAVE_GETMAXX 1 @@ -46,24 +45,34 @@ #define HAVE_LOCALE_H 1 #define HAVE_MATH_H 1 #define HAVE_MATH_FUNCS 1 +#define HAVE_MENU_H 1 #define HAVE_NAPMS 1 #define HAVE_NEWPAD 1 #define HAVE_PANEL_H 1 #define HAVE_PUTWIN 1 +#define HAVE_RIPOFFLINE 1 #define HAVE_SCR_DUMP 1 #define HAVE_SLK_COLOR 1 #define HAVE_SLK_INIT 1 #define HAVE_STRSTR 1 #define HAVE_USE_DEFAULT_COLORS 1 +#define HAVE_WINSDELLN 1 #define HAVE_WRESIZE 1 #define USE_STRING_HACKS 1 +#define USE_LIBMENU 1 #ifdef PDC_WIDE -# define USE_WIDEC_SUPPORT 1 -# define HAVE_WCSRTOMBS 1 -# define HAVE_MBSRTOWCS 1 -# define HAVE_MBRTOWC 1 -# define HAVE_MBRLEN 1 + # define USE_WIDEC_SUPPORT 1 + # define HAVE_WCSRTOMBS 1 + # define HAVE_WCTYPE_H 1 + # define HAVE_MBSRTOWCS 1 + # define HAVE_MBRTOWC 1 + # define HAVE_MBRLEN 1 + # define wcwidth PDC_wcwidth + PDCEX int PDC_wcwidth( const int32_t ucs); + # define NCURSES_CH_T cchar_t +#else + # define NCURSES_CH_T chtype #endif /* Fool ncurses.c so it gives us all the tests, and doesn't redefine @@ -72,16 +81,15 @@ #ifdef __GNUC__ #define GCC_UNUSED __attribute__((unused)) #define GCC_NORETURN __attribute__((noreturn)) + #define GCC_DEPRECATED(msg) __attribute__((deprecated)) #else #define GCC_UNUSED #define GCC_NORETURN + #define GCC_DEPRECATED(msg) #endif #define NCURSES_VERSION PDCURSES -#ifdef PDC_WIDE - #define wcwidth PDC_wcwidth - PDCEX int PDC_wcwidth( const int32_t ucs); -#endif +#include char *tigetstr( const char *capname);