+
+}
+
+
+static inline char *window_ptr(struct map_struct *buf,int off,int len)
+{
+ static char *p=NULL;
+ static int p_len = 0;
+ static int p_off = 0;
+
+ if (off == 0) {
+ p_off = 0;
+ p_len = CHUNK_SIZE;
+ p = map_ptr(buf,p_off,p_len);
+ }
+
+ while (off+len > p_off+p_len) {
+ p_off += CHUNK_SIZE;
+ p_len = CHUNK_SIZE;
+ p = map_ptr(buf,p_off,p_len);
+ }
+
+ return(p + (off-p_off));