900{
902 char *table_start, *table_end;
903 int i;
904
905
906
909
910
911
912
914
915
916 loader_file_config->
shp_file = strdup(filename);
917
918
919 table_start = loader_file_config->
shp_file + strlen(loader_file_config->
shp_file);
920 while (*table_start !=
'/' && *table_start !=
'\\' && table_start > loader_file_config->
shp_file)
921 table_start--;
922
923
924 table_start++;
925
926
927 table_end = loader_file_config->
shp_file + strlen(loader_file_config->
shp_file);
928 while (*table_end !=
'.' && table_end > loader_file_config->
shp_file && table_end > table_start )
929 table_end--;
930
931
932 loader_file_config->
table =
malloc(table_end - table_start + 1);
933 memcpy(loader_file_config->
table, table_start, table_end - table_start);
934 loader_file_config->
table[table_end - table_start] =
'\0';
935
936
937 for (i = 0; i < table_end - table_start; i++)
938 {
939 if (isupper(loader_file_config->
table[i]) != 0)
940 loader_file_config->
table[i] = tolower(loader_file_config->
table[i]);
941 }
942
943
944 loader_file_config->
schema = strdup(
"public");
945
946
949 else
951
952 return loader_file_config;
953}
#define GEOGRAPHY_DEFAULT
static SHPLOADERCONFIG * global_loader_config