
@c ===== member doc =====

@macro _member_doc id
  @insert {@id@} decl_warn_sentence
  @insert {@id@} decl_homonyms_sentence
  @insert {@id@} decl_cpp_condition_sentence
  @insert {@id@} decl_involved_macros_sentence

  @insert {@id@} decl_inline_doc
  @insert {@id@} decl_content
  @insert {@id@} see_related_typedefs
@end macro

@c ===== compound members detail =====

@macro _compound_details id

  @foreach mid {typedef,enum,struct,function,variable,macro} {@id@} {1}
    @section {} {@mid@}
      @ifsymattr {@id@} {visible}
        @insert {@mid@} decl_location_sentence
      @else
        @insert {@mid@} decl_module_sentence
      @end if
      @invoke {@mid@} _member_doc
    @end section
  @end foreach

@end macro

@c ===== compound documentation macro for internal use =====

@macro _compound_doc id

  @section e {Description}
    @insert {@id@} decl_inline_doc
  @end section

  @ifsymtype {@id@} {module}
    @section e {Related headers}
      @insert {header} {1} {@id@} compound_table 
    @end section
  @end if

  @ifsymtype {@id@} {header}
    @section e {Inclusion list}
      @insert {@id@} include_list
    @end section
  @end if

  @section e {Members}
    @insert {@id@} compound_member_list
  @end section

@end macro

@c ===== compound section macro for internal use =====

@macro _compound_section type id name

  @section P {@name@ @type@ reference} {@id@}
    @ifsymattr {@id@} {visible}
      @invoke {@id@} _compound_doc
    @end if

    @ifsymtype {@id@} {header}
      @section e {Members detail}
        @invoke {@id@} _compound_details
      @end section
    @end if

    @end section

@end macro

@c ===== compound section with documentation and member details =====

@macro member_section name

  @lookup id {@name@}
    @section {} {@id@}
      @invoke {@id@} _member_doc
    @end section
  @end lookup

@end macro

@c ===== compound section with documentation and member details =====

@macro compound_section name

  @lookup id mname mtype {@name@}
    @invoke {@mtype@} {@id@} {@mname@} _compound_section
  @end lookup

@end macro

@c ===== global scope section with documentation and member details =====

@macro global_scope_doc
  @invoke {::} _compound_doc
@end macro

@c ===== documentation sections for all compounds of given types =====

@macro all_compound_sections types scope

  @foreach id name type {@types@} {@scope@} {0}
    @info Inserting `@name@' @type@ documentation
    @invoke {@type@} {@id@} {@name@} _compound_section
  @end foreach

@end macro

