| 1 |
/* @(#)iodev2.c 19.1 (ES0-DMD) 02/25/03 13:56:10 */ |
| 2 |
/*=========================================================================== |
| 3 |
Copyright (C) 1995 European Southern Observatory (ESO) |
| 4 |
|
| 5 |
This program is free software; you can redistribute it and/or |
| 6 |
modify it under the terms of the GNU General Public License as |
| 7 |
published by the Free Software Foundation; either version 2 of |
| 8 |
the License, or (at your option) any later version. |
| 9 |
|
| 10 |
This program is distributed in the hope that it will be useful, |
| 11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
GNU General Public License for more details. |
| 14 |
|
| 15 |
You should have received a copy of the GNU General Public |
| 16 |
License along with this program; if not, write to the Free |
| 17 |
Software Foundation, Inc., 675 Massachusetss Ave, Cambridge, |
| 18 |
MA 02139, USA. |
| 19 |
|
| 20 |
Corresponding concerning ESO-MIDAS should be addressed as follows: |
| 21 |
Internet e-mail: [email protected] |
| 22 |
Postal address: European Southern Observatory |
| 23 |
Data Management Division |
| 24 |
Karl-Schwarzschild-Strasse 2 |
| 25 |
D 85748 Garching bei Muenchen |
| 26 |
GERMANY |
| 27 |
===========================================================================*/ |
| 28 |
|
| 29 |
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 30 |
.TYPE Module |
| 31 |
.NAME iodev2 |
| 32 |
.LANGUAGE C |
| 33 |
.AUTHOR IPG-ESO Garching |
| 34 |
.CATEGORY Host operating system interfaces. TBD |
| 35 |
.COMMENTS ============= TEMPLATE ============== |
| 36 |
.VERSION 0.0 12-Oct-1989: Design, F. Ochsenbein, C. Guirao |
| 37 |
.ENVIRONMENT UNIX |
| 38 |
------------------------------------------------------------*/ |
| 39 |
static char class_name[] = "template"; |
| 40 |
|
| 41 |
#include <osdefos.h> |
| 42 |
#include <osudef.h> |
| 43 |
|
| 44 |
MID_EXTERN int oserror; |
| 45 |
MID_EXTERN char *oserrmsg; |
| 46 |
|
| 47 |
/*===================================================================== |
| 48 |
* Definition of the structure returned to osu |
| 49 |
*=====================================================================*/ |
| 50 |
|
| 51 |
/* struct iolist *iodev3(); */ |
| 52 |
|
| 53 |
/* In the following list, zero'ed functions are replaced by inherited |
| 54 |
from class "dumb" |
| 55 |
*/ |
| 56 |
|
| 57 |
static OPITEM list_of_functions[] = { |
| 58 |
{ U_INFO, (int (*)())0} |
| 59 |
/* { U_OPEN, ioopen}, */ |
| 60 |
/* { U_CLOSE, ioclose}, */ |
| 61 |
/* { U_READ, ioread}, */ |
| 62 |
/* { U_WRITE, iowrite}, */ |
| 63 |
/* { U_REWIND, iorew}, */ |
| 64 |
/* { U_WEOF, ioweof}, */ |
| 65 |
/* { U_FMF, iofsf}, /* File Move Forward */ |
| 66 |
/* { U_FMB, iobsf}, /* File Move Backward */ |
| 67 |
/* { U_BMF, iofsr}, /* Block Move Forward */ |
| 68 |
/* { U_BMB, iobsr} /* Block Move Backward */ |
| 69 |
}; |
| 70 |
|
| 71 |
static struct iolist this_dev = { |
| 72 |
(IODEV)0, /* Next iodev in List */ |
| 73 |
class_name, /* How it's written in DEVCAPFILE */ |
| 74 |
sizeof(list_of_functions)/sizeof(list_of_functions[0]), |
| 75 |
list_of_functions |
| 76 |
}; |
| 77 |
|
| 78 |
struct iolist *iodev2() |
| 79 |
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 80 |
.PURPOSE Get All definitions concerning this class of Devices |
| 81 |
.RETURNS The iolist |
| 82 |
.REMARKS Just a template here: inherits zero'ed functions. |
| 83 |
------------------------------------------------------------*/ |
| 84 |
{ |
| 85 |
OPITEM *pop; |
| 86 |
int i; |
| 87 |
|
| 88 |
for (pop = list_of_functions, i = this_dev.nop; --i >= 0; pop++) |
| 89 |
if (!pop->opf) osugrep("dumb", pop); |
| 90 |
|
| 91 |
return(&this_dev); |
| 92 |
} |