source: trunk/include/helpers/xstring.h@ 14

Last change on this file since 14 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: 3.5 KB
Line 
1
2/*
3 *@@sourcefile xstring.h:
4 * header file for xstring.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 "xstring.h"
12 */
13
14/*
15 * Copyright (C) 1999-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 XSTRING_HEADER_INCLUDED
32 #define XSTRING_HEADER_INCLUDED
33
34 #ifndef XWPENTRY
35 #error You must define XWPENTRY to contain the standard linkage for the XWPHelpers.
36 #endif
37
38 /*
39 *@@ XSTRING:
40 *
41 *@@added V0.9.6 (2000-11-01) [umoeller]
42 */
43
44 typedef struct _XSTRING
45 {
46 PSZ psz; // ptr to string or NULL
47 ULONG ulLength; // length of *psz
48 ULONG cbAllocated; // memory allocated in *psz
49 // (>= ulLength + 1)
50 } XSTRING, *PXSTRING;
51
52 void XWPENTRY xstrInit(PXSTRING pxstr, ULONG ulPreAllocate);
53 typedef void XWPENTRY XSTRINIT(PXSTRING pxstr, ULONG ulPreAllocate);
54 typedef XSTRINIT *PXSTRINIT;
55
56 void XWPENTRY xstrInitSet(PXSTRING pxstr, PSZ pszNew);
57
58 void XWPENTRY xstrInitCopy(PXSTRING pxstr, const char *pcszSource);
59
60 void XWPENTRY xstrClear(PXSTRING pxstr);
61 typedef void XWPENTRY XSTRCLEAR(PXSTRING pxstr);
62 typedef XSTRCLEAR *PXSTRCLEAR;
63
64 PXSTRING XWPENTRY xstrCreate(ULONG ulPreAllocate);
65
66 VOID XWPENTRY xstrFree(PXSTRING pxstr);
67
68 ULONG XWPENTRY xstrset(PXSTRING pxstr, PSZ pszNew);
69
70 ULONG XWPENTRY xstrcpy(PXSTRING pxstr, const char *pcszSource);
71
72 ULONG XWPENTRY xstrcat(PXSTRING pxstr, const char *pcszSource);
73 typedef ULONG XWPENTRY XSTRCAT(PXSTRING pxstr, const char *pcszSource);
74 typedef XSTRCAT *PXSTRCAT;
75
76 /*
77 *@@ xstrIsString:
78 * returns TRUE if psz contains something.
79 *
80 *@@added V0.9.6 (2000-10-16) [umoeller]
81 */
82
83 #define xstrIsString(psz) ( (psz != 0) && (*(psz) != 0) )
84
85 PSZ XWPENTRY xstrFindWord(const XSTRING *pxstr,
86 ULONG ulOfs,
87 const XSTRING *pstrFind,
88 size_t *pShiftTable,
89 PBOOL pfRepeatFind,
90 const char *pcszBeginChars,
91 const char *pcszEndChars);
92
93 ULONG XWPENTRY xstrrpl(PXSTRING pxstr,
94 PULONG pulOfs,
95 const XSTRING *pstrSearch,
96 const XSTRING *pstrReplace,
97 size_t *pShiftTable,
98 PBOOL pfRepeatFind);
99
100 ULONG XWPENTRY xstrcrpl(PXSTRING pxstr,
101 PULONG pulOfs,
102 const char *pcszSearch,
103 const char *pcszReplace);
104#endif
105
106#if __cplusplus
107}
108#endif
109
Note: See TracBrowser for help on using the repository browser.