| 1169 | } |
| 1170 | |
| 1171 | static int ply_read_header_format(p_ply ply) { |
| 1172 | assert(ply && ply->fp && ply->io_mode == PLY_READ); |
| 1173 | if (strcmp(BWORD(ply), "format")) return 0; |
| 1174 | if (!ply_read_word(ply)) return 0; |
| 1175 | ply->storage_mode = ply_find_string(BWORD(ply), ply_storage_mode_list); |
| 1176 | if (ply->storage_mode == (e_ply_storage_mode) (-1)) return 0; |
| 1177 | if (ply->storage_mode == PLY_ASCII) ply->idriver = &ply_idriver_ascii; |
| 1178 | else if (ply->storage_mode == ply_arch_endian()) |
| 1179 | ply->idriver = &ply_idriver_binary; |
| 1180 | else ply->idriver = &ply_idriver_binary_reverse; |
| 1181 | if (!ply_read_word(ply)) return 0; |
| 1182 | if (strcmp(BWORD(ply), "1.0")) return 0; |
| 1183 | if (!ply_read_word(ply)) return 0; |
| 1184 | return 1; |
| 1185 | } |
| 1186 | |
| 1187 | static int ply_read_header_comment(p_ply ply) { |
| 1188 | assert(ply && ply->fp && ply->io_mode == PLY_READ); |
no test coverage detected