blob: dfcd82bbc26978498afceb906287362c47a4117b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
include <mach.h>
include <error.h>
include "gkt.h"
.help writeb
.nf ___________________________________________________________________________
WRITEB -- Write an NCAR metacode record. Always write a full record
regardless of the buffer length; any data beyond buflen is undefined.
If the buffer length is passed as zero, the metafile standard wants us to
write a full (zeroed) record and backspace over it, to signify end of
metafile if the physical metafile is subsequently closed. Instead of
writing the EOF record here, we leave that to the FIO close routine
for the graphics device.
.endhelp ______________________________________________________________________
procedure writeb (metacode_buffer, buflen, mbunit)
int metacode_buffer # LOC pointer to metacode buffer
int buflen # number of words of metacode data
int mbunit # FIO file descriptor !! from nspp common !!
int dummy[1], offset
int loci()
include "gkt.com"
begin
if (buflen <= 0)
return
# Standard NCAR pointer technique for accessing integer arrays. This
# assumes alignment of integer variables. Convert to use IRAF
# pointers if this causes problems.
offset = metacode_buffer - loci (dummy) + 1
iferr (call write (mbunit, dummy[offset], SZ_MFRECORD))
call erract (EA_FATAL)
end
|