MISR Toolkit  1.5.1
fmtvalue.c
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  Description: This file contains routines that are used to format
4  ODL values for output. Each routine converts a
5  specific type of data value from its internal ODLC
6  format to an ASCII text string.
7 
8  Author: Randy Davis, University of Colorado LASP
9 
10  Creation Date: 22 March 1989
11  Last Modified: 18 May 1991
12 
13  History:
14 
15  Creation - This module was introduced in the Version 1 release of the
16  ODLC library.
17 
18  Version 2.0 - 03 November 1990 - R. Davis, U. of Colorado LASP
19  a) Modified to be compatible with Version 2 data structures.
20  b) Direct writing of output is eliminated: formatted values now
21  returned in text strings.
22  c) Changed names of routines from ODLPutx (for example, ODLPutString)
23  to ODLFormatx (as in ODLFormatString) to reflect the fact that
24  these routines no longer directly write their output.
25  d) Cleaned up the code for routine ODLFormatString.
26 
27  Version 2.1 - 13 March 1991 - R. Davis, U. of Colorado LASP
28  a) Modified the calling sequence to ODLFormatString so that the
29  pointer to the current column is passed as argument column,
30  and an updated value is returned. This makes the routine
31  format output correctly for arrays of strings and other
32  situations that previously caused problems with excessively
33  long lines of output.
34  a) Added routine ODLFormatComment to format comments in labels.
35 
36  Version 2.2 - 18 May 1991 - M. DeMore, Jet Propulsion Laboratory
37  Removed include statements that were Unix specific and placed them
38  in odldef.h. Added include file odlinter.h.
39 
40  Version 2.3 - 13 October 1991 - M. DeMore, Jet Propulsion Laboratory.
41  Added is_pointer input to ODLFormatString in order to cope with
42  backslashes in DOS file names.
43 
44  26 October 1996, Alward N. Siyyid Changed the value for MAX_RIGHT_MARGIN from
45  132 to 317 to allow for long words in a string
46 
47 *****************************************************************************/
48 
49 
50 #include <ctype.h>
51 #include <math.h>
52 
53 #include "odldef.h"
54 #include "odlinter.h"
55 
56 
57 
58 
59 
60 /*****************************************************************************
61 
62  Routine: ODLFormatInteger
63 
64  Description: Formats an integer number for output, in decimal or based
65  format, and with or without units.
66 
67  Input:
68  stmt - Character string to receive formatted value.
69  value - Pointer to a value data structure that contains the
70  value and associated formatting information.
71 
72  Output: The value is formatted and returned in the string pointed
73  to by the first parameter. The count of characters
74  placed into the output string is returned as the
75  function value.
76 
77 *****************************************************************************/
78 
79 
80 int ODLFormatInteger (char stmt[], VALUE_DATA *item)
81 {
82  char digits[64]; /* Array to hold string of digits */
83  int base; /* Number base */
84  int dnum; /* Current digit of number */
85  int i; /* Index into array */
86  int len; /* Number of characters in output string */
87  unsigned long num; /* Used to hold number during conversion */
88 
89 
90  /* If the format is 0 then we are to print in standard signed decimal
91  format. If format > 0, the value will be printed as an unsigned number
92  using based notation. A format value < 0 indicates an error and the
93  value cannot be printed. */
94 
95  if (item->valid == 0)
96  {
97  sprintf (stmt, "**Error**");
98  len = 9;
99  }
100  else
101  {
102  num = item->value.integer.number;
103  if (item->format == 0)
104  {
105  sprintf (stmt, "%ld", num);
106  }
107  else
108  {
109  /* The output is to be in based notation. Convert the output a digit
110  at a time, according to the specified base. We always put out at
111  least one digit. */
112 
113  i = 64;
114  digits[--i] = '\0';
115 
116  if (item->format > 0)
117  {
118  /* The number is positive */
119 
120  base = item->format;
121  }
122  else
123  {
124  /* The number is negative: negate the value to be output */
125 
126  base = -item->format;
127  num = -num;
128  }
129 
130  do
131  {
132  dnum = num%base;
133  digits[--i] = (dnum < 10) ? dnum + '0' : (dnum-10) + 'A';
134  num = num/base;
135  } while (num > 0);
136 
137  if (item->format < (char) 0)
138  {
139  digits[--i] = '-';
140  }
141 
142  sprintf (stmt, "%d#%s#",
143  base,
144  &digits[i]);
145  }
146 
147  /* Determine the length of the number string */
148 
149  len = strlen (stmt);
150 
151  /* Put in the units associated with the number, if any */
152 
153  len += ODLFormatUnits (&stmt[len], item->value.integer.units);
154  }
155 
156  return (len);
157 }
158 
159 
160 
161 
162 /*****************************************************************************
163 
164  Routine: ODLFormatReal
165 
166  Description: Formats a real number for output, with or without units.
167 
168  Input:
169  output_file - A pointer to the file to which the output is to go.
170  value - Pointer to a value data structure that contains the
171  value and associated formatting information.
172 
173  Output: The value is formatted and returned in the string pointed
174  to by the first parameter. The count of characters
175  placed into the output string is returned as the
176  function value.
177 
178 *****************************************************************************/
179 
180 
181 int ODLFormatReal (char *stmt, VALUE_DATA *item)
182 {
183  int len; /* Number of characters in output string */
184 
185 
186  /* If the format value is < 0 then the value is in error and can't
187  be output. Otherwise format the value for output */
188 
189  if (item->valid == 0)
190  {
191  sprintf (stmt, "**Error**");
192  len = 9;
193  }
194  else
195  {
196  if (item->format == 0)
197  {
198  /* Format the number using the general format */
199 
200  sprintf (stmt, "%g",
201  item->value.real.number);
202  }
203  else if (item->format == 1)
204  {
205  /* Format the number using the decimal format. We
206  always put in at least one decimal place */
207 
208  sprintf (stmt, "%.*f",
209  (item->precision <= 0)? 1 : item->precision,
210  item->value.real.number);
211  }
212  else
213  {
214  /* Format the number using the exponential format. We
215  always put in at least one decimal place */
216 
217  sprintf (stmt, "%.*e",
218  (item->precision <= 0)? 1 : item->precision,
219  item->value.real.number);
220  }
221 
222  /* Determine the length of the number string */
223 
224  len = strlen (stmt);
225 
226  /* Put in the units associated with the number, if any */
227 
228  len += ODLFormatUnits (&stmt[len], item->value.real.units);
229  }
230 
231  return (len);
232 }
233 
234 
235 
236 
237 /*****************************************************************************
238 
239  Routine: ODLFormatUnits
240 
241  Description: Formats the units of an integer or real number for output.
242 
243  Input:
244  stmt - Character string to receive formatted value.
245  units - Pointer to the first units field. If this value is
246  NULL then no units are present and the routine
247  does nothing.
248 
249  Output: The units are formatted and returned in the string pointed
250  to by the first parameter. The count of characters
251  placed into the output string is returned as the
252  function value.
253 
254 *****************************************************************************/
255 
256 
257 int ODLFormatUnits (char *stmt, struct ODLUnits *units)
258 {
259  struct ODLUnits *current_units;/* Pointer to current units field */
260  int first_field; /* =1 if first units field; 0 otherwise */
261  int uexp; /* Units exponent value */
262  int len; /* Number of characters in output string */
263 
264 
265  len = 0;
266 
267  if (units != NULL)
268  {
269  current_units = units;
270 
271  /* Start with the opening units expression delimiter */
272 
273  stmt[len++] = '<';
274 
275  /* Add in each field of the units expression */
276 
277  first_field = 1;
278 
279  while (current_units != NULL)
280  {
281  /* If this is not the first field put in a '*' if the field is
282  being multiplied by the previous units or '/' if the field
283  is being divided into the previous units */
284 
285  uexp = current_units->exponent;
286 
287  if (!first_field)
288  {
289  if (uexp > 0)
290  {
291  stmt[len++] = '*';
292  }
293 
294  else
295  {
296  stmt[len++] = '/';
297  uexp = -uexp;
298  }
299  }
300  else
301  {
302  first_field = 0;
303  }
304 
305  /* Put in the units */
306 
307  sprintf (&stmt[len], "%s",
308  current_units->designator);
309  len += strlen (&stmt[len]);
310 
311  /* Put in the exponent, if appropriate */
312 
313  if (uexp != 1)
314  {
315  sprintf (&stmt[len], "**%d",
316  uexp);
317  len += strlen (&stmt[len]);
318  }
319 
320  /* Get the next units field, if any */
321 
322  current_units = current_units->next_field;
323  }
324 
325  /* Put in the terminating delimiter for the units expression */
326 
327  stmt[len++] = '>';
328  stmt[len] = '\0';
329  }
330 
331  return (len);
332 }
333 
334 
335 
336 
337 /*****************************************************************************
338 
339  Routine: ODLFormatSymbol
340 
341  Description: Formats a symbol, with or without delimiters.
342 
343  Input:
344  stmt - Character string to receive the formatted output.
345  value - Pointer to a value data structure that contains the
346  value and associated formatting information.
347 
348  Output: The symbol is placed into the statement string and the number
349  of characters put in the string is returned as the function
350  value.
351 
352 *****************************************************************************/
353 
354 
355 int ODLFormatSymbol (char *stmt, VALUE_DATA *item)
356 {
357  int len; /* Number of characters in output string */
358 
359 
360  /* Format the symbol. If the format code is less than zero then the value
361  has an error and can't be output. If the format is greater than
362  zero then the symbol is a name that doesn't require delimiters.
363  Else, if format is zero, put the symbol between delimiters */
364 
365  if (item->valid == 0)
366  {
367  sprintf (stmt, "**Error**");
368  }
369  else if (item->format > 0)
370  {
371  sprintf (stmt, "%s",
372  item->value.string);
373  }
374  else
375  {
376  sprintf (stmt, "\'%s\'",
377  item->value.string);
378  }
379 
380  /* Determine the length of the formatted string */
381 
382  len = strlen (stmt);
383 
384  return (len);
385 }
386 
387 
388 
389 
390 /*****************************************************************************
391 
392  Routine: ODLFormatDate
393 
394  Description: Formats a date for output, either as year-month-day or
395  year-doy.
396 
397  Input:
398  stmt - Character string to receive formatted output.
399  value - Pointer to a value data structure that contains the
400  value and associated formatting information.
401 
402  Output: The formatted value is placed into the statement string and the
403  number of characters put in the string is returned as the
404  function value.
405 
406 *****************************************************************************/
407 
408 
409 int ODLFormatDate (char *stmt, VALUE_DATA *item)
410 {
411 /* >>>>>>>>>>>>>>>>>>>>>>>>>> BEGIN CN CHANGES >>>>>>>>>>>>>>>>>>>>>>>>> */
412 /* >>>>> MDD 5/26/91 Removed declarations of unused variables >>>>> */
413 /* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> */
414 
415  int day; /* Day of month (1-31) */
416  int doy; /* Day of year (1-366) */
417  int month; /* Month (1-12) */
418  int year; /* Year */
419  int len; /* Number of characters in output string */
420 
421 /* >>>>>>>>>>>>>>>>>>>>>>>>>> END OF CN CHANGES >>>>>>>>>>>>>>>>>>>>>>>>> */
422 
423 
424  /* If the format flag is less than zero then there is an error in the
425  value and we can't format it for output */
426 
427  if (item->valid == 0)
428  {
429  sprintf (stmt, "**Error**");
430  }
431  else
432  {
433  /* Get the components of the date */
434 
435  year = (int) item->value.date_time.year;
436  doy = (int) item->value.date_time.doy;
437  month = (int) item->value.date_time.month;
438  day = (int) item->value.date_time.day;
439 
440  if (item->format/10 == 3)
441  {
442  /* Format the date as year, month and day-of-month */
443 
444  sprintf (stmt, "%d-%02d-%02d",
445  year, month, day);
446  }
447  else
448  {
449 
450  /* Format the date as year and day-of-year */
451 
452  sprintf (stmt, "%d-%03d",
453  year, doy);
454  }
455  }
456 
457  /* Determine the length of the formatted string */
458 
459  len = strlen (stmt);
460 
461  return (len);
462 }
463 
464 
465 
466 
467 /*****************************************************************************
468 
469  Routine: ODLFormatTime
470 
471  Description: Formats a time and time zone indicator for output.
472 
473  Input:
474  stmt - Character string to receive formatted output.
475  value - Pointer to a value data structure that contains the
476  value and associated formatting information.
477 
478  Output: The formatted value is placed into the statement string. The
479  function returns the number of characters put in the string.
480 
481 *****************************************************************************/
482 
483 
484 int ODLFormatTime (char *stmt, VALUE_DATA *item)
485 {
486  int hours; /* Hours of day (0-23) and time zone hours */
487  int minutes; /* Minutes of hour (0-59) and time zone mins*/
488  double seconds; /* Seconds of minute (<60.0) */
489  int len; /* Number of characters in output string */
490 
491 
492  if (item->valid == 0)
493  {
494  sprintf (stmt, "**Error**");
495  len = 9;
496  }
497  else
498  {
499  /* Get the components of the time */
500 
501  hours = (int) item->value.date_time.hours;
502  minutes = (int) item->value.date_time.minutes;
503  seconds = (double) item->value.date_time.seconds +
504  (double) item->value.date_time.nanoseconds*1.0E-9;
505 
506  /* Put out the hours, minutes and seconds (always two
507  digits apiece) */
508 
509  sprintf (stmt, "%02d:%02d",
510  hours, minutes);
511  len = 5;
512 
513  if (item->format % 10 == 3)
514  {
515  /* Put out seconds part of time as well */
516 
517  stmt[len++] = ':';
518 
519  if (seconds < 10.0)
520  {
521  stmt[len++] = '0';
522  }
523  sprintf (&stmt[len], "%.*f",
524  item->precision,
525  seconds);
526  len += strlen (&stmt[len]);
527  }
528 
529  /* Put out the time zone. If UTC, output a 'Z'; otherwise
530  output the number of hours from Greenwich */
531 
532  hours = (int) item->value.date_time.zone_hours;
533  minutes = (int) item->value.date_time.zone_minutes;
534 
535  if (hours == 0)
536  {
537  stmt[len++] = 'Z';
538  stmt[len] = '\0';
539  }
540  else
541  {
542  /* Put out hours part of time zone offset */
543 
544  sprintf (&stmt[len], "%+03d",
545  hours);
546  len += 3;
547 
548  if (minutes != 0)
549  {
550  /* Put out minutes part of time zone offset also */
551 
552  sprintf (&stmt[len], ":%02d",
553  minutes);
554  len += 3;
555  }
556  }
557  }
558 
559  return (len);
560 }
561 
562 
563 
564 
565 /*****************************************************************************
566 
567  Routine: ODLFormatDateTime
568 
569  Description: Formats a date and time for output.
570 
571  Input:
572  stmt - Character string to received formatted result.
573  value - Pointer to a value data structure that contains the
574  value and associated formatting information.
575 
576  Output: The formatted value is placed into the statement string. The
577  function returns the number of characters put in the string.
578 
579 *****************************************************************************/
580 
581 
582 int ODLFormatDateTime (char *stmt, VALUE_DATA *item)
583 {
584  int len; /* Number of characters in output string */
585 
586 
587  /* If the format is less than zero then the value has an error and can't
588  be printed. Else print the date and time with a 'T' in between as
589  a separator. */
590 
591  if (item->valid == 0)
592  {
593  sprintf (stmt, "**Error**");
594  len = 9;
595  }
596  else
597  {
598  len = ODLFormatDate (stmt, item);
599  stmt[len++] = 'T';
600  len += ODLFormatTime (&stmt[len], item);
601  }
602 
603  return (len);
604 }
605 
606 
607 
608 
609 /*****************************************************************************
610 
611  ODLFormatString: Format an ODL string value for output.
612 
613  Input:
614  stmt - Character string to receive formatted output.
615  value - Pointer to a value data structure that contains
616  the value and associated formatting information.
617  column - Pointer to current column number. Upon return,
618  the value will be updated to point to the next
619  column after the terminating quotation mark.
620  left_margin - Starting column number for lines 2 and beyond,
621  counting from 1.
622  right_margin - Last column for text on all lines.
623  format_flag - Set to TRUE if the '\t's and '\n's in the string
624  are not be be expanded on output (PDS label format).
625  is_pointer - Set to TRUE if the string being processed was part
626  of a pointer attribute, in which case '\t's and '\n's
627  in the string aren't touched.
628 
629  Output: The formatted string is placed into the statement string and the
630  number of characters put in the string is returned as the
631  function value.
632 
633  ****************************************************************************/
634 
635 
636 int ODLFormatString (char stmt[], VALUE_DATA *item, int *column,
637  int left_margin, int right_margin, int format_flag,
638  int is_pointer)
639 
640 {
641  char *text; /* Pointer to input string */
642  char c; /* Current input character */
643  int i; /* Loop index */
644  int l; /* Current column number */
645  int m; /* Index into input string */
646  int n; /* Length of input string */
647  int lmargin; /* Adjusted left margin for line 2 & beyond */
648  int rmargin; /* Adjusted right margin */
649  int endline; /* TRUE if at end-of-line */
650  int len; /* Number of characters in output string */
651 
652 #define indentf(X) for (i=0 ; i < X ; i++) stmt[len++] = ' '
653 
654 #define TAB_SIZE 8
655 #define MIN_LINE_LENGTH 40
656 #define MAX_LEFT_MARGIN 32
657 /*
658 #define MAX_RIGHT_MARGIN 132
659 */
660 #define MAX_RIGHT_MARGIN 317
661 
662 
663  /* Check the line margin values and adjust them if they are out of range */
664 
665  if (left_margin < 1)
666  {
667  lmargin = 1;
668  }
669  else if (left_margin > MAX_LEFT_MARGIN)
670  {
671  lmargin = MAX_LEFT_MARGIN;
672  }
673  else
674  {
675  lmargin = left_margin;
676  }
677 
678  if (right_margin > MAX_RIGHT_MARGIN)
679  {
680  rmargin = MAX_RIGHT_MARGIN;
681  }
682  else if (right_margin < lmargin+MIN_LINE_LENGTH)
683  {
684  rmargin = lmargin + MIN_LINE_LENGTH;
685  }
686  else
687  {
688  rmargin = right_margin;
689  }
690 
691  /* Initialize counters and flags */
692 
693  l = (*column > 0)? *column : 1;
694  endline = 0;
695  len = 0;
696 
697  if (l > rmargin)
698  {
699  /* We're beyond the right margin already, so start a new one before
700  starting the string */
701 
702  stmt[len++] = '\n';
703  indentf (lmargin);
704  l = lmargin;
705  }
706 
707  /* Put out the opening quotation mark string delimiter */
708 
709  stmt[len++] = '\"';
710  l++;
711 
712  /* Scan through all of the input string, formatting as we go */
713 
714  text = item->value.string;
715  n = item->length;
716 
717  for ( m = 0 ; m < n ; )
718  {
719  c = text[m++];
720  if (!is_pointer && c == '\\')
721  {
722  c = text[m++];
723  switch (c)
724  {
725  case 'n':
726 
727  /* We encountered an explicit newline: go put out the line */
728 
729  if (format_flag)
730  {
731  stmt[len++] = '\\';
732  stmt[len++] = 'n';
733  l += 2;
734  }
735 
736  endline = 1;
737  break;
738 
739  case 't':
740 
741  /* Character is a horizontal tab */
742 
743  if (format_flag)
744  {
745  /* The output is being formatted in PDS label format, so
746  indicate the tab explicitly */
747 
748  stmt[len++] = '\\';
749  stmt[len++] = 't';
750  l += 2;
751  }
752  else
753  {
754  /* The output is being formatted as normal text so expand the
755  tab if there is room on the line; if the tab comes at the
756  end of the line it can be discarded */
757 
758  if (l+TAB_SIZE < rmargin)
759  {
760  indentf (TAB_SIZE);
761  l += TAB_SIZE;
762  }
763  else
764  {
765  endline = 1;
766  }
767  }
768  break;
769 
770  default:
771  stmt[len++] = '\\';
772  stmt[len++] = c;
773  l+=2;
774  break;
775  }
776  }
777  else
778  {
779  /* Add the character to the line. */
780 
781  stmt[len++] = c;
782  l++;
783 
784  if (l > rmargin)
785  {
786  /* The current output line is full. See if the next
787  character is a blank or tab */
788 
789  if (m < n && isspace (text[m]))
790  {
791  /* It is: skip forward to the next non-blank character */
792 
793  for ( ; m < n && isspace (text[m]) ; m++);
794  }
795  else
796  {
797  /* It is not: move back to a previous space character
798  to perform word wrapping. */
799 
800  while (l > lmargin && len > 1 && !isspace (stmt[len-1]))
801  {
802  len--;
803  l--;
804  m--;
805  }
806  }
807 
808  endline = 1;
809  }
810  }
811 
812  /* If we're at the end of a line, print it out and start a new line
813  at the left margin */
814 
815  if (endline)
816  {
817  stmt[len++] = '\n';
818  indentf (lmargin);
819  l = lmargin;
820  endline = 0;
821  }
822  }
823 
824  /* Put out the terminating quotation mark string delimiter and return
825  the location of the next available print column */
826 
827  stmt[len++] = '\"';
828  stmt[len] = '\0';
829  *column = l+2;
830 
831  return (len);
832 }
833 
834 
835 
836 
837 /*****************************************************************************
838 
839  Routine: ODLFormatComment
840 
841  Description: Formats a comment for insertion into a label
842 
843  Input:
844  stmt - Character string to receive the formatted output.
845  comment - Character string containing the comment.
846 
847  Output: The comment is placed into the statement string and the number
848  of characters put in the string is returned as the function
849  value.
850 
851 *****************************************************************************/
852 
853 
854 int ODLFormatComment (char *stmt, char *comment, int left_margin,
855  int right_margin)
856 {
857  char c; /* Current input character */
858  int i; /* Loop index */
859  int l; /* Index into output line */
860  int ic; /* Index into comment string */
861  int len; /* Number of characters in output string */
862  int lmargin; /* Adjusted left margin */
863  int rmargin; /* Adjusted right margin */
864 
865 #define indentf(X) for (i=0 ; i < X ; i++) stmt[len++] = ' '
866 
867 #define MIN_LINE_LENGTH 40
868 #define MAX_LEFT_MARGIN 32
869 #define MAX_RIGHT_MARGIN 317
870 
871 
872  if (comment == NULL)
873  {
874  return (0);
875  }
876 
877  /* Check the line margin values and adjust them if they are out of range */
878 
879  if (left_margin < 1)
880  {
881  lmargin = 1;
882  }
883  else if (left_margin > MAX_LEFT_MARGIN)
884  {
885  lmargin = MAX_LEFT_MARGIN;
886  }
887  else
888  {
889  lmargin = left_margin;
890  }
891 
892  if (right_margin > MAX_RIGHT_MARGIN)
893  {
894  rmargin = MAX_RIGHT_MARGIN;
895  }
896  else if (right_margin < lmargin+MIN_LINE_LENGTH)
897  {
898  rmargin = lmargin + MIN_LINE_LENGTH;
899  }
900  else
901  {
902  rmargin = right_margin;
903  }
904 
905  rmargin = rmargin - 3;
906 
907  /* Put out the slash and asterisk to start the first comment line */
908 
909  len = 0;
910  stmt[len++] = '\n';
911  indentf (lmargin-1);
912  stmt[len++] = '/';
913  stmt[len++] = '*';
914  l = lmargin+2;
915 
916  for (ic = 0 ; (c = comment[ic]) != '\0' ; ic++)
917  {
918  if (c == '\n' || l > rmargin)
919  {
920  /* This is the end of a line: put out the asterisk and slash
921  that terminate the current line */
922 
923  stmt[len++] = ' ';
924  stmt[len++] = '*';
925  stmt[len++] = '/';
926  stmt[len++] = '\n';
927 
928  /* Put out the slash and asterisk that start a new comment line */
929 
930  indentf (lmargin-1);
931  stmt[len++] = '/';
932  stmt[len++] = '*';
933  l = lmargin+2;
934  }
935 
936  if (c != '\n')
937  {
938  /* Put the current character into the output line */
939 
940  stmt[len++] = c;
941  l++;
942  }
943  }
944 
945  /* Terminate the last line of the comment */
946 
947  stmt[len++] = ' ';
948  stmt[len++] = '*';
949  stmt[len++] = '/';
950  stmt[len++] = '\n';
951  stmt[len++] = '\n';
952  stmt[len] = '\0';
953 
954  return (len);
955 }
HDFFCLIBAPI intf * len
char hours
Definition: odldef.h:204
char day
Definition: odldef.h:201
#define MAX_RIGHT_MARGIN
char format
Definition: odldef.h:215
char month
Definition: odldef.h:200
int ODLFormatString(char stmt[], VALUE_DATA *item, int *column, int left_margin, int right_margin, int format_flag, int is_pointer)
Definition: fmtvalue.c:636
short year
Definition: odldef.h:198
struct ODLInteger integer
Definition: odldef.h:219
int ODLFormatSymbol(char *stmt, VALUE_DATA *item)
Definition: fmtvalue.c:355
int ODLFormatUnits(char *stmt, struct ODLUnits *units)
Definition: fmtvalue.c:257
#define MAX_LEFT_MARGIN
struct ODLDate date_time
Definition: odldef.h:221
char seconds
Definition: odldef.h:206
short length
Definition: odldef.h:217
double number
Definition: odldef.h:184
char minutes
Definition: odldef.h:205
short doy
Definition: odldef.h:199
int ODLFormatDateTime(char *stmt, VALUE_DATA *item)
Definition: fmtvalue.c:582
int ODLFormatDate(char *stmt, VALUE_DATA *item)
Definition: fmtvalue.c:409
struct ODLUnits * next_field
Definition: odldef.h:178
char valid
Definition: odldef.h:214
int ODLFormatReal(char *stmt, VALUE_DATA *item)
Definition: fmtvalue.c:181
struct ODLReal real
Definition: odldef.h:220
int ODLFormatInteger(char stmt[], VALUE_DATA *item)
Definition: fmtvalue.c:80
long exponent
Definition: odldef.h:177
short precision
Definition: odldef.h:216
HDFFCLIBAPI _fcd _fcd intf * n
char * string
Definition: odldef.h:222
HDFFCLIBAPI intf intf intf * num
#define MIN_LINE_LENGTH
char * designator
Definition: odldef.h:176
int ODLFormatTime(char *stmt, VALUE_DATA *item)
Definition: fmtvalue.c:484
struct ODLUnits * units
Definition: odldef.h:185
struct ODLUnits * units
Definition: odldef.h:192
int ODLFormatComment(char *stmt, char *comment, int left_margin, int right_margin)
Definition: fmtvalue.c:854
char zone_minutes
Definition: odldef.h:203
#define TAB_SIZE
long nanoseconds
Definition: odldef.h:207
union Value_Data::@2 value
#define indentf(X)
short zone_hours
Definition: odldef.h:202
long number
Definition: odldef.h:191

MISR Toolkit - Copyright © 2005 - 2020 Jet Propulsion Laboratory
Generated on Fri Jun 19 2020 22:49:51