#include #include void idl_uvopen(int argc, void *argv[]) { struct IDL_STRING { int slen; unsigned short stype; char *s; }; struct IDL_STRING *instring; int *unit = (int *) argv[1]; char status[4]="new"; instring = (struct IDL_STRING *) argv[0]; /*printf("opening data set %s \n", (char *)(*instring).s);*/ uvopen_c(unit,(char *)(*instring).s,&status); /*printf("uvopen new unit %i successfully \n",*unit);*/ } void idl_uvclose(int argc, void *argv[]) { int unit = *(int *) argv[0]; uvclose_c(unit); /*printf("uvclose unit %i OK \n",unit);*/ } void idl_hisappend(int argc, void *argv[]) { int unit = *(int *) argv[0]; hisopen_c(unit,"append"); /*printf("history appending mode for unit %i \n",unit);*/ } void idl_hisclose(int argc, void *argv[]) { int unit = *(int *) argv[0]; hisclose_c(unit); /*printf("closing history for unit %i \n",unit);*/ } void idl_hiswrite(int argc, void *argv[]) { struct IDL_STRING { int slen; unsigned short stype; char *s; }; struct IDL_STRING *instring; int unit = *(int *) argv[0]; instring = (struct IDL_STRING *) argv[1]; hiswrite_c(unit, (char *)(*instring).s); /*printf("writing history for unit %i \n",unit);*/ } void idl_uvputvr(int argc, void *argv[]) { struct IDL_STRING { int slen; unsigned short stype; char *s; }; struct IDL_STRING *instring; struct complex { float real; float imagine; }; int unit = *(int *) argv[0]; int n; struct IDL_STRING *ops, *name, *sval; short *jval; int *ival; float *rval; double *dval; struct complex *cval; ops = (struct IDL_STRING *) argv[1]; name = (struct IDL_STRING *) argv[2]; if (argc > 4) { n = *(int *) argv[4]; /*printf("input number of variable(s) is %i \n", n);*/ } if (strcmp((char *)(*ops).s,"a")==0) { sval = (struct IDL_STRING *) argv[3]; /*printf("Writing Varible %s of %s \n",(char *)(*name).s, (char *)(*sval).s);*/ uvputvr_c(unit, 1, (char *)(*name).s, (char *)(*sval).s,(int *)(*sval).slen ); } if (strcmp((char *)(*ops).s,"j")==0) { jval = (short *) argv[3]; /*printf("Writing Varible %s of %d \n",(char *)(*name).s, *jval);*/ uvputvr_c(unit, 3, (char *)(*name).s, (char *)(jval), n); } if (strcmp((char *)(*ops).s,"i")==0) { ival = (int *) argv[3]; /*printf("Writing Varible %s of %d \n",(char *)(*name).s, *ival);*/ uvputvr_c(unit, 2, (char *)(*name).s, (char *)(ival), n); } if (strcmp((char *)(*ops).s,"r")==0) { rval = (float *) argv[3]; /*printf("Writing Varible %s of %f \n",(char *)(*name).s, *rval);*/ uvputvr_c(unit, 4, (char *)(*name).s, (char *)(rval), n); } if (strcmp((char *)(*ops).s,"d")==0) { dval = (double *) argv[3]; /*printf("Writing Varible %s of %f \n",(char *)(*name).s, *dval);*/ uvputvr_c(unit, 5, (char *)(*name).s, (char *)(dval), n); } if (strcmp((char *)(*ops).s,"c")==0) { cval = (struct complex *) argv[3]; /*printf("Writing Varible %s of %s \n",(char *)(*name).s, (char *)(cval));*/ uvputvr_c(unit, 7, (char *)(*name).s, (char *)(cval), n); } } void idl_wrhdi(int argc, void *argv[]) { struct IDL_STRING { int slen; unsigned short stype; char *s; }; struct IDL_STRING *name; int unit = *(int *) argv[0]; int val = *(int *) argv[2]; name = (struct IDL_STRING *) argv[1]; wrhdi_c(unit,(char *)(*name).s,val); /*printf("Writting header variable %s of value %i \n",(char *)(*name).s,val);*/ } void idl_uvwrite(int argc, void *argv[]) { int unit = *(int *) argv[0]; int n = *(int *) argv[4]; double *preamble; float *data; int *flags; preamble = (double *) argv[1]; data = (float *) argv[2]; flags = (int *) argv[3]; uvwrite_c(unit,preamble,data,flags,n); } void idl_uvwwrite(int argc, void *argv[]) { int unit = *(int *) argv[0]; int n = *(int *) argv[3]; float *data; int *flags; data = (float *) argv[1]; flags = (int *) argv[2]; uvwwrite_c(unit,data,flags,n); } void idl_vearth(int argc, void *argv[]) { double *jday; double *pos; double *vel; jday = (double *) argv[0]; pos = (double *) argv[1]; vel = (double *) argv[2]; vearth_(jday,pos,vel); } double d_mod(x,y) double *x, *y; { return(*x - (*y) * ( (long int) (*x / *y)) ); } int s_cmp(a, b, la, lb) /* compare two strings */ char *a, *b; long int la, lb; { char *aend, *bend; aend = a + la; if(la <= lb) { while(a < aend) if(*a != *b) return( *a - *b ); else { ++a; ++b; } } else { bend = b + lb; while(b < bend) if(*a == *b) { ++a; ++b; } else return( *a - *b ); while(a < aend) if(*a != ' ') return(*a - ' '); else ++a; } return(0); } double r_mod(x,y) float *x, *y; { return(*x - (*y) * ( (long int) (*x / *y)) ); }