1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
.TH LIBJ2_MAX_J2I 3 LIBJ2
.SH NAME
libj2_max_j2i \- Select maximum of a set of values
.SH SYNOPSIS
.nf
#include <libj2.h>
void \fBlibj2_max_j2i\fP(struct libj2_j2i *\fIa\fP, ... /*, NULL */)
void \fBlibj2_max_j2i_to_j2i\fP(const struct libj2_j2i *\fIa\fP, ... /*, NULL, struct libj2_j2i *\fIr\fP */)
const struct libj2_j2i *\fBlibj2_max_j2i_return\fP(const struct libj2_j2i *\fIa\fP, ... /*, NULL */)
void \fBlibj2_vmax_j2i\fP(struct libj2_j2i *\fIa\fP, va_list \fIargs\fP)
void \fBlibj2_vmax_j2i_to_j2i\fP(const struct libj2_j2i *\fIa\fP, va_list \fIargs\fP)
const struct libj2_j2i *\fBlibj2_vmax_j2i_return\fP(const struct libj2_j2i *\fIa\fP, va_list \fIargs\fP)
void \fBlibj2_max_j2u\fP(struct libj2_j2u *\fIa\fP, ... /*, NULL */)
void \fBlibj2_max_j2u_to_j2u\fP(const struct libj2_j2u *\fIa\fP, ... /*, NULL, struct libj2_j2u *\fIr\fP */)
const struct libj2_j2u *\fBlibj2_max_j2u_return\fP(const struct libj2_j2u *\fIa\fP, ... /*, NULL */)
void \fBlibj2_vmax_j2u\fP(struct libj2_j2u *\fIa\fP, va_list \fIargs\fP)
void \fBlibj2_vmax_j2u_to_j2u\fP(const struct libj2_j2u *\fIa\fP, va_list \fIargs\fP)
const struct libj2_j2u *\fBlibj2_vmax_j2u_return\fP(const struct libj2_j2u *\fIa\fP, va_list \fIargs\fP)
.fi
.PP
Link with
.IR -lj2 .
.SH DESCRIPTION
The above listed functions
selects the maximum value of
.I a
and all follow arguments up to the first
(and only)
.I NULL
argument (the so called
.I NULL
sentinel). For the functions with a
.B va_list
parameter, arguments are read from it.
.PP
The arguments after
.I a
or, for the functions with a
.B va_list
parameter, inside
.I args
must have the same type as
.IR a ,
except it can be
.B const
regardless of whether
.I a
is
.BR const .
.PP
For the
.BR libj2_max_j2i (),
.BR libj2_vmax_j2i (),
.BR libj2_max_j2u (),
and
.BR libj2_vmax_j2u ()
functions, the maximum value is stored in
.IR a .
.PP
For the
.BR libj2_max_j2i_to_j2i (),
.BR libj2_vmax_j2i_to_j2i (),
.BR libj2_max_j2u_to_j2u (),
and
.BR libj2_vmax_j2u_to_j2u ()
functions, the maximum value is stored in
and argument, with the same type as
.IR a ,
except without the qualifier
.BR const ,
provided by the caller immediately after the
.I NULL
sentinel.
.PP
For the
.BR libj2_max_j2i_return (),
.BR libj2_vmax_j2i_return (),
.BR libj2_max_j2u_return (),
and
.BR libj2_vmax_j2u_return ()
functions, the argument with the maximum
value is returned by the function. In the
case that multiple arguments have the same
value which is also the maximum value, one
of the is returned arbitrarily. It is safe
to remove the qualifier
.BR const
if you know that the argument with the
maximum value did not have the qualifier
.BR const
const (it is the same pointer).
.PP
The arguments, except the sentinel in
the varidic lists, are assumed to be
.RI non- NULL .
.RI ( a
is assumed to be
.RI non- NULL .)
.SH RETURN VALUE
For the
.BR libj2_max_j2i_return (),
.BR libj2_vmax_j2i_return (),
.BR libj2_max_j2u_return (),
and
.BR libj2_vmax_j2u_return ()
functions one of the arguments with the
highest value, is returned, for the
other functions, there is no return value.
.SH ERRORS
The above listed functions cannot fail.
.SH HISTORY
The
.BR libj2_max_j2u (),
.BR libj2_max_j2u_to_j2u (),
.BR libj2_max_j2u_return (),
.BR libj2_vmax_j2u (),
.BR libj2_vmax_j2u_to_j2u (),
and
.BR libj2_vmax_j2u_return ()
functions were added in version 1.0 of
.BR libj2 .
.PP
The
.BR libj2_max_j2i (),
.BR libj2_max_j2i_to_j2i (),
.BR libj2_max_j2i_return (),
.BR libj2_vmax_j2i (),
.BR libj2_vmax_j2i_to_j2i (),
and
.BR libj2_vmax_j2i_return ()
functions were added in version 1.1 of
.BR libj2 .
.SH SEE ALSO
.BR libj2 (7),
.BR libj2_min_j2i (3),
.BR libj2_j2i_max_j2i (3),
.BR libj2_j2i_min_j2i (3)
|