Changeset 3369 for trunk/Ohana/src/libfits/header/F_modify.c
- Timestamp:
- Mar 2, 2005, 6:02:44 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libfits/header/F_modify.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libfits/header/F_modify.c
r2415 r3369 1 1 # include "fits.h" 2 2 3 char *fits_keyword_start (char *line); 3 4 char *fits_keyword_end (char *line); 4 5 void pad_ending (char *line, char value, int Nbyte); … … 98 99 } 99 100 101 /* given a FITS card line, return pointer to the start of the data area */ 102 char *fits_keyword_start (char *line) { 103 104 int done; 105 char *c; 106 107 /* find the end of the existing data region */ 108 c = line + 8; 109 if (*c != '=') return (c); /* no data in COMMENT field */ 110 111 c += 2; 112 /* advance pointer over whitespace */ 113 while ((*c == ' ') && (c < line + 80)) { c++; } 114 115 /* skip one quote mark */ 116 if ((*c == 0x27) && (c < line + 80)) { c++; } 117 118 return (c); 119 } 120 100 121 /* given a FITS card line, return pointer to the end of the data area */ 101 122 char *fits_keyword_end (char *line) { … … 105 126 106 127 /* find the end of the existing data region */ 107 c2 = line + 8; 108 if (*c2 != '=') return (c2); /* no data in COMMENT field */ 128 c1 = line + 8; 129 if (*c1 != '=') return (c1); /* no data in COMMENT field */ 130 c1 += 2; 131 132 /* advance pointer over whitespace */ 133 while ((*c1 == ' ') && (c1 < line + 80)) { c1++; } 109 134 110 c1 = c2 + 2;111 135 if (c1[0] == 0x27) { /* entry a string, skip over 'fred' */ 112 136 for (done = FALSE, c2 = c1 + 1; !done && (c2 < line + 80); c2++) { … … 116 140 } 117 141 if (c2[0] == 0x27) { 118 c1 = c2 + 1;142 c1 = c2; 119 143 done = TRUE; 120 144 } … … 124 148 } 125 149 } else { 126 while ((*c1 == ' ') && (c1 < line + 80)) c1++;127 150 while ((*c1 != ' ') && (c1 < line + 80)) c1++; 128 151 }
Note:
See TracChangeset
for help on using the changeset viewer.
