23

I have a rather odd problem with Doxygen (1.6.1 on Mac OS X Snow Leopard) in that it does not seem to document my enums no matter what I do. I am programming in C and have followed the instructions in the manual. Here is my code:

/**
 * \enum dccp_pkt_type 
 * \brief specifies the available DCCP packet types
 */

enum dccp_pkt_type
{
    DCCP_REQUEST    = 0,    /**< DCCP Request Packet */
    DCCP_RESPONSE,          /**< DCCP Response Packet */
    DCCP_DATA,              /**< DCCP Data Packet */
    DCCP_ACK,               /**< DCCP Ack Packet */
    DCCP_DATAACK,           /**< DCCP Data Ack Packet */
    DCCP_CLOSEREQ,          /**< DCCP Close Request Packet */
    DCCP_CLOSE,             /**< DCCP Close Packet */
    DCCP_RESET,             /**< DCCP Reset Packet */
    DCCP_SYNC,              /**< DCCP Sync Packet */
    DCCP_SYNCACK,           /**< DCCP Sync Ack Packet */
    DCCP_RESERVED,          /**< DCCP Reserved Packet Type - Receivers MUST
                         ignore any packets with this type */
};

It should according to the doxygen manual produce properly documentated output but instead it produces nothing. I am most likely missing something simple, if anyone could point me in the right direction I would be grateful.

MiJyn
  • 5,327
  • 4
  • 37
  • 64
Cromulent
  • 3,788
  • 4
  • 31
  • 41
  • 1
    General comment not addressing the question: Your [Doxygen] comments for individual enum values (perhaps with the exception of the "ignore" note for DCCP_RESERVED) do not add anything useful, just clutter the view. – Petr Vepřek Oct 20 '17 at 07:17

3 Answers3

36

From the Doxygen manual:

Let’s repeat that, because it is often overlooked: to document global objects (functions, typedefs, enum, macros, etc), you must document the file in which they are defined. In other words, there must at least be a

/*! \file */ or a

/** @file */ line in this file.

albert
  • 8,285
  • 3
  • 19
  • 32
Tim Henigan
  • 60,452
  • 11
  • 85
  • 78
11

My experience is the same using EXTRACT_ALL=NO and SHOW_INCLUDE_FILES=NO with doxygen 1.8.9.1 - global enum types were not listed nor linked even though /*! \file */ is present and the global enum is referenced by a documented compound structure.

To work around this, I ended up defining an Enumerations group:

/*! \defgroup Enumerations Public enumeration types */

and for the enum types I used \ingroup Enumerations to include the enums in the new group. Doxygen then was able to autolink from the compound structures to the enum types.

Bryan
  • 111
  • 1
  • 2
4

If memory serves correctly, enum documentation doesn't show up unless the file is also documented. Try adding a @file section.

Stephen Newell
  • 7,330
  • 1
  • 24
  • 28