return complete_path;
}
-static char *getStringCat2(char *s1, char *s2)
+char *getStringCat2(char *s1, char *s2)
{
char *complete_string = checked_malloc(strlen(s1) + strlen(s2) + 1);
read_token_parameters(extra_file_list, suffix_list, new_list_entry);
}
+static void add_property_mapping(struct PropertyMapping **list,
+ int *num_list_entries,
+ int base_index, int ext1_index,int ext2_index,
+ int artwork_index)
+{
+ struct PropertyMapping *new_list_entry;
+
+ (*num_list_entries)++;
+ *list = checked_realloc(*list,
+ *num_list_entries * sizeof(struct PropertyMapping));
+ new_list_entry = &(*list)[*num_list_entries - 1];
+
+ new_list_entry->base_index = base_index;
+ new_list_entry->ext1_index = ext1_index;
+ new_list_entry->ext2_index = ext2_index;
+
+ new_list_entry->artwork_index = artwork_index;
+}
+
void LoadArtworkConfig(struct ArtworkListInfo *artwork_info)
{
struct FileInfo *file_list = artwork_info->file_list;
}
free(artwork_info->dynamic_file_list);
-
artwork_info->dynamic_file_list = NULL;
- artwork_info->num_dynamic_file_list_entries = 0;
FreeCustomArtworkList(artwork_info, &artwork_info->dynamic_artwork_list,
&artwork_info->num_dynamic_file_list_entries);
}
+ /* free previous property mapping */
+ if (artwork_info->property_mapping != NULL)
+ {
+ free(artwork_info->property_mapping);
+
+ artwork_info->property_mapping = NULL;
+ artwork_info->num_property_mapping_entries = 0;
+ }
+
if (filename == NULL)
return;
for (i=0; i<num_file_list_entries; i++)
read_token_parameters(setup_file_list, suffix_list, &file_list[i]);
- /* set some additional tokens to "known" */
+ /* set all known tokens to "known" keyword */
setTokenValue(setup_file_list, "name", known_token_value);
setTokenValue(setup_file_list, "sort_priority", known_token_value);
for (list = extra_file_list; list != NULL; list = list->next)
{
- struct FileInfo **dynamic_file_list = &artwork_info->dynamic_file_list;
+ struct FileInfo **dynamic_file_list =
+ &artwork_info->dynamic_file_list;
int *num_dynamic_file_list_entries =
&artwork_info->num_dynamic_file_list_entries;
+ struct PropertyMapping **property_mapping =
+ &artwork_info->property_mapping;
+ int *num_property_mapping_entries =
+ &artwork_info->num_property_mapping_entries;
+ int current_summarized_file_list_entry =
+ artwork_info->num_file_list_entries +
+ artwork_info->num_dynamic_file_list_entries;
char *token = list->token;
int len_token = strlen(token);
int start_pos;
suffix_list,
num_suffix_list_entries,
token);
+ add_property_mapping(property_mapping,
+ num_property_mapping_entries,
+ i, -1, -1,
+ current_summarized_file_list_entry);
continue;
}
suffix_list,
num_suffix_list_entries,
token);
+ add_property_mapping(property_mapping,
+ num_property_mapping_entries,
+ i, j, -1,
+ current_summarized_file_list_entry);
continue;
}
suffix_list,
num_suffix_list_entries,
token);
+ add_property_mapping(property_mapping,
+ num_property_mapping_entries,
+ i, j, k,
+ current_summarized_file_list_entry);
continue;
}
}