42 for (p = buf, n = 0; n < sz; n++, p++) {
43 if (
strchr (accept, *p) == NULL)
63 for (p = buf, n = 0; n < sz; n++, p++) {
64 if (
strchr (reject, *p) != NULL)
82 for (p = q = s; sz > 0; sz--, p++)
107 if (org == NULL || dst == NULL || strlen (org) == 0)
128 if (strncmp(p,
"\r\n", 2) == 0 || strncmp(p,
"\n\r", 2) == 0)
130 if (*p ==
'\r' || *p ==
'\n')
136 while ((i < szorg) && (*p !=
'\0') && (*p !=
'\r') && (*p !=
'\n')) {
143 strncpy (dst, org, i);
168 if (strncmp(p,
"\r\n", 2) == 0 || strncmp(p,
"\n\r", 2) == 0)
170 if (*p ==
'\r' || *p ==
'\n')
196 if (stat (fname, &fstat) == 0) {
200 if ((buf = (
char *) malloc (fsize + 1)) == NULL)
203 if ((fd = open (fname, O_RDONLY)) < 0) {
209 if ((fsize = read (fd, buf, fsize)) < 0) {
237 memset(out, 0, szout);
238 n = strcspn (in,
"\r\n");
239 if ((szout > 0) && (n > szout - 1))
241 strncpy (out, in, n);
275 if ((buf == NULL) || (st == NULL))
282 while ((sz > 0) && (*p !=
'\0'))
315 unsigned char *p = (
unsigned char *) buf;
321 if ((buf == NULL) || (size == 0) || (prob == NULL))
324 memset(prob, 0, 256 *
sizeof(*prob));
326 for (p = (
unsigned char *) buf, n = 0; (n < size) && (*p !=
'\0'); n++, p++) {
void zeKStatsReset(kstats_T *)
bool zeStrRegex(char *, char *, long *, long *, bool)
size_t zeStrRmNulls(char *, size_t)
char * buf_get_next_line(char *out, char *in, size_t szout)
long text_buf_histogram(char *buf, size_t size, long *prob)
void zeKStatsUpdate(kstats_T *, double)
int buf_get_line(char *dst, long szdst, char *org, long szorg)
size_t buf_clean_rc(char *s, size_t sz)
#define ZE_LogSysWarning(...)
long bufcspn(char *buf, long sz, char *reject)
#define ZE_LogMsgWarning(level,...)
long bufspn(char *buf, long sz, char *accept)
char * read_text_file(char *fname, size_t *sz)
bool text_word_length(char *buf, kstats_T *st, size_t size)