System.h.in 2.5 KB

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