Astro-SLA

 view release on metacpan or  search on metacpan

lib/Astro/SLA.xs  view on Meta::CPAN

  double ob2
  double date
  double dut
  double elongm
  double phim
  double hm
  double xp
  double yp
  double tdk
  double pmb
  double rh
  double wl
  double tlr
  double rap = NO_INIT
  double dap = NO_INIT
 PROTOTYPE: $$$$$$$$$$$$$$$$$
 CODE:
#ifdef USE_FORTRAN
   TRAIL(sla_oap)(type, &ob1, &ob2, &date, &dut, &elongm, &phim, &hm, &xp,
		  &yp, &tdk, &pmb, &rh, &wl, &tlr, &rap, &dap, strlen(type));
#else
   slaOap(type, ob1, ob2, date, dut, elongm, phim, hm, xp, yp, tdk, pmb, rh, wl, tlr, &rap, &dap);
#endif
 OUTPUT:
  rap
  dap

void
slaOapqk(type, ob1, ob2, aoprms, rap, dap)
  char * type
  double ob1
  double ob2
  double * aoprms
  double rap = NO_INIT
  double dap = NO_INIT
 PROTOTYPE: $$$\@$$
 CODE:
#ifdef USE_FORTRAN
  TRAIL(sla_oapqk)(type, &ob1, &ob2, aoprms, &rap, &dap,strlen(type));
#else
  slaOapqk(type, ob1, ob2, aoprms, &rap, &dap);
#endif
 OUTPUT:
  rap
  dap


# If c is undef we need to convert to a blank since slalib
# will generate segmentation violation if it receieves an undef
# value for the string (the strcpy fails for some reason).
# overcome this by providing a wrapper in the .pm file to check
# for this case. Have not got the time to work out a fix at the
# XS level. 'c' can be an input or output variable but must be
# guaranteed to contain a valid pointer to char.
#  slaObs is now defined in the .pm file

# Since "c" can be both input and output depending on the value
# of n the XS routine is explicit and will write the output to
# outc regardless of inc. We do this to allow slaObs to be called
# with constants that can not handle always being modified in the
# simple XS {could use PPCODE but the multivar approach is easier
# since there are many return values that would need to be specified.)

void
_slaObs(n, inc, outc, name, w, p, h)
  int n
  char * inc
  char * outc = NO_INIT
  char * name = NO_INIT
  double w = NO_INIT
  double p = NO_INIT
  double h = NO_INIT
 PROTOTYPE: $$$$$$$
 PREINIT:
  int  name_len = 40;
  int  code_len = 11;
  char string[name_len];
  char * c;
  char code[code_len];
  char tempc[code_len];
 CODE:
  name = string;
  outc = code;
  outc[0] = '\0';

  /* If n is greater than 1 we need to write the output
     to outc. If n is less than 1 we can be readonly and just
     use inc.
  */
  if (n < 1) {
    /* read from inc. Length must be calculated for Fortran */
    c = inc;
    code_len = strlen(c);
  } else {
    /* write into outc directly. We know the length */
    c = outc;
  }
#ifdef USE_FORTRAN
  /* copy the input code [if any] to temp variable */
  myCnfExprt(c,tempc,code_len);
  TRAIL(sla_obs)(&n,tempc,name,&w,&p,&h,code_len,name_len);
  stringf77toC(name,name_len);
  if (n>0) {
    /* Need to C-ify the string if we were expecting a reply */
    outc = tempc;
    stringf77toC(outc,code_len);
  }
#else
  slaObs(n, c, name, &w, &p, &h);
#endif
 OUTPUT:
  outc
  name
  w
  p
  h


double
slaPa(ha, dec, phi)
  double ha



( run in 0.579 second using v1.01-cache-2.11-cpan-71847e10f99 )