I found the proper file, (button-c200) and added this:
/*At the top of the file I included plugin.h*/
if(button_hold){
static const char filename[] = PLUGIN_APPS_DIR "/RockLock.rock";
plugin_load((char*)filename, NULL);
}
Instead of launching the plugin when I move the hold button, it splashes the message "Loading..." then freezes. What's wrong?
If you've added this code to 'firmware/target/arm/sandisk/sansa-c200/button-c200.c' (you don't clearly state which file): that's totally incorrect.
At first you should understand the separation between firmware/ and apps/: firmware/ code should *never* call any apps/ code, only the opposite is allowed.
If I would be you, I would try adding this code to apps/main.c or apps/root_menu.c (and replace button_hold with button_hold(), button_hold isn't declared globally).
edit:
apps/main.c already has something you want: AUTOROCK.