<no title> — CALCEPH - C language 3.4.1 documentation

    int nvalue, k;
    t_calcephcharvalue *mission_units;
    t_calcephbin *peph;

    /* open the ephemeris file */
    peph = calceph_open("example1.dat");
    if (peph)
    {
      /* get the number of values */
      int nvalue = calceph_getconstantvs(peph, "MISSION_UNITS", NULL, 0);
      mission_units = (t_calcephcharvalue*)malloc(sizeof(t_calcephcharvalue)*nvalue);

      /* fill  the array radii */
      if (calceph_getconstantvs(peph, "MISSION_UNITS", mission_units, nvalue))
      {
          for (k=0; k<nvalue; k++)
          printf("MISSION_UNITS(%d)=%s\n", k, mission_units[k]);
      }
      free(mission_units);
      /* close the ephemeris file */
      calceph_close(peph);
    }