void (*func)(WebKitWebView*);
};
-static struct command *commands;
-static int numcmds = 0;
+static struct command commands[256];
+static int numcmds = 0;
static GtkWidget* create_browser ()
{
for (i = 0; i < numcmds && !done; i++)
{
+ printf("Looping\n");
if (!strcmp(command, commands[i].command))
{
+ printf("Parsed command \"%s\"\n", commands[i].command);
commands[i].func(web_view);
done = true;
}
static void add_command (char* cmdstr, void* function)
{
- struct command commands[numcmds];
- printf(" Defining string\n");
+ /*struct command commands[numcmds];*/
+ /*printf(" Defining string\n");*/
strncpy(commands[numcmds].command, cmdstr, strlen(cmdstr));
- printf(" Adding function\n");
+ /*printf(" Adding function\n");*/
commands[numcmds].func = function;
- printf(" Incrementing count\n");
+ /*printf(" Incrementing count\n");*/
numcmds++;
- printf(" Done\n");
+ /*printf(" Done\n");*/
}
static bool setup_gtk(int argc, char* argv[])
return true;
}
-static bool setup_commands()
+static void setup_commands()
{
- printf("Adding back\n");
add_command("back", &webkit_web_view_go_back);
- printf("Adding forward\n");
add_command("forward", &webkit_web_view_go_forward);
- printf("Done\n");
- return true;
}
static bool setup_threading()
setup_gtk (argc, argv);
setup_commands ();
+ printf("%s\n", commands[0].command);
setup_threading ();
gtk_main ();