summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/meson.build6
-rw-r--r--src/screen.c3
-rw-r--r--src/term.c5
3 files changed, 14 insertions, 0 deletions
diff --git a/src/meson.build b/src/meson.build
index 694ee0e..7223caa 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,5 +1,9 @@
subdir('osc')
+# The SONAME carries the major version. An ABI break bumps it, so an old
+# binary keeps the old library.
+term_soversion = meson.project_version().split('.')[0]
+
# The x86-64 SIMD kernels pick their level at run time (see simd.h), so the
# library needs no ISA flags. -march in c_args sets the lowest level.
term_lib = both_libraries('term',
@@ -23,6 +27,8 @@ term_lib = both_libraries('term',
include_directories: term_private_inc,
dependencies: [m_dep],
gnu_symbol_visibility: 'hidden',
+ version: meson.project_version(),
+ soversion: term_soversion,
install: true
)
diff --git a/src/screen.c b/src/screen.c
index 87d6f2c..c41234f 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -847,6 +847,9 @@ struct term *term_new(const struct term_options *opt)
static const struct term_options defaults;
if (!opt)
opt = &defaults;
+ for (size_t i = 0; i < sizeof(opt->reserved) / sizeof(opt->reserved[0]); i++)
+ if (opt->reserved[i])
+ return NULL;
int cols = opt->size.x < 1 ? 80 : opt->size.x;
int rows = opt->size.y < 1 ? 24 : opt->size.y;
if (cols > TERM_MAX_COLS)
diff --git a/src/term.c b/src/term.c
index 1b16670..bf8f3cf 100644
--- a/src/term.c
+++ b/src/term.c
@@ -8,6 +8,11 @@ const char *term_unicode_version(void)
return UNICODE_DATA_VERSION;
}
+unsigned term_version(void)
+{
+ return TERM_VERSION_CODE;
+}
+
void term_lock(struct term *t)
{
term_write_begin(t);