Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
store_key(3)			 Arcan Lua API			  store_key(3)

NAME
       store_key - Store one or	several	key-value pairs	in the database.

SYNOPSIS
       true or false
       store_key( argtbl or [key, val],	opttgt,	optcfg )

DESCRIPTION
       There are multiple key- value stores that can be	used for keeping track
       of  specific key	value pairs. The default one is	bound to the currently
       running appl, but there is also one connected to	each execution	target
       that  can  be  accessed	by  setting opttgt  to any value returned from
       calling list_targets . There is also an execution target	 configuration
       specific	 key-  value  store  if	 both opttgt  and optcfg  are set to a
       valid target- configuration  pair.  Only	 characters  in	 the  set  [a-
       Z][0-9]_/+= are valid key  values.

NOTES
       1      The /+= are allowed to support base64 encoded values.

       2      If  the string length of a value field is	set to 0, the key will
	      be deleted.  To set multiple pairs at once, pack them in a  key-
	      indexed table.

EXAMPLE
       function	store_key0()
	     tbl = {key_a = "ok", key_b	= "ok"};
	     store_key(tbl);
	     store_key("key_c",	"ok");
	     print(get_key("key_a"));
	     print(get_key("key_b"));
	     print(get_key("key_c"));
	     local tgtlist = list_targets();
	     if	(#tgtlist > 0) then
		   store_key(tbl, tgtlist[1]);
		   store_key(tbl, tgtlist[1], target_configurations(tgtlist[1])[1]);
	     end
       end

SEE ALSO:
       get_key(3) match_keys(3)	list_targets(3)	target_configurations(3)

database			  April	2025			  store_key(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=store_key&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>

home | help