aboutsummaryrefslogtreecommitdiffstats
path: root/libj2_j2u_lrot.3
blob: 8c089e27ff57df42a6ecfb41cce1d2c201748730 (plain) (blame)
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
.TH LIBJ2_J2U_LROT 3 LIBJ2
.SH NAME
libj2_j2u_lrot \- Left-rotate bits

.SH SYNOPSIS
.nf
#include <libj2.h>

void \fBlibj2_j2u_lrot\fP(struct libj2_j2u *\fIa\fP, unsigned \fIb\fP);
void \fBlibj2_j2u_lrot_to_j2u\fP(const struct libj2_j2u *\fIa\fP, unsigned \fIb\fP, struct libj2_j2u *\fIr\fP);
void \fBlibj2_ju_lrot_to_j2u\fP(uintmax_t \fIa\fP, unsigned \fIb\fP, struct libj2_j2u *\fIr\fP);
.fi
.PP
Link with
.IR -lj2 .

.SH DESCRIPTION
The
.BR libj2_j2u_lrot ()
function shifts each bit in
.I a
to
.I b
more significant positions; the
.I b
most significant bits are moved
to the
.I b
least significant positions with
preserved significance relative to
each other. The result is written
back to
.IR a .
.PP
The
.BR libj2_j2u_lrot_to_j2u ()
function modifies
.I a
likewise, but writes the result to
.I r
rather than
.IR a .
.PP
The
.BR libj2_ju_lrot_to_j2u ()
function is equivalent to the
.BR libj2_j2u_lrot_to_j2u ()
function, except
.I a
is converted to a
.B struct libj2_j2u *
before the modification takes place.
.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_lrot (),
.BR libj2_j2u_lrot_to_j2u (),
and
.BR libj2_ju_lrot_to_j2u ()
functions were added in version 1.0 of
.BR libj2 .

.SH SEE ALSO
.BR libj2 (7),
.BR libj2_j2u_rrot (3),
.BR libj2_j2i_lsh (3),
.BR libj2_j2i_rsh (3)