Changeset 27435 for trunk/Ohana/src/libfits/header/F_H_field.c
- Timestamp:
- Mar 24, 2010, 11:22:25 AM (16 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/libfits/header/F_H_field.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
-
Property svn:mergeinfo
set to
/branches/eam_branches/20091201/Ohana merged eligible /branches/eam_branches/largefiles.20100314/Ohana merged eligible
-
Property svn:mergeinfo
set to
-
trunk/Ohana/src/libfits/header/F_H_field.c
r21059 r27435 6 6 7 7 char *buf; 8 int i, Nwant, Nfound; 8 off_t i; 9 int Nwant, Nfound; 9 10 char keyword[10]; 11 12 if (header[0].buffer == NULL) return NULL; 10 13 11 14 /* create a blank-padded keyword with exactly 8 characters */ … … 19 22 /* find the Nth entry */ 20 23 Nfound = 0; 21 for (i = 0; i < header[0]. size; i+= FT_LINE_LENGTH, buf += FT_LINE_LENGTH) {24 for (i = 0; i < header[0].datasize; i+= FT_LINE_LENGTH, buf += FT_LINE_LENGTH) { 22 25 if (!strncmp (keyword, buf, 8)) { 23 26 Nfound ++; … … 30 33 /* count the entries */ 31 34 Nfound = 0; 32 for (i = 0; i < header[0]. size; i+= FT_LINE_LENGTH, buf += FT_LINE_LENGTH) {35 for (i = 0; i < header[0].datasize; i+= FT_LINE_LENGTH, buf += FT_LINE_LENGTH) { 33 36 if (!strncmp (keyword, buf, 8)) { 34 37 Nfound ++; … … 41 44 /* find the Nwant entry */ 42 45 Nfound = 0; 43 for (i = 0; i < header[0]. size; i+= FT_LINE_LENGTH, buf += FT_LINE_LENGTH) {46 for (i = 0; i < header[0].datasize; i+= FT_LINE_LENGTH, buf += FT_LINE_LENGTH) { 44 47 if (!strncmp (keyword, buf, 8)) { 45 48 Nfound ++; … … 50 53 } 51 54 52 return ((char *) NULL);55 return NULL; 53 56 54 57 /* … … 66 69 67 70 char *buf, *ptr; 68 int i, Nwant, Nfound, Nfield; 71 off_t i; 72 int Nwant, Nfound, Nfield; 73 74 if (header[0].buffer == NULL) return NULL; 69 75 70 76 Nfield = strlen (field); … … 76 82 if (N > 0) { 77 83 Nfound = 0; 78 for (i = 0; i < header[0]. size; i+= FT_LINE_LENGTH, buf += FT_LINE_LENGTH) {84 for (i = 0; i < header[0].datasize; i+= FT_LINE_LENGTH, buf += FT_LINE_LENGTH) { 79 85 // have we found a HIERARCH entry? 80 86 if (strncmp ("HIERARCH", buf, 8)) continue; … … 90 96 /* count the entries */ 91 97 Nfound = 0; 92 for (i = 0; i < header[0]. size; i+= FT_LINE_LENGTH, buf += FT_LINE_LENGTH) {98 for (i = 0; i < header[0].datasize; i+= FT_LINE_LENGTH, buf += FT_LINE_LENGTH) { 93 99 if (strncmp ("HIERARCH", buf, 8)) continue; 94 100 ptr = buf + 9; // start of following keyword … … 102 108 /* find the Nwant entry */ 103 109 Nfound = 0; 104 for (i = 0; i < header[0]. size; i+= FT_LINE_LENGTH, buf += FT_LINE_LENGTH) {110 for (i = 0; i < header[0].datasize; i+= FT_LINE_LENGTH, buf += FT_LINE_LENGTH) { 105 111 if (strncmp ("HIERARCH", buf, 8)) continue; 106 112 ptr = buf + 9; // start of following keyword … … 111 117 } 112 118 113 return ((char *) NULL);119 return NULL; 114 120 115 121 /* … … 122 128 123 129 /*********************** fits header field ****************************/ 124 char *gfits_header_lineno (Header *header, int N) {130 char *gfits_header_lineno (Header *header, off_t N) { 125 131 126 132 char *buf; 127 133 128 if (N*80 >= header[0]. size) return NULL;134 if (N*80 >= header[0].datasize) return NULL; 129 135 130 136 buf = &header[0].buffer[N*80];
Note:
See TracChangeset
for help on using the changeset viewer.
