48SDDSColumn::SDDSColumn() {
52 rowAllocationIncrement = 1000;
57 columnDescription = NULL;
58 columnFormatString = NULL;
59 columnFieldLength = 0;
77SDDSColumn::~SDDSColumn() {
79 if (columnName != NULL)
80 SDDS_free(columnName);
81 if (columnSymbol != NULL)
82 SDDS_free(columnSymbol);
83 if (columnUnits != NULL)
84 SDDS_free(columnUnits);
85 if (columnDescription != NULL)
86 SDDS_free(columnDescription);
87 if (columnFormatString != NULL)
88 SDDS_free(columnFormatString);
89 if (int16Value != NULL) {
90 for (i=0; i<pageCount; i++) {
91 if (int16Value[i] != NULL) {
92 SDDS_free(int16Value[i]);
95 SDDS_free(int16Value);
97 if (uint16Value != NULL) {
98 for (i=0; i<pageCount; i++) {
99 if (uint16Value[i] != NULL) {
100 SDDS_free(uint16Value[i]);
103 SDDS_free(uint16Value);
105 if (int32Value != NULL) {
106 for (i=0; i<pageCount; i++) {
107 if (int32Value[i] != NULL) {
108 SDDS_free(int32Value[i]);
111 SDDS_free(int32Value);
113 if (uint32Value != NULL) {
114 for (i=0; i<pageCount; i++) {
115 if (uint32Value[i] != NULL) {
116 SDDS_free(uint32Value[i]);
119 SDDS_free(uint32Value);
121 if (real32Value != NULL) {
122 for (i=0; i<pageCount; i++) {
123 if (real32Value[i] != NULL) {
124 SDDS_free(real32Value[i]);
127 SDDS_free(real32Value);
129 if (real64Value != NULL) {
130 for (i=0; i<pageCount; i++) {
131 if (real64Value[i] != NULL) {
132 SDDS_free(real64Value[i]);
135 SDDS_free(real64Value);
137 if (stringValue != NULL) {
138 for (i=0; i<pageCount; i++) {
139 if (stringValue[i] != NULL) {
140 for (j=0; j<rowCount[i] ; j++) {
141 if (stringValue[i][j] != NULL) {
142 SDDS_free(stringValue[i][j]);
145 SDDS_free(stringValue[i]);
148 SDDS_free(stringValue);
150 if (charValue != NULL) {
151 for (i=0; i<pageCount; i++) {
152 if (charValue[i] != NULL) {
153 SDDS_free(charValue[i]);
156 SDDS_free(charValue);
158 if (rowCount != NULL) {
161 if (rowsAllocated != NULL) {
162 SDDS_free(rowsAllocated);
173void SDDSColumn::freePage() {
175 switch (columnType) {
177 if (int16Value != NULL) {
178 for (i=0; i<pageCount; i++) {
179 if (int16Value[i] != NULL) {
180 SDDS_free(int16Value[i]);
183 SDDS_free(int16Value);
188 if (uint16Value != NULL) {
189 for (i=0; i<pageCount; i++) {
190 if (uint16Value[i] != NULL) {
191 SDDS_free(uint16Value[i]);
194 SDDS_free(uint16Value);
199 if (int32Value != NULL) {
200 for (i=0; i<pageCount; i++) {
201 if (int32Value[i] != NULL) {
202 SDDS_free(int32Value[i]);
205 SDDS_free(int32Value);
210 if (uint32Value != NULL) {
211 for (i=0; i<pageCount; i++) {
212 if (uint32Value[i] != NULL) {
213 SDDS_free(uint32Value[i]);
216 SDDS_free(uint32Value);
221 if (real32Value != NULL) {
222 for (i=0; i<pageCount; i++) {
223 if (real32Value[i] != NULL) {
224 SDDS_free(real32Value[i]);
227 SDDS_free(real32Value);
232 if (real64Value != NULL) {
233 for (i=0; i<pageCount; i++) {
234 if (real64Value[i] != NULL) {
235 SDDS_free(real64Value[i]);
238 SDDS_free(real64Value);
243 if (stringValue != NULL) {
244 for (i=0; i<pageCount; i++) {
245 if (stringValue[i] != NULL) {
246 for (j=0; j<rowCount[i] ; j++) {
247 if (stringValue[i][j] != NULL) {
248 SDDS_free(stringValue[i][j]);
251 SDDS_free(stringValue[i]);
254 SDDS_free(stringValue);
259 if (charValue != NULL) {
260 for (i=0; i<pageCount; i++) {
261 if (charValue[i] != NULL) {
262 SDDS_free(charValue[i]);
265 SDDS_free(charValue);
272 if (rowCount != NULL) {
276 if (rowsAllocated != NULL) {
277 SDDS_free(rowsAllocated);
279 rowsAllocated = NULL;
291void SDDSColumn::setupColumn(
char *name,
char *symbol,
char *units,
char *description,
char *format_string, int32_t type, uint32_t field_length) {
292 if (columnName != NULL)
293 SDDS_free(columnName);
294 if (columnSymbol != NULL)
295 SDDS_free(columnSymbol);
296 if (columnUnits != NULL)
297 SDDS_free(columnUnits);
298 if (columnDescription != NULL)
299 SDDS_free(columnDescription);
300 if (columnFormatString != NULL)
301 SDDS_free(columnFormatString);
306 columnName = (
char*)SDDS_malloc(
sizeof(
char) * strlen(name) + 1);
307 strcpy(columnName, name);
312 columnSymbol = (
char*)SDDS_malloc(
sizeof(
char) * strlen(symbol) + 1);
313 strcpy(columnSymbol, symbol);
318 columnUnits = (
char*)SDDS_malloc(
sizeof(
char) * strlen(units) + 1);
319 strcpy(columnUnits, units);
321 if (description == NULL)
322 columnDescription = NULL;
324 columnDescription = (
char*)SDDS_malloc(
sizeof(
char) * strlen(description) + 1);
325 strcpy(columnDescription, description);
327 if (format_string == NULL)
328 columnFormatString = NULL;
330 columnFormatString = (
char*)SDDS_malloc(
sizeof(
char) * strlen(format_string) + 1);
331 strcpy(columnFormatString, format_string);
334 columnFieldLength = field_length;
344void SDDSColumn::informAboutParent(
void *parent) {
355char* SDDSColumn::getName() {
366void SDDSColumn::setName(
char *name) {
367 if (columnName != NULL)
368 SDDS_free(columnName);
372 columnName = (
char*)SDDS_malloc(
sizeof(
char) * strlen(name) + 1);
373 strcpy(columnName, name);
384char* SDDSColumn::getSymbol() {
385 return(columnSymbol);
395void SDDSColumn::setSymbol(
char *symbol) {
396 if (columnSymbol != NULL)
397 SDDS_free(columnSymbol);
401 columnSymbol = (
char*)SDDS_malloc(
sizeof(
char) * strlen(symbol) + 1);
402 strcpy(columnSymbol, symbol);
413char* SDDSColumn::getUnits() {
424void SDDSColumn::setUnits(
char *units) {
425 if (columnUnits != NULL)
426 SDDS_free(columnUnits);
430 columnUnits = (
char*)SDDS_malloc(
sizeof(
char) * strlen(units) + 1);
431 strcpy(columnUnits, units);
442char* SDDSColumn::getDescription() {
443 return(columnDescription);
453void SDDSColumn::setDescription(
char *description) {
454 if (columnDescription != NULL)
455 SDDS_free(columnDescription);
456 if (description == NULL)
457 columnDescription = NULL;
459 columnDescription = (
char*)SDDS_malloc(
sizeof(
char) * strlen(description) + 1);
460 strcpy(columnDescription, description);
471char* SDDSColumn::getFormatString() {
472 return(columnFormatString);
482void SDDSColumn::setFormatString(
char *format_string) {
483 if (columnFormatString != NULL)
484 SDDS_free(columnFormatString);
485 if (format_string == NULL)
486 columnFormatString = NULL;
488 columnFormatString = (
char*)SDDS_malloc(
sizeof(
char) * strlen(format_string) + 1);
489 strcpy(columnFormatString, format_string);
500uint32_t SDDSColumn::getFieldLength() {
501 return(columnFieldLength);
511void SDDSColumn::setFieldLength(uint32_t field_length) {
512 columnFieldLength = field_length;
522int32_t SDDSColumn::getType() {
533void SDDSColumn::setType(int32_t type) {
544uint32_t SDDSColumn::getPageCount() {
556uint32_t SDDSColumn::getRowCount(uint32_t page) {
557 if (rowCount == NULL) {
560 if ((page == 0) || (page > pageCount)) {
563 return(rowCount[page-1]);
586int32_t SDDSColumn::setValues(int16_t *values, uint32_t page, uint32_t startRow, uint32_t rows) {
587 uint32_t rowsNeeded, i, n=0, p;
589 char s[SDDS_MAXLINE];
595 if (page > pageCount) {
597 n = page - pageCount;
600 rowsNeeded = rows + startRow;
602 rowCount = (uint32_t*)SDDS_realloc(rowCount,
sizeof(uint32_t) * page);
603 rowsAllocated = (uint32_t*)SDDS_realloc(rowsAllocated,
sizeof(uint32_t) * page);
604 for (i=0; i<n; i++) {
606 rowsAllocated[p-i] = 0;
609 switch (columnType) {
612 int16Value = (int16_t**)SDDS_realloc(int16Value,
sizeof(int16_t*) * page);
613 for (i=0; i<n; i++) {
614 int16Value[p-i] = (int16_t*)NULL;
617 if (rowsNeeded > rowsAllocated[p]) {
618 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
619 int16Value[p] = (int16_t*)SDDS_realloc(int16Value[p],
sizeof(int16_t) * rowsAllocated[p]);
622 for (i=rowCount[p] ; i<startRow; i++) {
623 int16Value[p][i] = (int16_t)0;
625 for (i=0; i<rows; i++) {
626 int16Value[p][i+startRow] = (int16_t)(values[i]);
629 memcpy(int16Value[p], values, rows * 2);
634 uint16Value = (uint16_t**)SDDS_realloc(uint16Value,
sizeof(uint16_t*) * page);
635 for (i=0; i<n; i++) {
636 uint16Value[p-i] = (uint16_t*)NULL;
639 if (rowsNeeded > rowsAllocated[p]) {
640 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
641 uint16Value[p] = (uint16_t*)SDDS_realloc(uint16Value[p],
sizeof(uint16_t) * rowsAllocated[p]);
643 for (i=rowCount[p] ; i<startRow; i++) {
644 uint16Value[p][i] = (uint16_t)0;
646 for (i=0; i<rows; i++) {
647 uint16Value[p][i+startRow] = (uint16_t)(values[i]);
652 int32Value = (int32_t**)SDDS_realloc(int32Value,
sizeof(int32_t*) * page);
653 for (i=0; i<n; i++) {
654 int32Value[p-i] = (int32_t*)NULL;
657 if (rowsNeeded > rowsAllocated[p]) {
658 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
659 int32Value[p] = (int32_t*)SDDS_realloc(int32Value[p],
sizeof(int32_t) * rowsAllocated[p]);
661 for (i=rowCount[p] ; i<startRow; i++) {
662 int32Value[p][i] = (int32_t)0;
664 for (i=0; i<rows; i++) {
665 int32Value[p][i+startRow] = (int32_t)(values[i]);
670 uint32Value = (uint32_t**)SDDS_realloc(uint32Value,
sizeof(uint32_t*) * page);
671 for (i=0; i<n; i++) {
672 uint32Value[p-i] = (uint32_t*)NULL;
675 if (rowsNeeded > rowsAllocated[p]) {
676 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
677 uint32Value[p] = (uint32_t*)SDDS_realloc(uint32Value[p],
sizeof(uint32_t) * rowsAllocated[p]);
679 for (i=rowCount[p] ; i<startRow; i++) {
680 uint32Value[p][i] = (uint32_t)0;
682 for (i=0; i<rows; i++) {
683 uint32Value[p][i+startRow] = (uint32_t)(values[i]);
688 real32Value = (
float**)SDDS_realloc(real32Value,
sizeof(
float*) * page);
689 for (i=0; i<n; i++) {
690 real32Value[p-i] = (
float*)NULL;
693 if (rowsNeeded > rowsAllocated[p]) {
694 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
695 real32Value[p] = (
float*)SDDS_realloc(real32Value[p],
sizeof(
float) * rowsAllocated[p]);
697 for (i=rowCount[p] ; i<startRow; i++) {
698 real32Value[p][i] = (float)0;
700 for (i=0; i<rows; i++) {
701 real32Value[p][i+startRow] = (float)(values[i]);
706 real64Value = (
double**)SDDS_realloc(real64Value,
sizeof(
double*) * page);
707 for (i=0; i<n; i++) {
708 real64Value[p-i] = (
double*)NULL;
711 if (rowsNeeded > rowsAllocated[p]) {
712 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
713 real64Value[p] = (
double*)SDDS_realloc(real64Value[p],
sizeof(
double) * rowsAllocated[p]);
715 for (i=rowCount[p] ; i<startRow; i++) {
716 real64Value[p][i] = (double)0;
718 for (i=0; i<rows; i++) {
719 real64Value[p][i+startRow] = (double)(values[i]);
724 stringValue = (
char***)SDDS_realloc(stringValue,
sizeof(
char**) * page);
725 for (i=0; i<n; i++) {
726 stringValue[p-i] = (
char**)NULL;
729 if (rowsNeeded > rowsAllocated[p]) {
730 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
731 stringValue[p] = (
char**)SDDS_realloc(stringValue[p],
sizeof(
char*) * rowsAllocated[p]);
733 for (i=rowCount[p] ; i<startRow; i++) {
734 stringValue[p][i] = (
char*)NULL;
736 for (i=0; i<rows; i++) {
737 sprintf(s,
"%" PRId16, values[i]);
738 stringValue[p][i+startRow] = (
char*)SDDS_malloc(
sizeof(
char) * strlen(s) + 1);
739 strcpy(stringValue[p][i+startRow], s);
744 charValue = (
char**)SDDS_realloc(charValue,
sizeof(
char*) * page);
745 for (i=0; i<n; i++) {
746 charValue[p-i] = (
char*)NULL;
749 if (rowsNeeded > rowsAllocated[p]) {
750 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
751 charValue[p] = (
char*)SDDS_realloc(charValue[p],
sizeof(
char) * rowsAllocated[p]);
753 for (i=rowCount[p] ; i<startRow; i++) {
754 charValue[p][i] = (char)0;
756 for (i=0; i<rows; i++) {
757 charValue[p][i+startRow] = (char)(values[i]);
766 if (rowCount[p] < rowsNeeded) {
767 rowCount[p] = rowsNeeded;
772int32_t SDDSColumn::setValues(uint16_t *values, uint32_t page, uint32_t startRow, uint32_t rows) {
773 uint32_t rowsNeeded, i, n=0, p;
775 char s[SDDS_MAXLINE];
781 if (page > pageCount) {
783 n = page - pageCount;
786 rowsNeeded = rows + startRow;
788 rowCount = (uint32_t*)SDDS_realloc(rowCount,
sizeof(uint32_t) * page);
789 rowsAllocated = (uint32_t*)SDDS_realloc(rowsAllocated,
sizeof(uint32_t) * page);
790 for (i=0; i<n; i++) {
792 rowsAllocated[p-i] = 0;
795 switch (columnType) {
798 int16Value = (int16_t**)SDDS_realloc(int16Value,
sizeof(int16_t*) * page);
799 for (i=0; i<n; i++) {
800 int16Value[p-i] = (int16_t*)NULL;
803 if (rowsNeeded > rowsAllocated[p]) {
804 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
805 int16Value[p] = (int16_t*)SDDS_realloc(int16Value[p],
sizeof(int16_t) * rowsAllocated[p]);
807 for (i=rowCount[p] ; i<startRow; i++) {
808 int16Value[p][i] = (int16_t)0;
810 for (i=0; i<rows; i++) {
811 int16Value[p][i+startRow] = (int16_t)(values[i]);
816 uint16Value = (uint16_t**)SDDS_realloc(uint16Value,
sizeof(uint16_t*) * page);
817 for (i=0; i<n; i++) {
818 uint16Value[p-i] = (uint16_t*)NULL;
821 if (rowsNeeded > rowsAllocated[p]) {
822 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
823 uint16Value[p] = (uint16_t*)SDDS_realloc(uint16Value[p],
sizeof(uint16_t) * rowsAllocated[p]);
826 for (i=rowCount[p] ; i<startRow; i++) {
827 uint16Value[p][i] = (uint16_t)0;
829 for (i=0; i<rows; i++) {
830 uint16Value[p][i+startRow] = (uint16_t)(values[i]);
833 memcpy(uint16Value[p], values, rows * 2);
838 int32Value = (int32_t**)SDDS_realloc(int32Value,
sizeof(int32_t*) * page);
839 for (i=0; i<n; i++) {
840 int32Value[p-i] = (int32_t*)NULL;
843 if (rowsNeeded > rowsAllocated[p]) {
844 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
845 int32Value[p] = (int32_t*)SDDS_realloc(int32Value[p],
sizeof(int32_t) * rowsAllocated[p]);
847 for (i=rowCount[p] ; i<startRow; i++) {
848 int32Value[p][i] = (int32_t)0;
850 for (i=0; i<rows; i++) {
851 int32Value[p][i+startRow] = (int32_t)(values[i]);
856 uint32Value = (uint32_t**)SDDS_realloc(uint32Value,
sizeof(uint32_t*) * page);
857 for (i=0; i<n; i++) {
858 uint32Value[p-i] = (uint32_t*)NULL;
861 if (rowsNeeded > rowsAllocated[p]) {
862 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
863 uint32Value[p] = (uint32_t*)SDDS_realloc(uint32Value[p],
sizeof(uint32_t) * rowsAllocated[p]);
865 for (i=rowCount[p] ; i<startRow; i++) {
866 uint32Value[p][i] = (uint32_t)0;
868 for (i=0; i<rows; i++) {
869 uint32Value[p][i+startRow] = (uint32_t)(values[i]);
874 real32Value = (
float**)SDDS_realloc(real32Value,
sizeof(
float*) * page);
875 for (i=0; i<n; i++) {
876 real32Value[p-i] = (
float*)NULL;
879 if (rowsNeeded > rowsAllocated[p]) {
880 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
881 real32Value[p] = (
float*)SDDS_realloc(real32Value[p],
sizeof(
float) * rowsAllocated[p]);
883 for (i=rowCount[p] ; i<startRow; i++) {
884 real32Value[p][i] = (float)0;
886 for (i=0; i<rows; i++) {
887 real32Value[p][i+startRow] = (float)(values[i]);
892 real64Value = (
double**)SDDS_realloc(real64Value,
sizeof(
double*) * page);
893 for (i=0; i<n; i++) {
894 real64Value[p-i] = (
double*)NULL;
897 if (rowsNeeded > rowsAllocated[p]) {
898 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
899 real64Value[p] = (
double*)SDDS_realloc(real64Value[p],
sizeof(
double) * rowsAllocated[p]);
901 for (i=rowCount[p] ; i<startRow; i++) {
902 real64Value[p][i] = (double)0;
904 for (i=0; i<rows; i++) {
905 real64Value[p][i+startRow] = (double)(values[i]);
910 stringValue = (
char***)SDDS_realloc(stringValue,
sizeof(
char**) * page);
911 for (i=0; i<n; i++) {
912 stringValue[p-i] = (
char**)NULL;
915 if (rowsNeeded > rowsAllocated[p]) {
916 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
917 stringValue[p] = (
char**)SDDS_realloc(stringValue[p],
sizeof(
char*) * rowsAllocated[p]);
919 for (i=rowCount[p] ; i<startRow; i++) {
920 stringValue[p][i] = (
char*)NULL;
922 for (i=0; i<rows; i++) {
923 sprintf(s,
"%" PRIu16, values[i]);
924 stringValue[p][i+startRow] = (
char*)SDDS_malloc(
sizeof(
char) * strlen(s) + 1);
925 strcpy(stringValue[p][i+startRow], s);
930 charValue = (
char**)SDDS_realloc(charValue,
sizeof(
char*) * page);
931 for (i=0; i<n; i++) {
932 charValue[p-i] = (
char*)NULL;
935 if (rowsNeeded > rowsAllocated[p]) {
936 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
937 charValue[p] = (
char*)SDDS_realloc(charValue[p],
sizeof(
char) * rowsAllocated[p]);
939 for (i=rowCount[p] ; i<startRow; i++) {
940 charValue[p][i] = (char)0;
942 for (i=0; i<rows; i++) {
943 charValue[p][i+startRow] = (char)(values[i]);
952 if (rowCount[p] < rowsNeeded) {
953 rowCount[p] = rowsNeeded;
958int32_t SDDSColumn::setValues(int32_t *values, uint32_t page, uint32_t startRow, uint32_t rows) {
959 uint32_t rowsNeeded, i, n=0, p;;
961 char s[SDDS_MAXLINE];
967 if (page > pageCount) {
969 n = page - pageCount;
972 rowsNeeded = rows + startRow;
974 rowCount = (uint32_t*)SDDS_realloc(rowCount,
sizeof(uint32_t) * page);
975 rowsAllocated = (uint32_t*)SDDS_realloc(rowsAllocated,
sizeof(uint32_t) * page);
976 for (i=0; i<n; i++) {
978 rowsAllocated[p-i] = 0;
981 switch (columnType) {
984 int16Value = (int16_t**)SDDS_realloc(int16Value,
sizeof(int16_t*) * page);
985 for (i=0; i<n; i++) {
986 int16Value[p-i] = (int16_t*)NULL;
989 if (rowsNeeded > rowsAllocated[p]) {
990 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
991 int16Value[p] = (int16_t*)SDDS_realloc(int16Value[p],
sizeof(int16_t) * rowsAllocated[p]);
993 for (i=rowCount[p] ; i<startRow; i++) {
994 int16Value[p][i] = (int16_t)0;
996 for (i=0; i<rows; i++) {
997 int16Value[p][i+startRow] = (int16_t)(values[i]);
1002 uint16Value = (uint16_t**)SDDS_realloc(uint16Value,
sizeof(uint16_t*) * page);
1003 for (i=0; i<n; i++) {
1004 uint16Value[p-i] = (uint16_t*)NULL;
1007 if (rowsNeeded > rowsAllocated[p]) {
1008 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1009 uint16Value[p] = (uint16_t*)SDDS_realloc(uint16Value[p],
sizeof(uint16_t) * rowsAllocated[p]);
1011 for (i=rowCount[p] ; i<startRow; i++) {
1012 uint16Value[p][i] = (uint16_t)0;
1014 for (i=0; i<rows; i++) {
1015 uint16Value[p][i+startRow] = (uint16_t)(values[i]);
1020 int32Value = (int32_t**)SDDS_realloc(int32Value,
sizeof(int32_t*) * page);
1021 for (i=0; i<n; i++) {
1022 int32Value[p-i] = (int32_t*)NULL;
1025 if (rowsNeeded > rowsAllocated[p]) {
1026 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1027 int32Value[p] = (int32_t*)SDDS_realloc(int32Value[p],
sizeof(int32_t) * rowsAllocated[p]);
1030 for (i=rowCount[p] ; i<startRow; i++) {
1031 int32Value[p][i] = (int32_t)0;
1033 for (i=0; i<rows; i++) {
1034 int32Value[p][i+startRow] = (int32_t)(values[i]);
1037 memcpy(int32Value[p], values, rows * 4);
1042 uint32Value = (uint32_t**)SDDS_realloc(uint32Value,
sizeof(uint32_t*) * page);
1043 for (i=0; i<n; i++) {
1044 uint32Value[p-i] = (uint32_t*)NULL;
1047 if (rowsNeeded > rowsAllocated[p]) {
1048 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1049 uint32Value[p] = (uint32_t*)SDDS_realloc(uint32Value[p],
sizeof(uint32_t) * rowsAllocated[p]);
1051 for (i=rowCount[p] ; i<startRow; i++) {
1052 uint32Value[p][i] = (uint32_t)0;
1054 for (i=0; i<rows; i++) {
1055 uint32Value[p][i+startRow] = (uint32_t)(values[i]);
1060 real32Value = (
float**)SDDS_realloc(real32Value,
sizeof(
float*) * page);
1061 for (i=0; i<n; i++) {
1062 real32Value[p-i] = (
float*)NULL;
1065 if (rowsNeeded > rowsAllocated[p]) {
1066 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1067 real32Value[p] = (
float*)SDDS_realloc(real32Value[p],
sizeof(
float) * rowsAllocated[p]);
1069 for (i=rowCount[p] ; i<startRow; i++) {
1070 real32Value[p][i] = (float)0;
1072 for (i=0; i<rows; i++) {
1073 real32Value[p][i+startRow] = (float)(values[i]);
1078 real64Value = (
double**)SDDS_realloc(real64Value,
sizeof(
double*) * page);
1079 for (i=0; i<n; i++) {
1080 real64Value[p-i] = (
double*)NULL;
1083 if (rowsNeeded > rowsAllocated[p]) {
1084 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1085 real64Value[p] = (
double*)SDDS_realloc(real64Value[p],
sizeof(
double) * rowsAllocated[p]);
1087 for (i=rowCount[p] ; i<startRow; i++) {
1088 real64Value[p][i] = (double)0;
1090 for (i=0; i<rows; i++) {
1091 real64Value[p][i+startRow] = (double)(values[i]);
1096 stringValue = (
char***)SDDS_realloc(stringValue,
sizeof(
char**) * page);
1097 for (i=0; i<n; i++) {
1098 stringValue[p-i] = (
char**)NULL;
1101 if (rowsNeeded > rowsAllocated[p]) {
1102 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1103 stringValue[p] = (
char**)SDDS_realloc(stringValue[p],
sizeof(
char*) * rowsAllocated[p]);
1105 for (i=rowCount[p] ; i<startRow; i++) {
1106 stringValue[p][i] = (
char*)NULL;
1108 for (i=0; i<rows; i++) {
1109 sprintf(s,
"%" PRId32, values[i]);
1110 stringValue[p][i+startRow] = (
char*)SDDS_malloc(
sizeof(
char) * strlen(s) + 1);
1111 strcpy(stringValue[p][i+startRow], s);
1116 charValue = (
char**)SDDS_realloc(charValue,
sizeof(
char*) * page);
1117 for (i=0; i<n; i++) {
1118 charValue[p-i] = (
char*)NULL;
1121 if (rowsNeeded > rowsAllocated[p]) {
1122 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1123 charValue[p] = (
char*)SDDS_realloc(charValue[p],
sizeof(
char) * rowsAllocated[p]);
1125 for (i=rowCount[p] ; i<startRow; i++) {
1126 charValue[p][i] = (char)0;
1128 for (i=0; i<rows; i++) {
1129 charValue[p][i+startRow] = (char)(values[i]);
1138 if (rowCount[p] < rowsNeeded) {
1139 rowCount[p] = rowsNeeded;
1144int32_t SDDSColumn::setValues(uint32_t *values, uint32_t page, uint32_t startRow, uint32_t rows) {
1145 uint32_t rowsNeeded, i, n=0, p;
1147 char s[SDDS_MAXLINE];
1153 if (page > pageCount) {
1155 n = page - pageCount;
1158 rowsNeeded = rows + startRow;
1160 rowCount = (uint32_t*)SDDS_realloc(rowCount,
sizeof(uint32_t) * page);
1161 rowsAllocated = (uint32_t*)SDDS_realloc(rowsAllocated,
sizeof(uint32_t) * page);
1162 for (i=0; i<n; i++) {
1164 rowsAllocated[p-i] = 0;
1167 switch (columnType) {
1170 int16Value = (int16_t**)SDDS_realloc(int16Value,
sizeof(int16_t*) * page);
1171 for (i=0; i<n; i++) {
1172 int16Value[p-i] = (int16_t*)NULL;
1175 if (rowsNeeded > rowsAllocated[p]) {
1176 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1177 int16Value[p] = (int16_t*)SDDS_realloc(int16Value[p],
sizeof(int16_t) * rowsAllocated[p]);
1179 for (i=rowCount[p] ; i<startRow; i++) {
1180 int16Value[p][i] = (int16_t)0;
1182 for (i=0; i<rows; i++) {
1183 int16Value[p][i+startRow] = (int16_t)(values[i]);
1188 uint16Value = (uint16_t**)SDDS_realloc(uint16Value,
sizeof(uint16_t*) * page);
1189 for (i=0; i<n; i++) {
1190 uint16Value[p-i] = (uint16_t*)NULL;
1193 if (rowsNeeded > rowsAllocated[p]) {
1194 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1195 uint16Value[p] = (uint16_t*)SDDS_realloc(uint16Value[p],
sizeof(uint16_t) * rowsAllocated[p]);
1197 for (i=rowCount[p] ; i<startRow; i++) {
1198 uint16Value[p][i] = (uint16_t)0;
1200 for (i=0; i<rows; i++) {
1201 uint16Value[p][i+startRow] = (uint16_t)(values[i]);
1206 int32Value = (int32_t**)SDDS_realloc(int32Value,
sizeof(int32_t*) * page);
1207 for (i=0; i<n; i++) {
1208 int32Value[p-i] = (int32_t*)NULL;
1211 if (rowsNeeded > rowsAllocated[p]) {
1212 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1213 int32Value[p] = (int32_t*)SDDS_realloc(int32Value[p],
sizeof(int32_t) * rowsAllocated[p]);
1215 for (i=rowCount[p] ; i<startRow; i++) {
1216 int32Value[p][i] = (int32_t)0;
1218 for (i=0; i<rows; i++) {
1219 int32Value[p][i+startRow] = (int32_t)(values[i]);
1224 uint32Value = (uint32_t**)SDDS_realloc(uint32Value,
sizeof(uint32_t*) * page);
1225 for (i=0; i<n; i++) {
1226 uint32Value[p-i] = (uint32_t*)NULL;
1229 if (rowsNeeded > rowsAllocated[p]) {
1230 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1231 uint32Value[p] = (uint32_t*)SDDS_realloc(uint32Value[p],
sizeof(uint32_t) * rowsAllocated[p]);
1234 for (i=rowCount[p] ; i<startRow; i++) {
1235 uint32Value[p][i] = (uint32_t)0;
1237 for (i=0; i<rows; i++) {
1238 uint32Value[p][i+startRow] = (uint32_t)(values[i]);
1241 memcpy(uint32Value[p], values, rows * 4);
1246 real32Value = (
float**)SDDS_realloc(real32Value,
sizeof(
float*) * page);
1247 for (i=0; i<n; i++) {
1248 real32Value[p-i] = (
float*)NULL;
1251 if (rowsNeeded > rowsAllocated[p]) {
1252 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1253 real32Value[p] = (
float*)SDDS_realloc(real32Value[p],
sizeof(
float) * rowsAllocated[p]);
1255 for (i=rowCount[p] ; i<startRow; i++) {
1256 real32Value[p][i] = (float)0;
1258 for (i=0; i<rows; i++) {
1259 real32Value[p][i+startRow] = (float)(values[i]);
1264 real64Value = (
double**)SDDS_realloc(real64Value,
sizeof(
double*) * page);
1265 for (i=0; i<n; i++) {
1266 real64Value[p-i] = (
double*)NULL;
1269 if (rowsNeeded > rowsAllocated[p]) {
1270 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1271 real64Value[p] = (
double*)SDDS_realloc(real64Value[p],
sizeof(
double) * rowsAllocated[p]);
1273 for (i=rowCount[p] ; i<startRow; i++) {
1274 real64Value[p][i] = (double)0;
1276 for (i=0; i<rows; i++) {
1277 real64Value[p][i+startRow] = (double)(values[i]);
1282 stringValue = (
char***)SDDS_realloc(stringValue,
sizeof(
char**) * page);
1283 for (i=0; i<n; i++) {
1284 stringValue[p-i] = (
char**)NULL;
1287 if (rowsNeeded > rowsAllocated[p]) {
1288 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1289 stringValue[p] = (
char**)SDDS_realloc(stringValue[p],
sizeof(
char*) * rowsAllocated[p]);
1291 for (i=rowCount[p] ; i<startRow; i++) {
1292 stringValue[p][i] = (
char*)NULL;
1294 for (i=0; i<rows; i++) {
1295 sprintf(s,
"%" PRIu32, values[i]);
1296 stringValue[p][i+startRow] = (
char*)SDDS_malloc(
sizeof(
char) * strlen(s) + 1);
1297 strcpy(stringValue[p][i+startRow], s);
1302 charValue = (
char**)SDDS_realloc(charValue,
sizeof(
char*) * page);
1303 for (i=0; i<n; i++) {
1304 charValue[p-i] = (
char*)NULL;
1307 if (rowsNeeded > rowsAllocated[p]) {
1308 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1309 charValue[p] = (
char*)SDDS_realloc(charValue[p],
sizeof(
char) * rowsAllocated[p]);
1311 for (i=rowCount[p] ; i<startRow; i++) {
1312 charValue[p][i] = (char)0;
1314 for (i=0; i<rows; i++) {
1315 charValue[p][i+startRow] = (char)(values[i]);
1324 if (rowCount[p] < rowsNeeded) {
1325 rowCount[p] = rowsNeeded;
1330int32_t SDDSColumn::setValues(
float *values, uint32_t page, uint32_t startRow, uint32_t rows) {
1331 uint32_t rowsNeeded, i, n=0, p;
1333 char s[SDDS_MAXLINE];
1339 if (page > pageCount) {
1341 n = page - pageCount;
1344 rowsNeeded = rows + startRow;
1346 rowCount = (uint32_t*)SDDS_realloc(rowCount,
sizeof(uint32_t) * page);
1347 rowsAllocated = (uint32_t*)SDDS_realloc(rowsAllocated,
sizeof(uint32_t) * page);
1348 for (i=0; i<n; i++) {
1350 rowsAllocated[p-i] = 0;
1353 switch (columnType) {
1356 int16Value = (int16_t**)SDDS_realloc(int16Value,
sizeof(int16_t*) * page);
1357 for (i=0; i<n; i++) {
1358 int16Value[p-i] = (int16_t*)NULL;
1361 if (rowsNeeded > rowsAllocated[p]) {
1362 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1363 int16Value[p] = (int16_t*)SDDS_realloc(int16Value[p],
sizeof(int16_t) * rowsAllocated[p]);
1365 for (i=rowCount[p] ; i<startRow; i++) {
1366 int16Value[p][i] = (int16_t)0;
1368 for (i=0; i<rows; i++) {
1369 int16Value[p][i+startRow] = (int16_t)(values[i]);
1374 uint16Value = (uint16_t**)SDDS_realloc(uint16Value,
sizeof(uint16_t*) * page);
1375 for (i=0; i<n; i++) {
1376 uint16Value[p-i] = (uint16_t*)NULL;
1379 if (rowsNeeded > rowsAllocated[p]) {
1380 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1381 uint16Value[p] = (uint16_t*)SDDS_realloc(uint16Value[p],
sizeof(uint16_t) * rowsAllocated[p]);
1383 for (i=rowCount[p] ; i<startRow; i++) {
1384 uint16Value[p][i] = (uint16_t)0;
1386 for (i=0; i<rows; i++) {
1387 uint16Value[p][i+startRow] = (uint16_t)(values[i]);
1392 int32Value = (int32_t**)SDDS_realloc(int32Value,
sizeof(int32_t*) * page);
1393 for (i=0; i<n; i++) {
1394 int32Value[p-i] = (int32_t*)NULL;
1397 if (rowsNeeded > rowsAllocated[p]) {
1398 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1399 int32Value[p] = (int32_t*)SDDS_realloc(int32Value[p],
sizeof(int32_t) * rowsAllocated[p]);
1401 for (i=rowCount[p] ; i<startRow; i++) {
1402 int32Value[p][i] = (int32_t)0;
1404 for (i=0; i<rows; i++) {
1405 int32Value[p][i+startRow] = (int32_t)(values[i]);
1410 uint32Value = (uint32_t**)SDDS_realloc(uint32Value,
sizeof(uint32_t*) * page);
1411 for (i=0; i<n; i++) {
1412 uint32Value[p-i] = (uint32_t*)NULL;
1415 if (rowsNeeded > rowsAllocated[p]) {
1416 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1417 uint32Value[p] = (uint32_t*)SDDS_realloc(uint32Value[p],
sizeof(uint32_t) * rowsAllocated[p]);
1419 for (i=rowCount[p] ; i<startRow; i++) {
1420 uint32Value[p][i] = (uint32_t)0;
1422 for (i=0; i<rows; i++) {
1423 uint32Value[p][i+startRow] = (uint32_t)(values[i]);
1428 real32Value = (
float**)SDDS_realloc(real32Value,
sizeof(
float*) * page);
1429 for (i=0; i<n; i++) {
1430 real32Value[p-i] = (
float*)NULL;
1433 if (rowsNeeded > rowsAllocated[p]) {
1434 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1435 real32Value[p] = (
float*)SDDS_realloc(real32Value[p],
sizeof(
float) * rowsAllocated[p]);
1438 for (i=rowCount[p] ; i<startRow; i++) {
1439 real32Value[p][i] = (float)0;
1441 for (i=0; i<rows; i++) {
1442 real32Value[p][i+startRow] = (float)(values[i]);
1445 memcpy(real32Value[p], values, rows * 4);
1450 real64Value = (
double**)SDDS_realloc(real64Value,
sizeof(
double*) * page);
1451 for (i=0; i<n; i++) {
1452 real64Value[p-i] = (
double*)NULL;
1455 if (rowsNeeded > rowsAllocated[p]) {
1456 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1457 real64Value[p] = (
double*)SDDS_realloc(real64Value[p],
sizeof(
double) * rowsAllocated[p]);
1459 for (i=rowCount[p] ; i<startRow; i++) {
1460 real64Value[p][i] = (double)0;
1462 for (i=0; i<rows; i++) {
1463 real64Value[p][i+startRow] = (double)(values[i]);
1468 stringValue = (
char***)SDDS_realloc(stringValue,
sizeof(
char**) * page);
1469 for (i=0; i<n; i++) {
1470 stringValue[p-i] = (
char**)NULL;
1473 if (rowsNeeded > rowsAllocated[p]) {
1474 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1475 stringValue[p] = (
char**)SDDS_realloc(stringValue[p],
sizeof(
char*) * rowsAllocated[p]);
1477 for (i=rowCount[p] ; i<startRow; i++) {
1478 stringValue[p][i] = (
char*)NULL;
1480 for (i=0; i<rows; i++) {
1481 sprintf(s,
"%lf", values[i]);
1482 stringValue[p][i+startRow] = (
char*)SDDS_malloc(
sizeof(
char) * strlen(s) + 1);
1483 strcpy(stringValue[p][i+startRow], s);
1488 charValue = (
char**)SDDS_realloc(charValue,
sizeof(
char*) * page);
1489 for (i=0; i<n; i++) {
1490 charValue[p-i] = (
char*)NULL;
1493 if (rowsNeeded > rowsAllocated[p]) {
1494 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1495 charValue[p] = (
char*)SDDS_realloc(charValue[p],
sizeof(
char) * rowsAllocated[p]);
1497 for (i=rowCount[p] ; i<startRow; i++) {
1498 charValue[p][i] = (char)0;
1500 for (i=0; i<rows; i++) {
1501 charValue[p][i+startRow] = (char)(values[i]);
1510 if (rowCount[p] < rowsNeeded) {
1511 rowCount[p] = rowsNeeded;
1516int32_t SDDSColumn::setValues(
double *values, uint32_t page, uint32_t startRow, uint32_t rows) {
1517 uint32_t rowsNeeded, i, n=0, p;
1519 char s[SDDS_MAXLINE];
1525 if (page > pageCount) {
1527 n = page - pageCount;
1530 rowsNeeded = rows + startRow;
1532 rowCount = (uint32_t*)SDDS_realloc(rowCount,
sizeof(uint32_t) * page);
1533 rowsAllocated = (uint32_t*)SDDS_realloc(rowsAllocated,
sizeof(uint32_t) * page);
1534 for (i=0; i<n; i++) {
1536 rowsAllocated[p-i] = 0;
1539 switch (columnType) {
1542 int16Value = (int16_t**)SDDS_realloc(int16Value,
sizeof(int16_t*) * page);
1543 for (i=0; i<n; i++) {
1544 int16Value[p-i] = (int16_t*)NULL;
1547 if (rowsNeeded > rowsAllocated[p]) {
1548 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1549 int16Value[p] = (int16_t*)SDDS_realloc(int16Value[p],
sizeof(int16_t) * rowsAllocated[p]);
1551 for (i=rowCount[p] ; i<startRow; i++) {
1552 int16Value[p][i] = (int16_t)0;
1554 for (i=0; i<rows; i++) {
1555 int16Value[p][i+startRow] = (int16_t)(values[i]);
1560 uint16Value = (uint16_t**)SDDS_realloc(uint16Value,
sizeof(uint16_t*) * page);
1561 for (i=0; i<n; i++) {
1562 uint16Value[p-i] = (uint16_t*)NULL;
1565 if (rowsNeeded > rowsAllocated[p]) {
1566 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1567 uint16Value[p] = (uint16_t*)SDDS_realloc(uint16Value[p],
sizeof(uint16_t) * rowsAllocated[p]);
1569 for (i=rowCount[p] ; i<startRow; i++) {
1570 uint16Value[p][i] = (uint16_t)0;
1572 for (i=0; i<rows; i++) {
1573 uint16Value[p][i+startRow] = (uint16_t)(values[i]);
1578 int32Value = (int32_t**)SDDS_realloc(int32Value,
sizeof(int32_t*) * page);
1579 for (i=0; i<n; i++) {
1580 int32Value[p-i] = (int32_t*)NULL;
1583 if (rowsNeeded > rowsAllocated[p]) {
1584 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1585 int32Value[p] = (int32_t*)SDDS_realloc(int32Value[p],
sizeof(int32_t) * rowsAllocated[p]);
1587 for (i=rowCount[p] ; i<startRow; i++) {
1588 int32Value[p][i] = (int32_t)0;
1590 for (i=0; i<rows; i++) {
1591 int32Value[p][i+startRow] = (int32_t)(values[i]);
1596 uint32Value = (uint32_t**)SDDS_realloc(uint32Value,
sizeof(uint32_t*) * page);
1597 for (i=0; i<n; i++) {
1598 uint32Value[p-i] = (uint32_t*)NULL;
1601 if (rowsNeeded > rowsAllocated[p]) {
1602 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1603 uint32Value[p] = (uint32_t*)SDDS_realloc(uint32Value[p],
sizeof(uint32_t) * rowsAllocated[p]);
1605 for (i=rowCount[p] ; i<startRow; i++) {
1606 uint32Value[p][i] = (uint32_t)0;
1608 for (i=0; i<rows; i++) {
1609 uint32Value[p][i+startRow] = (uint32_t)(values[i]);
1614 real32Value = (
float**)SDDS_realloc(real32Value,
sizeof(
float*) * page);
1615 for (i=0; i<n; i++) {
1616 real32Value[p-i] = (
float*)NULL;
1619 if (rowsNeeded > rowsAllocated[p]) {
1620 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1621 real32Value[p] = (
float*)SDDS_realloc(real32Value[p],
sizeof(
float) * rowsAllocated[p]);
1623 for (i=rowCount[p] ; i<startRow; i++) {
1624 real32Value[p][i] = (float)0;
1626 for (i=0; i<rows; i++) {
1627 real32Value[p][i+startRow] = (float)(values[i]);
1632 real64Value = (
double**)SDDS_realloc(real64Value,
sizeof(
double*) * page);
1633 for (i=0; i<n; i++) {
1634 real64Value[p-i] = (
double*)NULL;
1637 if (rowsNeeded > rowsAllocated[p]) {
1638 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1639 real64Value[p] = (
double*)SDDS_realloc(real64Value[p],
sizeof(
double) * rowsAllocated[p]);
1642 for (i=rowCount[p] ; i<startRow; i++) {
1643 real64Value[p][i] = (double)0;
1645 for (i=0; i<rows; i++) {
1646 real64Value[p][i+startRow] = (double)(values[i]);
1649 memcpy(real64Value[p], values, rows * 8);
1654 stringValue = (
char***)SDDS_realloc(stringValue,
sizeof(
char**) * page);
1655 for (i=0; i<n; i++) {
1656 stringValue[p-i] = (
char**)NULL;
1659 if (rowsNeeded > rowsAllocated[p]) {
1660 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1661 stringValue[p] = (
char**)SDDS_realloc(stringValue[p],
sizeof(
char*) * rowsAllocated[p]);
1663 for (i=rowCount[p] ; i<startRow; i++) {
1664 stringValue[p][i] = (
char*)NULL;
1666 for (i=0; i<rows; i++) {
1667 sprintf(s,
"%lf", values[i]);
1668 stringValue[p][i+startRow] = (
char*)SDDS_malloc(
sizeof(
char) * strlen(s) + 1);
1669 strcpy(stringValue[p][i+startRow], s);
1674 charValue = (
char**)SDDS_realloc(charValue,
sizeof(
char*) * page);
1675 for (i=0; i<n; i++) {
1676 charValue[p-i] = (
char*)NULL;
1679 if (rowsNeeded > rowsAllocated[p]) {
1680 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1681 charValue[p] = (
char*)SDDS_realloc(charValue[p],
sizeof(
char) * rowsAllocated[p]);
1683 for (i=rowCount[p] ; i<startRow; i++) {
1684 charValue[p][i] = (char)0;
1686 for (i=0; i<rows; i++) {
1687 charValue[p][i+startRow] = (char)(values[i]);
1696 if (rowCount[p] < rowsNeeded) {
1697 rowCount[p] = rowsNeeded;
1702int32_t SDDSColumn::setValues(
char **values, uint32_t page, uint32_t startRow, uint32_t rows) {
1703 int32_t returnVal=0;
1704 uint32_t rowsNeeded, i, n=0, p;
1706 int64_t *iValue=NULL;
1707 double *dValue=NULL;
1714 iValue = (int64_t*)SDDS_malloc(
sizeof(int64_t) * rows);
1715 for (i=0; i<rows; i++) {
1716 iValue[i] = strtoll(values[i], (
char**)NULL, 10);
1717 if ((iValue[i] == LLONG_MIN) || (iValue[i] == LLONG_MAX)) {
1724 dValue = (
double*)SDDS_malloc(
sizeof(
double) * rows);
1725 for (i=0; i<rows; i++) {
1726 dValue[i] = strtod(values[i], (
char**)NULL);
1727 if ((dValue[i] == HUGE_VAL) || (dValue[i] == -HUGE_VAL)) {
1736 if (page > pageCount) {
1738 n = page - pageCount;
1741 rowsNeeded = rows + startRow;
1743 rowCount = (uint32_t*)SDDS_realloc(rowCount,
sizeof(uint32_t) * page);
1744 rowsAllocated = (uint32_t*)SDDS_realloc(rowsAllocated,
sizeof(uint32_t) * page);
1745 for (i=0; i<n; i++) {
1747 rowsAllocated[p-i] = 0;
1750 switch (columnType) {
1753 int16Value = (int16_t**)SDDS_realloc(int16Value,
sizeof(int16_t*) * page);
1754 for (i=0; i<n; i++) {
1755 int16Value[p-i] = (int16_t*)NULL;
1758 if (rowsNeeded > rowsAllocated[p]) {
1759 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1760 int16Value[p] = (int16_t*)SDDS_realloc(int16Value[p],
sizeof(int16_t) * rowsAllocated[p]);
1762 for (i=rowCount[p] ; i<startRow; i++) {
1763 int16Value[p][i] = (int16_t)0;
1765 for (i=0; i<rows; i++) {
1766 int16Value[p][i+startRow] = (int16_t)(iValue[i]);
1771 uint16Value = (uint16_t**)SDDS_realloc(uint16Value,
sizeof(uint16_t*) * page);
1772 for (i=0; i<n; i++) {
1773 uint16Value[p-i] = (uint16_t*)NULL;
1776 if (rowsNeeded > rowsAllocated[p]) {
1777 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1778 uint16Value[p] = (uint16_t*)SDDS_realloc(uint16Value[p],
sizeof(uint16_t) * rowsAllocated[p]);
1780 for (i=rowCount[p] ; i<startRow; i++) {
1781 uint16Value[p][i] = (uint16_t)0;
1783 for (i=0; i<rows; i++) {
1784 uint16Value[p][i+startRow] = (uint16_t)(iValue[i]);
1789 int32Value = (int32_t**)SDDS_realloc(int32Value,
sizeof(int32_t*) * page);
1790 for (i=0; i<n; i++) {
1791 int32Value[p-i] = (int32_t*)NULL;
1794 if (rowsNeeded > rowsAllocated[p]) {
1795 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1796 int32Value[p] = (int32_t*)SDDS_realloc(int32Value[p],
sizeof(int32_t) * rowsAllocated[p]);
1798 for (i=rowCount[p] ; i<startRow; i++) {
1799 int32Value[p][i] = (int32_t)0;
1801 for (i=0; i<rows; i++) {
1802 int32Value[p][i+startRow] = (int32_t)(iValue[i]);
1807 uint32Value = (uint32_t**)SDDS_realloc(uint32Value,
sizeof(uint32_t*) * page);
1808 for (i=0; i<n; i++) {
1809 uint32Value[p-i] = (uint32_t*)NULL;
1812 if (rowsNeeded > rowsAllocated[p]) {
1813 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1814 uint32Value[p] = (uint32_t*)SDDS_realloc(uint32Value[p],
sizeof(uint32_t) * rowsAllocated[p]);
1816 for (i=rowCount[p] ; i<startRow; i++) {
1817 uint32Value[p][i] = (uint32_t)0;
1819 for (i=0; i<rows; i++) {
1820 uint32Value[p][i+startRow] = (uint32_t)(iValue[i]);
1825 real32Value = (
float**)SDDS_realloc(real32Value,
sizeof(
float*) * page);
1826 for (i=0; i<n; i++) {
1827 real32Value[p-i] = (
float*)NULL;
1830 if (rowsNeeded > rowsAllocated[p]) {
1831 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1832 real32Value[p] = (
float*)SDDS_realloc(real32Value[p],
sizeof(
float) * rowsAllocated[p]);
1834 for (i=rowCount[p] ; i<startRow; i++) {
1835 real32Value[p][i] = (float)0;
1837 for (i=0; i<rows; i++) {
1838 real32Value[p][i+startRow] = (float)(dValue[i]);
1843 real64Value = (
double**)SDDS_realloc(real64Value,
sizeof(
double*) * page);
1844 for (i=0; i<n; i++) {
1845 real64Value[p-i] = (
double*)NULL;
1848 if (rowsNeeded > rowsAllocated[p]) {
1849 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1850 real64Value[p] = (
double*)SDDS_realloc(real64Value[p],
sizeof(
double) * rowsAllocated[p]);
1852 for (i=rowCount[p] ; i<startRow; i++) {
1853 real64Value[p][i] = (double)0;
1855 for (i=0; i<rows; i++) {
1856 real64Value[p][i+startRow] = (double)(dValue[i]);
1861 stringValue = (
char***)SDDS_realloc(stringValue,
sizeof(
char**) * page);
1862 for (i=0; i<n; i++) {
1863 stringValue[p-i] = (
char**)NULL;
1866 if (rowsNeeded > rowsAllocated[p]) {
1867 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1868 stringValue[p] = (
char**)SDDS_realloc(stringValue[p],
sizeof(
char*) * rowsAllocated[p]);
1870 for (i=rowCount[p] ; i<startRow; i++) {
1871 stringValue[p][i] = (
char*)NULL;
1873 for (i=0; i<rows; i++) {
1874 stringValue[p][i+startRow] = (
char*)SDDS_malloc(
sizeof(
char) * strlen(values[i]) + 1);
1875 strcpy(stringValue[p][i+startRow], values[i]);
1880 charValue = (
char**)SDDS_realloc(charValue,
sizeof(
char*) * page);
1881 for (i=0; i<n; i++) {
1882 charValue[p-i] = (
char*)NULL;
1885 if (rowsNeeded > rowsAllocated[p]) {
1886 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1887 charValue[p] = (
char*)SDDS_realloc(charValue[p],
sizeof(
char) * rowsAllocated[p]);
1889 for (i=rowCount[p] ; i<startRow; i++) {
1890 charValue[p][i] = (char)0;
1892 for (i=0; i<rows; i++) {
1893 charValue[p][i+startRow] = (char)(values[i][0]);
1902 if (rowCount[p] < rowsNeeded) {
1903 rowCount[p] = rowsNeeded;
1908int32_t SDDSColumn::setValues(
char *values, uint32_t page, uint32_t startRow, uint32_t rows) {
1909 uint32_t rowsNeeded, i, n=0, p;
1911 char s[SDDS_MAXLINE];
1917 if (page > pageCount) {
1919 n = page - pageCount;
1922 rowsNeeded = rows + startRow;
1924 rowCount = (uint32_t*)SDDS_realloc(rowCount,
sizeof(uint32_t) * page);
1925 rowsAllocated = (uint32_t*)SDDS_realloc(rowsAllocated,
sizeof(uint32_t) * page);
1926 for (i=0; i<n; i++) {
1928 rowsAllocated[p-i] = 0;
1931 switch (columnType) {
1934 int16Value = (int16_t**)SDDS_realloc(int16Value,
sizeof(int16_t*) * page);
1935 for (i=0; i<n; i++) {
1936 int16Value[p-i] = (int16_t*)NULL;
1939 if (rowsNeeded > rowsAllocated[p]) {
1940 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1941 int16Value[p] = (int16_t*)SDDS_realloc(int16Value[p],
sizeof(int16_t) * rowsAllocated[p]);
1943 for (i=rowCount[p] ; i<startRow; i++) {
1944 int16Value[p][i] = (int16_t)0;
1946 for (i=0; i<rows; i++) {
1947 int16Value[p][i+startRow] = (int16_t)(values[i]);
1952 uint16Value = (uint16_t**)SDDS_realloc(uint16Value,
sizeof(uint16_t*) * page);
1953 for (i=0; i<n; i++) {
1954 uint16Value[p-i] = (uint16_t*)NULL;
1957 if (rowsNeeded > rowsAllocated[p]) {
1958 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1959 uint16Value[p] = (uint16_t*)SDDS_realloc(uint16Value[p],
sizeof(uint16_t) * rowsAllocated[p]);
1961 for (i=rowCount[p] ; i<startRow; i++) {
1962 uint16Value[p][i] = (uint16_t)0;
1964 for (i=0; i<rows; i++) {
1965 uint16Value[p][i+startRow] = (uint16_t)(values[i]);
1970 int32Value = (int32_t**)SDDS_realloc(int32Value,
sizeof(int32_t*) * page);
1971 for (i=0; i<n; i++) {
1972 int32Value[p-i] = (int32_t*)NULL;
1975 if (rowsNeeded > rowsAllocated[p]) {
1976 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1977 int32Value[p] = (int32_t*)SDDS_realloc(int32Value[p],
sizeof(int32_t) * rowsAllocated[p]);
1979 for (i=rowCount[p] ; i<startRow; i++) {
1980 int32Value[p][i] = (int32_t)0;
1982 for (i=0; i<rows; i++) {
1983 int32Value[p][i+startRow] = (int32_t)(values[i]);
1988 uint32Value = (uint32_t**)SDDS_realloc(uint32Value,
sizeof(uint32_t*) * page);
1989 for (i=0; i<n; i++) {
1990 uint32Value[p-i] = (uint32_t*)NULL;
1993 if (rowsNeeded > rowsAllocated[p]) {
1994 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
1995 uint32Value[p] = (uint32_t*)SDDS_realloc(uint32Value[p],
sizeof(uint32_t) * rowsAllocated[p]);
1997 for (i=rowCount[p] ; i<startRow; i++) {
1998 uint32Value[p][i] = (uint32_t)0;
2000 for (i=0; i<rows; i++) {
2001 uint32Value[p][i+startRow] = (uint32_t)(values[i]);
2006 real32Value = (
float**)SDDS_realloc(real32Value,
sizeof(
float*) * page);
2007 for (i=0; i<n; i++) {
2008 real32Value[p-i] = (
float*)NULL;
2011 if (rowsNeeded > rowsAllocated[p]) {
2012 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
2013 real32Value[p] = (
float*)SDDS_realloc(real32Value[p],
sizeof(
float) * rowsAllocated[p]);
2015 for (i=rowCount[p] ; i<startRow; i++) {
2016 real32Value[p][i] = (float)0;
2018 for (i=0; i<rows; i++) {
2019 real32Value[p][i+startRow] = (float)(values[i]);
2024 real64Value = (
double**)SDDS_realloc(real64Value,
sizeof(
double*) * page);
2025 for (i=0; i<n; i++) {
2026 real64Value[p-i] = (
double*)NULL;
2029 if (rowsNeeded > rowsAllocated[p]) {
2030 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
2031 real64Value[p] = (
double*)SDDS_realloc(real64Value[p],
sizeof(
double) * rowsAllocated[p]);
2033 for (i=rowCount[p] ; i<startRow; i++) {
2034 real64Value[p][i] = (double)0;
2036 for (i=0; i<rows; i++) {
2037 real64Value[p][i+startRow] = (double)(values[i]);
2042 stringValue = (
char***)SDDS_realloc(stringValue,
sizeof(
char**) * page);
2043 for (i=0; i<n; i++) {
2044 stringValue[p-i] = (
char**)NULL;
2047 if (rowsNeeded > rowsAllocated[p]) {
2048 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
2049 stringValue[p] = (
char**)SDDS_realloc(stringValue[p],
sizeof(
char*) * rowsAllocated[p]);
2051 for (i=rowCount[p] ; i<startRow; i++) {
2052 stringValue[p][i] = (
char*)NULL;
2054 for (i=0; i<rows; i++) {
2055 sprintf(s,
"%" PRId32, values[i]);
2056 stringValue[p][i+startRow] = (
char*)SDDS_malloc(
sizeof(
char) * strlen(s) + 1);
2057 strcpy(stringValue[p][i+startRow], s);
2062 charValue = (
char**)SDDS_realloc(charValue,
sizeof(
char*) * page);
2063 for (i=0; i<n; i++) {
2064 charValue[p-i] = (
char*)NULL;
2067 if (rowsNeeded > rowsAllocated[p]) {
2068 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
2069 charValue[p] = (
char*)SDDS_realloc(charValue[p],
sizeof(
char) * rowsAllocated[p]);
2072 for (i=rowCount[p] ; i<startRow; i++) {
2073 charValue[p][i] = (char)0;
2075 for (i=0; i<rows; i++) {
2076 charValue[p][i+startRow] = (char)(values[i]);
2079 memcpy(charValue[p], values, rows);
2088 if (rowCount[p] < rowsNeeded) {
2089 rowCount[p] = rowsNeeded;
2102int32_t SDDSColumn::readAsciiValue(
char **bigBuffer, int32_t *bigBufferSize, uint32_t page) {
2103 int32_t returnVal=0, length;
2104 uint32_t rowsNeeded, startRow, i, n=0, p;
2108 static char *buffer=NULL;
2109 static int32_t bufferSize=0;
2111 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--invalid page number (SDDSColumn::readAsciiValue)");
2114 startRow = getRowCount(page);
2115 if (startRow == UINT_MAX) {
2118 if (bufferSize==0) {
2119 bufferSize=SDDS_MAXLINE;
2120 buffer = (
char*)SDDS_malloc(
sizeof(*buffer)*(bufferSize));
2122 length = *bigBufferSize;
2123 if (length < columnFieldLength) {
2124 length = columnFieldLength;
2126 if (bufferSize <= length) {
2127 bufferSize = 2 * length;
2128 buffer = (
char*)SDDS_realloc(buffer,
sizeof(*buffer)*(bufferSize));
2131 if (columnFieldLength) {
2132 if (columnFieldLength > *bigBufferSize) {
2133 strcpy(buffer, *bigBuffer);
2137 strncpy(buffer, *bigBuffer, columnFieldLength);
2138 buffer[columnFieldLength] = 0;
2139 *bigBuffer += columnFieldLength;
2140 *bigBufferSize -= columnFieldLength;
2145 if (SDDS_getToken(bigBuffer, bigBufferSize, buffer, bufferSize) < 0) {
2146 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column (SDDSColumn::readAsciiValue)");
2150 iValue = strtoll(buffer, (
char**)NULL, 10);
2151 if ((iValue == LLONG_MIN) || (iValue == LLONG_MAX)) {
2152 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--not a valid integer (SDDSColumn::readAsciiValue)");
2158 if (SDDS_getToken(bigBuffer, bigBufferSize, buffer, bufferSize) < 0) {
2159 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column (SDDSColumn::readAsciiValue)");
2163 dValue = strtod(buffer, (
char**)NULL);
2164 if ((dValue == HUGE_VAL) || (dValue == -HUGE_VAL)) {
2165 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--not a valid number (SDDSColumn::readAsciiValue)");
2171 if (page > pageCount) {
2173 n = page - pageCount;
2176 rowsNeeded = 1 + startRow;
2178 rowCount = (uint32_t*)SDDS_realloc(rowCount,
sizeof(uint32_t) * page);
2179 rowsAllocated = (uint32_t*)SDDS_realloc(rowsAllocated,
sizeof(uint32_t) * page);
2180 for (i=0; i<n; i++) {
2182 rowsAllocated[p-i] = 0;
2185 switch (columnType) {
2188 int16Value = (int16_t**)SDDS_realloc(int16Value,
sizeof(int16_t*) * page);
2189 for (i=0; i<n; i++) {
2190 int16Value[p-i] = NULL;
2193 if (rowsNeeded > rowsAllocated[p]) {
2194 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
2195 int16Value[p] = (int16_t*)SDDS_realloc(int16Value[p],
sizeof(int16_t) * rowsAllocated[p]);
2197 int16Value[p][startRow] = (int16_t)iValue;
2201 uint16Value = (uint16_t**)SDDS_realloc(uint16Value,
sizeof(uint16_t*) * page);
2202 for (i=0; i<n; i++) {
2203 uint16Value[p-i] = NULL;
2206 if (rowsNeeded > rowsAllocated[p]) {
2207 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
2208 uint16Value[p] = (uint16_t*)SDDS_realloc(uint16Value[p],
sizeof(uint16_t) * rowsAllocated[p]);
2210 uint16Value[p][startRow] = (uint16_t)iValue;
2214 int32Value = (int32_t**)SDDS_realloc(int32Value,
sizeof(int32_t*) * page);
2215 for (i=0; i<n; i++) {
2216 int32Value[p-i] = NULL;
2219 if (rowsNeeded > rowsAllocated[p]) {
2220 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
2221 int32Value[p] = (int32_t*)SDDS_realloc(int32Value[p],
sizeof(int32_t) * rowsAllocated[p]);
2223 int32Value[p][startRow] = (int32_t)iValue;
2227 uint32Value = (uint32_t**)SDDS_realloc(uint32Value,
sizeof(uint32_t*) * page);
2228 for (i=0; i<n; i++) {
2229 uint32Value[p-i] = NULL;
2232 if (rowsNeeded > rowsAllocated[p]) {
2233 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
2234 uint32Value[p] = (uint32_t*)SDDS_realloc(uint32Value[p],
sizeof(uint32_t) * rowsAllocated[p]);
2236 uint32Value[p][startRow] = (uint32_t)iValue;
2240 real32Value = (
float**)SDDS_realloc(real32Value,
sizeof(
float*) * page);
2241 for (i=0; i<n; i++) {
2242 real32Value[p-i] = NULL;
2245 if (rowsNeeded > rowsAllocated[p]) {
2246 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
2247 real32Value[p] = (
float*)SDDS_realloc(real32Value[p],
sizeof(
float) * rowsAllocated[p]);
2249 real32Value[p][startRow] = (float)dValue;
2253 real64Value = (
double**)SDDS_realloc(real64Value,
sizeof(
double*) * page);
2254 for (i=0; i<n; i++) {
2255 real64Value[p-i] = NULL;
2258 if (rowsNeeded > rowsAllocated[p]) {
2259 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
2260 real64Value[p] = (
double*)SDDS_realloc(real64Value[p],
sizeof(
double) * rowsAllocated[p]);
2262 real64Value[p][startRow] = (double)dValue;
2266 stringValue = (
char***)SDDS_realloc(stringValue,
sizeof(
char**) * page);
2267 for (i=0; i<n; i++) {
2268 stringValue[p-i] = NULL;
2271 if (rowsNeeded > rowsAllocated[p]) {
2272 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
2273 stringValue[p] = (
char**)SDDS_realloc(stringValue[p],
sizeof(
char*) * rowsAllocated[p]);
2275 length = strlen(*bigBuffer);
2277 if ((*bigBuffer)[length-1] ==
'\r') {
2278 (*bigBuffer)[length-1] = 0;
2281 if (SDDS_getToken(bigBuffer, bigBufferSize, buffer, bufferSize) < 0) {
2282 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column (SDDSColumn::readAsciiValue)");
2284 stringValue[p][startRow] = (
char*)SDDS_malloc(
sizeof(
char) * 4);
2285 strcpy(stringValue[p][startRow],
"\"\"");
2287 SDDS_interpretEscapes(buffer);
2288 stringValue[p][startRow] = (
char*)SDDS_malloc(
sizeof(
char) * strlen(buffer) + 1);
2289 strcpy(stringValue[p][startRow], buffer);
2294 charValue = (
char**)SDDS_realloc(charValue,
sizeof(
char*) * page);
2295 for (i=0; i<n; i++) {
2296 charValue[p-i] = NULL;
2299 if (rowsNeeded > rowsAllocated[p]) {
2300 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
2301 charValue[p] = (
char*)SDDS_realloc(charValue[p],
sizeof(
char) * rowsAllocated[p]);
2303 if (SDDS_getToken(bigBuffer, bigBufferSize, buffer, bufferSize) < 0) {
2304 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column (SDDSColumn::readAsciiValue)");
2306 charValue[p][startRow] =
'-';
2308 charValue[p][startRow] = (char)(buffer[0]);
2312 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--invalid column type (SDDSColumn::readAsciiValue)");
2332void* SDDSColumn::getInternalValues(uint32_t page) {
2334 if ((page == 0) || (pageCount < page)) {
2335 ((SDDSFile*)sddsfile)->setError((
char*)
"Invalid page (SDDSColumn::getInternalValues)");
2339 if (rowCount[p] == 0) {
2342 switch (columnType) {
2344 return(int16Value[p]);
2346 return(uint16Value[p]);
2348 return(int32Value[p]);
2350 return(uint32Value[p]);
2352 return(real32Value[p]);
2354 return(real64Value[p]);
2356 return(stringValue[p]);
2358 return(charValue[p]);
2360 ((SDDSFile*)sddsfile)->setError((
char*)
"Invalid data type (SDDSColumn::getInternalValues)");
2376int32_t* SDDSColumn::getValuesInInt32(uint32_t page, int32_t *errorcode) {
2381 if ((page == 0) || (pageCount < page)) {
2383 return((int32_t*)NULL);
2387 if (rowCount[p] == 0) {
2388 return((int32_t*)NULL);
2390 rValues = (int32_t*)SDDS_malloc(
sizeof(int32_t) * rowCount[p]);
2391 switch (columnType) {
2393 for (i=0; i<rowCount[p]; i++)
2394 rValues[i] = (int32_t)int16Value[p][i];
2395 return((int32_t*)rValues);
2397 for (i=0; i<rowCount[p]; i++)
2398 rValues[i] = (int32_t)uint16Value[p][i];
2399 return((int32_t*)rValues);
2401 for (i=0; i<rowCount[p]; i++)
2402 rValues[i] = (int32_t)int32Value[p][i];
2403 return((int32_t*)rValues);
2405 for (i=0; i<rowCount[p]; i++)
2406 rValues[i] = (int32_t)uint32Value[p][i];
2407 return((int32_t*)rValues);
2409 for (i=0; i<rowCount[p]; i++)
2410 rValues[i] = (int32_t)real32Value[p][i];
2411 return((int32_t*)rValues);
2413 for (i=0; i<rowCount[p]; i++)
2414 rValues[i] = (int32_t)real64Value[p][i];
2415 return((int32_t*)rValues);
2417 for (i=0; i<rowCount[p]; i++) {
2418 iValue = strtoll(stringValue[p][i], (
char**)NULL, 10);
2419 if ((iValue == LLONG_MIN) || (iValue == LLONG_MAX)) {
2423 return((int32_t*)NULL);
2425 rValues[i] = (int32_t)iValue;
2427 return((int32_t*)rValues);
2429 for (i=0; i<rowCount[p]; i++)
2430 rValues[i] = (int32_t)charValue[p][i];
2431 return((int32_t*)rValues);
2434 return((int32_t*)NULL);
2449uint32_t* SDDSColumn::getValuesInUInt32(uint32_t page, int32_t *errorcode) {
2453 if ((page == 0) || (pageCount < page)) {
2455 return((uint32_t*)NULL);
2459 if (rowCount[p] == 0) {
2460 return((uint32_t*)NULL);
2462 rValues = (uint32_t*)SDDS_malloc(
sizeof(uint32_t) * rowCount[p]);
2463 switch (columnType) {
2465 for (i=0; i<rowCount[p]; i++)
2466 rValues[i] = (uint32_t)int16Value[p][i];
2467 return((uint32_t*)rValues);
2469 for (i=0; i<rowCount[p]; i++)
2470 rValues[i] = (uint32_t)uint16Value[p][i];
2471 return((uint32_t*)rValues);
2473 for (i=0; i<rowCount[p]; i++)
2474 rValues[i] = (uint32_t)int32Value[p][i];
2475 return((uint32_t*)rValues);
2477 for (i=0; i<rowCount[p]; i++)
2478 rValues[i] = (uint32_t)uint32Value[p][i];
2479 return((uint32_t*)rValues);
2481 for (i=0; i<rowCount[p]; i++)
2482 rValues[i] = (uint32_t)real32Value[p][i];
2483 return((uint32_t*)rValues);
2485 for (i=0; i<rowCount[p]; i++)
2486 rValues[i] = (uint32_t)real64Value[p][i];
2487 return((uint32_t*)rValues);
2489 for (i=0; i<rowCount[p]; i++) {
2490 iValue = strtoll(stringValue[p][i], (
char**)NULL, 10);
2491 if ((iValue == LLONG_MIN) || (iValue == LLONG_MAX)) {
2495 return((uint32_t*)NULL);
2497 rValues[i] = (uint32_t)iValue;
2499 return((uint32_t*)rValues);
2501 for (i=0; i<rowCount[p]; i++)
2502 rValues[i] = (uint32_t)charValue[p][i];
2503 return((uint32_t*)rValues);
2506 return((uint32_t*)NULL);
2521double* SDDSColumn::getValuesInDouble(uint32_t page, int32_t *errorcode) {
2525 if ((page == 0) || (pageCount < page)) {
2527 return((
double*)NULL);
2531 if (rowCount[p] == 0) {
2532 return((
double*)NULL);
2534 rValues = (
double*)SDDS_malloc(
sizeof(
double) * rowCount[p]);
2535 switch (columnType) {
2537 for (i=0; i<rowCount[p]; i++)
2538 rValues[i] = (
double)int16Value[p][i];
2539 return((
double*)rValues);
2541 for (i=0; i<rowCount[p]; i++)
2542 rValues[i] = (
double)uint16Value[p][i];
2543 return((
double*)rValues);
2545 for (i=0; i<rowCount[p]; i++)
2546 rValues[i] = (
double)int32Value[p][i];
2547 return((
double*)rValues);
2549 for (i=0; i<rowCount[p]; i++)
2550 rValues[i] = (
double)uint32Value[p][i];
2551 return((
double*)rValues);
2553 for (i=0; i<rowCount[p]; i++)
2554 rValues[i] = (
double)real32Value[p][i];
2555 return((
double*)rValues);
2557 for (i=0; i<rowCount[p]; i++)
2558 rValues[i] = (
double)real64Value[p][i];
2559 return((
double*)rValues);
2561 for (i=0; i<rowCount[p]; i++) {
2562 dValue = strtod(stringValue[p][i], (
char**)NULL);
2563 if ((dValue == HUGE_VAL) || (dValue == -HUGE_VAL)) {
2567 return((
double*)NULL);
2569 rValues[i] = (double)dValue;
2571 return((
double*)rValues);
2573 for (i=0; i<rowCount[p]; i++)
2574 rValues[i] = (
double)charValue[p][i];
2575 return((
double*)rValues);
2578 return((
double*)NULL);
2593char** SDDSColumn::getValuesInString(uint32_t page, int32_t *errorcode) {
2596 char s[SDDS_MAXLINE];
2597 if ((page == 0) || (pageCount < page)) {
2599 return((
char**)NULL);
2603 if (rowCount[p] == 0) {
2604 return((
char**)NULL);
2606 rValues = (
char**)SDDS_malloc(
sizeof(
char*) * rowCount[p]);
2607 switch (columnType) {
2609 for (i=0; i<rowCount[p]; i++) {
2610 sprintf(s,
"%" PRId16, int16Value[p][i]);
2611 rValues[i] = (
char*)SDDS_malloc(
sizeof(
char) * strlen(s) + 1);
2612 strcpy(rValues[i], s);
2614 return((
char**)rValues);
2616 for (i=0; i<rowCount[p]; i++) {
2617 sprintf(s,
"%" PRIu16, uint16Value[p][i]);
2618 rValues[i] = (
char*)SDDS_malloc(
sizeof(
char) * strlen(s) + 1);
2619 strcpy(rValues[i], s);
2621 return((
char**)rValues);
2623 for (i=0; i<rowCount[p]; i++) {
2624 sprintf(s,
"%" PRId32, int32Value[p][i]);
2625 rValues[i] = (
char*)SDDS_malloc(
sizeof(
char) * strlen(s) + 1);
2626 strcpy(rValues[i], s);
2628 return((
char**)rValues);
2630 for (i=0; i<rowCount[p]; i++) {
2631 sprintf(s,
"%" PRIu32, uint32Value[p][i]);
2632 rValues[i] = (
char*)SDDS_malloc(
sizeof(
char) * strlen(s) + 1);
2633 strcpy(rValues[i], s);
2635 return((
char**)rValues);
2637 for (i=0; i<rowCount[p]; i++) {
2638 sprintf(s,
"%f", real32Value[p][i]);
2639 rValues[i] = (
char*)SDDS_malloc(
sizeof(
char) * strlen(s) + 1);
2640 strcpy(rValues[i], s);
2642 return((
char**)rValues);
2644 for (i=0; i<rowCount[p]; i++) {
2645 sprintf(s,
"%lf", real64Value[p][i]);
2646 rValues[i] = (
char*)SDDS_malloc(
sizeof(
char) * strlen(s) + 1);
2647 strcpy(rValues[i], s);
2649 return((
char**)rValues);
2651 for (i=0; i<rowCount[p]; i++) {
2652 rValues[i] = (
char*)SDDS_malloc(
sizeof(
char) * strlen(stringValue[p][i]) + 1);
2653 strcpy(rValues[i], stringValue[p][i]);
2655 return((
char**)rValues);
2657 for (i=0; i<rowCount[p]; i++) {
2658 sprintf(s,
"%c", charValue[p][i]);
2659 rValues[i] = (
char*)SDDS_malloc(
sizeof(
char) * strlen(s) + 1);
2660 strcpy(rValues[i], s);
2662 return((
char**)rValues);
2665 return((
char**)NULL);
2678int32_t SDDSColumn::writeDefinition(FILE *fp) {
2685 fputs(
"&column ", fp);
2686 if (SDDS_printNamelistField(fp, (
char*)
"name", columnName)) {
2689 if (SDDS_printNamelistField(fp, (
char*)
"symbol", SDDS_blankToNull(columnSymbol))) {
2692 if (SDDS_printNamelistField(fp, (
char*)
"units", SDDS_blankToNull(columnUnits))) {
2695 if (SDDS_printNamelistField(fp, (
char*)
"description", SDDS_blankToNull(columnDescription))) {
2698 if (SDDS_printNamelistField(fp, (
char*)
"format_string", SDDS_blankToNull(columnFormatString))) {
2701 if (((SDDSFile*)sddsfile)->layoutVersion == 1) {
2702 if (SDDS_printNamelistField(fp, (
char*)
"type", SDDS_getVer1TypeName(columnType))) {
2705 }
else if (((SDDSFile*)sddsfile)->layoutVersion == 2) {
2706 if (SDDS_printNamelistField(fp, (
char*)
"type", SDDS_getVer2TypeName(columnType))) {
2710 if (SDDS_printNamelistField(fp, (
char*)
"type", SDDS_getTypeName(columnType))) {
2714 fputs(
"&end\n", fp);
2718int32_t SDDSColumn::writeDefinition(voidp *gzfp) {
2725 gzputs(gzfp,
"&column ");
2726 if (SDDS_printNamelistField(gzfp, (
char*)
"name", columnName)) {
2729 if (SDDS_printNamelistField(gzfp, (
char*)
"symbol", SDDS_blankToNull(columnSymbol))) {
2732 if (SDDS_printNamelistField(gzfp, (
char*)
"units", SDDS_blankToNull(columnUnits))) {
2735 if (SDDS_printNamelistField(gzfp, (
char*)
"description", SDDS_blankToNull(columnDescription))) {
2738 if (SDDS_printNamelistField(gzfp, (
char*)
"format_string", SDDS_blankToNull(columnFormatString))) {
2741 if (((SDDSFile*)sddsfile)->layoutVersion == 1) {
2742 if (SDDS_printNamelistField(gzfp, (
char*)
"type", SDDS_getVer1TypeName(columnType))) {
2745 }
else if (((SDDSFile*)sddsfile)->layoutVersion == 2) {
2746 if (SDDS_printNamelistField(gzfp, (
char*)
"type", SDDS_getVer2TypeName(columnType))) {
2750 if (SDDS_printNamelistField(gzfp, (
char*)
"type", SDDS_getTypeName(columnType))) {
2754 gzputs(gzfp,
"&end\n");
2767int32_t SDDSColumn::writeAsciiValue(FILE *fp, uint32_t page, uint32_t row) {
2770 int32_t hasWhitespace;
2772 if ((page == 0) || (page > pageCount) || (row == 0) || (row > rowCount[page-1])) {
2777 switch (columnType) {
2779 fprintf(fp,
"%" PRId16
" ", int16Value[page][row]);
2782 fprintf(fp,
"%" PRIu16
" ", uint16Value[page][row]);
2785 fprintf(fp,
"%" PRId32
" ", int32Value[page][row]);
2788 fprintf(fp,
"%" PRIu32
" ", uint32Value[page][row]);
2791 fprintf(fp,
"%.*g ", FLT_DIG, real32Value[page][row]);
2794 fprintf(fp,
"%.*g ", DBL_DIG, real64Value[page][row]);
2797 s = stringValue[page][row];
2799 if (SDDS_hasWhitespace(s) || SDDS_stringIsBlank(s)) {
2807 }
else if (c==
'\\') {
2809 }
else if (c==
'"') {
2811 }
else if (c==
' ') {
2813 }
else if (isspace(c) || !isprint(c)) {
2814 fprintf(fp,
"\\%03o", c);
2819 if (hasWhitespace) {
2825 c = charValue[page][row];
2832 else if (!c || isspace(c) || !isprint(c))
2833 fprintf(fp,
"\\%03o", c);
2844int32_t SDDSColumn::writeAsciiValue(voidp *gzfp, uint32_t page, uint32_t row) {
2847 int32_t hasWhitespace;
2849 if ((page == 0) || (page > pageCount) || (row == 0) || (row > rowCount[page-1])) {
2854 switch (columnType) {
2856 gzprintf(gzfp,
"%" PRId16
" ", int16Value[page][row]);
2859 gzprintf(gzfp,
"%" PRIu16
" ", uint16Value[page][row]);
2862 gzprintf(gzfp,
"%" PRId32
" ", int32Value[page][row]);
2865 gzprintf(gzfp,
"%" PRIu32
" ", uint32Value[page][row]);
2868 gzprintf(gzfp,
"%.*g ", FLT_DIG, real32Value[page][row]);
2871 gzprintf(gzfp,
"%.*g ", DBL_DIG, real64Value[page][row]);
2874 s = stringValue[page][row];
2876 if (SDDS_hasWhitespace(s) || SDDS_stringIsBlank(s)) {
2883 gzputs(gzfp,
"\\!");
2884 }
else if (c==
'\\') {
2885 gzputs(gzfp,
"\\\\");
2886 }
else if (c==
'"') {
2887 gzputs(gzfp,
"\\\"");
2888 }
else if (c==
' ') {
2890 }
else if (isspace(c) || !isprint(c)) {
2891 gzprintf(gzfp,
"\\%03o", c);
2896 if (hasWhitespace) {
2902 c = charValue[page][row];
2904 gzputs(gzfp,
"\\!");
2906 gzputs(gzfp,
"\\\\");
2908 gzputs(gzfp,
"\\\"");
2909 else if (!c || isspace(c) || !isprint(c))
2910 gzprintf(gzfp,
"\\%03o", c);
3129int32_t SDDSColumn::writeBinaryValue(FILE *fp,
SDDS_FILEBUFFER *fBuffer, uint32_t page, uint32_t row,
bool nonNativeEndian) {
3130 switch (columnType) {
3132 if (SDDS_bufferedWrite(&(int16Value[page][row]), 2, fp, fBuffer, sddsfile)) {
3133 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValue)");
3138 if (SDDS_bufferedWrite(&(uint16Value[page][row]), 2, fp, fBuffer, sddsfile)) {
3139 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValue)");
3144 if (SDDS_bufferedWrite(&(int32Value[page][row]), 4, fp, fBuffer, sddsfile)) {
3145 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValue)");
3150 if (SDDS_bufferedWrite(&(uint32Value[page][row]), 4, fp, fBuffer, sddsfile)) {
3151 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValue)");
3156 if (SDDS_bufferedWrite(&(real32Value[page][row]), 4, fp, fBuffer, sddsfile)) {
3157 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValue)");
3162 if (SDDS_bufferedWrite(&(real64Value[page][row]), 8, fp, fBuffer, sddsfile)) {
3163 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValue)");
3168 if (SDDS_writeBinaryString(stringValue[page][row], fp, fBuffer, sddsfile)) {
3169 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing string (SDDSColumn::writeBinaryValue)");
3174 if (SDDS_bufferedWrite(&(charValue[page][row]), 1, fp, fBuffer, sddsfile)) {
3175 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValue)");
3180 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--unknown type (SDDSColumn::writeBinaryValue)");
3184int32_t SDDSColumn::writeBinaryValue(voidp *gzfp,
SDDS_FILEBUFFER *fBuffer, uint32_t page, uint32_t row,
bool nonNativeEndian) {
3185 switch (columnType) {
3187 if (SDDS_bufferedWrite(&(int16Value[page][row]), 2, gzfp, fBuffer, sddsfile)) {
3188 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValue)");
3193 if (SDDS_bufferedWrite(&(uint16Value[page][row]), 2, gzfp, fBuffer, sddsfile)) {
3194 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValue)");
3199 if (SDDS_bufferedWrite(&(int32Value[page][row]), 4, gzfp, fBuffer, sddsfile)) {
3200 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValue)");
3205 if (SDDS_bufferedWrite(&(uint32Value[page][row]), 4, gzfp, fBuffer, sddsfile)) {
3206 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValue)");
3211 if (SDDS_bufferedWrite(&(real32Value[page][row]), 4, gzfp, fBuffer, sddsfile)) {
3212 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValue)");
3217 if (SDDS_bufferedWrite(&(real64Value[page][row]), 8, gzfp, fBuffer, sddsfile)) {
3218 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValue)");
3223 if (SDDS_writeBinaryString(stringValue[page][row], gzfp, fBuffer, sddsfile)) {
3224 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing string (SDDSColumn::writeBinaryValue)");
3229 if (SDDS_bufferedWrite(&(charValue[page][row]), 1, gzfp, fBuffer, sddsfile)) {
3230 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValue)");
3235 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--unknown type (SDDSColumn::writeBinaryValue)");
3248int32_t SDDSColumn::writeBinaryValues(FILE *fp,
SDDS_FILEBUFFER *fBuffer, uint32_t page,
bool nonNativeEndian) {
3250 switch (columnType) {
3252 if (SDDS_bufferedWrite(&(int16Value[page][0]), 2 * rowCount[page], fp, fBuffer, sddsfile)) {
3253 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValues)");
3258 if (SDDS_bufferedWrite(&(uint16Value[page][0]), 2 * rowCount[page], fp, fBuffer, sddsfile)) {
3259 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValues)");
3264 if (SDDS_bufferedWrite(&(int32Value[page][0]), 4 * rowCount[page], fp, fBuffer, sddsfile)) {
3265 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValues)");
3270 if (SDDS_bufferedWrite(&(uint32Value[page][0]), 4 * rowCount[page], fp, fBuffer, sddsfile)) {
3271 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValues)");
3276 if (SDDS_bufferedWrite(&(real32Value[page][0]), 4 * rowCount[page], fp, fBuffer, sddsfile)) {
3277 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValues)");
3282 if (SDDS_bufferedWrite(&(real64Value[page][0]), 8 * rowCount[page], fp, fBuffer, sddsfile)) {
3283 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValues)");
3288 for (row=0; row<rowCount[page]; row++) {
3289 if (SDDS_writeBinaryString(stringValue[page][row], fp, fBuffer, sddsfile)) {
3290 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing string (SDDSColumn::writeBinaryValues)");
3296 if (SDDS_bufferedWrite(&(charValue[page][0]), rowCount[page], fp, fBuffer, sddsfile)) {
3297 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValues)");
3302 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--unknown type (SDDSColumn::writeBinaryValues)");
3306int32_t SDDSColumn::writeBinaryValues(voidp *gzfp,
SDDS_FILEBUFFER *fBuffer, uint32_t page,
bool nonNativeEndian) {
3308 switch (columnType) {
3310 if (SDDS_bufferedWrite(&(int16Value[page][0]), 2 * rowCount[page], gzfp, fBuffer, sddsfile)) {
3311 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValues)");
3316 if (SDDS_bufferedWrite(&(uint16Value[page][0]), 2 * rowCount[page], gzfp, fBuffer, sddsfile)) {
3317 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValues)");
3322 if (SDDS_bufferedWrite(&(int32Value[page][0]), 4 * rowCount[page], gzfp, fBuffer, sddsfile)) {
3323 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValues)");
3328 if (SDDS_bufferedWrite(&(uint32Value[page][0]), 4 * rowCount[page], gzfp, fBuffer, sddsfile)) {
3329 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValues)");
3334 if (SDDS_bufferedWrite(&(real32Value[page][0]), 4 * rowCount[page], gzfp, fBuffer, sddsfile)) {
3335 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValues)");
3340 if (SDDS_bufferedWrite(&(real64Value[page][0]), 8 * rowCount[page], gzfp, fBuffer, sddsfile)) {
3341 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValues)");
3346 for (row=0; row<rowCount[page]; row++) {
3347 if (SDDS_writeBinaryString(stringValue[page][row], gzfp, fBuffer, sddsfile)) {
3348 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing string (SDDSColumn::writeBinaryValues)");
3354 if (SDDS_bufferedWrite(&(charValue[page][0]), rowCount[page], gzfp, fBuffer, sddsfile)) {
3355 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--failure writing value (SDDSColumn::writeBinaryValues)");
3360 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to write column--unknown type (SDDSColumn::writeBinaryValues)");
3373int32_t SDDSColumn::readBinaryValue(FILE *fp,
SDDS_FILEBUFFER *fBuffer, uint32_t page,
bool nonNativeEndian) {
3374 uint32_t i, n=0, p, rowsNeeded;
3378 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--invalid page number (SDDSColumn::readBinaryValue)");
3381 if (page > pageCount) {
3383 n = page - pageCount;
3387 rowCount = (uint32_t*)SDDS_realloc(rowCount,
sizeof(uint32_t) * page);
3388 rowsAllocated = (uint32_t*)SDDS_realloc(rowsAllocated,
sizeof(uint32_t) * page);
3389 for (i=0; i<n; i++) {
3391 rowsAllocated[p-i] = 0;
3394 rowsNeeded = 1 + rowCount[p];
3395 switch (columnType) {
3398 int16Value = (int16_t**)SDDS_realloc(int16Value,
sizeof(int16_t*) * page);
3399 for (i=0; i<n; i++) {
3400 int16Value[p-i] = NULL;
3403 if (rowsNeeded > rowsAllocated[p]) {
3404 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
3405 int16Value[p] = (int16_t*)SDDS_realloc(int16Value[p],
sizeof(int16_t) * rowsAllocated[p]);
3407 if (SDDS_bufferedRead(&(int16Value[p][rowCount[p]]), 2, fp, fBuffer, sddsfile)) {
3408 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading value (SDDSColumn::readBinaryValue)");
3414 uint16Value = (uint16_t**)SDDS_realloc(uint16Value,
sizeof(uint16_t*) * page);
3415 for (i=0; i<n; i++) {
3416 uint16Value[p-i] = NULL;
3419 if (rowsNeeded > rowsAllocated[p]) {
3420 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
3421 uint16Value[p] = (uint16_t*)SDDS_realloc(uint16Value[p],
sizeof(uint16_t) * rowsAllocated[p]);
3423 if (SDDS_bufferedRead(&(uint16Value[p][rowCount[p]]), 2, fp, fBuffer, sddsfile)) {
3424 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading value (SDDSColumn::readBinaryValue)");
3430 int32Value = (int32_t**)SDDS_realloc(int32Value,
sizeof(int32_t*) * page);
3431 for (i=0; i<n; i++) {
3432 int32Value[p-i] = NULL;
3435 if (rowsNeeded > rowsAllocated[p]) {
3436 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
3437 int32Value[p] = (int32_t*)SDDS_realloc(int32Value[p],
sizeof(int32_t) * rowsAllocated[p]);
3439 if (SDDS_bufferedRead(&(int32Value[p][rowCount[p]]), 4, fp, fBuffer, sddsfile)) {
3440 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading value (SDDSColumn::readBinaryValue)");
3446 uint32Value = (uint32_t**)SDDS_realloc(uint32Value,
sizeof(uint32_t*) * page);
3447 for (i=0; i<n; i++) {
3448 uint32Value[p-i] = NULL;
3451 if (rowsNeeded > rowsAllocated[p]) {
3452 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
3453 uint32Value[p] = (uint32_t*)SDDS_realloc(uint32Value[p],
sizeof(uint32_t) * rowsAllocated[p]);
3455 if (SDDS_bufferedRead(&(uint32Value[p][rowCount[p]]), 4, fp, fBuffer, sddsfile)) {
3456 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading value (SDDSColumn::readBinaryValue)");
3462 real32Value = (
float**)SDDS_realloc(real32Value,
sizeof(
float*) * page);
3463 for (i=0; i<n; i++) {
3464 real32Value[p-i] = NULL;
3467 if (rowsNeeded > rowsAllocated[p]) {
3468 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
3469 real32Value[p] = (
float*)SDDS_realloc(real32Value[p],
sizeof(
float) * rowsAllocated[p]);
3471 if (SDDS_bufferedRead(&(real32Value[p][rowCount[p]]), 4, fp, fBuffer, sddsfile)) {
3472 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading value (SDDSColumn::readBinaryValue)");
3478 real64Value = (
double**)SDDS_realloc(real64Value,
sizeof(
double*) * page);
3479 for (i=0; i<n; i++) {
3480 real64Value[p-i] = NULL;
3483 if (rowsNeeded > rowsAllocated[p]) {
3484 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
3485 real64Value[p] = (
double*)SDDS_realloc(real64Value[p],
sizeof(
double) * rowsAllocated[p]);
3487 if (SDDS_bufferedRead(&(real64Value[p][rowCount[p]]), 8, fp, fBuffer, sddsfile)) {
3488 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading value (SDDSColumn::readBinaryValue)");
3494 stringValue = (
char***)SDDS_realloc(stringValue,
sizeof(
char**) * page);
3495 for (i=0; i<n; i++) {
3496 stringValue[p-i] = NULL;
3499 if (rowsNeeded > rowsAllocated[p]) {
3500 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
3501 stringValue[p] = (
char**)SDDS_realloc(stringValue[p],
sizeof(
char*) * rowsAllocated[p]);
3503 stringValue[p][rowCount[p]] = NULL;
3504 if (SDDS_readBinaryString(&(stringValue[p][rowCount[p]]), fp, fBuffer, sddsfile)) {
3505 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading string (SDDSColumn::readBinaryValue)");
3511 charValue = (
char**)SDDS_realloc(charValue,
sizeof(
char*) * page);
3512 for (i=0; i<n; i++) {
3513 charValue[p-i] = NULL;
3516 if (rowsNeeded > rowsAllocated[p]) {
3517 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
3518 charValue[p] = (
char*)SDDS_realloc(charValue[p],
sizeof(
char) * rowsAllocated[p]);
3520 if (SDDS_bufferedRead(&(charValue[p][rowCount[p]]), 1, fp, fBuffer, sddsfile)) {
3521 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading value (SDDSColumn::readBinaryValue)");
3526 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--unknown type (SDDSColumn::readBinaryValue)");
3538int32_t SDDSColumn::readBinaryValue(voidp *gzfp,
SDDS_FILEBUFFER *fBuffer, uint32_t page,
bool nonNativeEndian) {
3539 uint32_t i, n=0, p, rowsNeeded;
3543 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--invalid page number (SDDSColumn::readBinaryValue)");
3546 if (page > pageCount) {
3548 n = page - pageCount;
3552 rowCount = (uint32_t*)SDDS_realloc(rowCount,
sizeof(uint32_t) * page);
3553 rowsAllocated = (uint32_t*)SDDS_realloc(rowsAllocated,
sizeof(uint32_t) * page);
3554 for (i=0; i<n; i++) {
3556 rowsAllocated[p-i] = 0;
3559 rowsNeeded = 1 + rowCount[p];
3560 switch (columnType) {
3563 int16Value = (int16_t**)SDDS_realloc(int16Value,
sizeof(int16_t*) * page);
3564 for (i=0; i<n; i++) {
3565 int16Value[p-i] = NULL;
3568 if (rowsNeeded > rowsAllocated[p]) {
3569 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
3570 int16Value[p] = (int16_t*)SDDS_realloc(int16Value[p],
sizeof(int16_t) * rowsAllocated[p]);
3572 if (SDDS_bufferedRead(&(int16Value[p][rowCount[p]]), 2, gzfp, fBuffer, sddsfile)) {
3573 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading value (SDDSColumn::readBinaryValue)");
3579 uint16Value = (uint16_t**)SDDS_realloc(uint16Value,
sizeof(uint16_t*) * page);
3580 for (i=0; i<n; i++) {
3581 uint16Value[p-i] = NULL;
3584 if (rowsNeeded > rowsAllocated[p]) {
3585 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
3586 uint16Value[p] = (uint16_t*)SDDS_realloc(uint16Value[p],
sizeof(uint16_t) * rowsAllocated[p]);
3588 if (SDDS_bufferedRead(&(uint16Value[p][rowCount[p]]), 2, gzfp, fBuffer, sddsfile)) {
3589 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading value (SDDSColumn::readBinaryValue)");
3595 int32Value = (int32_t**)SDDS_realloc(int32Value,
sizeof(int32_t*) * page);
3596 for (i=0; i<n; i++) {
3597 int32Value[p-i] = NULL;
3600 if (rowsNeeded > rowsAllocated[p]) {
3601 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
3602 int32Value[p] = (int32_t*)SDDS_realloc(int32Value[p],
sizeof(int32_t) * rowsAllocated[p]);
3604 if (SDDS_bufferedRead(&(int32Value[p][rowCount[p]]), 4, gzfp, fBuffer, sddsfile)) {
3605 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading value (SDDSColumn::readBinaryValue)");
3611 uint32Value = (uint32_t**)SDDS_realloc(uint32Value,
sizeof(uint32_t*) * page);
3612 for (i=0; i<n; i++) {
3613 uint32Value[p-i] = NULL;
3616 if (rowsNeeded > rowsAllocated[p]) {
3617 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
3618 uint32Value[p] = (uint32_t*)SDDS_realloc(uint32Value[p],
sizeof(uint32_t) * rowsAllocated[p]);
3620 if (SDDS_bufferedRead(&(uint32Value[p][rowCount[p]]), 4, gzfp, fBuffer, sddsfile)) {
3621 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading value (SDDSColumn::readBinaryValue)");
3627 real32Value = (
float**)SDDS_realloc(real32Value,
sizeof(
float*) * page);
3628 for (i=0; i<n; i++) {
3629 real32Value[p-i] = NULL;
3632 if (rowsNeeded > rowsAllocated[p]) {
3633 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
3634 real32Value[p] = (
float*)SDDS_realloc(real32Value[p],
sizeof(
float) * rowsAllocated[p]);
3636 if (SDDS_bufferedRead(&(real32Value[p][rowCount[p]]), 4, gzfp, fBuffer, sddsfile)) {
3637 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading value (SDDSColumn::readBinaryValue)");
3643 real64Value = (
double**)SDDS_realloc(real64Value,
sizeof(
double*) * page);
3644 for (i=0; i<n; i++) {
3645 real64Value[p-i] = NULL;
3648 if (rowsNeeded > rowsAllocated[p]) {
3649 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
3650 real64Value[p] = (
double*)SDDS_realloc(real64Value[p],
sizeof(
double) * rowsAllocated[p]);
3652 if (SDDS_bufferedRead(&(real64Value[p][rowCount[p]]), 8, gzfp, fBuffer, sddsfile)) {
3653 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading value (SDDSColumn::readBinaryValue)");
3659 stringValue = (
char***)SDDS_realloc(stringValue,
sizeof(
char**) * page);
3660 for (i=0; i<n; i++) {
3661 stringValue[p-i] = NULL;
3664 if (rowsNeeded > rowsAllocated[p]) {
3665 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
3666 stringValue[p] = (
char**)SDDS_realloc(stringValue[p],
sizeof(
char*) * rowsAllocated[p]);
3668 stringValue[p][rowCount[p]] = NULL;
3669 if (SDDS_readBinaryString(&(stringValue[p][rowCount[p]]), gzfp, fBuffer, sddsfile)) {
3670 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading string (SDDSColumn::readBinaryValue)");
3676 charValue = (
char**)SDDS_realloc(charValue,
sizeof(
char*) * page);
3677 for (i=0; i<n; i++) {
3678 charValue[p-i] = NULL;
3681 if (rowsNeeded > rowsAllocated[p]) {
3682 rowsAllocated[p] = rowsNeeded + rowAllocationIncrement;
3683 charValue[p] = (
char*)SDDS_realloc(charValue[p],
sizeof(
char) * rowsAllocated[p]);
3685 if (SDDS_bufferedRead(&(charValue[p][rowCount[p]]), 1, gzfp, fBuffer, sddsfile)) {
3686 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading value (SDDSColumn::readBinaryValue)");
3691 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--unknown type (SDDSColumn::readBinaryValue)");
3714int32_t SDDSColumn::readBinaryValues(FILE *fp,
SDDS_FILEBUFFER *fBuffer, uint32_t page, uint32_t rows,
bool nonNativeEndian) {
3718 ((SDDSFile*)sddsfile)->setError((
char*)
"Invalid page number--failure reading values (SDDSColumn::readBinaryValues)");
3721 if (page > pageCount) {
3722 n = page - pageCount;
3724 ((SDDSFile*)sddsfile)->setError((
char*)
"Invalid page number--failure reading values (SDDSColumn::readBinaryValues)");
3728 rowCount = (uint32_t*)SDDS_realloc(rowCount,
sizeof(uint32_t) * page);
3729 rowsAllocated = (uint32_t*)SDDS_realloc(rowsAllocated,
sizeof(uint32_t) * page);
3730 for (i=0; i<n; i++) {
3732 rowsAllocated[p-i] = 0;
3737 switch (columnType) {
3739 int16Value = (int16_t**)SDDS_realloc(int16Value,
sizeof(int16_t*) * page);
3740 for (i=0; i<n; i++) {
3741 int16Value[p-i] = NULL;
3743 int16Value[p] = (int16_t*)SDDS_realloc(int16Value[p],
sizeof(int16_t) * rows);
3744 rowsAllocated[p] = rows;
3745 if (SDDS_bufferedRead(&(int16Value[p][0]), 2 * rows, fp, fBuffer, sddsfile)) {
3746 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading values (SDDSColumn::readBinaryValues)");
3751 uint16Value = (uint16_t**)SDDS_realloc(uint16Value,
sizeof(uint16_t*) * page);
3752 for (i=0; i<n; i++) {
3753 uint16Value[p-i] = NULL;
3755 uint16Value[p] = (uint16_t*)SDDS_realloc(uint16Value[p],
sizeof(uint16_t) * rows);
3756 rowsAllocated[p] = rows;
3757 if (SDDS_bufferedRead(&(uint16Value[p][0]), 2 * rows, fp, fBuffer, sddsfile)) {
3758 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading values (SDDSColumn::readBinaryValues)");
3763 int32Value = (int32_t**)SDDS_realloc(int32Value,
sizeof(int32_t*) * page);
3764 for (i=0; i<n; i++) {
3765 int32Value[p-i] = NULL;
3767 int32Value[p] = (int32_t*)SDDS_realloc(int32Value[p],
sizeof(int32_t) * rows);
3768 rowsAllocated[p] = rows;
3769 if (SDDS_bufferedRead(&(int32Value[p][0]), 4 * rows, fp, fBuffer, sddsfile)) {
3770 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading values (SDDSColumn::readBinaryValues)");
3775 uint32Value = (uint32_t**)SDDS_realloc(uint32Value,
sizeof(uint32_t*) * page);
3776 for (i=0; i<n; i++) {
3777 uint32Value[p-i] = NULL;
3779 uint32Value[p] = (uint32_t*)SDDS_realloc(uint32Value[p],
sizeof(uint32_t) * rows);
3780 rowsAllocated[p] = rows;
3781 if (SDDS_bufferedRead(&(uint32Value[p][0]), 4 * rows, fp, fBuffer, sddsfile)) {
3782 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading values (SDDSColumn::readBinaryValues)");
3787 real32Value = (
float**)SDDS_realloc(real32Value,
sizeof(
float*) * page);
3788 for (i=0; i<n; i++) {
3789 real32Value[p-i] = NULL;
3791 rowsAllocated[p] = rows;
3792 real32Value[p] = (
float*)SDDS_realloc(real32Value[p],
sizeof(
float) * rows);
3793 if (SDDS_bufferedRead(&(real32Value[p][0]), 4 * rows, fp, fBuffer, sddsfile)) {
3794 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading values (SDDSColumn::readBinaryValues)");
3799 real64Value = (
double**)SDDS_realloc(real64Value,
sizeof(
double*) * page);
3800 for (i=0; i<n; i++) {
3801 real64Value[p-i] = NULL;
3803 real64Value[p] = (
double*)SDDS_realloc(real64Value[p],
sizeof(
double) * rows);
3804 rowsAllocated[p] = rows;
3805 if (SDDS_bufferedRead(&(real64Value[p][0]), 8 * rows, fp, fBuffer, sddsfile)) {
3806 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading values (SDDSColumn::readBinaryValues)");
3811 stringValue = (
char***)SDDS_realloc(stringValue,
sizeof(
char**) * page);
3812 for (i=0; i<n; i++) {
3813 stringValue[p-i] = NULL;
3815 stringValue[p] = (
char**)SDDS_realloc(stringValue[p],
sizeof(
char*) * rows);
3816 rowsAllocated[p] = rows;
3817 for (i=0; i<rows; i++) {
3818 stringValue[p][i] = NULL;
3819 if (SDDS_readBinaryString(&(stringValue[p][i]), fp, fBuffer, sddsfile)) {
3820 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading strings (SDDSColumn::readBinaryValues)");
3826 charValue = (
char**)SDDS_realloc(charValue,
sizeof(
char*) * page);
3827 for (i=0; i<n; i++) {
3828 charValue[p-i] = NULL;
3830 charValue[p] = (
char*)SDDS_realloc(charValue[p],
sizeof(
char) * rows);
3831 rowsAllocated[p] = rows;
3832 if (SDDS_bufferedRead(&(charValue[p][0]), rows, fp, fBuffer, sddsfile)) {
3833 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading values (SDDSColumn::readBinaryValues)");
3838 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--unknown type (SDDSColumn::readBinaryValues)");
3846int32_t SDDSColumn::readBinaryValues(voidp *gzfp,
SDDS_FILEBUFFER *fBuffer, uint32_t page, uint32_t rows,
bool nonNativeEndian) {
3850 ((SDDSFile*)sddsfile)->setError((
char*)
"Invalid page number--failure reading values (SDDSColumn::readBinaryValues)");
3853 if (page > pageCount) {
3854 n = page - pageCount;
3856 ((SDDSFile*)sddsfile)->setError((
char*)
"Invalid page number--failure reading values (SDDSColumn::readBinaryValues)");
3860 rowCount = (uint32_t*)SDDS_realloc(rowCount,
sizeof(uint32_t) * page);
3861 rowsAllocated = (uint32_t*)SDDS_realloc(rowsAllocated,
sizeof(uint32_t) * page);
3862 for (i=0; i<n; i++) {
3864 rowsAllocated[p-i] = 0;
3869 switch (columnType) {
3871 int16Value = (int16_t**)SDDS_realloc(int16Value,
sizeof(int16_t*) * page);
3872 for (i=0; i<n; i++) {
3873 int16Value[p-i] = NULL;
3875 int16Value[p] = (int16_t*)SDDS_realloc(int16Value[p],
sizeof(int16_t) * rows);
3876 rowsAllocated[p] = rows;
3877 if (SDDS_bufferedRead(&(int16Value[p][0]), 2 * rows, gzfp, fBuffer, sddsfile)) {
3878 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading values (SDDSColumn::readBinaryValues)");
3883 uint16Value = (uint16_t**)SDDS_realloc(uint16Value,
sizeof(uint16_t*) * page);
3884 for (i=0; i<n; i++) {
3885 uint16Value[p-i] = NULL;
3887 uint16Value[p] = (uint16_t*)SDDS_realloc(uint16Value[p],
sizeof(uint16_t) * rows);
3888 rowsAllocated[p] = rows;
3889 if (SDDS_bufferedRead(&(uint16Value[p][0]), 2 * rows, gzfp, fBuffer, sddsfile)) {
3890 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading values (SDDSColumn::readBinaryValues)");
3895 int32Value = (int32_t**)SDDS_realloc(int32Value,
sizeof(int32_t*) * page);
3896 for (i=0; i<n; i++) {
3897 int32Value[p-i] = NULL;
3899 int32Value[p] = (int32_t*)SDDS_realloc(int32Value[p],
sizeof(int32_t) * rows);
3900 rowsAllocated[p] = rows;
3901 if (SDDS_bufferedRead(&(int32Value[p][0]), 4 * rows, gzfp, fBuffer, sddsfile)) {
3902 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading values (SDDSColumn::readBinaryValues)");
3907 uint32Value = (uint32_t**)SDDS_realloc(uint32Value,
sizeof(uint32_t*) * page);
3908 for (i=0; i<n; i++) {
3909 uint32Value[p-i] = NULL;
3911 uint32Value[p] = (uint32_t*)SDDS_realloc(uint32Value[p],
sizeof(uint32_t) * rows);
3912 rowsAllocated[p] = rows;
3913 if (SDDS_bufferedRead(&(uint32Value[p][0]), 4 * rows, gzfp, fBuffer, sddsfile)) {
3914 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading values (SDDSColumn::readBinaryValues)");
3919 real32Value = (
float**)SDDS_realloc(real32Value,
sizeof(
float*) * page);
3920 for (i=0; i<n; i++) {
3921 real32Value[p-i] = NULL;
3923 rowsAllocated[p] = rows;
3924 real32Value[p] = (
float*)SDDS_realloc(real32Value[p],
sizeof(
float) * rows);
3925 if (SDDS_bufferedRead(&(real32Value[p][0]), 4 * rows, gzfp, fBuffer, sddsfile)) {
3926 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading values (SDDSColumn::readBinaryValues)");
3931 real64Value = (
double**)SDDS_realloc(real64Value,
sizeof(
double*) * page);
3932 for (i=0; i<n; i++) {
3933 real64Value[p-i] = NULL;
3935 real64Value[p] = (
double*)SDDS_realloc(real64Value[p],
sizeof(
double) * rows);
3936 rowsAllocated[p] = rows;
3937 if (SDDS_bufferedRead(&(real64Value[p][0]), 8 * rows, gzfp, fBuffer, sddsfile)) {
3938 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading values (SDDSColumn::readBinaryValues)");
3943 stringValue = (
char***)SDDS_realloc(stringValue,
sizeof(
char**) * page);
3944 for (i=0; i<n; i++) {
3945 stringValue[p-i] = NULL;
3947 stringValue[p] = (
char**)SDDS_realloc(stringValue[p],
sizeof(
char*) * rows);
3948 rowsAllocated[p] = rows;
3949 for (i=0; i<rows; i++) {
3950 stringValue[p][i] = NULL;
3951 if (SDDS_readBinaryString(&(stringValue[p][i]), gzfp, fBuffer, sddsfile)) {
3952 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading strings (SDDSColumn::readBinaryValues)");
3958 charValue = (
char**)SDDS_realloc(charValue,
sizeof(
char*) * page);
3959 for (i=0; i<n; i++) {
3960 charValue[p-i] = NULL;
3962 charValue[p] = (
char*)SDDS_realloc(charValue[p],
sizeof(
char) * rows);
3963 rowsAllocated[p] = rows;
3964 if (SDDS_bufferedRead(&(charValue[p][0]), rows, gzfp, fBuffer, sddsfile)) {
3965 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--failure reading values (SDDSColumn::readBinaryValues)");
3970 ((SDDSFile*)sddsfile)->setError((
char*)
"Unable to read column--unknown type (SDDSColumn::readBinaryValues)");
#define SDDS_NUM_TYPES
Total number of defined SDDS data types.
#define SDDS_INTEGER_TYPE(type)
Checks if the given type identifier corresponds to an integer type.
#define SDDS_STRING
Identifier for the string data type.
#define SDDS_FLOATING_TYPE(type)
Checks if the given type identifier corresponds to a floating-point type.
#define SDDS_CHARACTER
Identifier for the character data type.