Changeset 12 for trunk/include


Ignore:
Timestamp:
Nov 4, 2000, 8:55:45 PM (25 years ago)
Author:
umoeller
Message:

Updated string helpers.

Location:
trunk/include/helpers
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/helpers/stringh.h

    r7 r12  
    5959    ULONG strhStrip(PSZ psz);
    6060
     61    PSZ strhins(const char *pcszBuffer,
     62                ULONG ulInsertOfs,
     63                const char *pcszInsert);
     64
     65    ULONG strhrpl(PSZ *ppszBuf,
     66                  ULONG ulOfs,
     67                  const char *pcszSearch,
     68                  const char *pcszReplace,
     69                  PULONG pulAfterOfs);
     70
    6171    ULONG strhWords(PSZ psz);
    6272
     
    101111    PSZ strhFindNextLine(PSZ pszSearchIn, PULONG pulOffset);
    102112
    103     PSZ strhFindKey(PSZ pszSearchIn,
    104                     PSZ pszKey,
    105                     BOOL *pfIsAllUpperCase);
    106 
    107     PSZ strhGetParameter(PSZ pszSearchIn, PSZ pszKey, PSZ pszCopyTo, ULONG cbCopyTo);
    108 
    109     PSZ strhSetParameter(PSZ* ppszSearchIn,
    110                          PSZ pszKey,
     113    PSZ strhFindKey(const char *pcszSearchIn,
     114                    const char *pcszKey,
     115                    PBOOL pfIsAllUpperCase);
     116
     117    PSZ strhGetParameter(const char *pcszSearchIn,
     118                         const char *pcszKey,
     119                         PSZ pszCopyTo,
     120                         ULONG cbCopyTo);
     121
     122    PSZ strhSetParameter(PSZ* ppszBuf,
     123                         const char *pcszKey,
    111124                         PSZ pszNewParam,
    112125                         BOOL fRespectCase);
  • trunk/include/helpers/textview.h

    r7 r12  
    1919 *      GNU General Public License for more details.
    2020 *
    21  *@@include #define INCL_SPL    // for printing functions
     21 *@@include #define INCL_SPL        // for printing functions
    2222 *@@include #include <os2.h>
    23  *@@include #include "linklist.h" // for device-independent functions
     23 *@@include #include "linklist.h"   // for device-independent functions
     24 *@@include #include "xstring.h"    // for device-independent functions
    2425 *@@include #include "textview.h"
    2526 */
     
    329330
    330331    #ifdef LINKLIST_HEADER_INCLUDED
     332    #ifdef XSTRING_HEADER_INCLUDED
    331333
    332334        /*
     
    340342        {
    341343            // input to txvFormatText
    342             PSZ         pszViewText;    // original view text
     344            XSTRING     strViewText;    // original view text
    343345                                        // from WinSetWindowText
    344346
     
    371373                           PRECTL prclView,
    372374                           BOOL fFullRecalc);
    373 
     375    #endif
    374376    #endif
    375377
  • trunk/include/helpers/xstring.h

    r7 r12  
    3333
    3434    /*
    35      *@@ XSTR:
    36      *      string type for the strhx* functions.
    37      *      That's a simple pointer to a PSZ.
     35     *@@ XSTRING:
     36     *
     37     *@@added V0.9.6 (2000-11-01) [umoeller]
    3838     */
    3939
    40     typedef PSZ* XSTR;
     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);
    4171
    4272    /*
     
    4979    #define xstrIsString(psz) ( (psz != 0) && (*(psz) != 0) )
    5080
    51     ULONG xstrcpy(XSTR ppszBuf,
    52                   const char *pszString);
     81    ULONG xstrrpl(PXSTRING pxstr,
     82                  ULONG ulOfs,
     83                  const XSTRING *pstrSearch,
     84                  const XSTRING *pstrReplace,
     85                  PULONG pulAfterOfs);
    5386
    54     #ifdef __XWPMEMDEBUG__ // setup.h, helpers\memdebug.c
    55         ULONG xstrcatDebug(XSTR ppszBuf,
    56                            const char *pszString,
    57                            const char *file,
    58                            unsigned long line,
    59                            const char *function);
    60         #define xstrcat(a, b) xstrcatDebug((a), (b), __FILE__, __LINE__, __FUNCTION__)
    61     #else
    62         ULONG xstrcat(XSTR ppszBuf,
    63                        const char *pszString);
    64     #endif
    65 
    66     #ifdef __XWPMEMDEBUG__ // setup.h, helpers\memdebug.c
    67         ULONG xstrrplDebug(PSZ *ppszBuf,
    68                            ULONG ulOfs,
    69                            const char *pszSearch,
    70                            const char *pszReplace,
    71                            PULONG pulAfterOfs,
    72                            const char *file,
    73                            unsigned long line,
    74                            const char *function);
    75         #define xstrrpl(a, b, c, d, e) xstrrplDebug((a), (b), (c), (d), (e), __FILE__, __LINE__, __FUNCTION__)
    76     #else
    77         ULONG xstrrpl(PSZ *ppszBuf,
    78                       ULONG ulOfs,
    79                       const char *pszSearch,
    80                       const char *pszReplace,
    81                       PULONG pulAfterOfs);
    82     #endif
    83 
    84     PSZ xstrins(PSZ pszBuffer,
    85                  ULONG ulInsertOfs,
    86                  const char *pszInsert);
    87 
     87    ULONG xstrcrpl(PXSTRING pxstr,
     88                   ULONG ulOfs,
     89                   const char *pcszSearch,
     90                   const char *pcszReplace,
     91                   PULONG pulAfterOfs);
    8892#endif
    8993
Note: See TracChangeset for help on using the changeset viewer.