<*-CSTDLIB  *>
<*+NOHEADER *>
<*+M2EXTENSIONS *>
DEFINITION MODULE ["C"] yuma;

FROM SYSTEM IMPORT CARD16, CARD8, ADDRESS;

(*
TYPE YUMA_structAlmanac=RECORD
    reserved1,
    week,                  (* 10 bit gps week 0-1023 (user must account for week rollover) [week] *)   
    prn:CARD16;            (* GPS prn number *)  
    health:CARD8;          (* 0=healthy, unhealthy otherwise  [], subframe 4 and 5, page 25 six-bit health code *)
    ecc,          (* eccentricity *)
    toa,          (* time of applicability *)
    i0,           (* orbital inclination at reference time                        [rad] *)
    omegadot,     (* rate of right ascension                                      [rad/s] *)
    sqrta,        (* square root of the semi-major axis                           [m^(1/2)]*)
    omega0,       (* longitude of ascending node of orbit plane at weekly epoch   [rad] *)
    w,            (* argument of perigee                                          [rad] *)
    m0,           (* mean anomaly at reference time                               [rad] *)
    af0,          (* polynomial clock correction coefficient (clock bias)         [s],   Note: parameters from ephemeris preferred vs almanac (22 vs 11 bits) *)
    af1:LONGREAL; (* polynomial clock correction coefficient (clock drift)        [s/s], Note: parameters from ephemeris preferred vs almanac (16 vs 11 bits) *)
  END;


PROCEDURE YUMA_ReadAlmanacDataFromFile(fn:ARRAY OF CHAR; VAR alm:ARRAY OF YUMA_structAlmanac;
                                       almsize:CARD8;
                                         VAR rdsize:CARD8):BOOLEAN;
*)
PROCEDURE YUMA_ReadAlmanacDataFromFile(fn:ARRAY OF CHAR; yumaalm:ADDRESS;
                                       almsize:CARD8; VAR rdsize:CARD8):BOOLEAN;

(*  const char* semFilePath,  //!< path to the input SEM ASCII file
  SEM_structAlmanac* alm,     //!< pointer to an array of SEM almanac structs
  unsigned char  max_to_read, //!< length of the array
  unsigned char* number_read  //!< number of almanac items read
*)  

END yuma.
