#ifndef __MAPREADDLL_H #define __MAPREADDLL_H #ifdef __cplusplus extern "C" { #endif #define _MR_NOT_IMG -1 #define _MR_CANNOT_INITIALISE -2 #define _MR_NOT_INITIALISED -3 #define _MAX_SEGMENTS 512 #ifdef _DLL_VERSION #define LIBSPEC __declspec(dllexport) #define CALL_API __stdcall #else #define LIBSPEC __declspec(dllimport) #define CALL_API __stdcall #endif struct mapRead_coord { float we, ns; }; struct mapRead_coord_integer { int we, ns; }; struct mapRead_rect { // In degrees. float x0, y0, x1, y1; }; struct mapRead_segment { unsigned int coordinate_number; }; struct mapRead_address { char city_left[80]; char city_right[80]; char region_left[80]; char region_right[80]; char country_left[80]; char country_right[80]; int segment; int left_type; int left_start; int left_end; int right_type; int right_start; int right_end; char zip_left[80]; char zip_right[80]; }; struct mapRead_address_i { unsigned short city_left; unsigned short city_right; int segment; unsigned short zip_left; unsigned short zip_right; }; typedef int (CALL_API *_HEADERDATA)(int map_index,int map_sub_index,const char* map_id,const char* map_name,const char* copyright1,const char* copyright2,int levels,float &x0,float &x1,float &y0,float &y1,int locked,unsigned char level_def[10]); typedef int (CALL_API *_HEADERDATA_BOUNDS)(float &x0,float &x1,float &y0,float &y1); typedef int (CALL_API *_READDATA)(int layer,int object_type,int type,int sub_type, unsigned int poi_address,unsigned int net_address,const char* label,mapRead_coord* coords,int coord_size,mapRead_segment* segments,int segments_size,unsigned int reserved); typedef int (CALL_API *_READDATA_INTEGER)(int layer,int object_type,int type,int sub_type, unsigned int poi_address, unsigned int net_address,const char* label,mapRead_coord_integer* coords,int coord_size,mapRead_segment* segments,int segments_size,unsigned int reserved); typedef int (CALL_API *_READPOI)(const char* house_number,const char* street_name,const char* city, const char* region, const char* country,const char* zip,const char* phone); typedef int (CALL_API *_READNET)(const char* name1,const char* name2,const char* name3,const char* name4,int &records,mapRead_address address[_MAX_SEGMENTS]); /** Open IMG file @param file_name @param _headerFunction @param _dataFunction @param _dataFunctionInteger - only one function should exist - dataFunction or dataFunctionInteger @param _poiFunction @param _netFunction @param sub_maps - return number of sub maps - to be used by mapRead_readMap @return map_index - as several maps can be open the same time - this index is used by mapRead_readMap to process a specific map only */ long CALL_API mapRead_openIMG(const char *file_name,int& sub_maps,_HEADERDATA _headerFunction,_READDATA _dataFunction,_READDATA_INTEGER _dataFunctionInteger,_READPOI _poiFunction,_READNET _netFunction); /** Close previously open file @param map_index - map to be closed */ void CALL_API mapRead_closeIMG(int map_index); /** Change reading of labels from MP like style to real codes @param style - 1 MP like, 0 - real codes */ void CALL_API mapRead_labelStyle(int style); /** Close all open files */ void CALL_API mapRead_closeAll(); /** Check if map_index is still valid @param map_index @return - true if map is still open */ bool CALL_API mapRead_mapValid(int map_index); /** Return last win32 api error */ long CALL_API mapRead_lastError(); /** Read desired part of the map @param map_index - map to be processed @param sub_map - if a single file is built from more than one map - then this parameter can be used to process only one map if set to 0 - then all maps from the file are processed @param x0,x1,y0,y1 - bounds to be processed @param min_ns,min_we - if object will be smaller than min_ns,min_we - it will not be returned by the procedure */ void CALL_API mapRead_readMap(int map_index,int sub_map,float& x0,float& y0,float& x1,float& y1,float& min_ns,float& min_we,int layer); /** Read of POI data @param type type of the object @param sub_type sub type of the object @param poi_address address of POI structure */ void CALL_API mapRead_readPOI(int map_index,const unsigned int& type,const unsigned int& sub_type,const unsigned long& poi_address); /** Read of NET additional data - street citi/region/country @param net_address address of NET structure */ void CALL_API mapRead_readNET(int map_index,const unsigned long& net_address,mapRead_segment* segments,int segments_size); #ifdef __cplusplus } #endif #endif