mirror of
https://github.com/wiiu-env/WiiUPluginSystem.git
synced 2024-11-13 06:15:11 +01:00
[ALL] Added more fields to the metadata
- Now the plugin it holds the build timestamp and a description - Added descriptions for all plugins
This commit is contained in:
parent
869b3bc391
commit
d64f221a92
@ -79,7 +79,7 @@ extern "C" int Menu_Main(int argc, char **argv){
|
|||||||
|
|
||||||
DEBUG_FUNCTION_LINE("Wii U Plugin System Loader %s\n",APP_VERSION);
|
DEBUG_FUNCTION_LINE("Wii U Plugin System Loader %s\n",APP_VERSION);
|
||||||
|
|
||||||
//setup_os_exceptions();
|
setup_os_exceptions();
|
||||||
|
|
||||||
DEBUG_FUNCTION_LINE("Mount SD partition\n");
|
DEBUG_FUNCTION_LINE("Mount SD partition\n");
|
||||||
Init_SD_USB();
|
Init_SD_USB();
|
||||||
|
@ -239,7 +239,7 @@ exit_error:
|
|||||||
|
|
||||||
bool PluginInformation::metadataRead(Elf *elf, Elf32_Sym *symtab, size_t symtab_count, size_t symtab_strndx) {
|
bool PluginInformation::metadataRead(Elf *elf, Elf32_Sym *symtab, size_t symtab_count, size_t symtab_strndx) {
|
||||||
char *metadata = NULL, *metadata_cur, *metadata_end;
|
char *metadata = NULL, *metadata_cur, *metadata_end;
|
||||||
const char *game, *name, *author, *version, *license, *wups;
|
const char *name, *author, *version, *license, *wups, *buildtimestamp, *description;
|
||||||
|
|
||||||
Elf_Scn *scn;
|
Elf_Scn *scn;
|
||||||
size_t shstrndx;
|
size_t shstrndx;
|
||||||
@ -300,12 +300,13 @@ bool PluginInformation::metadataRead(Elf *elf, Elf32_Sym *symtab, size_t symtab_
|
|||||||
goto exit_error;
|
goto exit_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
game = NULL;
|
|
||||||
name = NULL;
|
name = NULL;
|
||||||
author = NULL;
|
author = NULL;
|
||||||
version = NULL;
|
version = NULL;
|
||||||
license = NULL;
|
license = NULL;
|
||||||
wups = NULL;
|
wups = NULL;
|
||||||
|
buildtimestamp = NULL;
|
||||||
|
description = NULL;
|
||||||
|
|
||||||
for (metadata_cur = metadata; metadata_cur < metadata_end; metadata_cur = strchr(metadata_cur, '\0') + 1) {
|
for (metadata_cur = metadata; metadata_cur < metadata_end; metadata_cur = strchr(metadata_cur, '\0') + 1) {
|
||||||
|
|
||||||
@ -324,13 +325,7 @@ bool PluginInformation::metadataRead(Elf *elf, Elf32_Sym *symtab, size_t symtab_
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strncmp(metadata_cur, "game", eq - metadata_cur) == 0) {
|
if (strncmp(metadata_cur, "name", eq - metadata_cur) == 0) {
|
||||||
if (game != NULL) {
|
|
||||||
DEBUG_FUNCTION_LINE("Warning: Ignoring '%s' - Multiple WUPS_PLUGIN_GAME declarations.\n", path);
|
|
||||||
goto exit_error;
|
|
||||||
}
|
|
||||||
game = eq + 1;
|
|
||||||
} else if (strncmp(metadata_cur, "name", eq - metadata_cur) == 0) {
|
|
||||||
if (name != NULL) {
|
if (name != NULL) {
|
||||||
DEBUG_FUNCTION_LINE("Warning: Ignoring '%s' - Multiple WUPS_PLUGIN_NAME declarations.\n", path);
|
DEBUG_FUNCTION_LINE("Warning: Ignoring '%s' - Multiple WUPS_PLUGIN_NAME declarations.\n", path);
|
||||||
goto exit_error;
|
goto exit_error;
|
||||||
@ -354,6 +349,18 @@ bool PluginInformation::metadataRead(Elf *elf, Elf32_Sym *symtab, size_t symtab_
|
|||||||
goto exit_error;
|
goto exit_error;
|
||||||
}
|
}
|
||||||
license = eq + 1;
|
license = eq + 1;
|
||||||
|
} else if (strncmp(metadata_cur, "buildtimestamp", eq - metadata_cur) == 0) {
|
||||||
|
if (buildtimestamp != NULL) {
|
||||||
|
DEBUG_FUNCTION_LINE("Warning: Ignoring '%s' - Multiple WUPS_PLUGIN_TIMESTAMP declarations.\n", path);
|
||||||
|
goto exit_error;
|
||||||
|
}
|
||||||
|
buildtimestamp = eq + 1;
|
||||||
|
} else if (strncmp(metadata_cur, "description", eq - metadata_cur) == 0) {
|
||||||
|
if (description != NULL) {
|
||||||
|
DEBUG_FUNCTION_LINE("Warning: Ignoring '%s' - Multiple WUPS_PLUGIN_LICENSE declarations.\n", path);
|
||||||
|
goto exit_error;
|
||||||
|
}
|
||||||
|
description = eq + 1;
|
||||||
} else if (strncmp(metadata_cur, "wups", eq - metadata_cur) == 0) {
|
} else if (strncmp(metadata_cur, "wups", eq - metadata_cur) == 0) {
|
||||||
if (wups != NULL) {
|
if (wups != NULL) {
|
||||||
DEBUG_FUNCTION_LINE("Warning: Ignoring '%s' - Multiple WUPS_PLUGIN_NAME declarations.\n", path);
|
DEBUG_FUNCTION_LINE("Warning: Ignoring '%s' - Multiple WUPS_PLUGIN_NAME declarations.\n", path);
|
||||||
@ -363,14 +370,18 @@ bool PluginInformation::metadataRead(Elf *elf, Elf32_Sym *symtab, size_t symtab_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (game == NULL){
|
if (description == NULL){
|
||||||
game = "";
|
description = "";
|
||||||
}
|
}
|
||||||
// TODO:
|
|
||||||
/*if (wups == NULL || strcmp(wups, "0.1") != 0) {
|
if (wups == NULL || strcmp(wups, "0.1") != 0) {
|
||||||
DEBUG_FUNCTION_LINE("Warning: Ignoring '%s' - Unrecognised WUPS version.\n", path);
|
DEBUG_FUNCTION_LINE("Warning: Ignoring '%s' - Unrecognised WUPS version.\n", path);
|
||||||
goto exit_error;
|
goto exit_error;
|
||||||
}*/
|
}
|
||||||
|
if (buildtimestamp == NULL) {
|
||||||
|
DEBUG_FUNCTION_LINE("Warning: Ignoring '%s' - Couldn't find buildtimestamp.\n", path);
|
||||||
|
goto exit_error;
|
||||||
|
}
|
||||||
if (name == NULL) {
|
if (name == NULL) {
|
||||||
DEBUG_FUNCTION_LINE("Warning: Ignoring '%s' - Missing WUPS_PLUGIN_NAME declaration.\n",path);
|
DEBUG_FUNCTION_LINE("Warning: Ignoring '%s' - Missing WUPS_PLUGIN_NAME declaration.\n",path);
|
||||||
goto exit_error;
|
goto exit_error;
|
||||||
@ -392,6 +403,8 @@ bool PluginInformation::metadataRead(Elf *elf, Elf32_Sym *symtab, size_t symtab_
|
|||||||
this->setAuthor(author);
|
this->setAuthor(author);
|
||||||
this->setVersion(version);
|
this->setVersion(version);
|
||||||
this->setLicense(license);
|
this->setLicense(license);
|
||||||
|
this->setBuildTimestamp(buildtimestamp);
|
||||||
|
this->setDescription(description);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -79,6 +79,14 @@ class PluginInformation{
|
|||||||
return this->license;
|
return this->license;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string getBuildTimestamp(){
|
||||||
|
return this->buildtimestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string getDescription(){
|
||||||
|
return this->description;
|
||||||
|
}
|
||||||
|
|
||||||
std::string getPath(){
|
std::string getPath(){
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
@ -107,6 +115,14 @@ class PluginInformation{
|
|||||||
this->license = license;
|
this->license = license;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setBuildTimestamp(const char * buildtimestamp){
|
||||||
|
this->buildtimestamp = buildtimestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setDescription(const char * description){
|
||||||
|
this->description = description;
|
||||||
|
}
|
||||||
|
|
||||||
void setSize(size_t size){
|
void setSize(size_t size){
|
||||||
this->size = size;
|
this->size = size;
|
||||||
}
|
}
|
||||||
@ -126,6 +142,8 @@ class PluginInformation{
|
|||||||
std::string author;
|
std::string author;
|
||||||
std::string version;
|
std::string version;
|
||||||
std::string license;
|
std::string license;
|
||||||
|
std::string buildtimestamp;
|
||||||
|
std::string description;
|
||||||
size_t size;
|
size_t size;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -66,7 +66,8 @@ std::vector<PluginInformation *> PluginLoader::getPluginInformation(const char *
|
|||||||
DEBUG_FUNCTION_LINE("Found file: %s\n",full_file_path.c_str()) ;
|
DEBUG_FUNCTION_LINE("Found file: %s\n",full_file_path.c_str()) ;
|
||||||
PluginInformation * plugin = PluginInformation::loadPluginInformation(full_file_path);
|
PluginInformation * plugin = PluginInformation::loadPluginInformation(full_file_path);
|
||||||
if(plugin != NULL){
|
if(plugin != NULL){
|
||||||
DEBUG_FUNCTION_LINE("Found plugin %s by %s. Size: %d kb \n",plugin->getName().c_str(),plugin->getAuthor().c_str(),plugin->getSize()/1024) ;
|
DEBUG_FUNCTION_LINE("Found plugin %s by %s. Built on %s Size: %d kb \n",plugin->getName().c_str(),plugin->getAuthor().c_str(),plugin->getBuildTimestamp().c_str(),plugin->getSize()/1024) ;
|
||||||
|
DEBUG_FUNCTION_LINE("Description: %s \n",plugin->getDescription().c_str()) ;
|
||||||
result.push_back(plugin);
|
result.push_back(plugin);
|
||||||
} else {
|
} else {
|
||||||
DEBUG_FUNCTION_LINE("%s is not a valid plugin\n",full_file_path.c_str()) ;
|
DEBUG_FUNCTION_LINE("%s is not a valid plugin\n",full_file_path.c_str()) ;
|
||||||
@ -92,7 +93,6 @@ std::vector<PluginInformation *> PluginLoader::getPluginsLoadedInMemory(){
|
|||||||
void PluginLoader::loadAndLinkPlugins(std::vector<PluginInformation *> pluginInformation){
|
void PluginLoader::loadAndLinkPlugins(std::vector<PluginInformation *> pluginInformation){
|
||||||
std::vector<PluginData *> loadedPlugins;
|
std::vector<PluginData *> loadedPlugins;
|
||||||
for(size_t i = 0;i < pluginInformation.size(); i++){
|
for(size_t i = 0;i < pluginInformation.size(); i++){
|
||||||
DEBUG_FUNCTION_LINE("loadAndLinkPlugins for %d\n",i) ;
|
|
||||||
PluginInformation * cur_info = pluginInformation[i];
|
PluginInformation * cur_info = pluginInformation[i];
|
||||||
PluginData * pluginData = loadAndLinkPlugin(cur_info);
|
PluginData * pluginData = loadAndLinkPlugin(cur_info);
|
||||||
if(pluginData == NULL){
|
if(pluginData == NULL){
|
||||||
@ -126,7 +126,6 @@ void PluginLoader::clearPluginInformation(std::vector<PluginInformation *> plugi
|
|||||||
}
|
}
|
||||||
|
|
||||||
PluginData * PluginLoader::loadAndLinkPlugin(PluginInformation * pluginInformation){
|
PluginData * PluginLoader::loadAndLinkPlugin(PluginInformation * pluginInformation){
|
||||||
DEBUG_FUNCTION_LINE("\n");
|
|
||||||
PluginData * result = NULL;
|
PluginData * result = NULL;
|
||||||
int fd = -1;
|
int fd = -1;
|
||||||
Elf *elf = NULL;
|
Elf *elf = NULL;
|
||||||
@ -160,7 +159,6 @@ PluginData * PluginLoader::loadAndLinkPlugin(PluginInformation * pluginInformati
|
|||||||
goto exit_error;
|
goto exit_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_FUNCTION_LINE("\n");
|
|
||||||
result = new PluginData(pluginInformation);
|
result = new PluginData(pluginInformation);
|
||||||
if(result == NULL){
|
if(result == NULL){
|
||||||
DEBUG_FUNCTION_LINE("Failed to create object\n");
|
DEBUG_FUNCTION_LINE("Failed to create object\n");
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
#include "dynamic_libs/fs_functions.h"
|
#include "dynamic_libs/fs_functions.h"
|
||||||
#include "utils/logger.h"
|
#include "utils/logger.h"
|
||||||
|
|
||||||
WUPS_PLUGIN_NAME("test PLUGIN");
|
WUPS_PLUGIN_NAME("Example plugin");
|
||||||
|
WUPS_PLUGIN_DESCRIPTION("This is just an example plugin and will log the FSOpenFile function.");
|
||||||
WUPS_PLUGIN_VERSION("v1.0");
|
WUPS_PLUGIN_VERSION("v1.0");
|
||||||
WUPS_PLUGIN_AUTHOR("Maschell");
|
WUPS_PLUGIN_AUTHOR("Maschell");
|
||||||
WUPS_PLUGIN_LICENSE("BSD");
|
WUPS_PLUGIN_LICENSE("BSD");
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include <fs/sd_fat_devoptab.h>
|
#include <fs/sd_fat_devoptab.h>
|
||||||
|
|
||||||
WUPS_PLUGIN_NAME("HID to VPAD lite");
|
WUPS_PLUGIN_NAME("HID to VPAD lite");
|
||||||
|
WUPS_PLUGIN_DESCRIPTION("Enables HID devices as controllers on your Wii U");
|
||||||
WUPS_PLUGIN_VERSION("v1.0");
|
WUPS_PLUGIN_VERSION("v1.0");
|
||||||
WUPS_PLUGIN_AUTHOR("Maschell");
|
WUPS_PLUGIN_AUTHOR("Maschell");
|
||||||
WUPS_PLUGIN_LICENSE("GPL");
|
WUPS_PLUGIN_LICENSE("GPL");
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include "utils/logger.h"
|
#include "utils/logger.h"
|
||||||
|
|
||||||
WUPS_PLUGIN_NAME("Padcon");
|
WUPS_PLUGIN_NAME("Padcon");
|
||||||
|
WUPS_PLUGIN_DESCRIPTION("Turns the gamepad screen on/off when pressing the right stick.");
|
||||||
WUPS_PLUGIN_VERSION("v1.0");
|
WUPS_PLUGIN_VERSION("v1.0");
|
||||||
WUPS_PLUGIN_AUTHOR("Maschell");
|
WUPS_PLUGIN_AUTHOR("Maschell");
|
||||||
WUPS_PLUGIN_LICENSE("GPL");
|
WUPS_PLUGIN_LICENSE("GPL");
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include "modpackSelector.h"
|
#include "modpackSelector.h"
|
||||||
|
|
||||||
WUPS_PLUGIN_NAME("SDCaffiine lite");
|
WUPS_PLUGIN_NAME("SDCaffiine lite");
|
||||||
|
WUPS_PLUGIN_DESCRIPTION("Replaces the game files on the fly. Can be used for gamemods");
|
||||||
WUPS_PLUGIN_VERSION("v1.0");
|
WUPS_PLUGIN_VERSION("v1.0");
|
||||||
WUPS_PLUGIN_AUTHOR("Maschell");
|
WUPS_PLUGIN_AUTHOR("Maschell");
|
||||||
WUPS_PLUGIN_LICENSE("GPL");
|
WUPS_PLUGIN_LICENSE("GPL");
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include <common/c_retain_vars.h>
|
#include <common/c_retain_vars.h>
|
||||||
|
|
||||||
WUPS_PLUGIN_NAME("SwipSwapMe");
|
WUPS_PLUGIN_NAME("SwipSwapMe");
|
||||||
|
WUPS_PLUGIN_DESCRIPTION("Swaps the gamepad and tv screen when pressing a certain button (TV is default)");
|
||||||
WUPS_PLUGIN_VERSION("v1.0");
|
WUPS_PLUGIN_VERSION("v1.0");
|
||||||
WUPS_PLUGIN_AUTHOR("Maschell");
|
WUPS_PLUGIN_AUTHOR("Maschell");
|
||||||
WUPS_PLUGIN_LICENSE("GPL");
|
WUPS_PLUGIN_LICENSE("GPL");
|
||||||
|
@ -215,10 +215,11 @@ typedef struct wups_loader_entry_t {
|
|||||||
extern const char wups_meta_ ## id [] WUPS_SECTION("meta"); \
|
extern const char wups_meta_ ## id [] WUPS_SECTION("meta"); \
|
||||||
const char wups_meta_ ## id [] = #id "=" value
|
const char wups_meta_ ## id [] = #id "=" value
|
||||||
|
|
||||||
#define WUPS_PLUGIN_NAME(x) WUPS_META(name, x); WUPS_META(wups, "0.1")
|
#define WUPS_PLUGIN_NAME(x) WUPS_META(name, x); WUPS_META(wups, "0.1"); WUPS_META(buildtimestamp, __DATE__ " " __TIME__)
|
||||||
#define WUPS_PLUGIN_AUTHOR(x) WUPS_META(author, x)
|
#define WUPS_PLUGIN_AUTHOR(x) WUPS_META(author, x)
|
||||||
#define WUPS_PLUGIN_VERSION(x) WUPS_META(version, x)
|
#define WUPS_PLUGIN_VERSION(x) WUPS_META(version, x)
|
||||||
#define WUPS_PLUGIN_LICENSE(x) WUPS_META(license, x)
|
#define WUPS_PLUGIN_LICENSE(x) WUPS_META(license, x)
|
||||||
|
#define WUPS_PLUGIN_DESCRIPTION(x) WUPS_META(description, x)
|
||||||
|
|
||||||
void WUPS_InitFS(wups_loader_init_args_t* args);
|
void WUPS_InitFS(wups_loader_init_args_t* args);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user