Miriad subroutines are generally only callable by FORTRAN code, and this should be the language of choice for Miriad programmers. There are, however, C-callable entry points to most i/o routines. In certain applications (particularly ``foreign'' tasks, such as XDataSlice, hcconv, etc) these may be of some use (there use is, however discouraged).
The calling sequence is similar to the FORTRAN calling sequence. There are some differences:
_c
to the FORTRAN
name. The entry point names are always lower case. For example, the
FORTRAN routine bug
becomes bug_c
.
length
or n
in the descriptions below)
which give the size of the return buffer.
void bug_c(char sev,char message[]) void bugno_c(char sev,int status) void haccess_c(int *tno,void **item,char name[],char status[],int *iostat) void hclose_c(int tno) void hdaccess_c(void *item,int *iostat) void hdcopy_c(int tin, int tout, char itemname[]) void hdprobe_c(int tno,char keyword[],char descr[length],int length, char type[],int *n) int hdprsnt_c_c(int tno, char itemname[]) void hisclose_c(int tno) void hisopen_c(int tno,char status[]) void hisread_c(int tno,char line[length],int length,int eof) void hiswrite_c(int tno,char line[]) void hopen_c(int *tno,char name[],char status[],int *iostat) (Note: The hread routines are implemented as macros) void hreada_c(void *item,char line[length],int length,int *iostat) (Note: In hreadb, buffer is not zero-terminated) void hreadb_c(void *item,char *buffer[],int offset,int length,int *iostat) void hreadd_c(void *item,double buffer[],int offset,int length,int *iostat) void hreadi_c(void *item,int buffer[],int offset,int length,int *iostat) void hreadj_c(void *item,int buffer[],int offset,int length,int *iostat) void hreadr_c(void *item,float buffer[],int offset,int length,int *iostat) int hsize_c(void *item) (Note: The hwrite routines are implemented as macros) void hwritea_c(void *item,char line[length],int length,int *iostat) (Note: In hwriteb, buffer need not be zero-terminated) void hwriteb_c(void *item,char *buffer[length],int offset,int length, int *iostat) void hwrited_c(void *item,double buffer[],int offset,int length,int *iostat) void hwritei_c(void *item,int buffer[],int offset,int length,int *iostat) void hwritej_c(void *item,int buffer[],int offset,int length,int *iostat) void hwriter_c(void *item,float buffer[],int offset,int length,int *iostat) (Note: There is no rdhdr_c or rdhdi_c. Implement them with rdhdd_c) void rdhda_c(int tno,char *keyword[],char value[length],char defval[], int length) void rdhdc_c(int tno,char keyword[],float *value,float defval[2]) void rdhdd_c(int tno,char keyword[],double *value,double defval) void scrclose_c(void *handle) void scropen_c(void **handle) void scrread_c(void *handle,float buffer[],int offset,int length) void scrwrite_c(void *handle,float buffer[length],int offset,int length) void uvclose_c(int tno) void uvcopyvr_c(int tin,int tout) void uvflgwr_c(int tno,int flags[]) (Note: The uvgetvr routines are implemented as macros) void uvgetvra_c(int tno,char var[],char data[n],int n) void uvgetvrc_c(int tno,char var[],float data[2*n],int n) void uvgetvrd_c(int tno,char var[],double data[n],int n) void uvgetvri_c(int tno,char var[],int data[n],int n) void uvgetvrj_c(int tno,char var[],int data[n],int n) void uvgetvrr_c(int tno,char var[],float data[n],int n) void uvinfo_c(int tno,char object[],double data[]) void uvmark_c(int tno, int flag) void uvnext_c(int tno) void uvopen_c(int tno,char name[],char status[]) (Note: The uvputvr routines are implemented as macros) void uvprobvr_c(int tno,char var[],char *type,int *length,int *updated) (Note: In uvputvra string does not need to be zero terminated). void uvputvra_c(int tno,char var[],char string[n],int n) void uvputvrc_c(int tno,char var[],float data[2*n],int n) void uvputvrd_c(int tno,char var[],double data[n],int n) void uvputvri_c(int tno,char var[],int data[n],int n) void uvputvrr_c(int tno,char var[],float data[n],int n) (Note: The uvrdvr routines are implemented as macros) void uvrdvra_c(int tno,char var[],char data[length],char def[],int length) void uvrdvrc_c(int tno,char var[],float data[2],float def[2]) void uvrdvrd_c(int tno,char var[],double *data,double def) void uvrdvri_c(int tno,char var[],int *data,int def) void uvrdvrr_c(int tno,char var[],float *data,float def) void uvread_c(int tno,double preamble[4],float data[2*n],int flags[n], int n,int *nread) void uvrewind_c(int tno) int uvscan_c(int tno,char var[]) void uvselect_c(int tno,char object[],double p1,double p2,int datasel) void uvset_c(int tno,char object[],char type[],int n,float p1,float p2, float p3) void uvtrack_c(int tno,char name[],char switches[]) int uvupdate_c(int tno) void uvwflgwr_c(int tno,int flags[]) void uvwread_c(int tno,float data[2*n],int flags[n],int n, int *nread) void uvwrite_c(int tno,double preamble[4],float data[2*n],int flags[n], int n) void uvwwrite_c(int tno, float data[2*n],int flags[n],int n) void wrhda_c(int tno,char keyword[],char value[]) void wrhdc_c(int tno,char keyword[],float value[2]) void wrhdd_c(int tno,char keyword[],double value) void wrhdi_c(int tno,char keyword[],int value) void wrhdr_c(int tno,char keyword[],float value) void xyclose_c(int tno) void xyflgrd_c(int tno,int index,int buffer[]) void xyflgwr_c(int tno,int index,int buffer[]) void xymkrd_c(int tno,int index,int buffer[],int n,int *nread) void xymkwr_c(int tno,int index,int buffer[],int n) void xyopen_c(int *tno,char name[],char status[],int naxis,int axes[]) void xyread_c(int tno,int index,float buffer[]) void xysetpl_c(int tno,int naxis,int axes[]) void xywrite_c(int tno,int index,float buffer[])