NX二次开发源码分享:封装一个函数--将ufun的链表转化成数组
NX二次开发源码分享:封装一个函数--将ufun的链表转化成数组
static int allocate_memory(unsigned int nbytes, void **where)
{
int
resp;
*where = UF_allocate_memory(nbytes, &resp);
return resp;
}
static int make_an_array(uf_list_p_t *object_list, tag_t **objects)
{
int
ii,
n;
uf_list_p_t
temp;
UF_CALL(UF_MODL_ask_list_count(*object_list, &n));
UF_CALL(allocate_memory(n * sizeof(tag_t), (void **)objects));
for (ii = 0, temp = *object_list; ii < n; temp = temp->next, ii++)
(*objects) = temp->eid;
UF_CALL(UF_MODL_delete_list(object_list));
return n;
}
页:
[1]