diff options
author | Brad King <brad.king@kitware.com> | 2006-09-21 15:49:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-09-21 15:49:36 (GMT) |
commit | 683346fa3d067fd7ac144446bd6a4c673dfec222 (patch) | |
tree | 27121cced64d5fd4d9797122b7d013896d6d8dde /Source/kwsys/System.h.in | |
parent | b6e8574ab191a1ff611454412ecdfaf0154990c7 (diff) | |
download | CMake-683346fa3d067fd7ac144446bd6a4c673dfec222.zip CMake-683346fa3d067fd7ac144446bd6a4c673dfec222.tar.gz CMake-683346fa3d067fd7ac144446bd6a4c673dfec222.tar.bz2 |
ENH: Adding 'System' component of C sources to hold system tools written in C. Moved windows shell command line argument escaping code to kwsysSystem_Windows_ShellArgument and kwsysSystem_Windows_ShellArgumentSize.
Diffstat (limited to 'Source/kwsys/System.h.in')
-rw-r--r-- | Source/kwsys/System.h.in | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/Source/kwsys/System.h.in b/Source/kwsys/System.h.in new file mode 100644 index 0000000..db4859e --- /dev/null +++ b/Source/kwsys/System.h.in @@ -0,0 +1,62 @@ +/*========================================================================= + + Program: KWSys - Kitware System Library + Module: $RCSfile$ + + Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ +#ifndef @KWSYS_NAMESPACE@_System_h +#define @KWSYS_NAMESPACE@_System_h + +#include <@KWSYS_NAMESPACE@/Configure.h> + +/* Redefine all public interface symbol names to be in the proper + namespace. These macros are used internally to kwsys only, and are + not visible to user code. Use kwsysHeaderDump.pl to reproduce + these macros after making changes to the interface. */ +#if !defined(KWSYS_NAMESPACE) +# define kwsys_ns(x) @KWSYS_NAMESPACE@##x +# define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT +#endif +#define kwsysSystem_Windows_ShellArgument kwsys_ns(System_Windows_ShellArgument) +#define kwsysSystem_Windows_ShellArgumentSize kwsys_ns(System_Windows_ShellArgumentSize) + +#if defined(__cplusplus) +extern "C" +{ +#endif + +/** + * Escape the given command line argument for use in a windows shell. + * Returns a pointer to the end of the command line argument in the + * given buffer. + */ +kwsysEXPORT char* kwsysSystem_Windows_ShellArgument(const char* in, char* out); + +/** + * Compute the size of the buffer needed to store the result of + * kwsysSystem_Windows_ShellArgument. The return value includes space + * for a null-terminator. + */ +kwsysEXPORT int kwsysSystem_Windows_ShellArgumentSize(const char* in); + +#if defined(__cplusplus) +} /* extern "C" */ +#endif + +/* If we are building a kwsys .c or .cxx file, let it use these macros. + Otherwise, undefine them to keep the namespace clean. */ +#if !defined(KWSYS_NAMESPACE) +# undef kwsys_ns +# undef kwsysEXPORT +# undef kwsysSystem_Windows_ShellArgument +# undef kwsysSystem_Windows_ShellArgumentSize +#endif + +#endif |