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

FreeBSD Manual Pages

  
 
  

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

NAME
       get_keys	- Retrieve all keys associated with a target or	target/config

SYNOPSIS
       kvtbl
       get_keys( targetname, configname	)

DESCRIPTION
       This  function  is  intended  to	be used	for the	corner cases where one
       need to explicitly enumerate / filter all  key:value  pairs  associated
       with  a target or a target+config pair, where explicit get_key calls or
       match_keys calls	wouldn't work.

NOTES
       1      output kvtbl  will always	be a table even	if the targetname  or

	      targetname  + configname	do not resolve to a valid  target  and
	      config,  but the table itself will be empty. Therefore it	is not
	      possible to distinguish between valid/invalid targets here.

EXAMPLE
       function	get_keys0()
	     local tbl = list_targets();
	     if	(#tbl == 0) then
		   warning("get_keys test must be run on a database with a valid target");
		   return shutdown();
	     end
	     store_key("test1",	"testval", tbl[1]);
	     store_key("test2",	"testval", tbl[2]);
	     for k,v in	ipairs(get_keys(tbl[1])) do
		   print(k, v);
	     end
       end

SEE ALSO:
database			  April	2025			   get_keys(3)

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

home | help