System.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 cmsys_System_h
  4. #define cmsys_System_h
  5. #include <cmsys/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) cmsys##x
  12. #define kwsysEXPORT cmsys_EXPORT
  13. #endif
  14. #if !cmsys_NAME_IS_KWSYS
  15. #define kwsysSystem_Parse_CommandForUnix kwsys_ns(System_Parse_CommandForUnix)
  16. #endif
  17. #if defined(__cplusplus)
  18. extern "C" {
  19. #endif
  20. /**
  21. * Parse a unix-style command line string into separate arguments.
  22. *
  23. * On success, returns a pointer to an array of pointers to individual
  24. * argument strings. Each string is null-terminated and the last
  25. * entry in the array is a NULL pointer (just like argv). It is the
  26. * caller's responsibility to free() the strings and the array of
  27. * pointers to them.
  28. *
  29. * On failure, returns NULL. Failure occurs only on invalid flags or
  30. * when memory cannot be allocated; never due to content of the input
  31. * string. Missing close-quotes are treated as if the necessary
  32. * closing quote appears.
  33. *
  34. * By default single- and double-quoted arguments are supported, and
  35. * any character may be escaped by a backslash. The flags argument is
  36. * reserved for future use, and must be zero (or the call will fail).
  37. */
  38. kwsysEXPORT char** kwsysSystem_Parse_CommandForUnix(const char* command,
  39. int flags);
  40. #if defined(__cplusplus)
  41. } /* extern "C" */
  42. #endif
  43. /* If we are building a kwsys .c or .cxx file, let it use these macros.
  44. Otherwise, undefine them to keep the namespace clean. */
  45. #if !defined(KWSYS_NAMESPACE)
  46. #undef kwsys_ns
  47. #undef kwsysEXPORT
  48. #if !defined(KWSYS_NAMESPACE) && !cmsys_NAME_IS_KWSYS
  49. #undef kwsysSystem_Parse_CommandForUnix
  50. #endif
  51. #endif
  52. #endif