47 "epr_get_field_elem_as_char: invalid field name");
50 if (elem_index >= field->info->num_elems) {
52 "epr_get_field_elem_as_char: invalid elem_index parameter");
57 "epr_get_field_elem_as_char: invalid type");
60 return ((
char*) field->elems)[elem_index];
77 "epr_get_field_elems_as_chars: invalid field name");
82 "epr_get_field_elems_as_chars: invalid type");
85 return (
char*) field->elems;
104 "epr_get_field_elem_as_uchar: invalid field name");
107 if (elem_index >= field->info->num_elems) {
109 "epr_get_field_elem_as_uchar: invalid elem_index parameter");
114 "epr_get_field_elem_as_uchar: invalid type");
117 return ((
epr_uchar*) field->elems)[elem_index];
134 "epr_get_field_elems_as_uchars: invalid field name");
139 "epr_get_field_elems_as_uchars: invalid type");
161 "epr_get_field_elem_as_short: invalid field name");
164 if (elem_index >= field->info->num_elems) {
166 "epr_get_field_elem_as_short: invalid elem_index parameter");
172 return (
short)((
epr_uchar*) field->elems)[elem_index];
174 if (field->info->data_type_id ==
e_tid_char) {
175 return (
short)((
char*) field->elems)[elem_index];
178 return (
short)((
short*) field->elems)[elem_index];
182 "epr_get_field_elem_as_short: invalid type");
201 "epr_get_field_elems_as_shorts: invalid field name");
206 "epr_get_field_elems_as_shorts: invalid type");
209 return (
short*) field->elems;
228 "epr_get_field_elem_as_ushort: invalid field name");
231 if (elem_index >= field->info->num_elems) {
233 "epr_get_field_elem_as_ushort: invalid elem_index parameter");
240 if (field->info->data_type_id ==
e_tid_char) {
241 return (
epr_ushort)((
char*) field->elems)[elem_index];
248 "epr_get_field_elem_as_ushort: invalid type");
267 "epr_get_field_elems_as_ushorts: invalid field name");
272 "epr_get_field_elems_as_ushorts: invalid type");
297 "epr_get_field_elem_as_long: invalid field name");
300 if (elem_index >= field->info->num_elems) {
302 "epr_get_field_elem_as_long: invalid elem_index parameter");
307 return (
int)((
epr_uchar*) field->elems)[elem_index];
309 if (field->info->data_type_id ==
e_tid_char) {
310 return (
int)((
char*) field->elems)[elem_index];
313 return (
int)((
epr_ushort*) field->elems)[elem_index];
316 return (
int)((
short*) field->elems)[elem_index];
318 if (field->info->data_type_id ==
e_tid_int) {
319 return (
int)((
int*) field->elems)[elem_index];
323 "epr_get_field_elem_as_long: invalid type");
342 "epr_get_field_elems_as_longs: invalid field name");
345 if (field->info->data_type_id !=
e_tid_int) {
347 "epr_get_field_elems_as_longs: invalid type");
350 return (
int*) field->elems;
369 "epr_get_field_elem_as_uint: invalid field name");
372 if (elem_index >= field->info->num_elems) {
374 "epr_get_field_elem_as_uint: invalid elem_index parameter");
378 if (field->info->data_type_id ==
e_tid_uint) {
384 if (field->info->data_type_id ==
e_tid_char) {
385 return (
epr_uint)((
char*) field->elems)[elem_index];
391 return (
epr_uint)((
short*) field->elems)[elem_index];
395 "epr_get_field_elem_as_uint: invalid type");
414 "epr_get_field_elems_as_uints: invalid field name");
417 if (field->info->data_type_id !=
e_tid_uint) {
419 "epr_get_field_elems_as_uints: invalid type");
441 "epr_get_field_elem_as_float: invalid field name");
445 if (elem_index >= field->info->num_elems) {
447 "epr_get_field_elem_as_float: invalid elem_index parameter");
452 return (
float)((
float*) field->elems)[elem_index];
455 return (
float)((
epr_uchar*) field->elems)[elem_index];
457 if (field->info->data_type_id ==
e_tid_char) {
458 return (
float)((
char*) field->elems)[elem_index];
461 return (
float)((
epr_ushort*) field->elems)[elem_index];
464 return (
float)((
short*) field->elems)[elem_index];
466 if (field->info->data_type_id ==
e_tid_uint) {
467 return (
float)((
epr_uint*) field->elems)[elem_index];
469 if (field->info->data_type_id ==
e_tid_int) {
470 return (
float)((
int*) field->elems)[elem_index];
474 "epr_get_field_elems_as_float: invalid type");
493 "epr_get_field_elem_as_floats: invalid field name");
498 "epr_get_field_elems_as_floats: invalid type");
501 return (
float*) field->elems;
520 "epr_get_field_elems_as_double: invalid field name");
524 if (elem_index >= field->info->num_elems) {
526 "epr_get_field_elems_as_double: invalid elem_index parameter");
531 return (
double)((
double*) field->elems)[elem_index];
534 return (
double)((
float*) field->elems)[elem_index];
537 return (
double)((
epr_uchar*) field->elems)[elem_index];
539 if (field->info->data_type_id ==
e_tid_char) {
540 return (
double)((
char*) field->elems)[elem_index];
543 return (
double)((
epr_ushort*) field->elems)[elem_index];
546 return (
double)((
short*) field->elems)[elem_index];
548 if (field->info->data_type_id ==
e_tid_uint) {
549 return (
double)((
epr_uint*) field->elems)[elem_index];
551 if (field->info->data_type_id ==
e_tid_int) {
552 return (
double)((
int*) field->elems)[elem_index];
556 "epr_get_field_elems_as_double: invalid type");
576 "epr_get_field_elems_as_doubles: invalid field name");
581 "epr_get_field_elems_as_doubles: invalid type");
584 return (
double*) field->elems;
602 "epr_get_field_elem_as_mjd: invalid field name");
607 if (field->info->data_type_id !=
e_tid_time) {
609 "epr_get_field_elem_as_mjd: invalid type");
613 return (
const EPR_STime*) field->elems;
630 "epr_get_field_elem_as_str: invalid field name");
635 "epr_get_field_elem_as_str: invalid type");
638 return (
const char*) field->elems;
666 "epr_get_field_elems_as_doubles: invalid field name");
667 return num_elems_min;
670 num_elems_min = num_elems;
671 if (field->info->num_elems < num_elems_min) {
672 num_elems_min = field->info->num_elems;
676 for (
i = 0;
i < num_elems_min;
i++) {
679 }
else if (field->info->data_type_id ==
e_tid_char) {
680 for (
i = 0;
i < num_elems_min;
i++) {
681 buffer[
i] = (
double)((
char*) field->elems)[
i];
684 for (
i = 0;
i < num_elems_min;
i++) {
687 }
else if (field->info->data_type_id ==
e_tid_short) {
688 for (
i = 0;
i < num_elems_min;
i++) {
689 buffer[
i] = (
double)((
short*) field->elems)[
i];
691 }
else if (field->info->data_type_id ==
e_tid_uint) {
692 for (
i = 0;
i < num_elems_min;
i++) {
695 }
else if (field->info->data_type_id ==
e_tid_int) {
696 for (
i = 0;
i < num_elems_min;
i++) {
697 buffer[
i] = (
double)((
int*) field->elems)[
i];
699 }
else if (field->info->data_type_id ==
e_tid_float) {
700 for (
i = 0;
i < num_elems_min;
i++) {
701 buffer[
i] = (
double)((
float*) field->elems)[
i];
704 for (
i = 0;
i < num_elems_min;
i++) {
705 buffer[
i] = (
double)((
double*) field->elems)[
i];
709 "epr_get_field_elems_as_double: invalid type");
713 return num_elems_min;
738 "epr_copy_field_elems_as_floats: invalid field name");
739 return num_elems_min;
742 num_elems_min = num_elems;
743 if (field->info->num_elems < num_elems_min) {
744 num_elems_min = field->info->num_elems;
748 for (
i = 0;
i < num_elems_min;
i++) {
751 }
else if (field->info->data_type_id ==
e_tid_char) {
752 for (
i = 0;
i < num_elems_min;
i++) {
753 buffer[
i] = (
float)((
char*) field->elems)[
i];
756 for (
i = 0;
i < num_elems_min;
i++) {
759 }
else if (field->info->data_type_id ==
e_tid_short) {
760 for (
i = 0;
i < num_elems_min;
i++) {
761 buffer[
i] = (
float)((
short*) field->elems)[
i];
763 }
else if (field->info->data_type_id ==
e_tid_uint) {
764 for (
i = 0;
i < num_elems_min;
i++) {
767 }
else if (field->info->data_type_id ==
e_tid_int) {
768 for (
i = 0;
i < num_elems_min;
i++) {
769 buffer[
i] = (
float)((
int*) field->elems)[
i];
771 }
else if (field->info->data_type_id ==
e_tid_float) {
772 for (
i = 0;
i < num_elems_min;
i++) {
773 buffer[
i] = (
float)((
float*) field->elems)[
i];
777 "epr_copy_field_elems_as_floats: invalid type");
781 return num_elems_min;
806 "epr_copy_field_elems_as_longs: invalid field name");
807 return num_elems_min;
810 num_elems_min = num_elems;
811 if (field->info->num_elems < num_elems_min) {
812 num_elems_min = field->info->num_elems;
816 for (
i = 0;
i < num_elems_min;
i++) {
819 }
else if (field->info->data_type_id ==
e_tid_char) {
820 for (
i = 0;
i < num_elems_min;
i++) {
821 buffer[
i] = (
int)((
char*) field->elems)[
i];
824 for (
i = 0;
i < num_elems_min;
i++) {
827 }
else if (field->info->data_type_id ==
e_tid_short) {
828 for (
i = 0;
i < num_elems_min;
i++) {
829 buffer[
i] = (
int)((
short*) field->elems)[
i];
831 }
else if (field->info->data_type_id ==
e_tid_int) {
832 for (
i = 0;
i < num_elems_min;
i++) {
833 buffer[
i] = (
int)((
int*) field->elems)[
i];
837 "epr_copy_field_elems_as_longs: invalid type");
841 return num_elems_min;
866 "epr_copy_field_elems_as_uints: invalid field name");
867 return num_elems_min;
870 num_elems_min = num_elems;
871 if (field->info->num_elems < num_elems_min) {
872 num_elems_min = field->info->num_elems;
876 for (
i = 0;
i < num_elems_min;
i++) {
879 }
else if (field->info->data_type_id ==
e_tid_char) {
880 for (
i = 0;
i < num_elems_min;
i++) {
881 buffer[
i] = (
epr_uint)((
char*) field->elems)[
i];
884 for (
i = 0;
i < num_elems_min;
i++) {
887 }
else if (field->info->data_type_id ==
e_tid_short) {
888 for (
i = 0;
i < num_elems_min;
i++) {
889 buffer[
i] = (
epr_uint)((
short*) field->elems)[
i];
891 }
else if (field->info->data_type_id ==
e_tid_int) {
892 for (
i = 0;
i < num_elems_min;
i++) {
897 "epr_copy_field_elems_as_uints: invalid type");
901 return num_elems_min;