Visual Studio 2012 Support
[xy_vsfilter.git] / src / thirdparty / VirtualDub / h / vd2 / system / strutil.h
blob89d1f9f3f5731d476cf0475de459f06e83495fe0
1 // VirtualDub - Video processing and capture application
2 // System library component
3 // Copyright (C) 1998-2004 Avery Lee, All Rights Reserved.
4 //
5 // Beginning with 1.6.0, the VirtualDub system library is licensed
6 // differently than the remainder of VirtualDub. This particular file is
7 // thus licensed as follows (the "zlib" license):
8 //
9 // This software is provided 'as-is', without any express or implied
10 // warranty. In no event will the authors be held liable for any
11 // damages arising from the use of this software.
13 // Permission is granted to anyone to use this software for any purpose,
14 // including commercial applications, and to alter it and redistribute it
15 // freely, subject to the following restrictions:
17 // 1. The origin of this software must not be misrepresented; you must
18 // not claim that you wrote the original software. If you use this
19 // software in a product, an acknowledgment in the product
20 // documentation would be appreciated but is not required.
21 // 2. Altered source versions must be plainly marked as such, and must
22 // not be misrepresented as being the original software.
23 // 3. This notice may not be removed or altered from any source
24 // distribution.
25 #ifndef f_VD2_SYSTEM_STRUTIL_H
26 #define f_VD2_SYSTEM_STRUTIL_H
28 #include <string.h>
29 #include <vd2/system/vdtypes.h>
31 char *strncpyz(char *strDest, const char *strSource, size_t count);
32 wchar_t *wcsncpyz(wchar_t *strDest, const wchar_t *strSource, size_t count);
33 const char *strskipspace(const char *s);
35 inline char *strskipspace(char *s) {
36 return const_cast<char *>(strskipspace(s));
39 size_t vdstrlcpy(char *dst, const char *src, size_t sizeChars);
40 size_t vdwcslcpy(wchar_t *dst, const wchar_t *src, size_t sizeChars);
42 size_t vdstrlcat(char *dst, const char *src, size_t sizeChars);
44 inline int vdstricmp(const char *s, const char *t) {
45 return _stricmp(s, t);
48 inline int vdstricmp(const char *s, const char *t, size_t maxlen) {
49 return _strnicmp(s, t, maxlen);
52 inline int vdwcsicmp(const wchar_t *s, const wchar_t *t) {
53 return _wcsicmp(s, t);
56 inline int vdwcsnicmp(const wchar_t *s, const wchar_t *t, size_t maxlen) {
57 return _wcsnicmp(s, t, maxlen);
60 #endif