source: trunk/include/helpers/stringh.h@ 147

Last change on this file since 147 was 147, checked in by umoeller, 23 years ago

Misc updates for Unicode.

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 7.3 KB
Line 
1
2/*
3 *@@sourcefile stringh.h:
4 * header file for stringh.c. See notes there.
5 *
6 * Note: Version numbering in this file relates to XWorkplace version
7 * numbering.
8 *
9 *@@include #define INCL_DOSDATETIME
10 *@@include #include <os2.h>
11 *@@include #include "helpers\stringh.h"
12 */
13
14/*
15 * Copyright (C) 1997-2000 Ulrich M”ller.
16 * This file is part of the "XWorkplace helpers" source package.
17 * This is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published
19 * by the Free Software Foundation, in version 2 as it comes in the
20 * "COPYING" file of the XWorkplace main distribution.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 */
26
27#if __cplusplus
28extern "C" {
29#endif
30
31#ifndef STRINGH_HEADER_INCLUDED
32 #define STRINGH_HEADER_INCLUDED
33
34 #if defined(__DEBUG_MALLOC_ENABLED__) && !defined(DONT_REPLACE_STRINGH_MALLOC) // setup.h, helpers\memdebug.c
35 APIRET XWPENTRY strhStoreDebug(PSZ *ppszTarget,
36 PCSZ pcszSource,
37 PULONG pulLength,
38 const char *pcszSourceFile,
39 unsigned long ulLine,
40 const char *pcszFunction);
41 #define strhStore(a, b, c) strhStoreDebug((a), (b), (c), __FILE__, __LINE__, __FUNCTION__)
42 #else
43 APIRET XWPENTRY strhStore(PSZ *ppszTarget, PCSZ pcszSource, PULONG pulLength);
44 #endif
45
46 PSZ XWPENTRY strhcpy(PSZ string1, const char *string2);
47
48 #if defined(__DEBUG_MALLOC_ENABLED__) && !defined(DONT_REPLACE_STRINGH_MALLOC) // setup.h, helpers\memdebug.c
49 PSZ XWPENTRY strhdupDebug(const char *pcszSource,
50 unsigned long *pulLength,
51 const char *pcszSourceFile,
52 unsigned long ulLine,
53 const char *pcszFunction);
54 #define strhdup(a, pul) strhdupDebug((a), (pul), __FILE__, __LINE__, __FUNCTION__)
55 #else
56 PSZ XWPENTRY strhdup(const char *pcszSource,
57 unsigned long *pulLength);
58 #endif
59
60 int XWPENTRY strhcmp(const char *p1, const char *p2);
61
62 int XWPENTRY strhicmp(const char *p1, const char *p2);
63
64 PSZ XWPENTRY strhistr(const char *string1, const char *string2);
65
66 ULONG XWPENTRY strhncpy0(PSZ pszTarget,
67 const char *pszSource,
68 ULONG cbSource);
69
70 ULONG XWPENTRY strhSize(PCSZ pcsz);
71
72 ULONG XWPENTRY strhCount(const char *pszSearch, CHAR c);
73
74 BOOL XWPENTRY strhIsDecimal(PSZ psz);
75
76 #if defined(__DEBUG_MALLOC_ENABLED__) && !defined(DONT_REPLACE_STRINGH_MALLOC) // setup.h, helpers\memdebug.c
77 PSZ XWPENTRY strhSubstrDebug(const char *pBegin, // in: first char
78 const char *pEnd, // in: last char (not included)
79 const char *pcszSourceFile,
80 unsigned long ulLine,
81 const char *pcszFunction);
82 #define strhSubstr(a, b) strhSubstrDebug((a), (b), __FILE__, __LINE__, __FUNCTION__)
83 #else
84 PSZ XWPENTRY strhSubstr(const char *pBegin, const char *pEnd);
85 #endif
86
87 PSZ XWPENTRY strhExtract(PSZ pszBuf,
88 CHAR cOpen,
89 CHAR cClose,
90 PSZ *ppEnd);
91
92 PSZ XWPENTRY strhQuote(PSZ pszBuf,
93 CHAR cQuote,
94 PSZ *ppEnd);
95
96 ULONG XWPENTRY strhStrip(PSZ psz);
97
98 PSZ XWPENTRY strhins(const char *pcszBuffer,
99 ULONG ulInsertOfs,
100 const char *pcszInsert);
101
102 ULONG XWPENTRY strhFindReplace(PSZ *ppszBuf,
103 PULONG pulOfs,
104 const char *pcszSearch,
105 const char *pcszReplace);
106
107 ULONG XWPENTRY strhWords(PSZ psz);
108
109 #define STRH_BEGIN_CHARS "\x0d\x0a "
110 #define STRH_END_CHARS "\x0d\x0a /-"
111
112 BOOL XWPENTRY strhGetWord(PSZ *ppszStart,
113 const char *pLimit,
114 const char *pcszBeginChars,
115 const char *pcszEndChars, // = "\x0d\x0a /-";
116 PSZ *ppszEnd);
117
118 BOOL XWPENTRY strhIsWord(const char *pcszBuf,
119 const char *p,
120 ULONG cbSearch,
121 const char *pcszBeginChars,
122 const char *pcszEndChars);
123
124 PSZ XWPENTRY strhFindWord(const char *pszBuf,
125 const char *pszSearch,
126 const char *pcszBeginChars,
127 const char *pcszEndChars);
128
129 PSZ XWPENTRY strhFindEOL(const char *pcszSearchIn, ULONG *pulOffset);
130
131 PSZ XWPENTRY strhFindNextLine(PSZ pszSearchIn, PULONG pulOffset);
132
133 BOOL XWPENTRY strhBeautifyTitle(PSZ psz);
134
135 PSZ XWPENTRY strhFindAttribValue(const char *pszSearchIn, const char *pszAttrib);
136
137 PSZ XWPENTRY strhGetNumAttribValue(const char *pszSearchIn,
138 const char *pszTag,
139 PLONG pl);
140
141 PSZ XWPENTRY strhGetTextAttr(const char *pszSearchIn, const char *pszTag, PULONG pulOffset);
142
143 PSZ XWPENTRY strhFindEndOfTag(const char *pszBeginOfTag);
144
145 ULONG XWPENTRY strhGetBlock(const char *pszSearchIn,
146 PULONG pulSearchOffset,
147 const char *pszTag,
148 PSZ *ppszBlock,
149 PSZ *ppszAttribs,
150 PULONG pulOfsBeginTag,
151 PULONG pulOfsBeginBlock);
152
153 /* ******************************************************************
154 *
155 * Miscellaneous
156 *
157 ********************************************************************/
158
159 VOID XWPENTRY strhArrayAppend(PSZ *ppszRoot,
160 const char *pcszNew,
161 ULONG cbNew,
162 PULONG pcbRoot);
163
164 PSZ XWPENTRY strhCreateDump(PBYTE pb,
165 ULONG ulSize,
166 ULONG ulIndent);
167
168 /* ******************************************************************
169 *
170 * Fast string searches
171 *
172 ********************************************************************/
173
174 void* XWPENTRY strhmemfind(const void *in_block,
175 size_t block_size,
176 const void *in_pattern,
177 size_t pattern_size,
178 size_t *shift,
179 BOOL *repeat_find);
180
181 char* XWPENTRY strhtxtfind (const char *string,
182 const char *pattern);
183
184#endif
185
186#if __cplusplus
187}
188#endif
189
Note: See TracBrowser for help on using the repository browser.