I'm reading through some open-source code at the moment, and I see the following lines of code at the top of this C header file:
#ifndef __BASH_H__ #define __BASH_H__ I don't see __BASH_H__ referenced anywhere else in the codebase, so I suspected it is used indirectly (i.e. by the shell, a C compiler, or a 3rd-party library), not by the code itself.
I Googled for "BASH_H" and I saw it used by other open-source libraries (i.e. here and here), so I'm assuming I'm directionally correct in my assumption.
However the Google results don't include any official documentation on this declaration, its purpose, its usage(s), etc. I just see 2 pages total of search results, most of which look pretty irrelevant.
I'm assuming it's somehow related to bash, but I'm mystified by the lack of official docs. Can anyone point me in the right direction?
#ifndefright there.#endifin that file, you might better understand how these "include guards" work.BASHin it, so I assumed the question was at least partially relevant to thebashshell. I did do research and homework prior to posting here (as I outlined in the question itself), but it was all shell-specific research based on the aforementioned assumption. I now know better after reading Stephen Kitt's answer below and have now migrated the question from the Unix Q&A site over to StackOverflow. Sometimes you have to ask the wrong question in order to realize what the right question is.