- Timestamp:
- Mar 16, 2010, 6:44:32 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/largefiles.20100314/Ohana/src/libfits/header/F_modify.c
r21059 r27295 29 29 30 30 /* is there enough space for 1 more line? */ 31 if (header[0]. size - (p - (header[0].buffer)) < 2*FT_LINE_LENGTH) {32 header[0]. size += FT_RECORD_SIZE;33 REALLOCATE (header[0].buffer, char, header[0]. size);31 if (header[0].datasize - (p - (header[0].buffer)) < 2*FT_LINE_LENGTH) { 32 header[0].datasize += FT_RECORD_SIZE; 33 REALLOCATE (header[0].buffer, char, header[0].datasize); 34 34 p = gfits_header_field (header, "END", 1); 35 35 if (p == NULL) return (FALSE); … … 50 50 51 51 /* write the numeric modes */ 52 if (!strcmp (mode, "%d")) snprintf (string, 81, "%-8s= %20d / %-s ", field, va_arg (argp, int), comment); 53 if (!strcmp (mode, "%u")) snprintf (string, 81, "%-8s= %20d / %-s ", field, va_arg (argp, unsigned), comment); 54 if (!strcmp (mode, "%ld")) snprintf (string, 81, "%-8s= %20ld / %-s ", field, va_arg (argp, long), comment); 55 if (!strcmp (mode, "%hd")) snprintf (string, 81, "%-8s= %20d / %-s ", field, va_arg (argp, int), comment); 56 if (!strcmp (mode, "%f")) snprintf (string, 81, "%-8s= %20.10f / %-s ", field, va_arg (argp, double), comment); 57 if (!strcmp (mode, "%lf")) snprintf (string, 81, "%-8s= %20.10f / %-s ", field, va_arg (argp, double), comment); 58 if (!strcmp (mode, "%e")) snprintf (string, 81, "%-8s= %20.10E / %-s ", field, va_arg (argp, double), comment); 59 if (!strcmp (mode, "%le")) snprintf (string, 81, "%-8s= %20.10E / %-s ", field, va_arg (argp, double), comment); 60 if (!strcmp (mode, "%g")) snprintf (string, 81, "%-8s= %20.10G / %-s ", field, va_arg (argp, double), comment); 61 if (!strcmp (mode, "%lg")) snprintf (string, 81, "%-8s= %20.10G / %-s ", field, va_arg (argp, double), comment); 52 if (!strcmp (mode, "%d")) snprintf (string, 81, "%-8s= %20d / %-s ", field, va_arg (argp, int), comment); 53 if (!strcmp (mode, "%ld")) snprintf (string, 81, "%-8s= %20ld / %-s ", field, va_arg (argp, long), comment); 54 if (!strcmp (mode, "%lld")) snprintf (string, 81, "%-8s= %20lld / %-s ", field, va_arg (argp, long long), comment); 55 if (!strcmp (mode, "%Ld")) snprintf (string, 81, "%-8s= %20lld / %-s ", field, va_arg (argp, long long), comment); 56 if (!strcmp (mode, "%u")) snprintf (string, 81, "%-8s= %20u / %-s ", field, va_arg (argp, unsigned), comment); 57 if (!strcmp (mode, "%lu")) snprintf (string, 81, "%-8s= %20lu / %-s ", field, va_arg (argp, unsigned long), comment); 58 if (!strcmp (mode, "%llu")) snprintf (string, 81, "%-8s= %20llu / %-s ", field, va_arg (argp, unsigned long long), comment); 59 if (!strcmp (mode, "%Lu")) snprintf (string, 81, "%-8s= %20llu / %-s ", field, va_arg (argp, unsigned long long), comment); 60 if (!strcmp (mode, "%hd")) snprintf (string, 81, "%-8s= %20d / %-s ", field, va_arg (argp, int), comment); 61 if (!strcmp (mode, "%f")) snprintf (string, 81, "%-8s= %20.10f / %-s ", field, va_arg (argp, double), comment); 62 if (!strcmp (mode, "%lf")) snprintf (string, 81, "%-8s= %20.10f / %-s ", field, va_arg (argp, double), comment); 63 if (!strcmp (mode, "%e")) snprintf (string, 81, "%-8s= %20.10E / %-s ", field, va_arg (argp, double), comment); 64 if (!strcmp (mode, "%le")) snprintf (string, 81, "%-8s= %20.10E / %-s ", field, va_arg (argp, double), comment); 65 if (!strcmp (mode, "%g")) snprintf (string, 81, "%-8s= %20.10G / %-s ", field, va_arg (argp, double), comment); 66 if (!strcmp (mode, "%lg")) snprintf (string, 81, "%-8s= %20.10G / %-s ", field, va_arg (argp, double), comment); 62 67 63 68 /* write the boolean mode */
Note:
See TracChangeset
for help on using the changeset viewer.
