Re: Help with Doxygen and C structs



On 24 Lug, 06:32, "J. Bourne" <n...@xxxxxxxx> wrote:
[snip]

typedef struct _User {
/* ... stuff ... */
struct _User *next_user;

} User;

When documenting the struct and its variables, Doxygen calls the
structure "_User" in the output, instead of the prefered "User".
Is there a way to force Doxygen to identify the struct as "User" instead
of "_User"?

No. User is a typedef of the struct _User type and Doxygen treats it
as any other typedef. If you want to document user you have to either
split the declaration into two parts:

/** comment about struct _User */
struct _User {
/* ... stuff ... */
struct _User *next_user;
}

/** comment about User */
typedef struct _User User;

Or explicitely tell Doxygen what to document:

/** \typedef User
* comment about User */

/** comment about _User */
typedef struct _User {
/* ... stuff ... */
struct _User *next_user;

} User;

.



Relevant Pages

  • Re: [patch] Re: newer version of HTC Dream support
    ... new file mode 100644 ... without even the implied warranty of ... +struct rpcsvr_platform_device ...
    (Linux-Kernel)
  • Re: [PATCH 1/4] staging: cpc-usb: convert comment style in cpc.h
    ... -// representation of the CAN parameters for the PCA82C200 controller ... typedef struct CPC_PCA82C200_PARAMS { ... -// In general two types of overrun may occur. ...
    (Linux-Kernel)
  • Re: Variable array sizes as members ?
    ... space for an object of type struct tag_lb. ... Sorry Barry, excuse my ignorance, but its the first time I see malloc being ... Barry and Scott have talked about making my array member a pointer so it can ... typedef struct tag_list60 ...
    (microsoft.public.vc.language)
  • passing structure to unmanged function
    ... typedef struct tagLABELINFO { ... public struct TObjectID ... typedef struct tagObjectInfo { ... BOOL WINAPI PrintLabel(LPCSTR DeviceName, LPCSTR Port, int ...
    (microsoft.public.dotnet.framework.interop)
  • passing a structure to unmanaged code
    ... typedef struct tagLABELINFO { ... public struct TObjectID ... typedef struct tagObjectInfo { ... BOOL WINAPI PrintLabel(LPCSTR DeviceName, LPCSTR Port, int ...
    (microsoft.public.dotnet.languages.csharp)