feat: ports - netsurf with the monkey frontend
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Ae69wJS7sueQMUwNxV3nX
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
diff --git a/utils/config.h b/utils/config.h
|
||||
index 3914771fd..09f2659d6 100644
|
||||
--- a/utils/config.h
|
||||
+++ b/utils/config.h
|
||||
@@ -119,7 +119,7 @@ char *strchrnul(const char *s, int c);
|
||||
#endif
|
||||
|
||||
#define HAVE_UTSNAME
|
||||
-#if (defined(_WIN32))
|
||||
+#if (defined(_WIN32) || defined(__montauk__))
|
||||
#undef HAVE_UTSNAME
|
||||
#endif
|
||||
|
||||
@@ -158,14 +158,14 @@ char *realpath(const char *path, char *resolved_path);
|
||||
#define HAVE_DIRFD
|
||||
#define HAVE_UNLINKAT
|
||||
#define HAVE_FSTATAT
|
||||
-#if (defined(_WIN32) || defined(__riscos__) || defined(__HAIKU__) || defined(__BEOS__) || defined(__amigaos4__) || defined(__AMIGA__) || defined(__MINT__))
|
||||
+#if (defined(_WIN32) || defined(__riscos__) || defined(__HAIKU__) || defined(__BEOS__) || defined(__amigaos4__) || defined(__AMIGA__) || defined(__MINT__) || defined(__montauk__))
|
||||
#undef HAVE_DIRFD
|
||||
#undef HAVE_UNLINKAT
|
||||
#undef HAVE_FSTATAT
|
||||
#endif
|
||||
|
||||
#define HAVE_REGEX
|
||||
-#if (defined(__serenity__))
|
||||
+#if (defined(__serenity__) || defined(__montauk__))
|
||||
#undef HAVE_REGEX
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
diff --git a/frontends/monkey/main.c b/frontends/monkey/main.c
|
||||
index 463f0bea6..578d148e4 100644
|
||||
--- a/frontends/monkey/main.c
|
||||
+++ b/frontends/monkey/main.c
|
||||
@@ -422,7 +422,12 @@ main(int argc, char **argv)
|
||||
setbuf(stderr, NULL);
|
||||
|
||||
/* Prep the search paths */
|
||||
+#if defined(__montauk__)
|
||||
+ /* see NS_RESPATH_SEP: ':' is part of a MontaukOS drive path */
|
||||
+ respaths = nsmonkey_init_resource("${HOME}/.netsurf/;${NETSURFRES};"MONKEY_RESPATH";./frontends/monkey/res");
|
||||
+#else
|
||||
respaths = nsmonkey_init_resource("${HOME}/.netsurf/:${NETSURFRES}:"MONKEY_RESPATH":./frontends/monkey/res");
|
||||
+#endif
|
||||
|
||||
/* initialise logging. Not fatal if it fails but not much we can do
|
||||
* about it either.
|
||||
diff --git a/utils/filepath.c b/utils/filepath.c
|
||||
index b87e2bf0d..9c4bcd34b 100644
|
||||
--- a/utils/filepath.c
|
||||
+++ b/utils/filepath.c
|
||||
@@ -325,7 +325,7 @@ filepath_path_to_strvec(const char *path)
|
||||
estart = eend = path;
|
||||
|
||||
while (strc < (MAX_RESPATH - 2)) {
|
||||
- while ( (*eend != 0) && (*eend != ':') )
|
||||
+ while ( (*eend != 0) && (*eend != NS_RESPATH_SEP) )
|
||||
eend++;
|
||||
elen = eend - estart;
|
||||
|
||||
@@ -339,7 +339,7 @@ filepath_path_to_strvec(const char *path)
|
||||
}
|
||||
|
||||
/* skip colons */
|
||||
- while (*eend == ':')
|
||||
+ while (*eend == NS_RESPATH_SEP)
|
||||
eend++;
|
||||
|
||||
/* check for termination */
|
||||
diff --git a/utils/filepath.h b/utils/filepath.h
|
||||
index 784264b33..469830a9d 100644
|
||||
--- a/utils/filepath.h
|
||||
+++ b/utils/filepath.h
|
||||
@@ -24,6 +24,22 @@
|
||||
#ifndef _NETSURF_UTILS_FILEPATH_H_
|
||||
#define _NETSURF_UTILS_FILEPATH_H_
|
||||
|
||||
+/**
|
||||
+ * Character separating elements of a resource path list.
|
||||
+ *
|
||||
+ * A colon cannot double as the list separator on platforms whose absolute
|
||||
+ * paths already contain one -- MontaukOS names drives as "N:/dir", so
|
||||
+ * "0:/os/netsurf/" would split into "0" and "/os/netsurf/", neither of which
|
||||
+ * resolves.
|
||||
+ */
|
||||
+#ifndef NS_RESPATH_SEP
|
||||
+#if defined(__montauk__)
|
||||
+#define NS_RESPATH_SEP ';'
|
||||
+#else
|
||||
+#define NS_RESPATH_SEP ':'
|
||||
+#endif
|
||||
+#endif
|
||||
+
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "utils/errors.h"
|
||||
Reference in New Issue
Block a user