27 lines
610 B
C
27 lines
610 B
C
|
#ifndef COMMON_HEADER
|
||
|
#include "common.h"
|
||
|
#endif
|
||
|
|
||
|
#ifndef TOWERS_HEADER
|
||
|
#define TOWERS_HEADER
|
||
|
|
||
|
typedef struct tower {
|
||
|
char *id;
|
||
|
char *postcode;
|
||
|
char *manager;
|
||
|
int population;
|
||
|
double x;
|
||
|
double y;
|
||
|
} tower_t;
|
||
|
|
||
|
/* Reads the CSV file and stores the information in the towers array */
|
||
|
tower_t **readTowers(tower_t **towers, FILE *datasetFile, int *numTowers);
|
||
|
|
||
|
/* Reads the current row from the CSV and converts it into a new tower */
|
||
|
void readCurrentTower(char *lineBuffer, tower_t *tower);
|
||
|
|
||
|
/* Frees all towers in a towers array */
|
||
|
void freeTowers(tower_t **towers, int numTowers);
|
||
|
|
||
|
#endif
|