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