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

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

Sources as of 1.0.1.

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 8.1 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 APIRET XWPENTRY strhCopyBuf(PSZ pszTarget,
49 PCSZ pcszSource,
50 ULONG cbTarget);
51
52 #if defined(__DEBUG_MALLOC_ENABLED__) && !defined(DONT_REPLACE_STRINGH_MALLOC) // setup.h, helpers\memdebug.c
53 PSZ XWPENTRY strhdupDebug(const char *pcszSource,
54 unsigned long *pulLength,
55 const char *pcszSourceFile,
56 unsigned long ulLine,
57 const char *pcszFunction);
58 #define strhdup(a, pul) strhdupDebug((a), (pul), __FILE__, __LINE__, __FUNCTION__)
59 #else
60 PSZ XWPENTRY strhdup(const char *pcszSource,
61 unsigned long *pulLength);
62 #endif
63
64 int XWPENTRY strhcmp(const char *p1, const char *p2);
65
66 int XWPENTRY strhicmp(const char *p1, const char *p2);
67
68 PSZ XWPENTRY strhistr(const char *string1, const char *string2);
69
70 ULONG XWPENTRY strhncpy0(PSZ pszTarget,
71 const char *pszSource,
72 ULONG cbSource);
73
74 size_t XWPENTRY strlcpy(char *dst,
75 const char *src,
76 size_t siz);
77
78 size_t strlcat(char *dst,
79 const char *src,
80 size_t siz);
81
82 ULONG XWPENTRY strhlen(PCSZ pcsz);
83
84 ULONG XWPENTRY strhSize(PCSZ pcsz);
85
86 ULONG XWPENTRY strhCount(const char *pszSearch, CHAR c);
87
88 BOOL XWPENTRY strhIsDecimal(PSZ psz);
89
90 #if defined(__DEBUG_MALLOC_ENABLED__) && !defined(DONT_REPLACE_STRINGH_MALLOC) // setup.h, helpers\memdebug.c
91 PSZ XWPENTRY strhSubstrDebug(const char *pBegin, // in: first char
92 const char *pEnd, // in: last char (not included)
93 const char *pcszSourceFile,
94 unsigned long ulLine,
95 const char *pcszFunction);
96 #define strhSubstr(a, b) strhSubstrDebug((a), (b), __FILE__, __LINE__, __FUNCTION__)
97 #else
98 PSZ XWPENTRY strhSubstr(const char *pBegin, const char *pEnd);
99 #endif
100
101 PSZ XWPENTRY strhExtract(PCSZ pszBuf,
102 CHAR cOpen,
103 CHAR cClose,
104 PCSZ *ppEnd);
105
106 PSZ XWPENTRY strhQuote(PSZ pszBuf,
107 CHAR cQuote,
108 PSZ *ppEnd);
109
110 ULONG XWPENTRY strhStrip(PSZ psz);
111
112 PSZ XWPENTRY strhins(const char *pcszBuffer,
113 ULONG ulInsertOfs,
114 const char *pcszInsert);
115
116 ULONG XWPENTRY strhFindReplace(PSZ *ppszBuf,
117 PULONG pulOfs,
118 const char *pcszSearch,
119 const char *pcszReplace);
120
121 ULONG XWPENTRY strhWords(PSZ psz);
122
123 #define STRH_BEGIN_CHARS "\x0d\x0a "
124 #define STRH_END_CHARS "\x0d\x0a /-"
125
126 BOOL XWPENTRY strhGetWord(PSZ *ppszStart,
127 const char *pLimit,
128 const char *pcszBeginChars,
129 const char *pcszEndChars, // = "\x0d\x0a /-";
130 PSZ *ppszEnd);
131
132 BOOL XWPENTRY strhIsWord(const char *pcszBuf,
133 const char *p,
134 ULONG cbSearch,
135 const char *pcszBeginChars,
136 const char *pcszEndChars);
137
138 PSZ XWPENTRY strhFindWord(const char *pszBuf,
139 const char *pszSearch,
140 const char *pcszBeginChars,
141 const char *pcszEndChars);
142
143 PSZ XWPENTRY strhFindEOL(const char *pcszSearchIn, ULONG *pulOffset);
144
145 PSZ XWPENTRY strhFindNextLine(PSZ pszSearchIn, PULONG pulOffset);
146
147 ULONG XWPENTRY strhBeautifyTitle(PSZ psz);
148 typedef ULONG XWPENTRY STRHBEAUTIFYTITLE(PSZ psz);
149 typedef STRHBEAUTIFYTITLE *PSTRHBEAUTIFYTITLE;
150
151 ULONG strhBeautifyTitle2(PSZ pszTarget,
152 PCSZ pcszSource);
153
154 BOOL XWPENTRY strhKillChar(PSZ psz,
155 CHAR c,
156 PULONG pulLength);
157
158 PSZ XWPENTRY strhFindAttribValue(const char *pszSearchIn, const char *pszAttrib);
159
160 PSZ XWPENTRY strhGetNumAttribValue(const char *pszSearchIn,
161 const char *pszTag,
162 PLONG pl);
163
164 PSZ XWPENTRY strhGetTextAttr(const char *pszSearchIn, const char *pszTag, PULONG pulOffset);
165
166 PSZ XWPENTRY strhFindEndOfTag(const char *pszBeginOfTag);
167
168 ULONG XWPENTRY strhGetBlock(const char *pszSearchIn,
169 PULONG pulSearchOffset,
170 const char *pszTag,
171 PSZ *ppszBlock,
172 PSZ *ppszAttribs,
173 PULONG pulOfsBeginTag,
174 PULONG pulOfsBeginBlock);
175
176 /* ******************************************************************
177 *
178 * Miscellaneous
179 *
180 ********************************************************************/
181
182 VOID XWPENTRY strhArrayAppend(PSZ *ppszRoot,
183 const char *pcszNew,
184 ULONG cbNew,
185 PULONG pcbRoot);
186
187 PSZ XWPENTRY strhCreateDump(PBYTE pb,
188 ULONG ulSize,
189 ULONG ulIndent);
190
191 /* ******************************************************************
192 *
193 * Fast string searches
194 *
195 ********************************************************************/
196
197 void* XWPENTRY strhmemfind(const void *in_block,
198 size_t block_size,
199 const void *in_pattern,
200 size_t pattern_size,
201 size_t *shift,
202 BOOL *repeat_find);
203
204 char* XWPENTRY strhtxtfind (const char *string,
205 const char *pattern);
206
207#endif
208
209#if __cplusplus
210}
211#endif
212
Note: See TracBrowser for help on using the repository browser.