00001 #ifndef __CIDB_H 00002 #define __CIDB_H 00003 00004 #include "fileio.h" 00005 00013 #ifdef __cplusplus 00014 extern "C" { 00015 #endif 00016 00020 typedef enum { 00022 CIDB_ERR_OK = 0, 00024 CIDB_ERR_PARAM, 00026 CIDB_ERR_MEMORY, 00028 CIDB_ERR_READ, 00030 CIDB_ERR_WRITE, 00032 CIDB_ERR_PARSE, 00034 CIDB_ERR_FILE, 00036 CIDB_ERR_SEEK, 00038 CIDB_ERR_INTERRUPT, 00040 CIDB_ERR_INTERNAL, 00042 CIDB_NFND_CTRY, 00044 CIDB_NFND_NET, 00046 CIDB_NFND_AREA, 00048 CIDB_NFND_CELL 00049 } t_cidb_err; 00050 00061 typedef short (*t_cidb_progress)(short perc, short rdwr, void *ctx); 00062 00070 typedef struct { 00086 int *arr; 00091 int size; 00096 int ctryid; 00101 int netid; 00106 int areaid; 00107 } t_cidbrd_ctx; 00108 00112 typedef struct { 00117 double lat; 00122 double lon; 00123 } t_cidb_coord; 00124 00185 t_cidb_err cidbcrt(const t_filename *anInputFile, 00186 const t_filename *anOutputFile, 00187 t_cidb_progress aProgrCb, 00188 double aMinLat, 00189 double aMaxLat, 00190 double aMinLon, 00191 double aMaxLon, 00192 void *aProgrCbCtx); 00193 00218 t_cidb_err cidbrd(t_cidbrd_ctx *aCtx, 00219 t_cidb_coord *theCoords, 00220 int *theNum, 00221 t_hfileio anFD, 00222 int aCtryId, 00223 int aNetId, 00224 int anAreaId, 00225 int aCellId); 00226 00251 t_cidb_err cidbrdfile(t_cidb_coord *theCoords, 00252 int *theNum, 00253 const t_filename *aFileName, 00254 int aCtryId, 00255 int aNetId, 00256 int anAreaId, 00257 int aCellId); 00258 00262 void cidbrd_ctx_free(t_cidbrd_ctx *aCtx); 00263 00264 #ifdef __cplusplus 00265 } 00266 #endif 00267 00268 #endif 00269