Skip to main content
Protocol 1 is the original VEF interface. It was stable as of v0.0.1 and will be dropped after 0.0.5. New extensions should use the Protocol 3 API — the template-based type builders in the Creating Extensions in C++ and C++ Development guides. This page exists for reference when working with existing extensions built against Protocol 1.

Function-Pointer Type API

Protocol 1 custom types are registered using explicit function pointers instead of the vsql::make_type<> template. The function signatures differ from the Protocol 3 equivalents — they take raw pointers and lengths rather than Arg and Result objects.

Function Signatures

Registration

vsql::make_type<kMyTypeName>() (with a compile-time string NTTP) is the preferred form. make_type(MYTYPE) (no template parameter) is the Protocol 1 form — support for it will be dropped after 0.0.5.

Raw ABI Style (Functions)

Protocol 1 VDF implementations can pass the raw C structs directly instead of using typed wrappers. This style will be dropped after 0.0.5 — use the typed argument/result API for all new code.
Registration is identical to the typed approach — the builder detects the signature automatically.

Result Constants

The raw ABI communicates result state via vef_return_value_type_t set on result->type: In Protocol 3, out.set(), out.set_null(), out.warning(), and out.error() handle this automatically.

Aggregate Registration in Protocol 1

For aggregates, .clear<>() and .accumulate<>() accept raw ABI function pointer signatures. .prerun<>() and .postrun<>() do not — the builder requires typed signatures (void(PrerunArgs, PrerunResult) and void(PostrunArgs)) even for Protocol 1 extensions. Use the typed aggregate approach for all new code.