C GTK文档未呈现结构的文档注释
我在.h文件中有以下代码:C GTK文档未呈现结构的文档注释,c,documentation-generation,C,Documentation Generation,我在.h文件中有以下代码: /** * udp_result_s: * @available: indicates the availability of the property stored in @data * @data: the property value (will only be meaningful if @available indicates its presence) * * A transparent struct, representing the res
/**
* udp_result_s:
* @available: indicates the availability of the property stored in @data
* @data: the property value (will only be meaningful if @available indicates its presence)
*
* A transparent struct, representing the result of a query on a UDP object. Note that the @data field will contain unspecified junk *unless* @available is `udp_PRESENT`.
*/
typedef struct udp_result_s
{
/*< public > */
udp_availability available;
void *data;
} udp_result_s;
/**
*udp_结果_s:
*@available:表示存储在@data中的属性的可用性
*@data:property值(仅当@available指示其存在时才有意义)
*
*透明结构,表示UDP对象上的查询结果。请注意,@data字段将包含未指定的垃圾*,除非*@available为“udp\u PRESENT”。
*/
类型定义结构udp_结果
{
/**/
udp_可用性;
作废*数据;
}udp_结果_s;
由于某些原因,我完全无法理解,GTK文档生成的文档中没有显示这一点。应该从此文件生成的所有其他内容都是-我是否遗漏了一些非常明显的内容?尝试:
typedef struct
{
/*< public > */
udp_availability available;
void *data;
} udp_result_s;
typedef结构
{
/**/
udp_可用性;
作废*数据;
}udp_结果_s;
如果将结构定义和typedef分开,它将起作用,如:
/**
* udp_result_s:
* @available: indicates the availability of the property stored in @data
* @data: the property value (will only be meaningful if @available indicates its presence)
*
* A transparent struct, representing the result of a query on a UDP object. Note that the @data field will contain unspecified junk *unless* @available is `udp_PRESENT`.
*/
struct udp_result_s
{
udp_availability available;
void *data;
};
typedef struct udp_result_s udp_result_s;
即使这样,我也不会用这个。为了文档而更改代码似乎是错误的,不仅仅是“代码”和“文档”。它是“GTK代码”和“GTK文件”。事实上,根据GTK惯例,您应该将结构声明为
typedef struct\u udp\u result\u s
(请注意前导下划线)。如果是这样,请将其添加到您的答案中,因为到目前为止,这似乎是一个错误的建议。我将更新答案,但我现在无法验证答案是否正确(尽管我肯定这就是解决方案)。请尝试并让我知道此建议是否解决了您的问题。如果没有,请检查GTK文档日志,如果它们包含任何相关内容,这可能会有所帮助。@simurg这些建议都没有任何效果-出于某种原因,它仍然没有显示出来。