The changes made to the ODL C code are preprocessor defined. Each change has it's own preprocessor conditional definition. These are turned on by defining the flag for each change in the Makefile CFLAGS. These flags are:

SEQUENCE ( -DSEQUENCE_FIX ) - Implement the Back slash n, '\n', solution.
OVERFLOW ( -DOVERFLOW_FIX ) - Implement the buffer overflow solution.
WRAP ( -DWRAP_FIX ) - Implement the wrapping of long lines with the insertion of an & at the end which ReadLabel removes.
DASH ( -DDASH_FIX ) - Remove the implementation of the dash, '-', delimiter.

The routines altered are: wrtlabel.c, fmtvalue.c and lexan.c. Makefile is edited as needed.

You may obtain the new ODL, click on the source. This is a compressed file.


BACKSLASH N

(newline)

A back slash n, '\n', will be inserted at the start of a quote for a sequence of strings. This will appear in subsequent writes of this string as \ n in files created by the ODL routine. They should be new line characters.

The back slash n character appears in string sequences. To fix the problem, code has been modified to write out each string sequence on a single line. The newline is placed before the starting double quote mark.
Routine wrtlabel.c, function WriteLabel() was modified to correct this problem. The first modification appears after the opening left bracket is encountered. The second is encountered when the start of a new string sequence is located.

Sample Input:

  DATASET_ID           = ("AMPR BRIGHTNESS TEMPERATURE (TB) CAMEX", "AMPR 
BRIGHTNESS TEMPERATURE (TB) CAMEX2 PROJECT", "AMPR BRIGHTNESS TEMPERATURE (TB)
TOGA COARE", "GAI LIGHTNING GROUND STRIKES", "MSFC SSM/I BRIGHTNESS TEMPERATURE
GRIDS FROM DMSP F10", "MSFC SSM/I BRIGHTNESS TEMPERATURE GRIDS FROM DMSP F13")

Output before changes:

  DATASET_ID           = ("AMPR BRIGHTNESS TEMPERATURE (TB) CAMEX",
      "AMPR BRIGHTNESS TEMPERATURE (TB) CAMEX2 PROJECT", "AMPR
      BRIGHTNESS TEMPERATURE (TB) TOGA COARE", "GAI LIGHTNING GROUND
      STRIKES", "MSFC SSM/I BRIGHTNESS TEMPERATURE GRIDS FROM DMSP
      F10", "MSFC SSM/I BRIGHTNESS TEMPERATURE GRIDS FROM DMSP F13")

Output after changes:

  DATASET_ID           = (
      "AMPR BRIGHTNESS TEMPERATURE (TB) CAMEX",
      "AMPR BRIGHTNESS TEMPERATURE (TB) CAMEX2 PROJECT",
      "AMPR BRIGHTNESS TEMPERATURE (TB) TOGA COARE",
      "GAI LIGHTNING GROUND STRIKES",
      "MSFC SSM/I BRIGHTNESS TEMPERATURE GRIDS FROM DMSP F10",
      "MSFC SSM/I BRIGHTNESS TEMPERATURE GRIDS FROM DMSP F13")

BUFFER OVERFLOW

The buffer size is to small. If all data sets are picked, the buffer is over written and the client crashes. Making the buffer larger must be done at the DAACs and client at the same time. Failure to do this will lead to a crash of the client or the DAAC software.

In routine wrtlabel.c, function WriteLabel() the current buffer pointer position is tested to see if it's at or beyond 95% of the buffer size. If the new line to be added to the buffer will place the buffer pointer beyond the 95% level, the buffer is flushed to disk and the buffer pointer is reset to point to the start of buffer.

LINE WRAP

The 70 character format limit causes problems when the ODL file is used by other code for formating. If a change is make in this, dataset names can be broken causing a problem in reading. This problem is compounded by the SEQUENCE fix if a sequence string has no white space in it. The code will write newlines till a buffer overflow occurs. This should not be enabled unless verified by the ims team as implementation prior to upgrading all clients/gateways can result in a crash. The ims team can be contacted via sending email to ims@killians.gsfc.nasa.gov. Another problem exists for any string sequence ending with a dash, (-). The ODL routines will strip the dash from the end of a line and concatenate the following line. This can prove to be a problem when ODL tries to handle URLs.

In routine fmtvalue.c, function ODLFormatString() a modification has been made to use logic provided by the ODLc library programs. A long string is back scanned for the first occurrence of a white space, up to the opening double quote. If the white space is found the string is broken by existing code creates a newline for it. If no white space can be found in the sequence string, then the string is broken and an ampersand, (&), is place at the end of line with a newline following. Existing code within ODL will concatenate the string in the correct fashion when reading in the new file.

Sample Input:

  PARAMETER            = ("AIR TEMPERATURE", "ANTENNA TEMPERATURE", "BOUNDARY L
AYER TEMPERATURE", "BRIGHTNESS TEMPERATURE", "CLOUD LIQUID WATER", "LAND CLASSE
S", "LIGHTNING", "PRECIPITATION", "PRECIPITATION AMOUNT", "PRECIPITATION RATE",
"RADAR REFLECTIVITY", "SENSOR COUNTS", "SURFACE TEMPERATURE", "SURFACE WIND SP
EED/DIRECTION", "WATER VAPOR", "http://www.aspensys.com/jobs.html#Internet", "h
ttp://www.gnn.com/gnn/wic/wics/bank.02.html", "http://pubweb.parc.xerox.com/map
/db=usa/features=alltypes/ht=0.70/lat=39.68/lon=-104.99/wd=1.41")

Output Before Changes:

  PARAMETER            = ("AIR TEMPERATURE", "ANTENNA TEMPERATURE",
      "BOUNDARY LAYER TEMPERATURE", "BRIGHTNESS TEMPERATURE",
      "CLOUD LIQUID WATER", "LAND CLASSES", "LIGHTNING",
      "PRECIPITATION", "PRECIPITATION AMOUNT", "PRECIPITATION RATE",
      "RADAR REFLECTIVITY", "SENSOR COUNTS", "SURFACE TEMPERATURE",
      "SURFACE WIND SPEED/DIRECTION", "WATER VAPOR", "http://www.asp
      ensys.com/jobs.html#Internet", "http://www.gnn.com/gnn/wic/wic
      s/bank.02.html"

core dump

Output After Changes:

  PARAMETER            = (
      "AIR TEMPERATURE",
      "ANTENNA TEMPERATURE",
      "BOUNDARY LAYER TEMPERATURE",
      "BRIGHTNESS TEMPERATURE",
      "CLOUD LIQUID WATER",
      "LAND CLASSES",
      "LIGHTNING",
      "PRECIPITATION",
      "PRECIPITATION AMOUNT",
      "PRECIPITATION RATE",
      "RADAR REFLECTIVITY",
      "SENSOR COUNTS",
      "SURFACE TEMPERATURE",
      "SURFACE WIND SPEED/DIRECTION",
      "WATER VAPOR",
      "http://www.aspensys.com/jobs.html#Internet",
      "http://www.gnn.com/gnn/wic/wics/bank.02.html",
      "http://pubweb.parc.xerox.com/map/db=usa/features=alltypes/ht=0&
      .70/lat=39.68/lon=-104.99/wd=1.41")

NOTE: This does not correct the weakness ODL has in splicing formatted strings. White-spaces can be deleted from a string when the user had no intention of removing them. Mr. Eryq Dorfman has proposed a solution that will take care of this problem and others. See the Other sources section below.

In routine lexan.c, function yyGetStringToken() a change has been made to exclude the dash conditional.


Deep ODL problem

Another problem was reported by Mr. Beaumont with the PGS Toolkit team, Global Hydrology and Climate Center located at the University of Alabama in Huntsville. The fix he submitted has been incorporated into the ODLC library we are using.

Yesterday's e-mail indicated that there was an "error deep in the ODL library" which prevented the proper parsing of names containing numeric digits (HERES_1_EXAMPLE).
In odl2.l, make the following change:
Circa line 173 (depending on your version of ODL) change
{WORD}("_"{WORD})*("_"{U_INTEGER})?
to
{WORD}("_"({LETTER}|{DIGIT})+)*
You may also have to change the %o value (circa line 2) to something larger, say 3550.
Then
lex odl2.l mv lex.yy.c lexan.c
and rebuild the ODL library. The entire process should take no more than 10 minutes. Depending on your ODL makefile, you may get a number of "statement is not reachable" errors from the SGI compiler.

Other sources of information for ODL:

ODL Specification and Usage - JPL documentation
A Very Brief Introduction to ODL
Origonal version 1.0 C source code. See http://pds.jpl.nasa.gov/softinv/inv.html for more information.

Text-ODL - A Perl implementation
Index of Text-ODL A source index

The following is a proposal is authored by Eryq Dorfman to implement a new ODL library. This ODL library would address and correct the issues listed above.

On Fri, 18 Apr 1997, Eryq wrote:
I see the strategy as this:
  1. Produce an ODLC capable of parsing v.1 and v.2 ODL. By default, it should *generate* v.1-compatible ODL; that means clean sequence-strings, but old-style text-wrapping.
  2. Propagate it throughout the community. Some people will upgrade soon, some will not. That's okay; for now, it just looks like a "fixed" ODLC for v.1 syntax. It will continue to parse and generate v.1.
  3. When you're fairly certain everyone you care about has upgraded (might take a year or more), tell everyone that -- at their convenience -- they should recompile their ODLC with -DODLV2. Again, this need not be done in lock-step.

At that point, the library will generate v.2 ODL by default, with correct string wrapping. Since everyone has an ODL library which will tolerate the new syntax, there should be few problems. Some, maybe. But few.

The point is, it's not in lock-step. People can upgrade gradually, and switch over gradually. The trick is that you always allow parsing of v.1 and v.2 first (maybe indefinitely), and when everyone has a v.2-aware parser, you let them switch over to v.2.

Last revised: March 26, 1998
Information Contact: IMS V0 Development (ims@gsfc.nasa.gov)
IMS Web Curator:Grace Payne (grace@ killians.gsfc.nasa.gov)
NASA Official: Chris Wilkinson (chris.wilkinson1@gsfc.nasa.gov)