Lines Matching defs:wrec

93 static int wlog_rec_pack(struct wlog_rec *wrec, char *buf, int flag);
94 static int wlog_rec_unpack(struct wlog_rec *wrec, char *buf);
173 * bit in wrec cleared), but not completed, and then later update the
193 int wlog_record_write(struct wlog_file *wfile, struct wlog_rec *wrec,
202 * Otherwise, we overlay wrec at the file offset indicated and assume
207 reclen = wlog_rec_pack(wrec, wbuf, (offset < 0));
268 struct wlog_rec wrec;
377 wlog_rec_unpack(&wrec, albuf);
384 if ((rval = (*func) (&wrec, data)) == WLOG_STOP_SCAN) {
405 static int wlog_rec_pack(struct wlog_rec *wrec, char *buf, int flag)
412 wrecd->w_pid = (uint) wrec->w_pid;
413 wrecd->w_offset = (uint) wrec->w_offset;
414 wrecd->w_nbytes = (uint) wrec->w_nbytes;
415 wrecd->w_oflags = (uint) wrec->w_oflags;
416 wrecd->w_done = (uint) wrec->w_done;
417 wrecd->w_async = (uint) wrec->w_async;
419 wrecd->w_pathlen = (wrec->w_pathlen > 0) ? (uint) wrec->w_pathlen : 0;
420 wrecd->w_hostlen = (wrec->w_hostlen > 0) ? (uint) wrec->w_hostlen : 0;
422 (wrec->w_patternlen > 0) ? (uint) wrec->w_patternlen : 0;
436 memcpy(file, wrec->w_path, wrecd->w_pathlen);
439 memcpy(host, wrec->w_host, wrecd->w_hostlen);
442 memcpy(pattern, wrec->w_pattern, wrecd->w_patternlen);
452 static int wlog_rec_unpack(struct wlog_rec *wrec, char *buf)
457 memset((char *)wrec, 0x00, sizeof(struct wlog_rec));
460 wrec->w_pid = wrecd->w_pid;
461 wrec->w_offset = wrecd->w_offset;
462 wrec->w_nbytes = wrecd->w_nbytes;
463 wrec->w_oflags = wrecd->w_oflags;
464 wrec->w_hostlen = wrecd->w_hostlen;
465 wrec->w_pathlen = wrecd->w_pathlen;
466 wrec->w_patternlen = wrecd->w_patternlen;
467 wrec->w_done = wrecd->w_done;
468 wrec->w_async = wrecd->w_async;
470 if (wrec->w_pathlen > 0) {
472 memcpy(wrec->w_path, file, wrec->w_pathlen);
475 if (wrec->w_hostlen > 0) {
476 host = buf + sizeof(struct wlog_rec_disk) + wrec->w_pathlen;
477 memcpy(wrec->w_host, host, wrec->w_hostlen);
480 if (wrec->w_patternlen > 0) {
482 wrec->w_pathlen + wrec->w_hostlen;
483 memcpy(wrec->w_pattern, pattern, wrec->w_patternlen);