aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-01-19 22:01:31 +0100
committerMattias Andrée <m@maandree.se>2026-01-19 22:01:31 +0100
commit3919e65b5a7600e9b9baa0e9f2fab7af051c8eb9 (patch)
treed893b1607b2ec2612d17adf584b640d15b30b4cb
parentAdd man pages for bitwise connectives (diff)
downloadlibj2-3919e65b5a7600e9b9baa0e9f2fab7af051c8eb9.tar.gz
libj2-3919e65b5a7600e9b9baa0e9f2fab7af051c8eb9.tar.bz2
libj2-3919e65b5a7600e9b9baa0e9f2fab7af051c8eb9.tar.xz
Add some man pages
Signed-off-by: Mattias Andrée <m@maandree.se>
-rw-r--r--libj2_j2i_max_j2i.368
-rw-r--r--libj2_j2i_max_j2i.c10
-rw-r--r--libj2_j2i_min_j2i.368
-rw-r--r--libj2_j2i_min_j2i.c10
-rw-r--r--libj2_j2u_has_j2u.375
-rw-r--r--libj2_j2u_has_j2u.c5
l---------libj2_j2u_test_bit.31
-rw-r--r--libj2_j2u_test_bit.c1
-rw-r--r--libj2_j2u_test_j2u.386
-rw-r--r--libj2_j2u_test_j2u.c5
10 files changed, 298 insertions, 31 deletions
diff --git a/libj2_j2i_max_j2i.3 b/libj2_j2i_max_j2i.3
new file mode 100644
index 0000000..e918f78
--- /dev/null
+++ b/libj2_j2i_max_j2i.3
@@ -0,0 +1,68 @@
+.TH LIBJ2_J2I_MAX_J2I 3 LIBJ2
+.SH NAME
+libj2_j2i_max_j2i \- Select maximum of two values
+
+.SH SYNOPSIS
+.nf
+#include <libj2.h>
+
+void \fBlibj2_j2i_max_j2i\fP(struct libj2_j2i *\fIa\fP, const struct libj2_j2i *\fIb\fP);
+void \fBlibj2_j2i_max_j2i_to_j2i\fP(const struct libj2_j2i *\fIa\fP, const struct libj2_j2i *\fIb\fP, struct libj2_j2i *\fIr\fP);
+void \fBlibj2_j2i_max_ji\fP(struct libj2_j2i *\fIa\fP, intmax_t \fIb\fP);
+void \fBlibj2_j2i_max_ji_to_j2i\fP(const struct libj2_j2i *\fIa\fP, intmax_t \fIb\fP, struct libj2_j2i *\fIr\fP);
+void \fBlibj2_j2u_max_j2u\fP(struct libj2_j2u *\fIa\fP, const struct libj2_j2u *\fIb\fP);
+void \fBlibj2_j2u_max_j2u_to_j2u\fP(const struct libj2_j2u *\fIa\fP, const struct libj2_j2u *\fIb\fP, struct libj2_j2u *\fIr\fP);
+void \fBlibj2_j2u_max_ju\fP(struct libj2_j2u *\fIa\fP, uintmax_t \fIb\fP);
+void \fBlibj2_j2u_max_ju_to_j2u\fP(const struct libj2_j2u *\fIa\fP, uintmax_t \fIb\fP, struct libj2_j2u *\fIr\fP);
+.fi
+.PP
+Link with
+.IR -lj2 .
+
+.SH DESCRIPTION
+The above listed functions
+calculate selects the maximum value of
+.I a
+and
+.I b
+and stores the result in
+.IR r ,
+or in
+.I a
+for the functions that does not have an
+.I r
+parameter.
+.PP
+The arguments are assumed to be
+.RI non- NULL .
+
+.SH RETURN VALUE
+None.
+
+.SH ERRORS
+The above listed functions cannot fail.
+
+.SH HISTORY
+The
+.BR libj2_j2u_max_j2u (),
+.BR libj2_j2u_max_j2u_to_j2u (),
+.BR libj2_j2u_max_ju (),
+and
+.BR libj2_j2u_max_ju_to_j2u ()
+functions were added in version 1.0 of
+.BR libj2 .
+.PP
+The
+.BR libj2_j2i_max_j2i (),
+.BR libj2_j2i_max_j2i_to_j2i (),
+.BR libj2_j2i_max_ji (),
+and
+.BR libj2_j2i_max_ji_to_j2i ()
+functions were added in version 1.1 of
+.BR libj2 .
+
+.SH SEE ALSO
+.BR libj2 (7),
+.BR libj2_j2i_min_j2i (3),
+.BR libj2_max_j2i (3),
+.BR libj2_min_j2i (3)
diff --git a/libj2_j2i_max_j2i.c b/libj2_j2i_max_j2i.c
index ecd06d0..9e46b7c 100644
--- a/libj2_j2i_max_j2i.c
+++ b/libj2_j2i_max_j2i.c
@@ -3,16 +3,6 @@
#ifndef TEST
extern inline void libj2_j2i_max_j2i(struct libj2_j2i *a, const struct libj2_j2i *b);
-/* TODO Add man pages
- libj2_j2i_max_j2i
- libj2_j2i_max_j2i_to_j2i
- libj2_j2i_max_ji
- libj2_j2i_max_ji_to_j2i
- libj2_j2u_max_j2u
- libj2_j2u_max_j2u_to_j2u
- libj2_j2u_max_ju
- libj2_j2u_max_ju_to_j2u
- */
#else
diff --git a/libj2_j2i_min_j2i.3 b/libj2_j2i_min_j2i.3
new file mode 100644
index 0000000..c677943
--- /dev/null
+++ b/libj2_j2i_min_j2i.3
@@ -0,0 +1,68 @@
+.TH LIBJ2_J2I_MIN_J2I 3 LIBJ2
+.SH NAME
+libj2_j2i_min_j2i \- Select minimum of two values
+
+.SH SYNOPSIS
+.nf
+#include <libj2.h>
+
+void \fBlibj2_j2i_min_j2i\fP(struct libj2_j2i *\fIa\fP, const struct libj2_j2i *\fIb\fP);
+void \fBlibj2_j2i_min_j2i_to_j2i\fP(const struct libj2_j2i *\fIa\fP, const struct libj2_j2i *\fIb\fP, struct libj2_j2i *\fIr\fP);
+void \fBlibj2_j2i_min_ji\fP(struct libj2_j2i *\fIa\fP, intmax_t \fIb\fP);
+void \fBlibj2_j2i_min_ji_to_j2i\fP(const struct libj2_j2i *\fIa\fP, intmax_t \fIb\fP, struct libj2_j2i *\fIr\fP);
+void \fBlibj2_j2u_min_j2u\fP(struct libj2_j2u *\fIa\fP, const struct libj2_j2u *\fIb\fP);
+void \fBlibj2_j2u_min_j2u_to_j2u\fP(const struct libj2_j2u *\fIa\fP, const struct libj2_j2u *\fIb\fP, struct libj2_j2u *\fIr\fP);
+void \fBlibj2_j2u_min_ju\fP(struct libj2_j2u *\fIa\fP, uintmax_t \fIb\fP);
+void \fBlibj2_j2u_min_ju_to_j2u\fP(const struct libj2_j2u *\fIa\fP, uintmax_t \fIb\fP, struct libj2_j2u *\fIr\fP);
+.fi
+.PP
+Link with
+.IR -lj2 .
+
+.SH DESCRIPTION
+The above listed functions
+calculate selects the minimum value of
+.I a
+and
+.I b
+and stores the result in
+.IR r ,
+or in
+.I a
+for the functions that does not have an
+.I r
+parameter.
+.PP
+The arguments are assumed to be
+.RI non- NULL .
+
+.SH RETURN VALUE
+None.
+
+.SH ERRORS
+The above listed functions cannot fail.
+
+.SH HISTORY
+The
+.BR libj2_j2u_min_j2u (),
+.BR libj2_j2u_min_j2u_to_j2u (),
+.BR libj2_j2u_min_ju (),
+and
+.BR libj2_j2u_min_ju_to_j2u ()
+functions were added in version 1.0 of
+.BR libj2 .
+.PP
+The
+.BR libj2_j2i_min_j2i (),
+.BR libj2_j2i_min_j2i_to_j2i (),
+.BR libj2_j2i_min_ji (),
+and
+.BR libj2_j2i_min_ji_to_j2i ()
+functions were added in version 1.1 of
+.BR libj2 .
+
+.SH SEE ALSO
+.BR libj2 (7),
+.BR libj2_j2i_max_j2i (3),
+.BR libj2_min_j2i (3),
+.BR libj2_max_j2i (3)
diff --git a/libj2_j2i_min_j2i.c b/libj2_j2i_min_j2i.c
index 6286ec3..f80e884 100644
--- a/libj2_j2i_min_j2i.c
+++ b/libj2_j2i_min_j2i.c
@@ -3,16 +3,6 @@
#ifndef TEST
extern inline void libj2_j2i_min_j2i(struct libj2_j2i *a, const struct libj2_j2i *b);
-/* TODO Add man pages
- libj2_j2i_min_j2i
- libj2_j2i_min_j2i_to_j2i
- libj2_j2i_min_ji
- libj2_j2i_min_ji_to_j2i
- libj2_j2u_min_j2u
- libj2_j2u_min_j2u_to_j2u
- libj2_j2u_min_ju
- libj2_j2u_min_ju_to_j2u
- */
#else
diff --git a/libj2_j2u_has_j2u.3 b/libj2_j2u_has_j2u.3
new file mode 100644
index 0000000..285a68b
--- /dev/null
+++ b/libj2_j2u_has_j2u.3
@@ -0,0 +1,75 @@
+.TH LIBJ2_J2U_HAS_J2U 3 LIBJ2
+.SH NAME
+libj2_j2u_has_j2u \- Check whether all bits from a set are set
+
+.SH SYNOPSIS
+.nf
+#include <libj2.h>
+
+int \fBlibj2_j2u_has_j2u\fP(const struct libj2_j2u *\fIa\fP, const struct libj2_j2u *\fIb\fP);
+int \fBlibj2_j2u_has_ju\fP(const struct libj2_j2u *\fIa\fP, uintmax_t \fIb\fP);
+int \fBlibj2_j2u_has_high_ju\fP(const struct libj2_j2u *\fIa\fP, uintmax_t \fIb\fP);
+.fi
+.PP
+Link with
+.IR -lj2 .
+
+.SH DESCRIPTION
+The
+.BR libj2_j2u_has_j2u ()
+function checks whether all set bit in
+.I b
+are also set in
+.IR a .
+.PP
+The
+.BR libj2_j2u_has_ju ()
+function checks whether all set bit in
+.I b
+are also set in the least significant half of
+.IR a .
+.PP
+The
+.BR libj2_j2u_has_high_ju ()
+function checks whether all set bit in
+.I b
+are also set in the most significant half of
+.IR a .
+.PP
+The arguments are assumed to be
+.RI non- NULL .
+
+.SH RETURN VALUE
+The
+.BR libj2_j2u_has_j2u (),
+.BR libj2_j2u_has_ju (),
+and
+.BR libj2_j2u_has_high_ju (),
+functions return 1 if the has passes, and 0 otherwise.
+
+.SH ERRORS
+The above listed functions cannot fail.
+
+.SH HISTORY
+The
+.BR libj2_j2u_has_j2u (),
+.BR libj2_j2u_has_ju (),
+and
+.BR libj2_j2u_has_high_ju (),
+functions were added in version 1.0 of
+.BR libj2 .
+
+.SH SEE ALSO
+.BR libj2 (7),
+.BR libj2_j2u_test_j2u (3),
+.BR libj2_j2u_and_j2u (3),
+.BR libj2_j2u_or_j2u (3),
+.BR libj2_j2u_xor_j2u (3),
+.BR libj2_j2u_if_j2u (3),
+.BR libj2_j2u_imply_j2u (3),
+.BR libj2_j2u_nand_j2u (3),
+.BR libj2_j2u_nor_j2u (3),
+.BR libj2_j2u_xnor_j2u (3),
+.BR libj2_j2u_nif_j2u (3),
+.BR libj2_j2u_nimply_j2u (3),
+.BR libj2_not_j2u (3)
diff --git a/libj2_j2u_has_j2u.c b/libj2_j2u_has_j2u.c
index 901a623..a9a5ce5 100644
--- a/libj2_j2u_has_j2u.c
+++ b/libj2_j2u_has_j2u.c
@@ -3,11 +3,6 @@
#ifndef TEST
extern inline int libj2_j2u_has_j2u(const struct libj2_j2u *a, const struct libj2_j2u *b);
-/* TODO Add man pages
- libj2_j2u_has_j2u
- libj2_j2u_has_ju
- libj2_j2u_has_high_ju
- */
#else
diff --git a/libj2_j2u_test_bit.3 b/libj2_j2u_test_bit.3
new file mode 120000
index 0000000..9ae3113
--- /dev/null
+++ b/libj2_j2u_test_bit.3
@@ -0,0 +1 @@
+libj2_j2u_has_j2u.3 \ No newline at end of file
diff --git a/libj2_j2u_test_bit.c b/libj2_j2u_test_bit.c
index 2d4661b..c9f67cb 100644
--- a/libj2_j2u_test_bit.c
+++ b/libj2_j2u_test_bit.c
@@ -3,7 +3,6 @@
#ifndef TEST
extern inline int libj2_j2u_test_bit(const struct libj2_j2u *a, unsigned b);
-/* TODO Add man page */
#else
diff --git a/libj2_j2u_test_j2u.3 b/libj2_j2u_test_j2u.3
new file mode 100644
index 0000000..b9dd8f0
--- /dev/null
+++ b/libj2_j2u_test_j2u.3
@@ -0,0 +1,86 @@
+.TH LIBJ2_J2U_TEST_J2U 3 LIBJ2
+.SH NAME
+libj2_j2u_test_j2u \- Check whether any bit from a set is set
+
+.SH SYNOPSIS
+.nf
+#include <libj2.h>
+
+int \fBlibj2_j2u_test_j2u\fP(const struct libj2_j2u *\fIa\fP, const struct libj2_j2u *\fIb\fP);
+int \fBlibj2_j2u_test_ju\fP(const struct libj2_j2u *\fIa\fP, uintmax_t \fIb\fP);
+int \fBlibj2_j2u_test_high_ju\fP(const struct libj2_j2u *\fIa\fP, uintmax_t \fIb\fP);
+int \fBlibj2_j2u_test_bit\fP(const struct libj2_j2u *\fIa\fP, unsigned \fIb\fP);
+.fi
+.PP
+Link with
+.IR -lj2 .
+
+.SH DESCRIPTION
+The
+.BR libj2_j2u_test_j2u ()
+function checks whether any set bit in
+.I b
+is also set in
+.IR a .
+.PP
+The
+.BR libj2_j2u_test_ju ()
+function checks whether any set bit in
+.I b
+is also set in the least significant half of
+.IR a .
+.PP
+The
+.BR libj2_j2u_test_high_ju ()
+function checks whether any set bit in
+.I b
+is also set in the most significant half of
+.IR a .
+.PP
+The
+.BR libj2_j2u_test_bit ()
+function checks whether the bit at position
+.IR b ,
+counting from 0 at the least significant bit,
+is set in
+.IR a .
+.PP
+The arguments are assumed to be
+.RI non- NULL .
+
+.SH RETURN VALUE
+The
+.BR libj2_j2u_test_j2u (),
+.BR libj2_j2u_test_ju (),
+.BR libj2_j2u_test_high_ju (),
+and
+.BR libj2_j2u_test_bit ()
+functions return 1 if the test passes, and 0 otherwise.
+
+.SH ERRORS
+The above listed functions cannot fail.
+
+.SH HISTORY
+The
+.BR libj2_j2u_test_j2u (),
+.BR libj2_j2u_test_ju (),
+.BR libj2_j2u_test_high_ju (),
+and
+.BR libj2_j2u_test_bit ()
+functions were added in version 1.0 of
+.BR libj2 .
+
+.SH SEE ALSO
+.BR libj2 (7),
+.BR libj2_j2u_has_j2u (3),
+.BR libj2_j2u_and_j2u (3),
+.BR libj2_j2u_or_j2u (3),
+.BR libj2_j2u_xor_j2u (3),
+.BR libj2_j2u_if_j2u (3),
+.BR libj2_j2u_imply_j2u (3),
+.BR libj2_j2u_nand_j2u (3),
+.BR libj2_j2u_nor_j2u (3),
+.BR libj2_j2u_xnor_j2u (3),
+.BR libj2_j2u_nif_j2u (3),
+.BR libj2_j2u_nimply_j2u (3),
+.BR libj2_not_j2u (3)
diff --git a/libj2_j2u_test_j2u.c b/libj2_j2u_test_j2u.c
index d84fd71..2d2a3f5 100644
--- a/libj2_j2u_test_j2u.c
+++ b/libj2_j2u_test_j2u.c
@@ -3,11 +3,6 @@
#ifndef TEST
extern inline int libj2_j2u_test_j2u(const struct libj2_j2u *a, const struct libj2_j2u *b);
-/* TODO Add man pages
- libj2_j2u_test_j2u
- libj2_j2u_test_ju
- libj2_j2u_test_high_ju
- */
#else