~ubuntu-branches/ubuntu/raring/texlive-bin/raring

« back to all changes in this revision

Viewing changes to utils/pmx/pmx-2.6.18/libf2c/sue.c

  • Committer: Package Import Robot
  • Author(s): Norbert Preining
  • Date: 2012-05-30 11:02:05 UTC
  • mfrom: (4.1.20 sid)
  • Revision ID: package-import@ubuntu.com-20120530110205-9gb0n01ahjs4g15y
Tags: 2012.20120530-1
* new upstream snapshot (svn 26726)
  exporting kpse_cnf_get (Closes: #675109)
* cnf.h is again installed, don't install it via libkpathsea-dev.install
* patch handling:
  . removed: 41_maketexmf, 12_fix_epstopdf_invocation
    both included upstream or not needed anymore
  . new: set-e-fmtutil part of set-e-in-various-scripts that still 
    applies
  . disabled: 57_texconfig_papersizes_for_upstream,
    58_texconfig_papersizes_use_ucf, superseeded by 55_texconfig_stuff
  . disabled: set-e-in-various-scripts: split into set-e-fmtutil
    and a disabled part for texconfig

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "f2c.h"
 
2
#include "fio.h"
 
3
#ifdef __cplusplus
 
4
extern "C" {
 
5
#endif
 
6
extern uiolen f__reclen;
 
7
OFF_T f__recloc;
 
8
 
 
9
 int
 
10
#ifdef KR_headers
 
11
c_sue(a) cilist *a;
 
12
#else
 
13
c_sue(cilist *a)
 
14
#endif
 
15
{
 
16
        f__external=f__sequential=1;
 
17
        f__formatted=0;
 
18
        f__curunit = &f__units[a->ciunit];
 
19
        if(a->ciunit >= MXUNIT || a->ciunit < 0)
 
20
                err(a->cierr,101,"startio");
 
21
        f__elist=a;
 
22
        if(f__curunit->ufd==NULL && fk_open(SEQ,UNF,a->ciunit))
 
23
                err(a->cierr,114,"sue");
 
24
        f__cf=f__curunit->ufd;
 
25
        if(f__curunit->ufmt) err(a->cierr,103,"sue")
 
26
        if(!f__curunit->useek) err(a->cierr,103,"sue")
 
27
        return(0);
 
28
}
 
29
#ifdef KR_headers
 
30
integer s_rsue(a) cilist *a;
 
31
#else
 
32
integer s_rsue(cilist *a)
 
33
#endif
 
34
{
 
35
        int n;
 
36
        if(!f__init) f_init();
 
37
        f__reading=1;
 
38
        if(n=c_sue(a)) return(n);
 
39
        f__recpos=0;
 
40
        if(f__curunit->uwrt && f__nowreading(f__curunit))
 
41
                err(a->cierr, errno, "read start");
 
42
        if(fread((char *)&f__reclen,sizeof(uiolen),1,f__cf)
 
43
                != 1)
 
44
        {       if(feof(f__cf))
 
45
                {       f__curunit->uend = 1;
 
46
                        err(a->ciend, EOF, "start");
 
47
                }
 
48
                clearerr(f__cf);
 
49
                err(a->cierr, errno, "start");
 
50
        }
 
51
        return(0);
 
52
}
 
53
#ifdef KR_headers
 
54
integer s_wsue(a) cilist *a;
 
55
#else
 
56
integer s_wsue(cilist *a)
 
57
#endif
 
58
{
 
59
        int n;
 
60
        if(!f__init) f_init();
 
61
        if(n=c_sue(a)) return(n);
 
62
        f__reading=0;
 
63
        f__reclen=0;
 
64
        if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
 
65
                err(a->cierr, errno, "write start");
 
66
        f__recloc=FTELL(f__cf);
 
67
        FSEEK(f__cf,(OFF_T)sizeof(uiolen),SEEK_CUR);
 
68
        return(0);
 
69
}
 
70
integer e_wsue(Void)
 
71
{       OFF_T loc;
 
72
        fwrite((char *)&f__reclen,sizeof(uiolen),1,f__cf);
 
73
#ifdef ALWAYS_FLUSH
 
74
        if (fflush(f__cf))
 
75
                err(f__elist->cierr, errno, "write end");
 
76
#endif
 
77
        loc=FTELL(f__cf);
 
78
        FSEEK(f__cf,f__recloc,SEEK_SET);
 
79
        fwrite((char *)&f__reclen,sizeof(uiolen),1,f__cf);
 
80
        FSEEK(f__cf,loc,SEEK_SET);
 
81
        return(0);
 
82
}
 
83
integer e_rsue(Void)
 
84
{
 
85
        FSEEK(f__cf,(OFF_T)(f__reclen-f__recpos+sizeof(uiolen)),SEEK_CUR);
 
86
        return(0);
 
87
}
 
88
#ifdef __cplusplus
 
89
}
 
90
#endif