source: branches/branch-1-0/include/helpers/stringh.h@ 429

Last change on this file since 429 was 306, checked in by pr, 20 years ago

1.0.5 update

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