System.h.in 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing#kwsys for details. */
  3. #ifndef @KWSYS_NAMESPACE@_System_h
  4. #define @KWSYS_NAMESPACE@_System_h
  5. #include <@KWSYS_NAMESPACE@/Configure.h>
  6. /* Redefine all public interface symbol names to be in the proper
  7. namespace. These macros are used internally to kwsys only, and are
  8. not visible to user code. Use kwsysHeaderDump.pl to reproduce
  9. these macros after making changes to the interface. */
  10. #if !defined(KWSYS_NAMESPACE)
  11. # define kwsys_ns(x) @KWSYS_NAMESPACE@##x
  12. # define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
  13. #endif
  14. #if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
  15. # define kwsysSystem_Parse_CommandForUnix \
  16. kwsys_ns(System_Parse_CommandForUnix)
  17. #endif
  18. #if defined(__cplusplus)
  19. extern "C" {
  20. #endif
  21. /**
  22. * Parse a unix-style command line string into separate arguments.
  23. *
  24. * On success, returns a pointer to an array of pointers to individual
  25. * argument strings. Each string is null-terminated and the last
  26. * entry in the array is a NULL pointer (just like argv). It is the
  27. * caller's responsibility to free() the strings and the array of
  28. * pointers to them.
  29. *
  30. * On failure, returns NULL. Failure occurs only on invalid flags or
  31. * when memory cannot be allocated; never due to content of the input
  32. * string. Missing close-quotes are treated as if the necessary
  33. * closing quote appears.
  34. *
  35. * By default single- and double-quoted arguments are supported, and
  36. * any character may be escaped by a backslash. The flags argument is
  37. * reserved for future use, and must be zero (or the call will fail).
  38. */
  39. kwsysEXPORT char** kwsysSystem_Parse_CommandForUnix(const char* command,
  40. int flags);
  41. #if defined(__cplusplus)
  42. } /* extern "C" */
  43. #endif
  44. /* If we are building a kwsys .c or .cxx file, let it use these macros.
  45. Otherwise, undefine them to keep the namespace clean. */
  46. #if !defined(KWSYS_NAMESPACE)
  47. # undef kwsys_ns
  48. # undef kwsysEXPORT
  49. # if !defined(KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
  50. # undef kwsysSystem_Parse_CommandForUnix
  51. # endif
  52. #endif
  53. #endif