File: array_truncate.3

package info (click to toggle)
libowfat 0.34-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,288 kB
  • sloc: ansic: 20,181; makefile: 16
file content (24 lines) | stat: -rw-r--r-- 874 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.TH array_truncate 3
.SH NAME
array_truncate \- reduce number of initialized bytes
.SH SYNTAX
.B #include <libowfat/array.h>

void \fBarray_truncate\fP(array* \fIx\fR, uint64 \fImembersize\fR, int64 \fIlen\fR);

  array_truncate(&\fIx\fR,sizeof(\fIt\fR),\fIlen\fR);

.SH DESCRIPTION
array_truncate reduces the number of initialized bytes in \fIx\fR to
exactly \fIlen\fR*sizeof(\fIt\fR). If the number of initialized bytes
was already this small (or smaller), array_truncate has no effect. If
\fIlen\fR is negative, array_truncate has no effect. If \fIx\fR is
unallocated, array_truncate has no effect. If \fIx\fR has failed,
array_truncate has no effect.

array_truncate does not change the allocation in \fIx\fR. If you want to free
the memory used by \fIx\fR, use array_reset.

.SH "SEE ALSO"
array_allocate(3), array_get(3), array_fail(3), array_trunc(3),
array_reset(3)