我很难理解tchdbfwmkeys
东京内阁的方法。
文档如下:
该函数
tchdbfwmkeys
用于在哈希数据库对象中获取前向匹配键。
TCLIST *tchdbfwmkeys(TCHDB *hdb, const void *pbuf, int psiz, int max);
`hdb' specifies the hash database object.
`pbuf' specifies the pointer to the region of the prefix.
`psiz' specifies the size of the region of the prefix.
`max' specifies the maximum number of keys to be fetched. If it is negative, no limit is specified.
The return value is a list object of the corresponding keys. This function does never fail. It returns an empty list even if no key corresponds.
Because the object of the return value is created with the function `tclistnew', it should be deleted with the function `tclistdel' when it is no longer in use. Note that this function may be very slow because every key in the database is scanned.
我对它的含义有一个模糊的理解:你传递一个键的前缀,它返回所有具有这个前缀的键。例如,您传递前缀data_
并获得数据库中以 . 开头的所有键data_
。
但是,我不确定这是否正确,即使正确,我也不了解pbuf
andpsiz
参数。你到底应该传递给他们什么?