ICP  1
riovme.h
Go to the documentation of this file.
1 /*
2  * This file contains the RIO interface header file
3  * that is callable from FORTRAN
4  *
5  * it hopes to simulate the good old RIO routines as part of DAE 1S
6  *
7  * Author: Freddie Akeroyd
8  */
9 
10 
11 /*
12  * Unix fortran compilers append an "_" to Fortran subroutine names
13  *
14  * OPEN_DAE is special in that it passes a string and so requires
15  * a jacket FORTRAN routine
16  */
17 #ifndef RIOVME_H
18 #define RIOVME_H
19 
20 #include "isisvme_types.h"
21 
22 #define RIOVME_SUCCESS 1
23 #define RIOVME_FAILED 0
24 
25 #ifdef _WIN32
26 # define CALLMECHANISM __stdcall
27 # ifdef IN_RIOVME_DLL
28 # define DLLEXPORT __declspec(dllexport)
29 # else
30 # define DLLEXPORT __declspec(dllimport)
31 # endif /* IN_RIOVME_DLL */
32 #endif /* _WIN32 */
33 
34 #if defined(__unix)
35 # define OPEN_DAE open_dae__
36 # define CLOSE_DAE close_dae_
37 # define RESET_DAE reset_dae_
38 # define RIO rio_
39 # define RIOD riod_
40 # define RMEM rmem_
41 # define RMEMD rmemd_
42 # define WIO wio_
43 # define WIOD wiod_
44 # define WMEM wmem_
45 # define WMEMD wmemd_
46 # define RMEMVI rmemvi_
47 # define READ_CRPT read_crpt_
48 #elif defined(__VMS)
49 # define OPEN_DAE open_dae_
50 # define CLOSE_DAE close_dae
51 # define RESET_DAE reset_dae
52 # define RIO rio
53 # define RIOD riod
54 # define RMEM rmem
55 # define RMEMD rmemd
56 # define WIO wio
57 # define WIOD wiod
58 # define WMEM wmem
59 # define WMEMD wmemd
60 # define RMEMVI rmemvi
61 # define READ_CRPT read_crpt
62 #elif defined(_WIN32)
63 # define OPEN_DAE OPEN_DAE_
64 #endif /* ifdef unix */
65 
66 /*
67  * bus_addr the multibus address
68  * word the transferred data word (16 bit)
69  * device a VMS channel number in DAE-I (ignored here, just for compatibility)
70  * nwrds the number of 16 bit words to transfer
71  * wrd_length word length of DAE memory. Could be 8, 16 or 32 bit
72  * for DAE-I, but only 32 bit allowed for DAE-II
73  */
74 typedef char DAE_STRING;
75 
76 #ifdef __cplusplus
77 extern "C" {
78 #endif /* __cplusplus */
79 
80  DLLEXPORT isis32_t CALLMECHANISM OPEN_DAE(DAE_STRING* dae_name);
81  DLLEXPORT isis32_t CALLMECHANISM CLOSE_DAE();
82  DLLEXPORT isis32_t CALLMECHANISM RESET_DAE(isis32_t* nn);
83  DLLEXPORT isis32_t CALLMECHANISM RIO(isis32_t* bus_addr, isisU16_t* word, isis16_t* device);
84  DLLEXPORT isis32_t CALLMECHANISM RIOD(isis32_t* bus_addr, isisU16_t* buffer, isis32_t* nwrds, isis16_t* device);
85  DLLEXPORT isis32_t CALLMECHANISM RMEM(isis32_t* bus_addr, isisU16_t* word, isis16_t* device);
86  DLLEXPORT isis32_t CALLMECHANISM RMEMD(isis32_t* bus_addr, isisU16_t* buffer, isis32_t* nwrds, isis16_t* device);
87  DLLEXPORT isis32_t CALLMECHANISM WIO(isis32_t* bus_addr, isisU16_t* word, isis16_t* device);
88  DLLEXPORT isis32_t CALLMECHANISM WIOD(isis32_t* bus_addr, isisU16_t* buffer, isis32_t* nwrds, isis16_t* device);
89  DLLEXPORT isis32_t CALLMECHANISM WMEM(isis32_t* bus_addr, isisU16_t* word, isis16_t* device);
90  DLLEXPORT isis32_t CALLMECHANISM WMEMD(isis32_t* bus_addr, isisU16_t* buffer, isis32_t* nwrds, isis16_t* device);
91  DLLEXPORT isis32_t CALLMECHANISM RMEMVI(isis32_t* bus_addr, isisU32_t* buffer, isis32_t* length, isis16_t* device, isis32_t* wrd_len);
92  DLLEXPORT isis32_t CALLMECHANISM READ_CRPT(isis32_t** start, isis32_t* crpt_section, isis32_t* size_in_words);
93 
94  DLLEXPORT isis32_t open_dae_c(const char* dae_name);
95  DLLEXPORT isis32_t open_dae_cds(const char* dae_name);
96  DLLEXPORT isis32_t rio_c(isis32_t bus_addr, isis16_t* word, isis16_t device);
97  DLLEXPORT isis32_t rmemvi_c(isis32_t* bus_addr, isis32_t* buffer, isis32_t* length, isis16_t* device, isis32_t* wrd_len);
98  DLLEXPORT isis32_t close_dae_c();
99  DLLEXPORT isis32_t read_crpt_c(isis32_t** start, isis32_t* crpt_section, isis32_t* size_in_words);
100 /*
101  * dynamic versions
102  */
103  DLLEXPORT isis32_t d_open_dae_cds(const char* dae_name);
104  DLLEXPORT isis32_t d_rio(isis32_t bus_addr, isis16_t* word, isis16_t device);
105  DLLEXPORT isis32_t d_close_dae();
106  DLLEXPORT isis32_t d_rmemvi(isis32_t* bus_addr, isis32_t* buffer, isis32_t* length, isis16_t* device, isis32_t* wrd_len);
107  DLLEXPORT isis32_t d_read_crpt(isis32_t** start, isis32_t* crpt_section, isis32_t* size_in_words);
108 
109 #ifdef __cplusplus
110 }
111 #endif /* __cplusplus */
112 
113 #endif /* RIOVME_H */
int __stdcall RIOD(isis32_t &bus_addr, isisU16_t *word, isis32_t &nwrds, isis16_t &device)
short isis16_t
Definition: isisvme_types.h:13
DLLEXPORT isis32_t d_rmemvi(isis32_t *bus_addr, isis32_t *buffer, isis32_t *length, isis16_t *device, isis32_t *wrd_len)
DLLEXPORT isis32_t open_dae_c(const char *dae_name)
DLLEXPORT isis32_t CALLMECHANISM READ_CRPT(isis32_t **start, isis32_t *crpt_section, isis32_t *size_in_words)
int __stdcall RMEM(isis32_t &bus_addr, isisU16_t *word, isisU16_t &device)
Definition: daeset.cpp:101
DLLEXPORT isis32_t close_dae_c()
int __stdcall WIOD(isis32_t &bus_addr, isisU16_t *word, isis32_t &nwrds, isis16_t &device)
Definition: daeset.cpp:55
unsigned long isisU32_t
Definition: isisvme_types.h:8
DLLEXPORT isis32_t d_close_dae()
int open_dae_cds(const char *name)
Definition: daeset.cpp:72
DLLEXPORT isis32_t rmemvi_c(isis32_t *bus_addr, isis32_t *buffer, isis32_t *length, isis16_t *device, isis32_t *wrd_len)
int read_crpt_c(int **start, int &section, int &size)
Definition: daeset.cpp:66
int __stdcall RMEMVI(isis32_t &bus_addr, isisU32_t *buffer, isisU32_t &length, isis16_t &device, isis32_t &wrd_len)
Definition: daeset.cpp:123
DLLEXPORT isis32_t d_open_dae_cds(const char *dae_name)
DLLEXPORT isis32_t d_rio(isis32_t bus_addr, isis16_t *word, isis16_t device)
DLLEXPORT isis32_t CALLMECHANISM CLOSE_DAE()
unsigned short isisU16_t
Definition: isisvme_types.h:7
char DAE_STRING
Definition: riovme.h:74
int __stdcall WIO(isis32_t &bus_addr, isisU16_t *word, isis16_t &device)
Definition: daeset.cpp:49
int __stdcall RMEMD(isis32_t &bus_addr, isisU16_t *word, isis32_t &nwrds, isisU16_t &device)
Definition: daeset.cpp:109
DLLEXPORT isis32_t CALLMECHANISM OPEN_DAE(DAE_STRING *dae_name)
int __stdcall RIO(isis32_t &bus_addr, isisU16_t *word, isis16_t &device)
Definition: daeset.cpp:138
DLLEXPORT isis32_t CALLMECHANISM RESET_DAE(isis32_t *nn)
int rio_c(long bus_addr, isisU16_t *word, short device)
Definition: daeset.cpp:61
long isis32_t
Definition: isisvme_types.h:14
DLLEXPORT isis32_t d_read_crpt(isis32_t **start, isis32_t *crpt_section, isis32_t *size_in_words)
int __stdcall WMEM(isis32_t &bus_addr, isisU16_t *word, isisU16_t &device)
Definition: daeset.cpp:89
int __stdcall WMEMD(isis32_t &bus_addr, isisU16_t *word, isis32_t &nwrds, isisU16_t &device)
Definition: daeset.cpp:95