You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libtdata/man/usrtc_init.3

88 lines
1.9 KiB
Groff

.TH USRTC_INIT 3 "21 May 2019" "LIBTDATA" "Portable data structures C library manual"
.SH NAME
usrtc_init \- Initialize usrtc core structure
.br
usrtc_create \- Allocate and initialize usrtc core structure
.br
usrtc_destroy \- Destroy (free) usrtc core structure
.br
.SH SYNOPSYS
.B #include <tdata/usrtc.h>
.sp
void usrtc_init(usrtc_t *us, int impl, usrtc_count_t maxcount, usrtc_compare_t compare);
usrtc_t *usrtc_create(int impl, usrtc_count_t maxcount, usrtc_compare_t compare);
void usrtc_destroy(usrtc_t *us);
typedef long (*usrtc_compare_t)(const void*, const void*);
.br
.sp
.SH DESCRIPTION
.B usrtc_init
and
.B usrtc_create
are used to initialize a new usrtc core structure. The difference is
.B usrtc_create
will allocate
.B usrtc_t
structure via
.B malloc()
function, but
.B usrtc_init
expect already allocated structure. Argument
.B impl
is used to point the type of search data structure used for this particular usrtc core structure. Possible values are:
.br
.B * USRTC_LIST:
Linked list
.br
.B * USRTC_BST:
Binary search tree
.br
.B * USRTC_REDBLACK:
Redblack tree
.br
.B * USRTC_SPLAY:
Splay tree
.br
.B * USRTC_AVL:
AVL tree
.br
.B maxcount
argument is pointing to a max amount of the nodes within a search data structure.
.B compare
is a pointer to a compare function.
.br
.B usrtc_destroy
is used to destroy (free) usrtc core structure. This function must be used only for structures allocated via
.B usrtc_create
function.
.br
.SH RETURN VALUE
Valid pointer to a newly allocated and initialized core structure, otherwise
.B NULL.
.br
.SH BUGS
Not known yet.
.br
.SH EXAMPLE
.br
.SH RATIONALE
Using functions
.B usrtc_create
and
.B usrtc_destroy
is deprecating.
.br
.SH SEE ALSO
.br
.SH COPYRIGHT
This software licensed under GNU LGPL v2.1 or later. See COPYING for further details.
.br
(c) Authors of libtdata. See AUTHORS for further details.
.SH AUTHOR
Alexander Vdolainen (alex@vapaa.xyz)
.br