From 298d2a3c821552757a99b36086dac604e0f36b43 Mon Sep 17 00:00:00 2001 From: Yuce Tekol Date: Wed, 17 Apr 2024 10:45:47 +0300 Subject: [PATCH] Fixed type and added the reference for CPMap advanced script functions. --- docs/modules/ROOT/pages/clc-cpmap.adoc | 4 ++-- docs/modules/ROOT/pages/clc-script.adoc | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/docs/modules/ROOT/pages/clc-cpmap.adoc b/docs/modules/ROOT/pages/clc-cpmap.adoc index 706d030..18ef1c4 100644 --- a/docs/modules/ROOT/pages/clc-cpmap.adoc +++ b/docs/modules/ROOT/pages/clc-cpmap.adoc @@ -181,7 +181,7 @@ clc cpmap -n my-cpmap set -k string hello -v f32 19.94 == clc cpmap put -Put sthe given value in the given CPMap and return sthe old value. +Puts the given value in the given CPMap and returns the old value. Usage: @@ -238,7 +238,7 @@ clc cpmap -n my-cpmap put -k string hello -v f32 19.94 == clc cpmap remove -Removes the value of a given key in a CPMap and returns the key. +Removes the value of a given key in a CPMap and returns the old value. Usage: diff --git a/docs/modules/ROOT/pages/clc-script.adoc b/docs/modules/ROOT/pages/clc-script.adoc index a8ef2da..46a58a5 100644 --- a/docs/modules/ROOT/pages/clc-script.adoc +++ b/docs/modules/ROOT/pages/clc-script.adoc @@ -154,6 +154,27 @@ The following functions are available for advanced scripts: |`VALUES_LIST = map_values(name=MAP_NAME)` |Returns the values in the Map as a list. +|`BOOL = cpmap_compare_and_set(KEY, EXPECTED_VALUE, NEW_VALUE, name=CPMAP_NAME)` +|Sets the value for the given key if it has the expected value. + +|`cpmap_delete(KEY, name=CPMAP_NAME)` +|Deletes the value of a given key in a CPMap. + +|`cpmap_destroy(name=CPMAP_NAME)` +|Deletes the CPMap and all the data in it. + +|`cpmap_get(KEY, name=CPMAP_NAME)` +|Gets a value from the given CPMap. + +|`OLD_VALUE = cpmap_put(KEY, VALUE, name=CPMAP_NAME)` +|Puts the given value in the given CPMap and returns the old value. + +|`VALUE = cpmap_remove(KEY, name=CPMAP_NAME)` +|Removes the value of a given key in a CPMap and returns the old value. + +|`cpmap_set(KEY, VALUE, name=CPMAP_NAME)` +|Sets a value in the given CPMap. + |`TIME = now()` |Returns the current time in nanoseconds.