1 |
/* |
2 |
* CUnit - A Unit testing framework library for C. |
3 |
* Copyright (C) 2001 Anil Kumar |
4 |
* Copyright (C) 2004, 2005 Anil Kumar, Jerry St.Clair |
5 |
* |
6 |
* This library is free software; you can redistribute it and/or |
7 |
* modify it under the terms of the GNU Library General Public |
8 |
* License as published by the Free Software Foundation; either |
9 |
* version 2 of the License, or (at your option) any later version. |
10 |
* |
11 |
* This library is distributed in the hope that it will be useful, |
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 |
* Library General Public License for more details. |
15 |
* |
16 |
* You should have received a copy of the GNU Library General Public |
17 |
* License along with this library; if not, write to the Free Software |
18 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 |
*/ |
20 |
|
21 |
/* |
22 |
* Contains Type Definitions for some generic functions used across |
23 |
* CUnit project files. |
24 |
* |
25 |
* Created By : Anil Kumar on 13/Oct/2001 |
26 |
* Last Modified : 13/Oct/2001 |
27 |
* Comment : Moved some of the generic functions declarations |
28 |
* from other files to this one so as to use the |
29 |
* functions consitently. This file is not included |
30 |
* in the distribution headers because it is used |
31 |
* internally by CUnit. |
32 |
* EMail : aksaharan@yahoo.com |
33 |
* |
34 |
* Last Modified : 20-Jul-2004 (JDS) |
35 |
* Comment : New interface, support for deprecated version 1 names. |
36 |
* EMail : jds2@users.sourceforge.net |
37 |
* |
38 |
* Modified : 5-Sep-2004 (JDS) |
39 |
* Comment : Added internal test interface. |
40 |
* EMail : jds2@users.sourceforge.net |
41 |
*/ |
42 |
|
43 |
/** @file |
44 |
* Utility functions (user interface). |
45 |
*/ |
46 |
/** @addtogroup Framework |
47 |
* @{ |
48 |
*/ |
49 |
|
50 |
#ifndef CUNIT_UTIL_H_SEEN |
51 |
#define CUNIT_UTIL_H_SEEN |
52 |
|
53 |
#include "CUnit.h" |
54 |
|
55 |
#ifdef __cplusplus |
56 |
extern "C" { |
57 |
#endif |
58 |
|
59 |
/** Maximum string length. */ |
60 |
#define CUNIT_MAX_STRING_LENGTH 1024 |
61 |
/** maximum number of characters in a translated xml entity. */ |
62 |
#define CUNIT_MAX_ENTITY_LEN 5 |
63 |
|
64 |
CU_EXPORT int CU_translate_special_characters(/*@notnull@*/ const char* szSrc, |
65 |
/*@notnull@*//*@out@*/ char* szDest, |
66 |
size_t maxlen); |
67 |
CU_EXPORT int CU_compare_strings(/*@notnull@*/ const char* szSrc, |
68 |
/*@notnull@*/ const char* szDest); |
69 |
|
70 |
CU_EXPORT void CU_trim_left(/*@notnull@*/ char* szString); |
71 |
CU_EXPORT void CU_trim_right(/*@notnull@*/ char* szString); |
72 |
CU_EXPORT void CU_trim(/*@notnull@*/ char* szString); |
73 |
|
74 |
#ifdef CUNIT_BUILD_TESTS |
75 |
void test_cunit_Util(void); |
76 |
#endif |
77 |
|
78 |
#ifdef __cplusplus |
79 |
} |
80 |
#endif |
81 |
|
82 |
#ifdef USE_DEPRECATED_CUNIT_NAMES |
83 |
/** Deprecated (version 1). @deprecated Use CU_translate_special_characters(). */ |
84 |
#define translate_special_characters(src, dest, len) CU_translate_special_characters(src, dest, len) |
85 |
/** Deprecated (version 1). @deprecated Use CU_compare_strings(). */ |
86 |
#define compare_strings(src, dest) CU_compare_strings(src, dest) |
87 |
|
88 |
/** Deprecated (version 1). @deprecated Use CU_trim_left(). */ |
89 |
#define trim_left(str) CU_trim_left(str) |
90 |
/** Deprecated (version 1). @deprecated Use CU_trim_right(). */ |
91 |
#define trim_right(str) CU_trim_right(str) |
92 |
/** Deprecated (version 1). @deprecated Use CU_trim(). */ |
93 |
#define trim(str) CU_trim(str) |
94 |
|
95 |
#endif /* USE_DEPRECATED_CUNIT_NAMES */ |
96 |
|
97 |
#endif /* CUNIT_UTIL_H_SEEN */ |
98 |
/** @} */ |