1 /*
2 * Copyright (c) 2014-2021, The OSKAR Developers.
3 * See the LICENSE file at the top-level directory of this distribution.
4 */
5
6 #include "telescope/station/oskar_station.h"
7
8 #include <stdio.h>
9 #include <stdlib.h>
10
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14
oskar_station_save_element_types(const oskar_Station * station,const char * filename,int * status)15 void oskar_station_save_element_types(const oskar_Station* station,
16 const char* filename, int* status)
17 {
18 FILE* file = 0;
19 if (*status || !station) return;
20 file = fopen(filename, "w");
21 if (!file)
22 {
23 *status = OSKAR_ERR_FILE_IO;
24 return;
25 }
26 oskar_mem_save_ascii(file, 1, 0, oskar_station_num_elements(station),
27 status, oskar_station_element_types_const(station));
28 fclose(file);
29 }
30
31 #ifdef __cplusplus
32 }
33 #endif
34