parameters: (app: Sphinx)
docstring: Generate XML documentation for C API by Doxygen.
  
      Parameters
      ----------
      app : sphinx.application.Sphinx
          The application object representing the Sphinx process.
docstring_summary: Generate XML documentation for C API by Doxygen.
docstring_tokens: Generate XML documentation for C API by Doxygen .
function: def generate_doxygen_xml(app: Sphinx) -> None:
      """Generate XML documentation for C API by Doxygen.
  
      Parameters
      ----------
      app : sphinx.application.Sphinx
          The application object representing the Sphinx process.
      """
      doxygen_args = [
          f"INPUT={CURR_PATH.parent / 'include' / 'LightGBM' / 'c_api.h'}",
          f"OUTPUT_DIRECTORY={CURR_PATH / 'doxyoutput'}",
          "GENERATE_HTML=NO",
          "GENERATE_LATEX=NO",
          "GENERATE_XML=YES",
          "XML_OUTPUT=xml",
          "XML_PROGRAMLISTING=YES",
          r'ALIASES="rst=\verbatim embed:rst:leading-asterisk"',
          r'ALIASES+="endrst=\endverbatim"',
          "ENABLE_PREPROCESSING=YES",
          "MACRO_EXPANSION=YES",
          "EXPAND_ONLY_PREDEF=NO",
          "SKIP_FUNCTION_MACROS=NO",
          "PREDEFINED=__cplusplus",
          "SORT_BRIEF_DOCS=YES",
          "WARN_AS_ERROR=YES",
      ]
      doxygen_input = '\n'.join(doxygen_args)
      doxygen_input = bytes(doxygen_input, "utf-8")
      (CURR_PATH / 'doxyoutput').mkdir(parents=True, exist_ok=True)
      try:
          # Warning! The following code can cause buffer overflows on RTD.
          # Consider suppressing output completely if RTD project silently fails.
          # Refer to https://github.com/svenevs/exhale
          # /blob/fe7644829057af622e467bb529db6c03a830da99/exhale/deploy.py#L99-L111
          process = Popen(["doxygen", "-"],
                          stdin=PIPE, stdout=PIPE, stderr=PIPE)
          stdout, stderr = process.communicate(doxygen_input)
          output = '\n'.join([i.decode('utf-8') for i in (stdout, stderr) if i is not None])
          if process.returncode != 0:
              raise RuntimeError(output)
          else:
              print(output)
      except BaseException as e:
          raise Exception(f"An error has occurred while executing Doxygen\n{e}")
function_tokens: def generate_doxygen_xml ( app : Sphinx ) -> None : doxygen_args = [ f"INPUT={CURR_PATH.parent / 'include' / 'LightGBM' / 'c_api.h'}" , f"OUTPUT_DIRECTORY={CURR_PATH / 'doxyoutput'}" , "GENERATE_HTML=NO" , "GENERATE_LATEX=NO" , "GENERATE_XML=YES" , "XML_OUTPUT=xml" , "XML_PROGRAMLISTING=YES" , r'ALIASES="rst=\verbatim embed:rst:leading-asterisk"' , r'ALIASES+="endrst=\endverbatim"' , "ENABLE_PREPROCESSING=YES" , "MACRO_EXPANSION=YES" , "EXPAND_ONLY_PREDEF=NO" , "SKIP_FUNCTION_MACROS=NO" , "PREDEFINED=__cplusplus" , "SORT_BRIEF_DOCS=YES" , "WARN_AS_ERROR=YES" , ] doxygen_input = '\n' . join ( doxygen_args ) doxygen_input = bytes ( doxygen_input , "utf-8" ) ( CURR_PATH / 'doxyoutput' ) . mkdir ( parents = True , exist_ok = True ) try : # Warning! The following code can cause buffer overflows on RTD. # Consider suppressing output completely if RTD project silently fails. # Refer to https://github.com/svenevs/exhale # /blob/fe7644829057af622e467bb529db6c03a830da99/exhale/deploy.py#L99-L111 process = Popen ( [ "doxygen" , "-" ] , stdin = PIPE , stdout = PIPE , stderr = PIPE ) stdout , stderr = process . communicate ( doxygen_input ) output = '\n' . join ( [ i . decode ( 'utf-8' ) for i in ( stdout , stderr ) if i is not None ] ) if process . returncode != 0 : raise RuntimeError ( output ) else : print ( output ) except BaseException as e : raise Exception ( f"An error has occurred while executing Doxygen\n{e}" )