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

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

Updates for V0.9.6.

  • 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 13 2000-11-23 18:36:41Z 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 source package.
19 * XWorkplace 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 strhThousandsULong(PSZ pszTarget, ULONG ul, CHAR cThousands);
73
74 PSZ strhThousandsDouble(PSZ pszTarget, double dbl, CHAR cThousands);
75
76 PSZ strhVariableDouble(PSZ pszTarget, double dbl, PSZ pszUnits,
77 CHAR cThousands);
78
79 VOID strhFileDate(PSZ pszBuf,
80 FDATE *pfDate,
81 ULONG ulDateFormat,
82 CHAR cDateSep);
83
84 VOID strhFileTime(PSZ pszBuf,
85 FTIME *pfTime,
86 ULONG ulTimeFormat,
87 CHAR cTimeSep);
88
89 VOID strhDateTime(PSZ pszDate,
90 PSZ pszTime,
91 DATETIME *pDateTime,
92 ULONG ulDateFormat,
93 CHAR cDateSep,
94 ULONG ulTimeFormat,
95 CHAR cTimeSep);
96
97 #define STRH_BEGIN_CHARS "\x0d\x0a "
98 #define STRH_END_CHARS "\x0d\x0a /-"
99
100 BOOL strhGetWord(PSZ *ppszStart,
101 const char *pLimit,
102 const char *pcszBeginChars,
103 const char *pcszEndChars, // = "\x0d\x0a /-";
104 PSZ *ppszEnd);
105
106 BOOL strhIsWord(const char *pcszBuf,
107 const char *p,
108 ULONG cbSearch,
109 const char *pcszBeginChars,
110 const char *pcszEndChars);
111
112 PSZ strhFindWord(const char *pszBuf,
113 const char *pszSearch,
114 const char *pcszBeginChars,
115 const char *pcszEndChars);
116
117 PSZ strhFindEOL(PSZ pszSearchIn, ULONG *pulOffset);
118
119 PSZ strhFindNextLine(PSZ pszSearchIn, PULONG pulOffset);
120
121 PSZ strhFindKey(const char *pcszSearchIn,
122 const char *pcszKey,
123 PBOOL pfIsAllUpperCase);
124
125 PSZ strhGetParameter(const char *pcszSearchIn,
126 const char *pcszKey,
127 PSZ pszCopyTo,
128 ULONG cbCopyTo);
129
130 PSZ strhSetParameter(PSZ* ppszBuf,
131 const char *pcszKey,
132 PSZ pszNewParam,
133 BOOL fRespectCase);
134
135 BOOL strhDeleteLine(PSZ pszSearchIn, PSZ pszKey);
136
137 BOOL strhBeautifyTitle(PSZ psz);
138
139 PSZ strhFindAttribValue(const char *pszSearchIn, const char *pszAttrib);
140
141 PSZ strhGetNumAttribValue(const char *pszSearchIn,
142 const char *pszTag,
143 PLONG pl);
144
145 PSZ strhGetTextAttr(const char *pszSearchIn, const char *pszTag, PULONG pulOffset);
146
147 PSZ strhFindEndOfTag(const char *pszBeginOfTag);
148
149 ULONG strhGetBlock(const char *pszSearchIn,
150 PULONG pulSearchOffset,
151 PSZ pszTag,
152 PSZ *ppszBlock,
153 PSZ *ppszAttribs,
154 PULONG pulOfsBeginTag,
155 PULONG pulOfsBeginBlock);
156
157 /* ******************************************************************
158 * *
159 * Miscellaneous *
160 * *
161 ********************************************************************/
162
163 VOID strhArrayAppend(PSZ *ppszRoot,
164 PSZ pszNew,
165 PULONG pcbRoot);
166
167 PSZ strhCreateDump(PBYTE pb,
168 ULONG ulSize,
169 ULONG ulIndent);
170
171 /* ******************************************************************
172 * *
173 * Wildcard matching *
174 * *
175 ********************************************************************/
176
177 #define FNM_MATCH 0
178 #define FNM_NOMATCH 1
179 #define FNM_ERR 2
180
181 #define FNM_NOESCAPE 16
182 #define FNM_PATHNAME 32
183 #define FNM_PERIOD 64
184
185 #define _FNM_STYLE_MASK 15
186
187 #define _FNM_POSIX 0
188 #define _FNM_OS2 1
189 #define _FNM_DOS 2
190
191 #define _FNM_IGNORECASE 128
192 #define _FNM_PATHPREFIX 256
193
194 BOOL strhMatchOS2(const unsigned char* pcszMask, const unsigned char* pcszName);
195
196 /* ******************************************************************
197 * *
198 * Fast string searches *
199 * *
200 ********************************************************************/
201
202 void* strhmemfind(const void *in_block,
203 size_t block_size,
204 const void *in_pattern,
205 size_t pattern_size,
206 size_t *shift,
207 BOOL *repeat_find);
208
209 char* strhtxtfind (const char *string,
210 const char *pattern);
211
212#endif
213
214#if __cplusplus
215}
216#endif
217
Note: See TracBrowser for help on using the repository browser.