summaryrefslogtreecommitdiff
path: root/surf.c.diff
diff options
context:
space:
mode:
authormiguel <miguel@localhost>2018-03-15 23:36:59 +0100
committermiguel <miguel@localhost>2018-03-15 23:36:59 +0100
commit54e06e03aad71888b3b05a1c249b170f3856da69 (patch)
tree808bd355f2421704e490edd6ad1c3a1e67b33d77 /surf.c.diff
parent7019970b24380cd823beb9760f34a6c00b569054 (diff)
v0.2
Diffstat (limited to 'surf.c.diff')
-rw-r--r--surf.c.diff71
1 files changed, 0 insertions, 71 deletions
diff --git a/surf.c.diff b/surf.c.diff
deleted file mode 100644
index 329df08..0000000
--- a/surf.c.diff
+++ /dev/null
@@ -1,71 +0,0 @@
-diff --git a/surf.c b/surf.c
-index f01a91c..76d4706 100644
---- a/surf.c
-+++ b/surf.c
-@@ -2,6 +2,10 @@
- *
- * To understand surf, start reading main().
- */
-+
-+#include <sys/ipc.h>
-+#include <sys/shm.h>
-+
- #include <sys/file.h>
- #include <sys/types.h>
- #include <sys/wait.h>
-@@ -223,6 +227,7 @@ static void togglefullscreen(Client *c, const Arg *a);
- static void togglecookiepolicy(Client *c, const Arg *a);
- static void toggleinspector(Client *c, const Arg *a);
- static void find(Client *c, const Arg *a);
-+static void domlinks(Client *c, const Arg *a);
-
- /* Buttons */
- static void clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h);
-@@ -2052,3 +2057,47 @@ main(int argc, char *argv[])
-
- return 0;
- }
-+
-+void
-+domlinks(Client *c, const Arg *a)
-+{
-+ static int goto_link=0;
-+ int digit=a->i;
-+
-+ // follow link
-+ if(digit==99)
-+ {
-+ printf("follow link %i\n",goto_link);
-+
-+ key_t my_ftok = ftok("~/surf-webext-dom-shared-mem",'a');
-+ int mem_seg=shmget(my_ftok,1024*1024,IPC_CREAT|0660);
-+ if(mem_seg==-1)
-+ {
-+ g_print("shmget failed\n");
-+ }
-+ char *shared_buf=shmat(mem_seg,NULL,0);
-+ if(shared_buf==(void*)-1)
-+ {
-+ g_print("shmat failed\n");
-+ }
-+
-+ printf("linking to : %s\n",&(shared_buf[goto_link*1024]));
-+ Arg aa = {.v = &(shared_buf[goto_link*1024]) };
-+ loaduri(c, &aa);
-+ goto_link=0;
-+ return;
-+ }
-+
-+ // adjust link number
-+ if(goto_link==0)
-+ {
-+ goto_link=digit;
-+ }
-+ else
-+ {
-+ goto_link*=10;
-+ goto_link+=digit;
-+ }
-+ printf("update link num to: %i\n",goto_link);
-+
-+}