Lines Matching defs:base
776 unsigned char *base;
804 base = (void *)mmap(NULL, (size_t)histfsize, PROT_READ,
806 if (base == (unsigned char *)MAP_FAILED)
808 if (base[0] != HMAGIC1 || base[1] != HMAGIC2) {
809 munmap(caddr_cast(base), (size_t)histfsize);
813 lines = histload(hist_source, base + 2, (size_t)histfsize - 2);
814 munmap(caddr_cast(base), (size_t)histfsize);
913 histload(Source *s, unsigned char *base, size_t bytes)
920 if (!bytes || (cp = memchr(base, COMMAND, bytes)) == NULL)
922 /* advance base pointer past COMMAND byte */
923 bytes -= ++cp - base;
924 base = cp;
926 if (bytes < 5 || (cp = memchr(base + 4, '\0', bytes - 4)) == NULL)
929 lno = ((base[0] & 0xFF) << 24) | ((base[1] & 0xFF) << 16) |
930 ((base[2] & 0xFF) << 8) | (base[3] & 0xFF);
931 /* store away the found line (@base[4]) */
940 strdupx(*hp, (char *)(base + 4), APERM);
944 histsave(&lno, (char *)(base + 4), HIST_NOTE, false);
946 /* advance base pointer past NUL */
947 bytes -= ++cp - base;
948 base = cp;
966 unsigned char *base, *news;
985 base = (void *)mmap(NULL, (size_t)sizenow, PROT_READ,
987 if (base == (unsigned char *)MAP_FAILED)
989 news = base + (size_t)histfsize;
997 munmap(caddr_cast(base), (size_t)sizenow);