.TH "cormr_axis_cli" 3 "corm" \" -*- nroff -*- .ad l .nh .SH NAME cormr_axis_cli \- Axis CLI contract (D14/D15B) .SH SYNOPSIS .br .PP .SS "Data Structures" .in +1c .ti -1c .RI "struct \fBcormr_axis_cli_option\fP" .br .in -1c .SS "Functions" .in +1c .ti -1c .RI "int \fBcormr_spec_scan\fP (const char **cur, const char **key, size_t *klen, const char **val, size_t *vlen, int *quoted)" .br .ti -1c .RI "int \fBcormr_cli_str_set\fP (char **dst, const char *value)" .br .ti -1c .RI "int \fBcormr_cli_int\fP (const char *v, int *out)" .br .ti -1c .RI "int \fBcormr_cli_int_b\fP (const char *v, const char *v_end, int *out)" .br .ti -1c .RI "int \fBcormr_cli_str_dup\fP (const char *v, size_t n, int quoted, char **out)" .br .in -1c .SH "Detailed Description" .PP The kernel owns the axis-CLI ABI and the decode-spec grammar exactly once (implementation: libcorm src/rec_cli\&.c)\&. An axis implements only its option table (cormr_axis_cli_options / rec_axis_cli_options) and its per-field mapping in cormr_axis_config_arg / decode\&. Layouts are visible to every TU via this header — never re-declared locally\&. .SH "Function Documentation" .PP .SS "int cormr_cli_int (const char * v, int * out)" Strict decimal parsers for cormr_axis_config_arg numeric fields: errno-cleared strto*, reject empty/trailing-junk/overflow, and a leading '-' for the unsigned ones\&. .SS "int cormr_cli_int_b (const char * v, const char * v_end, int * out)" Bounded variants for the read-only value ranges cormr_spec_scan hands out: parse [v, v_end), where the byte at v_end is the range's boundary (space / tab / '=' / quote / NUL) and so can never be part of a numeric token\&. Identical strictness to the NUL-terminated parsers, which are these on v\&.\&.v+strlen(v)\&. .SS "int cormr_cli_str_dup (const char * v, size_t n, int quoted, char ** out)" Duplicate the value range [v, v+n) into a fresh NUL-terminated string; when quoted, unescape IN PLACE ('\\'→'\\', '\\''→'\\'' like the scan grammar; a trailing lone '\\' stays literal)\&. 0 ok / -1 on NULL or allocation failure\&. The one allocation a string-field decode needs (query/field/file)\&. .SS "int cormr_cli_str_set (char ** dst, const char * value)" Owned string setter for cormr_axis_config_arg string fields: strdup then free-replace into *dst\&. 0 ok / -1 on NULL dst/value or allocation\&. .SS "int cormr_spec_scan (const char ** cur, const char ** key, size_t * klen, const char ** val, size_t * vlen, int * quoted)" Read-only pass over a decode spec (the kernel-owned decode grammar, ZERO allocation — it never writes the buffer): Keys AND values are returned as length-delimited ranges into the CALLER'S string: a bare value runs from \fIval to the next space / tab / '=' / NUL; a single-quoted value is returned as *val past the opening quote with the RAW interior bytes spanning *val \&.\&. *val + *vlen and *quoted set (backslash escapes stay encoded — use cormr_cli_str_dup to unescape into an owned copy)\&. Tokens without '=' are skipped; every 1-return yields one key=value pair (key may be empty, e\&.g\&. "=x")\&. Pair with the cormr_cli_\fP_b range parsers so a decode never needs to copy the spec: for (const char *cur = spec; cormr_spec_scan(&cur, &k, &klen, &v, &n, &q); ) if (cormr_key_eq(k, klen, "dim")) if (!cormr_cli_int_b(v, v + n, &i)) … Returns 1 while a pair was produced, 0 at the end\&. .SH "Author" .PP Generated automatically by Doxygen for corm from the source code\&.