.TH "bud/bud_jsx.h" 3 "bud" \" -*- nroff -*- .ad l .nh .SH NAME bud/bud_jsx.h \- JSX-style builder macros for bud node trees\&. .SH SYNOPSIS .br .PP \fR#include \fP .br \fR#include 'bud\&.h'\fP .br .SS "Data Structures" .in +1c .ti -1c .RI "struct \fBbud_arg\fP" .br .RI "One builder argument consumed by lx_el/lx_frag\&. " .in -1c .SS "Macros" .in +1c .ti -1c .RI "#define \fBlx_none\fP()" .br .RI "No-op builder argument\&. " .ti -1c .RI "#define \fB_bud_ATTR_SEL\fP(_1, _2, _3, _4, _5, _6, _7, NAME, \&.\&.\&.)" .br .RI "Selector helper for the \fBlx_attr()\fP arity dispatch\&. " .ti -1c .RI "#define \fBlx_attr\fP(\&.\&.\&.)" .br .RI "Build an attribute argument; extra args become a printf format\&. " .ti -1c .RI "#define \fB_bud_attr_2\fP(k, v)" .br .RI "Two-arg form: literal name/value attribute\&. " .ti -1c .RI "#define \fB_bud_attr_3\fP(k, fmt, \&.\&.\&.)" .br .RI "N-arg form dispatch for formatted attributes\&. " .ti -1c .RI "#define \fB_bud_attr_N\fP(k, fmt, \&.\&.\&.)" .br .RI "Formatted attribute implementation\&. " .ti -1c .RI "#define \fBlx_text\fP(str)" .br .RI "Text child argument\&. " .ti -1c .RI "#define \fBlx_node\fP(n)" .br .RI "Foreign node child argument\&. " .ti -1c .RI "#define \fBlx_tpl\fP(\&.\&.\&.)" .br .RI "Raw-HTMl child argument from a printf format\&. " .ti -1c .RI "#define \fBlx_on\fP(e, b)" .br .RI "Event registration argument\&. " .ti -1c .RI "#define \fBlx_bind\fP(e, b, h)" .br .RI "Handler binding argument\&. " .ti -1c .RI "#define \fBlx_key\fP(k)" .br .RI "Keyed element argument for resilient hydration\&. " .ti -1c .RI "#define \fBlx_el\fP(tag, \&.\&.\&.)" .br .RI "Element child argument from a tag and builder args\&. " .ti -1c .RI "#define \fBlx_frag\fP(\&.\&.\&.)" .br .RI "Fragment child argument from builder args\&. " .ti -1c .RI "#define \fBlx_n\fP(tag, \&.\&.\&.)" .br .RI "Standalone element builder (statement form)\&. " .ti -1c .RI "#define \fBlx_frag_n\fP(\&.\&.\&.)" .br .RI "Standalone fragment builder (statement form)\&. " .ti -1c .RI "#define \fBlx_textf\fP(fmt, \&.\&.\&.)" .br .RI "Formatted text child argument\&. " .ti -1c .RI "#define \fBlx_hidden\fP(name, val)" .br .RI "Hidden-input child argument\&. " .ti -1c .RI "#define \fBlx_hidden_int\fP(name, val)" .br .RI "Integer hidden-input child argument\&. " .ti -1c .RI "#define \fBlx_submit\fP(label, cls)" .br .RI "Submit-button child argument\&. " .ti -1c .RI "#define \fBlx_link\fP(href, text, cls)" .br .RI "Link child argument\&. " .in -1c .SS "Typedefs" .in +1c .ti -1c .RI "typedef enum \fBbud_arg_type\fP \fBbud_arg_type\fP" .br .RI "Discriminator for a builder argument\&. " .ti -1c .RI "typedef struct bud_arg \fBbud_arg\fP" .br .RI "One builder argument consumed by lx_el/lx_frag\&. " .in -1c .SS "Enumerations" .in +1c .ti -1c .RI "enum \fBbud_arg_type\fP { \fBBUD_ARG_NONE\fP = 0, \fBBUD_ARG_NODE\fP = 1, \fBBUD_ARG_ATTR\fP = 2, \fBBUD_ARG_EVENT\fP = 3, \fBBUD_ARG_BIND\fP = 4, \fBBUD_ARG_ATTR_FMT\fP = 5 }" .br .RI "Discriminator for a builder argument\&. " .in -1c .SS "Functions" .in +1c .ti -1c .RI "\fBbud_node\fP * \fBbud_el_impl\fP (const char *tag, size_t count, const \fBbud_arg\fP *args)" .br .RI "Assemble an element from builder arguments\&. " .ti -1c .RI "\fBbud_node\fP * \fBbud_frag_impl\fP (size_t count, const \fBbud_arg\fP *args)" .br .RI "Assemble a fragment from builder arguments\&. " .ti -1c .RI "\fBbud_arg\fP \fBbud_attr_fmt\fP (const char *name, const char *fmt,\&.\&.\&.)" .br .RI "Build a formatted attribute argument\&. " .in -1c .SH "Detailed Description" .PP JSX-style builder macros for bud node trees\&. Compiles attribute lists, bindings and nested nodes into \fBbud_node\fP construction calls; used by both SSR and WASM builds\&. .SH "Enumeration Type Documentation" .PP .SS "enum \fBbud_arg_type\fP" .PP Discriminator for a builder argument\&. .PP \fBEnumerator\fP .in +1c .TP \f(BIBUD_ARG_NONE \fP No-op placeholder\&. .TP \f(BIBUD_ARG_NODE \fP Child node\&. .TP \f(BIBUD_ARG_ATTR \fP Attribute name/value pair\&. .TP \f(BIBUD_ARG_EVENT \fP Event listener registration\&. .TP \f(BIBUD_ARG_BIND \fP Event handler binding\&. .TP \f(BIBUD_ARG_ATTR_FMT \fP Formatting attribute (name + printf format)\&. .SH "Function Documentation" .PP .SS "\fBbud_arg\fP bud_attr_fmt (const char * name, const char * fmt, \&.\&.\&.)" .PP Build a formatted attribute argument\&. .PP \fBParameters\fP .RS 4 \fIname\fP Attribute name\&. .br \fIfmt\fP Format string\&. .RE .PP \fBReturns\fP .RS 4 Attribute argument whose value is formatted lazily at assembly\&. .RE .PP .SS "\fBbud_node\fP * bud_el_impl (const char * tag, size_t count, const \fBbud_arg\fP * args)" .PP Assemble an element from builder arguments\&. .PP \fBParameters\fP .RS 4 \fItag\fP Element tag\&. .br \fIcount\fP Number of args\&. .br \fIargs\fP Builder argument array\&. .RE .PP \fBReturns\fP .RS 4 New element node\&. .RE .PP .SS "\fBbud_node\fP * bud_frag_impl (size_t count, const \fBbud_arg\fP * args)" .PP Assemble a fragment from builder arguments\&. .PP \fBParameters\fP .RS 4 \fIcount\fP Number of args\&. .br \fIargs\fP Builder argument array\&. .RE .PP \fBReturns\fP .RS 4 New fragment node\&. .RE .PP .SH "Author" .PP Generated automatically by Doxygen for bud from the source code\&.