Index: trunk/rtcm3torinex/lib/rtcm3torinex.c
===================================================================
--- trunk/rtcm3torinex/lib/rtcm3torinex.c	(revision 2668)
+++ trunk/rtcm3torinex/lib/rtcm3torinex.c	(revision 2699)
@@ -955,5 +955,5 @@
         };
 
-        int sys = RTCM3_MSM_GPS, i, count, j, old = 0, wasnoamb = 0;
+        int sys = RTCM3_MSM_GPS, i=0, count, j, old = 0, wasnoamb = 0;
         int syncf, sigmask, numsat = 0, numsig = 0, numcells;
         uint64_t satmask, cellmask, ui;
@@ -1171,4 +1171,7 @@
               {
                 int fullsat = sys+RTCM3_MSM_NUMSAT-i-1, num;
+                /* FIXME: workaround for GIOVE */
+                if(fullsat >= PRN_GALILEO_START && fullsat <= PRN_GALILEO_START+2)
+                  fullsat += PRN_GIOVE_START-PRN_GALILEO_START;
                 for(num = 0; num < gnss->numsats
                 && fullsat != gnss->satellites[num]; ++num)
@@ -1369,4 +1372,5 @@
   const char *typesofobsR; /* should not be modified outside */
   const char *typesofobsS; /* should not be modified outside */
+  const char *typesofobsE; /* should not be modified outside */
   const char *timeoffirstobs; /* should not be modified outside */
 };
@@ -1632,5 +1636,5 @@
       Parser->datapos##a[Parser->numdatatypes##a] = GNSSENTRY_##b##DATA; \
       ++Parser->numdatatypes##a; \
-      snprintf(tbuffer+tbufferpos, sizeof(tbuffer)-tbufferpos, " "#c); \
+      snprintf(tbuffer+tbufferpos, sizeof(tbuffer)-tbufferpos, " %-3s", #c); \
       tbufferpos += 4; \
     }
@@ -1646,8 +1650,8 @@
     CHECKFLAGSNEW(GPS, D1C, D1C)
     CHECKFLAGSNEW(GPS, S1C, S1C)
-    CHECKFLAGSNEW(GPS, P1,  C1P)
-    CHECKFLAGSNEW(GPS, L1P, L1P)
-    CHECKFLAGSNEW(GPS, D1P, D1P)
-    CHECKFLAGSNEW(GPS, S1P, S1P)
+    CHECKFLAGSNEW(GPS, P1,  C1W)
+    CHECKFLAGSNEW(GPS, L1P, L1W)
+    CHECKFLAGSNEW(GPS, D1P, D1W)
+    CHECKFLAGSNEW(GPS, S1P, S1W)
 
     hdata.data.named.typesofobsS = buffer;
@@ -1664,4 +1668,8 @@
     CHECKFLAGSNEW(GPS, D2C, D2X)
     CHECKFLAGSNEW(GPS, S2C, S2X)
+    CHECKFLAGSNEW(GPS, C5,  C5)
+    CHECKFLAGSNEW(GPS, L5,  L5)
+    CHECKFLAGSNEW(GPS, D5,  D5)
+    CHECKFLAGSNEW(GPS, S5,  S5)
 
     hdata.data.named.typesofobsG = buffer;
@@ -1698,4 +1706,37 @@
     "R  %3d%-52.52s  SYS / # / OBS TYPES", Parser->numdatatypesGLO, tbuffer);
     if(Parser->numdatatypesGLO>13)
+    {
+      i += snprintf(buffer+i-1, buffersize,
+      "\n      %-52.52s  SYS / # / OBS TYPES", tbuffer+13*4);
+    }
+    buffer += i; buffersize -= i;
+
+    tbufferpos = 0;
+
+    CHECKFLAGSNEW(GAL, C1,   C1)
+    CHECKFLAGSNEW(GAL, L1C,  L1)
+    CHECKFLAGSNEW(GAL, D1C,  D1)
+    CHECKFLAGSNEW(GAL, S1C,  S1)
+    CHECKFLAGSNEW(GAL, C6,   C6)
+    CHECKFLAGSNEW(GAL, L6,   L6)
+    CHECKFLAGSNEW(GAL, D6,   D6)
+    CHECKFLAGSNEW(GAL, S6,   S6)
+    CHECKFLAGSNEW(GAL, C5,   C5)
+    CHECKFLAGSNEW(GAL, L5,   L5)
+    CHECKFLAGSNEW(GAL, D5,   D5)
+    CHECKFLAGSNEW(GAL, S5,   S5)
+    CHECKFLAGSNEW(GAL, C5B,  C7)
+    CHECKFLAGSNEW(GAL, L5B,  L7)
+    CHECKFLAGSNEW(GAL, D5B,  D7)
+    CHECKFLAGSNEW(GAL, S5B,  S7)
+    CHECKFLAGSNEW(GAL, C5AB, C8)
+    CHECKFLAGSNEW(GAL, L5AB, L8)
+    CHECKFLAGSNEW(GAL, D5AB, D8)
+    CHECKFLAGSNEW(GAL, S5AB, S8)
+
+    hdata.data.named.typesofobsE = buffer;
+    i = 1+snprintf(buffer, buffersize,
+    "E  %3d%-52.52s  SYS / # / OBS TYPES", Parser->numdatatypesGAL, tbuffer);
+    if(Parser->numdatatypesGAL>13)
     {
       i += snprintf(buffer+i-1, buffersize,
@@ -2087,5 +2128,5 @@
           for(i = 0; i < Parser->Data.numsats; ++i)
           {
-            int glo = 0;
+            int glo = 0, gal = 0;
             if(Parser->Data.satellites[i] <= PRN_GPS_END)
               RTCM3Text("G%02d", Parser->Data.satellites[i]);
@@ -2095,4 +2136,16 @@
               RTCM3Text("R%02d", Parser->Data.satellites[i] - (PRN_GLONASS_START-1));
               glo = 1;
+            }
+            else if(Parser->Data.satellites[i] >= PRN_GALILEO_START
+            && Parser->Data.satellites[i] <= PRN_GALILEO_END)
+            {
+              RTCM3Text("E%02d", Parser->Data.satellites[i] - (PRN_GALILEO_START-1));
+              gal = 1;
+            }
+            else if(Parser->Data.satellites[i] >= PRN_GIOVE_START
+            && Parser->Data.satellites[i] <= PRN_GIOVE_END)
+            {
+              RTCM3Text("E%02d", Parser->Data.satellites[i] - (PRN_GIOVE_START-PRN_GIOVE_OFFSET));
+              gal = 1;
             }
             else if(Parser->Data.satellites[i] >= PRN_WAAS_START
@@ -2135,4 +2188,55 @@
               }
             }
+            else if(gal)
+            {
+              for(j = 0; j < Parser->numdatatypesGAL; ++j)
+              {
+                int df = Parser->dataflagGAL[j];
+                int pos = Parser->dataposGAL[j];
+                if((Parser->Data.dataflags[i] & df)
+                && !isnan(Parser->Data.measdata[i][pos])
+                && !isinf(Parser->Data.measdata[i][pos]))
+                {
+                  char lli = ' ';
+                  char snr = ' ';
+                  if(df & (GNSSDF_L1CDATA|GNSSDF_L1PDATA))
+                  {
+                    if(Parser->Data.dataflags2[i] & GNSSDF2_LOCKLOSSL1)
+                      lli = '1';
+                    snr = '0'+Parser->Data.snrL1[i];
+                  }
+                  if(df & GNSSDF_L6DATA)
+                  {
+                    if(Parser->Data.dataflags2[i] & GNSSDF2_LOCKLOSSE6)
+                      lli = '1';
+                    snr = ' ';
+                  }
+                  if(df & GNSSDF_L5DATA)
+                  {
+                    if(Parser->Data.dataflags2[i] & GNSSDF2_LOCKLOSSL5)
+                      lli = '1';
+                    snr = ' ';
+                  }
+                  if(df & GNSSDF_L5BDATA)
+                  {
+                    if(Parser->Data.dataflags2[i] & GNSSDF2_LOCKLOSSE5B)
+                      lli = '1';
+                    snr = ' ';
+                  }
+                  if(df & GNSSDF_L5ABDATA)
+                  {
+                    if(Parser->Data.dataflags2[i] & GNSSDF2_LOCKLOSSE5AB)
+                      lli = '1';
+                    snr = ' ';
+                  }
+                  RTCM3Text("%14.3f%c%c",
+                  Parser->Data.measdata[i][pos],lli,snr);
+                }
+                else
+                { /* no or illegal data */
+                  RTCM3Text("                ");
+                }
+              }
+            }
             else
             {
@@ -2158,4 +2262,10 @@
                       lli = '1';
                     snr = '0'+Parser->Data.snrL2[i];
+                  }
+                  if(df & GNSSDF_L5DATA)
+                  {
+                    if(Parser->Data.dataflags2[i] & GNSSDF2_LOCKLOSSL5)
+                      lli = '1';
+                    snr = ' ';
                   }
                   RTCM3Text("%14.3f%c%c",
