This is an automated email from the git hooks/post-receive script.

git pushed a commit to reference refs/pull/34/head
in repository terminology.

View the commit online.

commit b4a72c29e4eb9ed0111553ed5c00e50d7c776349
Author: [email protected] <[email protected]>
AuthorDate: Sun Mar 29 22:04:42 2026 -0600

    fix: decouple tytab from ipc.h to fix build
    
    ipc.h includes config.h which transitively pulls in Elementary/Evas
    headers, too heavy for the lightweight tytab binary. Define the tab
    IPC types locally in tytab.c instead. Also restore the full hash
    function in ipc.c to avoid a link error (terminology doesn't link
    tycommon.c).
    
    Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
---
 src/bin/ipc.c       | 37 +++++++++++++++++++++++++++++++++++--
 src/bin/meson.build |  2 +-
 src/bin/tytab.c     | 20 +++++++++++++++++++-
 3 files changed, 55 insertions(+), 4 deletions(-)

diff --git a/src/bin/ipc.c b/src/bin/ipc.c
index d22e220e..3636e9ec 100644
--- a/src/bin/ipc.c
+++ b/src/bin/ipc.c
@@ -5,7 +5,6 @@
 #include <Ecore_Ipc.h>
 #include <Eet.h>
 #include "ipc.h"
-#include "tycommon.h"
 
 /* forward declaration to avoid pulling in win.h (which requires Elementary headers) */
 char *tab_nonce_register(unsigned int term_id, const char *name,
@@ -122,7 +121,41 @@ ipc_tab_shutdown(void)
 static char *
 _ipc_hash_get(void)
 {
-   return ipc_hash_get();
+   char buf[1024], hash[64] = {};
+   const char *disp, *session, *xdg_session, *xdg_id, *xdg_seat, *xdg_vt;
+   char *s;
+   unsigned int i;
+
+   /* dumb stoopid hash - i'm feeling lazy */
+   disp = getenv("DISPLAY");
+   if (!disp) disp = "-unknown-";
+   session = getenv("DBUS_SESSION_BUS_ADDRESS");
+   if (!session) session = ":unknown:";
+   xdg_session = getenv("XDG_SESSION_COOKIE");
+   if (!xdg_session) xdg_session = "/unknown/";
+   xdg_id = getenv("XDG_SESSION_ID");
+   if (!xdg_id) xdg_id = "=unknown=";
+   xdg_seat = getenv("XDG_SEAT");
+   if (!xdg_seat) xdg_seat = "@unknown@";
+   xdg_vt = getenv("XDG_VTNR");
+   if (!xdg_vt) xdg_vt = "!unknown!";
+   snprintf(buf, sizeof(buf), "%s.%s.%s.%s.%s.%s",
+            disp, session, xdg_session,
+            xdg_id, xdg_seat, xdg_vt);
+   memcpy(hash, "terminology-", 12);
+   memset(hash+12, 'x', 32);
+   for (i = 0, s = buf; *s; s++)
+     {
+        unsigned char c1, c2;
+
+        c1 = (((unsigned char)*s) >> 4) & 0xf;
+        c2 = ((unsigned char)*s) & 0x0f;
+        hash[12 + (i % 32)] = (((hash[12 + (i % 32)] - 'a') ^ c1) % 26) + 'a';
+        i++;
+        hash[12 + (i % 32)] = (((hash[12 + (i % 32)] - 'a') ^ c2) % 26) + 'a';
+        i++;
+     }
+   return strdup(hash);
 }
 
 void
diff --git a/src/bin/meson.build b/src/bin/meson.build
index 7785be71..b91324f5 100644
--- a/src/bin/meson.build
+++ b/src/bin/meson.build
@@ -48,7 +48,7 @@ tyq_sources = ['tycommon.c', 'tycommon.h', 'tyq.c']
 tycat_sources = ['tycommon.c', 'tycommon.h', 'tycat.c', 'extns.c', 'extns.h']
 tyls_sources = ['extns.c', 'extns.h', 'tyls.c', 'tycommon.c', 'tycommon.h']
 tysend_sources = ['tycommon.c', 'tycommon.h', 'tysend.c']
-tytab_sources = ['tycommon.c', 'tycommon.h', 'tytab.c', 'ipc.h']
+tytab_sources = ['tycommon.c', 'tycommon.h', 'tytab.c']
 tyfuzz_sources = ['termptyesc.c', 'termptyesc.h',
                   'backlog.c', 'backlog.h',
                   'termptyops.c', 'termptyops.h',
diff --git a/src/bin/tytab.c b/src/bin/tytab.c
index 4089ef85..78877d3a 100644
--- a/src/bin/tytab.c
+++ b/src/bin/tytab.c
@@ -6,7 +6,25 @@
 #include <Eet.h>
 #include "private.h"
 #include "tycommon.h"
-#include "ipc.h"
+
+/* Tab IPC protocol types — must match ipc.h/ipc.c definitions */
+#define TY_IPC_MAJOR_TAB  4
+#define TY_IPC_MINOR_TAB  1
+
+typedef struct _Ipc_Tab_Request Ipc_Tab_Request;
+struct _Ipc_Tab_Request
+{
+   unsigned int term_id;
+   char *name;
+   char *cmd;
+   char *direction;
+};
+
+typedef struct _Ipc_Tab_Reply Ipc_Tab_Reply;
+struct _Ipc_Tab_Reply
+{
+   char *nonce_str;
+};
 
 static Eet_Data_Descriptor *_tab_req_edd = NULL;
 static Eet_Data_Descriptor *_tab_rep_edd = NULL;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to