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

Last change on this file since 115 was 115, checked in by umoeller, 24 years ago

More updates.

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