text.c
上传用户:shmaik
上传日期:2014-06-01
资源大小:45093k
文件大小:10k
- static char rcsid[] = "$Id: H:/drh/idioms/book/RCS/text.doc,v 1.10 1996/06/26 23:02:01 drh Exp $";
- #include <string.h>
- #include <limits.h>
- #include "assert.h"
- #include "fmt.h"
- #include "text.h"
- #include "mem.h"
- #define T Text_T
- #define idx(i, len) ((i) <= 0 ? (i) + (len) : (i) - 1)
- #define isatend(s, n) ((s).str+(s).len == current->avail
- && current->avail + (n) <= current->limit)
- #define equal(s, i, t)
- (memcmp(&(s).str[i], (t).str, (t).len) == 0)
- struct Text_save_T {
- struct chunk *current;
- char *avail;
- };
- static char cset[] =
- "