diff options
| author | Sam Varshavchik | 2013-08-19 16:39:41 -0400 | 
|---|---|---|
| committer | Sam Varshavchik | 2013-08-25 14:43:51 -0400 | 
| commit | 9c45d9ad13fdf439d44d7443ae75da15ea0223ed (patch) | |
| tree | 7a81a04cb51efb078ee350859a64be2ebc6b8813 /sqwebmail/buf.h | |
| parent | a9520698b770168d1f33d6301463bb70a19655ec (diff) | |
| download | courier-libs-9c45d9ad13fdf439d44d7443ae75da15ea0223ed.tar.bz2 | |
Initial checkin
Imported from subversion report, converted to git. Updated all paths in
scripts and makefiles, reflecting the new directory hierarchy.
Diffstat (limited to 'sqwebmail/buf.h')
| -rw-r--r-- | sqwebmail/buf.h | 42 | 
1 files changed, 42 insertions, 0 deletions
| diff --git a/sqwebmail/buf.h b/sqwebmail/buf.h new file mode 100644 index 0000000..81317cb --- /dev/null +++ b/sqwebmail/buf.h @@ -0,0 +1,42 @@ +/* +*/ +#ifndef	buf_h +#define	buf_h +/* +** Copyright 1998 - 1999 Double Precision, Inc.  See COPYING for +** distribution information. +*/ + + + + /* Oh, to hell with it, I have to write this... */ + +#if	HAVE_CONFIG_H +#include	"config.h" +#endif + +#if	HAVE_UNISTD_H +#include	<unistd.h> +#endif + +#include	<stdlib.h> +#include	<stdio.h> + +struct buf { +	char *ptr; +	size_t size, cnt; +	}; + +#define	buf_init(p)	( (p)->ptr=0, (p)->size=0, (p)->cnt=0) +#define	buf_free(p)	do { if ( (p)->ptr) free ((p)->ptr); buf_init(p);} while (0) + +void	buf_cpy(struct buf *, const char *); +void	buf_cpyn(struct buf *, const char *, size_t); +void	buf_cat(struct buf *, const char *); +void	buf_catn(struct buf *, const char *, size_t); +void	buf_memcpy(struct buf *, const char *, size_t); +void	buf_memcat(struct buf *, const char *, size_t); +void	buf_trimleft(struct buf *, size_t); +void	buf_append(struct buf *, char c); + +#endif | 
