CS-PROJECTS / c08_gis_system / GISParse.h
GISParse.h
Raw
#ifndef GISPARSE_H
#define GISPARSE_H
#include "arrayList.h"
#include "StringHashTable.h"
#include "nextField.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

/**
 * Combines both name and state to create one string in order to 
 * pass that new string into a the hastable as a key
 */
char* create_key(char* name, char* state);

/**
 * Given a line of a GIS file, this method retrives the 
 * name and state for the specified record
 */
char* get_name_and_state(char* line);

/**
 * Given an array of offsets, this method retrives the
 * first 5 fields of each record at the specified offset
 */
char** get_details_of(FILE* f, uint32_t offset);

/**
 * Alters the string of longitude or lattitude
 * found within the GIS file to the desired format
 * as specified within the documentation
 */
char** get_readable_lat_and_long(uint32_t offset, FILE* gis);

/**
 * Gets the longitude and lattitude field of a record at a 
 * specified offset
 */
char** get_dec_lat_and_long(uint32_t offset, FILE* gis);

/**
 * Calculates the distance between 2 records when
 * given the offset of both records 
 */
double find_distance_between(uint32_t offset1, uint32_t offset2, FILE* gis);

#endif