print_version.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License, version 2.0,
  4. as published by the Free Software Foundation.
  5. This program is also distributed with certain software (including
  6. but not limited to OpenSSL) that is licensed under separate terms,
  7. as designated in a particular file or component or in included license
  8. documentation. The authors of MySQL hereby grant you an additional
  9. permission to link the program and your derivative works with the
  10. separately licensed software that they have included with MySQL.
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. GNU General Public License, version 2.0, for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
  18. #ifndef _print_version_h_
  19. #define _print_version_h_
  20. #ifdef __cplusplus
  21. #include <string>
  22. extern "C" {
  23. #endif /* __cplusplus */
  24. /**
  25. @file include/print_version.h
  26. */
  27. /**
  28. This function prints a standard version string. Should be used by
  29. all utilities.
  30. */
  31. void print_version();
  32. /**
  33. This function prints a standard version string, with '-debug' added
  34. to the name of the executable. Used by utilties that have an
  35. explicit need to state that they have been compiled in debug mode.
  36. */
  37. void print_version_debug();
  38. /**
  39. This function prints a version string with the released version
  40. supplied by the caller. Used by the server process which needs to
  41. print if it is compiled with debug, ASAN, UBSAN or running with
  42. Valgrind.
  43. @param[in] version Null-terminated release version string
  44. */
  45. void print_explicit_version(const char *version);
  46. #ifdef __cplusplus
  47. /**
  48. This function builds a version string, with the program name
  49. supplied by the caller. Used by MEB and other utilities that want to
  50. present themselves under their own name.
  51. @param[in] progname Program name C++ string.
  52. @param[out] destination Output buffer.
  53. */
  54. void build_version(const std::string &progname, std::string *destination);
  55. } /* extern "C" */
  56. #endif /* __cplusplus */
  57. #endif /* _print_version_h_ */