| 1 |
/* @(#)dstring.h 17.1 (ESO-IPG) 01/25/02 17:26:04 */ |
| 2 |
/*--------------------------------------------------------------------- |
| 3 |
* $Date: 2003-06-04 14:49:18 $ $Revision: 1.1.1.1 $ |
| 4 |
*--------------------------------------------------------------------- |
| 5 |
* |
| 6 |
* |
| 7 |
* Copyright (c) 1990, Visual Edge Software Ltd. |
| 8 |
* |
| 9 |
* ALL RIGHTS RESERVED. Permission to use, copy, modify, and |
| 10 |
* distribute this software and its documentation for any purpose |
| 11 |
* and without fee is hereby granted, provided that the above |
| 12 |
* copyright notice appear in all copies and that both that |
| 13 |
* copyright notice and this permission notice appear in supporting |
| 14 |
* documentation, and that the name of Visual Edge Software not be |
| 15 |
* used in advertising or publicity pertaining to distribution of |
| 16 |
* the software without specific, written prior permission. The year |
| 17 |
* included in the notice is the year of the creation of the work. |
| 18 |
*-------------------------------------------------------------------*/ |
| 19 |
|
| 20 |
#ifndef _DSTRING_INCLUDED |
| 21 |
#define _DSTRING_INCLUDED |
| 22 |
|
| 23 |
#include "uxproto.h" |
| 24 |
|
| 25 |
#ifdef __cplusplus |
| 26 |
extern "C" { |
| 27 |
#endif /* __cplusplus */ |
| 28 |
|
| 29 |
|
| 30 |
typedef struct |
| 31 |
{ |
| 32 |
char *str; /* Character storage */ |
| 33 |
int size; /* Total bytes of storage */ |
| 34 |
int len; /* Strlen of current content */ |
| 35 |
} dstring; |
| 36 |
|
| 37 |
|
| 38 |
/*** private calls ***/ |
| 39 |
|
| 40 |
extern dstring UxDcreate UXPROTO(( char *str )); |
| 41 |
extern void UxFree_dstring UXPROTO(( dstring *ds )); |
| 42 |
extern void UxAppend_to_dstring UXPROTO(( dstring *s, char *dat )); |
| 43 |
|
| 44 |
/*** public declarations ***/ |
| 45 |
|
| 46 |
extern dstring UxDefaultDstring; |
| 47 |
|
| 48 |
#define UxEmptyDstring {NULL, 0, 0} |
| 49 |
|
| 50 |
#define dappend(s, dat) (UxAppend_to_dstring(&(s), dat)) |
| 51 |
#define dconcat(s, ds) (UxAppend_dstring(&(s), ds)) |
| 52 |
#define dfree(s) (UxFree_dstring(&(s))) |
| 53 |
#define dgetstr(s) ((s).str) |
| 54 |
#define dnstr(s) ((s).str ? (s).str : "") |
| 55 |
#define dlen(s) ((s).len) |
| 56 |
#define dcopy(ds) (dcreate(dgetstr(ds))) |
| 57 |
#define dcreate(s) (UxDcreate(s)) |
| 58 |
|
| 59 |
#ifdef __cplusplus |
| 60 |
} /* Close scope of 'extern "C"' declaration which encloses file. */ |
| 61 |
#endif /* __cplusplus */ |
| 62 |
|
| 63 |
|
| 64 |
#endif /* _DSTRING_INCLUDED */ |