~ubuntu-branches/ubuntu/quantal/psicode/quantal

« back to all changes in this revision

Viewing changes to src/lib/libciomr/sread.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2006-09-10 14:01:33 UTC
  • Revision ID: james.westby@ubuntu.com-20060910140133-ib2j86trekykfsfv
Tags: upstream-3.2.3
ImportĀ upstreamĀ versionĀ 3.2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/* $Log: sread.c,v $
 
3
/* Revision 1.1.1.1  2000/02/04 22:53:23  evaleev
 
4
/* Started PSI 3 repository
 
5
/*
 
6
/* Revision 2.6  1999/11/01 20:11:00  evaleev
 
7
/* Added explicit extern declarations of functions within the library.
 
8
/*
 
9
/* Revision 2.5  1997/09/12 13:53:05  crawdad
 
10
/* Changing marco name from ULL to PSI_FPTR.
 
11
/*
 
12
 * Revision 2.4  1997/08/25  21:50:10  crawdad
 
13
 * Making changes for extension of PSI file size limit.
 
14
 *
 
15
 * Revision 2.3  1997/06/23  12:26:01  crawdad
 
16
 * Multiple changes to libciomr: Moved "param.h" to "iomrparam.h" to avoid
 
17
 *     conflicts with similarly named system file under linux.  Corrected type
 
18
 *    casting in rread(), rwrit(), sread(), and swrit() functions.  Corrected
 
19
 *     unclosed tmpdisks.dat file in sequential.c.  Corrected block_matrix() to
 
20
 *    avoid malloc'ing zero-length arrays.
 
21
 *
 
22
 * -Daniel
 
23
 *
 
24
 * Revision 2.2  1995/04/01  20:53:07  fermann
 
25
 * changed bytewise file pointers such as first, last and length to long
 
26
 * unsigned ints in order to handle up to 4 gigabyte tmp files (striped into
 
27
 * individual pieces of less than 2 gigabytes).  added functions li2sec and
 
28
 * sec2li for where they are needed.
 
29
 *
 
30
 * Revision 2.1  1991/06/15  18:30:09  seidl
 
31
 * *** empty log message ***
 
32
 * */
 
33
 
 
34
static char *rcsid = "$Id: sread.c,v 1.1.1.1 2000/02/04 22:53:23 evaleev Exp $";
 
35
 
 
36
#include "iomrparam.h"
 
37
#include "includes.h"
 
38
#include "pointers.h"
 
39
 
 
40
extern void wreadw(int, char *, int, PSI_FPTR, PSI_FPTR *);
 
41
 
 
42
/* reads nlen bytes from itape into array starting at current pointer */
 
43
/* location */
 
44
 
 
45
void sread(itape,array,nlen)
 
46
   int itape, nlen;
 
47
   char *array;
 
48
   {
 
49
      PSI_FPTR start, end;
 
50
 
 
51
      start=ptr.wptr[itape];
 
52
 
 
53
      wreadw(itape,(char *) array,nlen,start,&end);
 
54
      ptr.wptr[itape]=((ptr.wptr[itape]-1+4096)/4096)*4096;
 
55
   }