我正在尝试使用ctypes映射结构定义:
struct attrl {
struct attrl *next;
char *name;
char *resource;
char *value;
};
我不确定如何处理ctypes映射中struct的“next”字段。定义如:
class attrl(Structure):
_fields_ = [
("next", attrl),
("name", c_char_p),
("resource", c_char_p),
("value", c_char_p)
]
结果:
NameError: name 'attrl' is not defined