/****************************************************************************
- * Copyright 2021 Thomas E. Dickey *
+ * Copyright 2021-2023,2024 Thomas E. Dickey *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
****************************************************************************/
/*
- * $Id: term.priv.h,v 1.6 2021/09/26 20:43:08 tom Exp $
+ * $Id: term.priv.h,v 1.13 2024/03/02 20:43:06 tom Exp $
*
* term.priv.h
*
* Header file for terminfo library objects which are private to
* the library.
- *
*/
#ifndef _TERM_PRIV_H
#include <ncurses_cfg.h>
+#ifndef __NCURSES_H
+#include <curses.h>
+#endif
+
#undef NCURSES_OPAQUE
#define NCURSES_INTERNALS 1
#define NCURSES_OPAQUE 0
-#include <limits.h> /* PATH_MAX */
+#if HAVE_LIMITS_H
+# include <limits.h> /* PATH_MAX, MB_LEN_MAX, etc */
+#elif HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
#include <signal.h> /* sig_atomic_t */
#include <time.h> /* time_t */
#include <term.h> /* time_t */
#endif
#endif
+/*
+ * If not properly configured to use the system's limits.h, we get gcc's
+ * fallback for limits.h which sets MB_LEN_MAX to 1, which is never correct.
+ */
+#if !HAVE_CONSISTENT_MB_LEN_MAX
+#undef MB_LEN_MAX
+#endif
+
+#ifndef MB_LEN_MAX
+#define MB_LEN_MAX 16 /* should be >= MB_CUR_MAX, but that may be a function */
+#endif
+
+#ifndef PATH_MAX
+# if defined(_POSIX_PATH_MAX)
+# define PATH_MAX _POSIX_PATH_MAX
+# elif defined(MAXPATHLEN)
+# define PATH_MAX MAXPATHLEN
+# else
+# define PATH_MAX 255 /* the Posix minimum path-size */
+# endif
+#endif
+
/*
* State of tparm().
*/
TGETENT_CACHE tgetent_cache[TGETENT_MAX];
int tgetent_index;
long tgetent_sequence;
+ int terminal_count;
char * dbd_blob; /* string-heap for dbd_list[] */
char ** dbd_list; /* distinct places to look for data */
#ifdef TRACE
bool trace_opened;
- char trace_fname[PATH_MAX];
int trace_level;
FILE * trace_fp;
int trace_fd;
extern NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen;
+extern NCURSES_EXPORT(void) _nc_free_tparm(TERMINAL*);
+
#ifdef __cplusplus
}
#endif