* reordered a little bit
[mascara-docs.git] / i86 / elks / elkscmd / levee / blockio.c
blob9c53512dd347301a7953d17d5fd6292ade4d8664
1 /*
2 * LEVEE, or Captain Video; A vi clone
4 * Copyright (c) 1982-1997 David L Parsons
5 * All rights reserved.
7 * Redistribution and use in source and binary forms are permitted
8 * provided that the above copyright notice and this paragraph are
9 * duplicated in all such forms and that any documentation,
10 * advertising materials, and other materials related to such
11 * distribution and use acknowledge that the software was developed
12 * by David L Parsons (orc@pell.chi.il.us). My name may not be used
13 * to endorse or promote products derived from this software without
14 * specific prior written permission. THIS SOFTWARE IS PROVIDED
15 * AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
16 * WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND
17 * FITNESS FOR A PARTICULAR PURPOSE.
19 #include "levee.h"
20 #include "extern.h"
21 #include <stdio.h>
22 /* read in a file -- return TRUE -- read file
23 FALSE-- file too big
26 int PROC
27 addfile(f, start, endd, size)
28 FILE *f;
29 int start;
30 int endd, *size;
32 register int chunk;
34 chunk = read(fileno(f), core+start, (endd-start)-1);
36 *size = chunk;
37 return chunk < (endd-start)-1;
41 /* write out a file -- return TRUE if ok. */
43 bool PROC
44 putfile(f, start, endd)
45 register FILE *f;
46 register start, endd;
48 write(fileno(f), core+start, endd-start);