Debian Codegraph @

prim/tc3/libsrc/file2.c

raw
1 /*===========================================================================
2 Copyright (C) 1988-2009 European Southern Observatory (ESO)
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of
7 the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public
15 License along with this program; if not, write to the Free
16 Software Foundation, Inc., 675 Massachusetss Ave, Cambridge,
17 MA 02139, USA.
18
19 Corresponding concerning ESO-MIDAS should be addressed as follows:
20 Internet e-mail: [email protected]
21 Postal address: European Southern Observatory
22 Data Management Division
23 Karl-Schwarzschild-Strasse 2
24 D 85748 Garching bei Muenchen
25 GERMANY
26 ===========================================================================*/
27
28 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29 .TYPE Module
30 .NAME file2.c
31 .LANGUAGE C
32 .AUTHOR Francois Ochsenbein [ESO-IPG]
33 .CATEGORY Further Interface to disk file access
34 .ENVIRONMENT
35 .COMMENTS
36 .VERSION 1.0 20-Jun-1988: Creation
37
38 090831 last modif
39 -------------------------------------------------------------*/
40
41 #define DEBUG 0 /* Debugging option */
42
43 #define PM_LEVEL LEVEL_FI
44 #define PASCAL_DEF 0 /* Don't include pascalisation ... */
45 #include <stesodef.h>
46 #include <midas_def.h>
47
48
49 extern int pm_enter(), pm_iexit(), fi_write();
50
51
52
53 #define FINISH goto FIN
54
55 /*======================================================================*/
56 int fi_wu (file, record, nbytes)
57 /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
58 .PURPOSE Write underlined text in file
59 .RETURNS Number of bytes actually written, or NOK for error
60 .REMARKS
61 -------------------------------------------------------------*/
62 int file; /* IN: File number */
63 char *record; /* IN: record buffer */
64 int nbytes; /* IN: size of buffer */
65 {
66 MID_STATIC char *buf = NULL_PTR(char);
67 int status;
68
69 ENTER("+fi_wu");
70
71 status = nbytes * 2;
72 if (status == 0) FINISH;
73
74 buf = MEM_EXP(char, buf, status);
75
76 oscfill(buf, nbytes, '_');
77 oscfill(buf+nbytes, nbytes, '\b'); /* Backspaces */
78 fi_write(file, buf, status);
79
80 status = fi_write(file,record,nbytes);
81
82 FIN:
83 EXIT (status);
84 }
85