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 Mller.
|
---|
16 | * This file is part of the XWorkplace source package.
|
---|
17 | * XWorkplace 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
|
---|
28 | extern "C" {
|
---|
29 | #endif
|
---|
30 |
|
---|
31 | #ifndef XSTRING_HEADER_INCLUDED
|
---|
32 | #define XSTRING_HEADER_INCLUDED
|
---|
33 |
|
---|
34 | /*
|
---|
35 | *@@ XSTRING:
|
---|
36 | *
|
---|
37 | *@@added V0.9.6 (2000-11-01) [umoeller]
|
---|
38 | */
|
---|
39 |
|
---|
40 | typedef struct _XSTRING
|
---|
41 | {
|
---|
42 | PSZ psz; // ptr to string or NULL
|
---|
43 | ULONG ulLength; // length of *psz
|
---|
44 | ULONG cbAllocated; // memory allocated in *psz
|
---|
45 | // (>= ulLength + 1)
|
---|
46 | } XSTRING, *PXSTRING;
|
---|
47 |
|
---|
48 | void xstrInit(PXSTRING pxstr,
|
---|
49 | ULONG ulPreAllocate);
|
---|
50 |
|
---|
51 | void xstrInitSet(PXSTRING pxstr,
|
---|
52 | PSZ pszNew);
|
---|
53 |
|
---|
54 | void xstrInitCopy(PXSTRING pxstr,
|
---|
55 | const char *pcszSource);
|
---|
56 |
|
---|
57 | void xstrClear(PXSTRING pxstr);
|
---|
58 |
|
---|
59 | PXSTRING xstrCreate(ULONG ulPreAllocate);
|
---|
60 |
|
---|
61 | VOID xstrFree(PXSTRING pxstr);
|
---|
62 |
|
---|
63 | ULONG xstrset(PXSTRING pxstr,
|
---|
64 | PSZ pszNew);
|
---|
65 |
|
---|
66 | ULONG xstrcpy(PXSTRING pxstr,
|
---|
67 | const char *pcszSource);
|
---|
68 |
|
---|
69 | ULONG xstrcat(PXSTRING pxstr,
|
---|
70 | const char *pcszSource);
|
---|
71 |
|
---|
72 | /*
|
---|
73 | *@@ xstrIsString:
|
---|
74 | * returns TRUE if psz contains something.
|
---|
75 | *
|
---|
76 | *@@added V0.9.6 (2000-10-16) [umoeller]
|
---|
77 | */
|
---|
78 |
|
---|
79 | #define xstrIsString(psz) ( (psz != 0) && (*(psz) != 0) )
|
---|
80 |
|
---|
81 | ULONG xstrrpl(PXSTRING pxstr,
|
---|
82 | ULONG ulOfs,
|
---|
83 | const XSTRING *pstrSearch,
|
---|
84 | const XSTRING *pstrReplace,
|
---|
85 | PULONG pulAfterOfs);
|
---|
86 |
|
---|
87 | ULONG xstrcrpl(PXSTRING pxstr,
|
---|
88 | ULONG ulOfs,
|
---|
89 | const char *pcszSearch,
|
---|
90 | const char *pcszReplace,
|
---|
91 | PULONG pulAfterOfs);
|
---|
92 | #endif
|
---|
93 |
|
---|
94 | #if __cplusplus
|
---|
95 | }
|
---|
96 | #endif
|
---|
97 |
|
---|