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

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

Tons of changes from the last weeks.

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