comparison stitch/srcio.c @ 0:5242703e91d3 tip

Initial checkin for AIM92 aimR8.2 (last updated May 1997).
author tomwalters
date Fri, 20 May 2011 15:19:45 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:5242703e91d3
1 /*
2 srcio.c
3 =======
4
5 stdio compatability routines for sources
6
7 */
8
9 #include "stitch.h"
10 #include "source.h"
11 #include "srcio.h"
12
13
14
15 /* Can be used for compatability with stdio FILE operations */
16
17 int sread( pointer, size, number, source )
18 char *pointer ;
19 unsigned size, number ;
20 Source source ;
21 {
22 ByteCount bytes = size * number ;
23
24 (void) FillSome( source, &bytes, pointer ) ;
25
26 return ( bytes / size ) ;
27 }
28
29 /* sseek() only works for positive, relative seeks i.e. data skiping seeks */
30
31 int sseek( source, offset, pointername )
32 Source source ;
33 long offset ;
34 int pointername ;
35 {
36 ByteCount bytes = -offset ;
37
38 if( offset > 0 && pointername == 1 )
39 (void) PullSome( source, &bytes ) ;
40
41 return ( 0 ) ;
42 }
43
44 int sclose( source )
45 Source source ;
46 {
47 ByteCount bytes = 0 ;
48
49 (void) PullSome( source, &bytes ) ;
50
51 return ( 0 ) ;
52 }