Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C st_表,st_数据_C_Ruby - Fatal编程技术网

C st_表,st_数据

C st_表,st_数据,c,ruby,C,Ruby,这是关于RUBY源代码的。结构st_*位于 我有一个结构 typedef struct TrieNode { VALUE loadpath; int expired; st_table* dirs; st_table* fileToAbsPath; }TrieNode; 我需要能够使用st_表存储和检索它,我的键是char*,值是trinode* 为了存储它,我使用了以下行,其中child是trineode*类型 为了找回它,我计划使用 st_data_t buff; //root->f

这是关于RUBY源代码的。结构st_*位于

我有一个结构

typedef struct TrieNode {
VALUE loadpath;
int expired;
st_table* dirs;
st_table* fileToAbsPath;
}TrieNode;
我需要能够使用st_表存储和检索它,我的键是char*,值是trinode*

为了存储它,我使用了以下行,其中child是trineode*类型

为了找回它,我计划使用

st_data_t buff;
//root->fileToAbsPath is st_table*, fname is char*
st_lookup(root->fileToAbsPath, (st_data_t)fname, &buff);

我不知道如何将buff转换为trinode*

只需将其施放即可。就是

TrieNode *buff = 0;
st_lookup(root->fileToAbsPath, (st_data_t)fname, (st_data_t*)&buff);

这里没有足够的信息来回答这个问题。st_表和st_数据在哪里定义?st_Addu_direct做什么?等
TrieNode *buff = 0;
st_lookup(root->fileToAbsPath, (st_data_t)fname, (st_data_t*)&buff);