Skip to documentation
DocumentationAll documentsEnglish

LIBBU(3)

NAME

libbu - BRL-CAD utility library

On this page

SYNOPSIS

#include <bu.h>

Link with -lbu.

The public interface is organized across the headers included by bu.h, including bu/app.h, bu/avs.h, bu/bitv.h, bu/cmd.h, bu/color.h, bu/list.h, bu/log.h, bu/malloc.h, bu/opt.h, bu/parallel.h, bu/ptbl.h, bu/str.h, and bu/vls.h, among others.

DESCRIPTION

LIBBU is BRL-CAD’s utility library; the two letters "BU" stand for "BRL-CAD" and "Utility". It provides several layers of low-level utility routines that make cross-platform coding easier, serving as a general extension to the data types offered by the C language and to the basic C runtime provided by the system C library.

Facilities provided by the library include parallel-processing support (threads, semaphores, and parallel-safe memory allocation), consolidated logging and error handling (bu_log(), bu_exit(), and bu_bomb()), dynamic memory management (bu_malloc() and related routines), variable-length strings (struct bu_vls), linked lists, pointer and bit vectors, attribute/value sets, command dispatch, option parsing, and numerous string and path helpers. All routines in LIBBU are designed to be parallel-safe (thread-safe) to ease development for multiprocessor systems.

By design, none of the routines in this library depend on data types defined in other BRL-CAD headers such as vmath.h; numerical routines that build on those types are found in libbn. All truly fatal errors detected by the library use bu_bomb() to exit with a status of 12, and the LIBBU variants of system calls (for example bu_malloc()) do not return to the caller unless they succeed, sparing the programmer from constant NULL checks.

The complete API, including data structures and function signatures, is documented in the headers noted above and in the Doxygen-generated reference for the LIBBU module.

SEE ALSO

brlcad(1), libbn(3), libbg(3), librt(3)

The BRL-CAD Doxygen API reference provides the authoritative, up-to-date description of all public LIBBU routines.

AUTHOR

BRL-CAD Team

This software is Copyright (c) 2004-2026 United States Government as represented by the U.S. Army Research Laboratory.

BUG REPORTS

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org