Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

62%
+3 −1
Q&A List what file(s) an identifier was declared in?

I haven't used Doxygen that much, but after checking the documentation and looking around online, it looks like the reason this might be happening is because the SHOW_USED_FILES setting which (if I...

posted 3y ago by summea‭  ·  edited 3y ago by summea‭

Answer
#4: Post edited by user avatar summea‭ · 2021-02-20T05:04:35Z (over 3 years ago)
  • I haven't used Doxygen that much, but after checking [the documentation](https://www.doxygen.nl/manual/index.html) and [looking around online](https://linux.m2osw.com/doxygen-does-not-generate-documentation-my-c-functions-or-any-global-function), it looks like the reason this might be happening is because the SHOW_USED_FILES setting which (if I'm [reading the documentation](https://www.doxygen.nl/manual/config.html#cfg_show_used_files) correctly) is used to show the list of files at the bottom of a page of documentation appears to be limited to the documentation of classes and structs.
  • In other words, if an `enum` is not particularly in a class, and if it's not somehow a `struct`, the outputted documentation page should not include this list of source files.
  • I tried out a test using C language files with an `enum` and a `struct`. When I tried just using an `enum` definition in my header file, I did not see the `The documentation for this struct was generated from the following file:` line from the bottom of the generated Doxygen page. When I included a struct definition in my header file, I finally noticed that the resulting page was under the `Classes` menu on the documentation generated by Doxygen. After clicking on the `Classes` menu and then clicking on the name of the `struct` I used, I was able to see the `The documentation for this struct was generated from the following file:` line at the bottom of the generated documentation.
  • Thus, from what I read in the documentation, it looks like a plain `enum` file is not meant to show the `The documentation for this struct was generated from the following file:` line. If your `enum` could somehow be a part of a class, however, like in [this example from the documentation](https://www.doxygen.nl/manual/examples/afterdoc/html/class_afterdoc___test.html), it should work!
  • For reference, here are the C files I used for my tests:
  • **q12.h**
  • ```
  • #include <stdio.h>
  • #include <string.h>
  • // ref: https://docs.microsoft.com/en-us/cpp/c-language
  • // /c-enumeration-declarations?view=msvc-160
  • enum COLOR
  • {
  • Red, /*!< Enum value red. */
  • Blue, /*!< Enum value blue. */
  • Yellow /*!< Enum value yellow. */
  • };
  • // ref: https://www.tutorialspoint.com/cprogramming/c_structures.htm
  • struct Colors {
  • char name[30]; /*!< Struct name. */
  • };
  • ```
  • **q12.c**
  • ```
  • #include <stdio.h>
  • #include "q12.h"
  • int main()
  • {
  • // ref: https://docs.microsoft.com/en-us/cpp/c-language
  • // /c-enumeration-declarations?view=msvc-160
  • enum COLOR primary = Red;
  • // ref: https://www.tutorialspoint.com/cprogramming/c_structures.htm
  • struct Colors Color1;
  • strcpy(Color1.name, "Red");
  • printf("Hello, world!\n");
  • printf("Printing color: %d\n", primary);
  • return 0;
  • }
  • ```
  • I haven't used Doxygen that much, but after checking [the documentation](https://www.doxygen.nl/manual/index.html) and [looking around online](https://linux.m2osw.com/doxygen-does-not-generate-documentation-my-c-functions-or-any-global-function), it looks like the reason this might be happening is because the `SHOW_USED_FILES` setting which (if I'm [reading the documentation](https://www.doxygen.nl/manual/config.html#cfg_show_used_files) correctly) is used to show the list of files at the bottom of a page of documentation appears to be limited to the documentation of classes and structs.
  • In other words, if an `enum` is not particularly in a class, and if it's not somehow a `struct`, the outputted documentation page should not include this list of source files.
  • I tried out a test using C language files with an `enum` and a `struct`. When I tried just using an `enum` definition in my header file, I did not see the `The documentation for this struct was generated from the following file:` line from the bottom of the generated Doxygen page. When I included a struct definition in my header file, I finally noticed that the resulting page was under the `Classes` menu on the documentation generated by Doxygen. After clicking on the `Classes` menu and then clicking on the name of the `struct` I used, I was able to see the `The documentation for this struct was generated from the following file:` line at the bottom of the generated documentation.
  • Thus, from what I read in the documentation, it looks like a plain `enum` file is not meant to show the `The documentation for this struct was generated from the following file:` line. If your `enum` could somehow be a part of a class, however, like in [this example from the documentation](https://www.doxygen.nl/manual/examples/afterdoc/html/class_afterdoc___test.html), it should work!
  • For reference, here are the C files I used for my tests:
  • **q12.h**
  • ```
  • #include <stdio.h>
  • #include <string.h>
  • // ref: https://docs.microsoft.com/en-us/cpp/c-language
  • // /c-enumeration-declarations?view=msvc-160
  • enum COLOR
  • {
  • Red, /*!< Enum value red. */
  • Blue, /*!< Enum value blue. */
  • Yellow /*!< Enum value yellow. */
  • };
  • // ref: https://www.tutorialspoint.com/cprogramming/c_structures.htm
  • struct Colors {
  • char name[30]; /*!< Struct name. */
  • };
  • ```
  • **q12.c**
  • ```
  • #include <stdio.h>
  • #include "q12.h"
  • int main()
  • {
  • // ref: https://docs.microsoft.com/en-us/cpp/c-language
  • // /c-enumeration-declarations?view=msvc-160
  • enum COLOR primary = Red;
  • // ref: https://www.tutorialspoint.com/cprogramming/c_structures.htm
  • struct Colors Color1;
  • strcpy(Color1.name, "Red");
  • printf("Hello, world!\n");
  • printf("Printing color: %d\n", primary);
  • return 0;
  • }
  • ```
#3: Post edited by user avatar summea‭ · 2021-02-20T05:04:09Z (over 3 years ago)
Fixed formatting, added a link to documentation, and added some detail to response.
#2: Post edited by user avatar summea‭ · 2021-02-20T05:03:32Z (over 3 years ago)
  • I haven't used Doxygen that much, but after checking [the documentation](https://www.doxygen.nl/manual/index.html) and [looking around online](https://linux.m2osw.com/doxygen-does-not-generate-documentation-my-c-functions-or-any-global-function), it looks like the reason this might be happening is because the SHOW_USED_FILES setting which is used to show the list of files at the bottom of a page of documentation appears to be limited to the documentation of classes and structs.
  • In other words, if an `enum` is not particularly in a class, and if it's not somehow a `struct`, the outputted documentation page should not include this list of source files.
  • I tried out a test using C language files with an `enum` and a `struct`. When I tried just using an `enum` definition in my header file, I did not see the `The documentation for this struct was generated from the following file:` line from the bottom of the generated Doxygen page. When I included a struct definition in my header file, I finally noticed that the resulting page was under the `Classes` menu on the documentation generated by Doxygen. After clicking on the `Classes` menu and then clicking on the name of the `struct` I used, I was able to see the `The documentation for this `struct` was generated from the following file:` line at the bottom of the generated documentation.
  • Thus, from what I read in the documentation, it looks like a plain `enum` file is not meant to show the `The documentation for this struct was generated from the following file:` line. If your `enum` could somehow be a part of a class, however, like in [this example from the documentation](https://www.doxygen.nl/manual/examples/afterdoc/html/class_afterdoc___test.html), it should work!
  • For reference, here are the C files I used for my tests:
  • **q12.h**
  • ```
  • #include <stdio.h>
  • #include <string.h>
  • // ref: https://docs.microsoft.com/en-us/cpp/c-language
  • // /c-enumeration-declarations?view=msvc-160
  • enum COLOR
  • {
  • Red, /*!< Enum value red. */
  • Blue, /*!< Enum value blue. */
  • Yellow /*!< Enum value yellow. */
  • };
  • // ref: https://www.tutorialspoint.com/cprogramming/c_structures.htm
  • struct Colors {
  • char name[30]; /*!< Struct name. */
  • };
  • ```
  • **q12.c**
  • ```
  • #include <stdio.h>
  • #include "q12.h"
  • int main()
  • {
  • // ref: https://docs.microsoft.com/en-us/cpp/c-language
  • // /c-enumeration-declarations?view=msvc-160
  • enum COLOR primary = Red;
  • // ref: https://www.tutorialspoint.com/cprogramming/c_structures.htm
  • struct Colors Color1;
  • strcpy(Color1.name, "Red");
  • printf("Hello, world!\n");
  • printf("Printing color: %d\n", primary);
  • return 0;
  • }
  • ```
  • I haven't used Doxygen that much, but after checking [the documentation](https://www.doxygen.nl/manual/index.html) and [looking around online](https://linux.m2osw.com/doxygen-does-not-generate-documentation-my-c-functions-or-any-global-function), it looks like the reason this might be happening is because the SHOW_USED_FILES setting which (if I'm [reading the documentation](https://www.doxygen.nl/manual/config.html#cfg_show_used_files) correctly) is used to show the list of files at the bottom of a page of documentation appears to be limited to the documentation of classes and structs.
  • In other words, if an `enum` is not particularly in a class, and if it's not somehow a `struct`, the outputted documentation page should not include this list of source files.
  • I tried out a test using C language files with an `enum` and a `struct`. When I tried just using an `enum` definition in my header file, I did not see the `The documentation for this struct was generated from the following file:` line from the bottom of the generated Doxygen page. When I included a struct definition in my header file, I finally noticed that the resulting page was under the `Classes` menu on the documentation generated by Doxygen. After clicking on the `Classes` menu and then clicking on the name of the `struct` I used, I was able to see the `The documentation for this struct was generated from the following file:` line at the bottom of the generated documentation.
  • Thus, from what I read in the documentation, it looks like a plain `enum` file is not meant to show the `The documentation for this struct was generated from the following file:` line. If your `enum` could somehow be a part of a class, however, like in [this example from the documentation](https://www.doxygen.nl/manual/examples/afterdoc/html/class_afterdoc___test.html), it should work!
  • For reference, here are the C files I used for my tests:
  • **q12.h**
  • ```
  • #include <stdio.h>
  • #include <string.h>
  • // ref: https://docs.microsoft.com/en-us/cpp/c-language
  • // /c-enumeration-declarations?view=msvc-160
  • enum COLOR
  • {
  • Red, /*!< Enum value red. */
  • Blue, /*!< Enum value blue. */
  • Yellow /*!< Enum value yellow. */
  • };
  • // ref: https://www.tutorialspoint.com/cprogramming/c_structures.htm
  • struct Colors {
  • char name[30]; /*!< Struct name. */
  • };
  • ```
  • **q12.c**
  • ```
  • #include <stdio.h>
  • #include "q12.h"
  • int main()
  • {
  • // ref: https://docs.microsoft.com/en-us/cpp/c-language
  • // /c-enumeration-declarations?view=msvc-160
  • enum COLOR primary = Red;
  • // ref: https://www.tutorialspoint.com/cprogramming/c_structures.htm
  • struct Colors Color1;
  • strcpy(Color1.name, "Red");
  • printf("Hello, world!\n");
  • printf("Printing color: %d\n", primary);
  • return 0;
  • }
  • ```
#1: Initial revision by user avatar summea‭ · 2021-02-20T04:03:39Z (over 3 years ago)
I haven't used Doxygen that much, but after checking [the documentation](https://www.doxygen.nl/manual/index.html) and [looking around online](https://linux.m2osw.com/doxygen-does-not-generate-documentation-my-c-functions-or-any-global-function), it looks like the reason this might be happening is because the SHOW_USED_FILES setting which is used to show the list of files at the bottom of a page of documentation appears to be limited to the documentation of classes and structs.

In other words, if an `enum` is not particularly in a class, and if it's not somehow a `struct`, the outputted documentation page should not include this list of source files.

I tried out a test using C language files with an `enum` and a `struct`. When I tried just using an `enum` definition in my header file, I did not see the `The documentation for this struct was generated from the following file:` line from the bottom of the generated Doxygen page. When I included a struct definition in my header file, I finally noticed that the resulting page was under the `Classes` menu on the documentation generated by Doxygen. After clicking on the `Classes` menu and then clicking on the name of the `struct` I used, I was able to see the `The documentation for this `struct` was generated from the following file:` line at the bottom of the generated documentation.

Thus, from what I read in the documentation, it looks like a plain `enum` file is not meant to show the `The documentation for this struct was generated from the following file:` line. If your `enum` could somehow be a part of a class, however, like in [this example from the documentation](https://www.doxygen.nl/manual/examples/afterdoc/html/class_afterdoc___test.html), it should work!

For reference, here are the C files I used for my tests:

**q12.h**
```
#include <stdio.h>
#include <string.h>

// ref: https://docs.microsoft.com/en-us/cpp/c-language
//   /c-enumeration-declarations?view=msvc-160
enum COLOR
{
    Red, /*!< Enum value red. */
    Blue, /*!< Enum value blue. */
    Yellow /*!< Enum value yellow. */
};

// ref: https://www.tutorialspoint.com/cprogramming/c_structures.htm
struct Colors {
    char name[30]; /*!< Struct name. */
};
```

**q12.c**
```
#include <stdio.h>
#include "q12.h"

int main()
{
    // ref: https://docs.microsoft.com/en-us/cpp/c-language
    //   /c-enumeration-declarations?view=msvc-160
    enum COLOR primary = Red;
    // ref: https://www.tutorialspoint.com/cprogramming/c_structures.htm
    struct Colors Color1;
    strcpy(Color1.name, "Red");
    printf("Hello, world!\n");
    printf("Printing color: %d\n", primary);
    return 0;
}
```