summaryrefslogtreecommitdiff
path: root/frontends/kolibrios/fb/gui.c
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/kolibrios/fb/gui.c')
-rw-r--r--frontends/kolibrios/fb/gui.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/frontends/kolibrios/fb/gui.c b/frontends/kolibrios/fb/gui.c
index 453ade67f..469c06494 100644
--- a/frontends/kolibrios/fb/gui.c
+++ b/frontends/kolibrios/fb/gui.c
@@ -490,6 +490,9 @@ process_cmdline(int argc, char** argv)
feurl = NETSURF_HOMEPAGE;
}
+ /* Remove me! */
+ feurl = "http://www.kolibrios.org";
+
/* NS on KolibriOS does not support option parsing (yet) */
/* while((opt = getopt_long(argc, argv, "f:b:w:h:", */
@@ -2091,8 +2094,7 @@ static struct gui_misc_table framebuffer_misc_table = {
* /param argv The argument string vector.
* /return The return code to the OS
*/
-int
-main(int argc, char** argv)
+int main(int argc, char** argv)
{
struct browser_window *bw;
char *options;
@@ -2111,42 +2113,42 @@ main(int argc, char** argv)
.layout = framebuffer_layout_table,
};
- ret = netsurf_register(&framebuffer_table);
- if (ret != NSERROR_OK) {
- die("NetSurf operation table failed registration");
- }
- /* The only restriction is that the kolibrios netsurf binary should be in the same
- directory as another "res" directory */
+ /* fix args */
+#define MKARGV(i,opt) argv[i] = (char *) malloc(strlen(opt) + 1); strcpy(argv[i], opt);
+#define ARGC 3
+MKARGV(1, "-V");
+MKARGV(2, "/tmp0/1/netsurf.log");
+MKARGV(ARGC, "\0");
+
+ argc = ARGC;
+ /* args fixed */
+
+ /* The only restriction is that the kolibrios-netsurf binary and the res/ directory should be in the same directory. */
/* On Kolibrios, argv[0] is the absolute path to the binary */
char *respath = strdup(argv[0]);
- int i;
- for(i = strlen(respath) - 1; i > 0; i--) {
+ for(int i = strlen(respath) - 1; i > 0; i--) {
if(respath[i] == '/') {
- respath[i+1] = 'r';
- respath[i+2] = 'e';
- respath[i+3] = 's';
- respath[i+4] = '\0';
+ strcpy((respath+i), "res");
break;
}
}
- assert(i!=0);
- debug_board_printf(" --- argv[0] : %s\n\n", argv[0]);
- debug_board_printf(" --- respath : %s\n\n", respath);
+ ret = netsurf_register(&framebuffer_table);
+ if (ret != NSERROR_OK)
+ die("NetSurf operation table failed registration");
+
respaths = fb_init_resource(respath);
/* initialise logging. Abort on failure for KolibriOS. */
ret = nslog_init(nslog_stream_configure, &argc, argv);
- if (ret != NSERROR_OK) {
+ if (ret != NSERROR_OK)
die("Logging failed to initialise. This is required to run on KolibriOS.");
- }
/* user options setup */
ret = nsoption_init(set_defaults, &nsoptions, &nsoptions_default);
- if (ret != NSERROR_OK) {
+ if (ret != NSERROR_OK)
die("Options failed to initialise");
- }
options = filepath_find(respaths, "Choices");
nsoption_read(options, nsoptions);
@@ -2175,7 +2177,7 @@ main(int argc, char** argv)
extern struct nsfb_surface_rtns_t kolibri_rtns;
_nsfb_register_surface(NSFB_SURFACE_KOLIBRI, &kolibri_rtns, "kolibri");
-
+
extern struct nsfb_surface_rtns_t ram_rtns;
_nsfb_register_surface(NSFB_SURFACE_RAM, &ram_rtns, "ram");