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

Last change on this file since 15 was 14, checked in by umoeller, 25 years ago

Major updates; timers, LVM, miscellaneous.

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 7.2 KB
Line 
1/* $Id: stringh.h 14 2000-12-09 19:19:42Z umoeller $ */
2
3
4/*
5 *@@sourcefile stringh.h:
6 * header file for stringh.c. See notes there.
7 *
8 * Note: Version numbering in this file relates to XWorkplace version
9 * numbering.
10 *
11 *@@include #define INCL_DOSDATETIME
12 *@@include #include <os2.h>
13 *@@include #include "stringh.h"
14 */
15
16/*
17 * Copyright (C) 1997-2000 Ulrich M”ller.
18 * This file is part of the "XWorkplace helpers" source package.
19 * This is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License as published
21 * by the Free Software Foundation, in version 2 as it comes in the
22 * "COPYING" file of the XWorkplace main distribution.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU General Public License for more details.
27 */
28
29#if __cplusplus
30extern "C" {
31#endif
32
33#ifndef STRINGH_HEADER_INCLUDED
34 #define STRINGH_HEADER_INCLUDED
35
36 PSZ strhdup(const char *pszSource);
37
38 PSZ strhistr(const char *string1, const char *string2);
39
40 ULONG strhncpy0(PSZ pszTarget,
41 const char *pszSource,
42 ULONG cbSource);
43
44 ULONG strhCount(const char *pszSearch, CHAR c);
45
46 BOOL strhIsDecimal(PSZ psz);
47
48 PSZ strhSubstr(const char *pBegin, const char *pEnd);
49
50 PSZ strhExtract(PSZ pszBuf,
51 CHAR cOpen,
52 CHAR cClose,
53 PSZ *ppEnd);
54
55 PSZ strhQuote(PSZ pszBuf,
56 CHAR cQuote,
57 PSZ *ppEnd);
58
59 ULONG strhStrip(PSZ psz);
60
61 PSZ strhins(const char *pcszBuffer,
62 ULONG ulInsertOfs,
63 const char *pcszInsert);
64
65 ULONG strhrpl(PSZ *ppszBuf,
66 PULONG pulOfs,
67 const char *pcszSearch,
68 const char *pcszReplace);
69
70 ULONG strhWords(PSZ psz);
71
72 PSZ APIENTRY strhThousandsULong(PSZ pszTarget, ULONG ul, CHAR cThousands);
73 typedef PSZ APIENTRY STRHTHOUSANDSULONG(PSZ pszTarget, ULONG ul, CHAR cThousands);
74 typedef STRHTHOUSANDSULONG *PSTRHTHOUSANDSULONG;
75
76 PSZ strhThousandsDouble(PSZ pszTarget, double dbl, CHAR cThousands);
77
78 PSZ strhVariableDouble(PSZ pszTarget, double dbl, PSZ pszUnits,
79 CHAR cThousands);
80
81 VOID strhFileDate(PSZ pszBuf,
82 FDATE *pfDate,
83 ULONG ulDateFormat,
84 CHAR cDateSep);
85
86 VOID strhFileTime(PSZ pszBuf,
87 FTIME *pfTime,
88 ULONG ulTimeFormat,
89 CHAR cTimeSep);
90
91 VOID APIENTRY strhDateTime(PSZ pszDate,
92 PSZ pszTime,
93 DATETIME *pDateTime,
94 ULONG ulDateFormat,
95 CHAR cDateSep,
96 ULONG ulTimeFormat,
97 CHAR cTimeSep);
98 typedef VOID APIENTRY STRHDATETIME(PSZ pszDate,
99 PSZ pszTime,
100 DATETIME *pDateTime,
101 ULONG ulDateFormat,
102 CHAR cDateSep,
103 ULONG ulTimeFormat,
104 CHAR cTimeSep);
105 typedef STRHDATETIME *PSTRHDATETIME;
106
107 #define STRH_BEGIN_CHARS "\x0d\x0a "
108 #define STRH_END_CHARS "\x0d\x0a /-"
109
110 BOOL strhGetWord(PSZ *ppszStart,
111 const char *pLimit,
112 const char *pcszBeginChars,
113 const char *pcszEndChars, // = "\x0d\x0a /-";
114 PSZ *ppszEnd);
115
116 BOOL strhIsWord(const char *pcszBuf,
117 const char *p,
118 ULONG cbSearch,
119 const char *pcszBeginChars,
120 const char *pcszEndChars);
121
122 PSZ strhFindWord(const char *pszBuf,
123 const char *pszSearch,
124 const char *pcszBeginChars,
125 const char *pcszEndChars);
126
127 PSZ strhFindEOL(PSZ pszSearchIn, ULONG *pulOffset);
128
129 PSZ strhFindNextLine(PSZ pszSearchIn, PULONG pulOffset);
130
131 PSZ strhFindKey(const char *pcszSearchIn,
132 const char *pcszKey,
133 PBOOL pfIsAllUpperCase);
134
135 PSZ strhGetParameter(const char *pcszSearchIn,
136 const char *pcszKey,
137 PSZ pszCopyTo,
138 ULONG cbCopyTo);
139
140 PSZ strhSetParameter(PSZ* ppszBuf,
141 const char *pcszKey,
142 PSZ pszNewParam,
143 BOOL fRespectCase);
144
145 BOOL strhDeleteLine(PSZ pszSearchIn, PSZ pszKey);
146
147 BOOL strhBeautifyTitle(PSZ psz);
148
149 PSZ strhFindAttribValue(const char *pszSearchIn, const char *pszAttrib);
150
151 PSZ strhGetNumAttribValue(const char *pszSearchIn,
152 const char *pszTag,
153 PLONG pl);
154
155 PSZ strhGetTextAttr(const char *pszSearchIn, const char *pszTag, PULONG pulOffset);
156
157 PSZ strhFindEndOfTag(const char *pszBeginOfTag);
158
159 ULONG strhGetBlock(const char *pszSearchIn,
160 PULONG pulSearchOffset,
161 PSZ pszTag,
162 PSZ *ppszBlock,
163 PSZ *ppszAttribs,
164 PULONG pulOfsBeginTag,
165 PULONG pulOfsBeginBlock);
166
167 /* ******************************************************************
168 *
169 * Miscellaneous
170 *
171 ********************************************************************/
172
173 VOID strhArrayAppend(PSZ *ppszRoot,
174 const char *pcszNew,
175 PULONG pcbRoot);
176
177 PSZ strhCreateDump(PBYTE pb,
178 ULONG ulSize,
179 ULONG ulIndent);
180
181 /* ******************************************************************
182 *
183 * Wildcard matching
184 *
185 ********************************************************************/
186
187 #define FNM_MATCH 0
188 #define FNM_NOMATCH 1
189 #define FNM_ERR 2
190
191 #define FNM_NOESCAPE 16
192 #define FNM_PATHNAME 32
193 #define FNM_PERIOD 64
194
195 #define _FNM_STYLE_MASK 15
196
197 #define _FNM_POSIX 0
198 #define _FNM_OS2 1
199 #define _FNM_DOS 2
200
201 #define _FNM_IGNORECASE 128
202 #define _FNM_PATHPREFIX 256
203
204 BOOL strhMatchOS2(const unsigned char* pcszMask, const unsigned char* pcszName);
205
206 /* ******************************************************************
207 *
208 * Fast string searches
209 *
210 ********************************************************************/
211
212 void* strhmemfind(const void *in_block,
213 size_t block_size,
214 const void *in_pattern,
215 size_t pattern_size,
216 size_t *shift,
217 BOOL *repeat_find);
218
219 char* strhtxtfind (const char *string,
220 const char *pattern);
221
222#endif
223
224#if __cplusplus
225}
226#endif
227
Note: See TracBrowser for help on using the repository browser.