From: Alan T. DeKok Date: Thu, 15 May 2025 10:15:46 +0000 (-0400) Subject: move pairs to its own directory X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9ddedb1fb9c563a39b5f4ca0cc6160d45f2a667;p=thirdparty%2Ffreeradius-server.git move pairs to its own directory --- diff --git a/doc/antora/modules/reference/nav.adoc b/doc/antora/modules/reference/nav.adoc index f524e794cac..41c8dd55567 100644 --- a/doc/antora/modules/reference/nav.adoc +++ b/doc/antora/modules/reference/nav.adoc @@ -95,9 +95,13 @@ **** xref:xlat/misc/config.adoc[Server Configuration] **** xref:xlat/misc/length.adoc[length] **** xref:xlat/misc/misc.adoc[Miscellaneous] -**** xref:xlat/misc/pairs.adoc[pairs.print] **** xref:xlat/misc/rand.adoc[rand] +*** xref:xlat/pairs/index.adoc[Pairs] +**** xref:xlat/pairs/debug.adoc[Write to debug output] +**** xref:xlat/pairs/immutable.adoc[Mark as immutable] +**** xref:xlat/pairs/print.adoc[Print to string] + *** xref:xlat/str/index.adoc[String Handling] **** xref:xlat/str/concat.adoc[Concatenation] **** xref:xlat/str/split.adoc[Split Strings] diff --git a/doc/antora/modules/reference/pages/xlat/all.adoc b/doc/antora/modules/reference/pages/xlat/all.adoc index f8f9d4b14a2..f0c5d155e0a 100644 --- a/doc/antora/modules/reference/pages/xlat/all.adoc +++ b/doc/antora/modules/reference/pages/xlat/all.adoc @@ -22,10 +22,20 @@ | xref:xlat/misc/config.adoc[Server Configuration] | Examine configuration items | xref:xlat/misc/length.adoc[length] | Get the length of data | xref:xlat/misc/misc.adoc[Miscellaneous] | Functions to execute regular expression search on string, using pattern. -| xref:xlat/misc/pairs.adoc[pairs.print] | print attributes with name and value. | xref:xlat/misc/rand.adoc[rand] | random integers |=== +== Pair Manipulation + +.Pair Manipulation +[options="headers, autowidth] +|=== +| *Function* | *Description* +| xref:xlat/pairs/debug.adoc[debug] | Print attributes to the debug output +| xref:xlat/pairs/immutable.adoc[immutable] | Mark attributes as immutable (cannot be changed) +| xref:xlat/pairs/print.adoc[print] | Print attribute name and value to string +|=== + == String Manipulation .String manipulation diff --git a/doc/antora/modules/reference/pages/xlat/dict.adoc b/doc/antora/modules/reference/pages/xlat/dict.adoc index dad1ef652d4..6d01d6e42a4 100644 --- a/doc/antora/modules/reference/pages/xlat/dict.adoc +++ b/doc/antora/modules/reference/pages/xlat/dict.adoc @@ -114,45 +114,6 @@ reply.Reply-Message := "Maximum should be %str.rpad(%{control.Tmp-String-0}, 11, Maximum should be 12300000000 ``` -== %pairs(.[*]) - -Serialize attributes as comma-delimited string. - -.Return: _string_ - -.Example - -[source,unlang] ----- -control.Tmp-String-0 := { "This is a string", "This is another one" } -reply.Reply-Message := "Serialize output: %pairs(control.[*])" ----- - -.Output - -``` -Serialize output: Tmp-String-0 = "\"This is a string\", Tmp-String-0 = \"This is another one\"" -``` - -== %str.rand( ...) - -Get random string built from character classes. - -.Return: _string_ - -.Example - -[source,unlang] ----- -reply.Reply-Message := "The random string output is %str.rand(aaaaaaaa}" ----- - -.Output - -``` -The random string output is 4Uq0gPyG -``` - == %str.lower( ... ) Dynamically expands the string and returns the lowercase version of diff --git a/doc/antora/modules/reference/pages/xlat/misc/index.adoc b/doc/antora/modules/reference/pages/xlat/misc/index.adoc index c0cc5b849ed..3502fc3fc97 100644 --- a/doc/antora/modules/reference/pages/xlat/misc/index.adoc +++ b/doc/antora/modules/reference/pages/xlat/misc/index.adoc @@ -11,7 +11,6 @@ which operate on inputs, and produce an output. | xref:xlat/misc/config.adoc[Server Configuration] | Examine configuration items | xref:xlat/misc/length.adoc[length] | Get the length of data | xref:xlat/misc/misc.adoc[Miscellaneous] | Functions to execute regular expression search on string, using pattern. -| xref:xlat/misc/pairs.adoc[pairs.print] | print attributes with name and value. | xref:xlat/misc/rand.adoc[rand] | random integers |=== diff --git a/doc/antora/modules/reference/pages/xlat/pairs/index.adoc b/doc/antora/modules/reference/pages/xlat/pairs/index.adoc new file mode 100644 index 00000000000..959c4ae54a3 --- /dev/null +++ b/doc/antora/modules/reference/pages/xlat/pairs/index.adoc @@ -0,0 +1,15 @@ += Pair Functions + +These functions manipulate attribute-value pairs. + +.Pair Manipulation +[options="headers, autowidth] +|=== +| *Function* | *Description* +| xref:xlat/pairs/debug.adoc[debug] | Print attributes to the debug output +| xref:xlat/pairs/immutable.adoc[immutable] | Mark attributes as immutable (cannot be changed) +| xref:xlat/pairs/print.adoc[print] | Print attribute name and value to string +|=== + +// Copyright (C) 2025 Network RADIUS SAS. Licenced under CC-by-NC 4.0. +// This documentation was developed by Network RADIUS SAS. diff --git a/doc/antora/modules/reference/pages/xlat/misc/pairs.adoc b/doc/antora/modules/reference/pages/xlat/pairs/print.adoc similarity index 83% rename from doc/antora/modules/reference/pages/xlat/misc/pairs.adoc rename to doc/antora/modules/reference/pages/xlat/pairs/print.adoc index 296c0c2ab14..8339f2d85ed 100644 --- a/doc/antora/modules/reference/pages/xlat/misc/pairs.adoc +++ b/doc/antora/modules/reference/pages/xlat/pairs/print.adoc @@ -7,14 +7,14 @@ Print attributes with name and value. Note that there is no "parse string into pairs" function. Instead, you can simply assign the string to a structural attribute (`group`, `tlv`, etc.) and the string will be parsed as assigning a value to a -given attribute. +given attribute. e.g. `reply += "User-Name := 'hello'"`. .Example [source,unlang] ---- control.Tmp-String-0 := { "This is a string", "This is another one" } -reply.Reply-Message := "Serialize output: %pairs.print('control.[*]')" +reply.Reply-Message := "Serialize output: %pairs.print(control.[*])" ---- .Output