/* Functions */ int CategorizeGamePatched(void *unk, int folder, int unk2) { int i; u32 *array = (u32 *) *(u32 *) ((*(u32 *) (text_addr_game + patches.struct_addr[patch_index])) + ((u32) folder << 2)); char *title = (char *) array[68 / 4]; kprintf("called\n"); Category *p = GetNextCategory(folder_list, NULL, global_pos); for (i = patches.index[patch_index]; p; i++) { char *name = &p->name; kprintf("name: %s\n", name); int len = sce_paf_private_strlen(name); if (sce_paf_private_strncmp(name, title, len) == 0) { if (title[len] == '/') { return CategorizeGame(unk, i, unk2); } } p = GetNextCategory(folder_list, p, 0); } /* uncategorized */ return CategorizeGame(unk, i - 1, unk2); }
int AddCategory(Category *head[], const char *category, u64 mtime, int location) { Category *p, *category_entry; while (1) { p = NULL; while ((p = GetNextCategory(head, p, location))) { if (sce_paf_private_strcmp(category, &p->name) == 0) { return 0; } if (p->mtime == mtime) { mtime++; break; } } if (!p) { break; } } kprintf("Adding [%s]\n", category); category_entry = (Category *) sce_paf_private_malloc(sizeof(Category) + sce_paf_private_strlen(category) + 1); if (category_entry) { category_entry->next = NULL; category_entry->mtime = mtime; category_entry->location = location; sce_paf_private_strcpy(&category_entry->name, category); if (!head[location]) { head[location] = category_entry; } else { p = (Category *) head[location]; while (p->next) { p = p->next; } p->next = category_entry; } return 1; } return 0; }