Search guides and the APICtrl K
  1. API reference
  2. Hosting plugins

ladspa_abi.h

The LADSPA binary interface, declared from the specification.

#include <sonore/ladspa_abi.h>
On this page

Design notes

Why these declarations are ours

LADSPA is a C ABI: one exported function, ladspa_descriptor, that hands out descriptor structs by index, and a handful of integer flags. The ABI itself is a fact about how existing binaries are laid out and cannot be owned by anybody. The header that is conventionally #included to get it, however, is LGPL, and an Apache-2.0 header-only SDK that pulled it in would hand every plugin that includes host.h a licence question it never asked.

So the layout is written here from the specification's text, not copied: the same fields in the same order, with this SDK's names. Nothing here may be reordered or resized. Every field is read by binaries compiled against the original declarations, and a struct that is one int out of step with theirs reads the port count from the copyright string.

unsigned long, deliberately

The specification types its indices and counts as unsigned long, and that is 32 bits on Windows and 64 on Linux and macOS. It looks like the very thing a fixed-width integer should replace, and replacing it would break the ABI on exactly one of the platforms: a plugin built with the original header has unsigned long in its struct, so ours must too.

Types 2

One port's presentation hints. The bounds mean something only where the matching kHintBounded* bit is set.

One plugin type. A library may export several, indexed from 0 until the entry point returns null.

The field order is the ABI. See the file comment.

Constants 25

↑↓ to move↵ to openEvery public name in the headers, and every guide