From 8d91b501dd3aa79d0d91e6f22c4e87ee3b59237c Mon Sep 17 00:00:00 2001
From: "Guy L. Albertelli" <galberte@neo.lrun.com>
Date: Thu, 4 Jan 2001 19:37:37 +0000
Subject: [PATCH] Reimplemented "relay=" and "snoop=" suboptions.

---
 misc/options.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/misc/options.c b/misc/options.c
index ca8d99a8556..72c52ee5c3d 100644
--- a/misc/options.c
+++ b/misc/options.c
@@ -10,6 +10,7 @@
 
 #include "winbase.h"
 #include "winnls.h"
+#include "ntddk.h"
 #include "wine/library.h"
 #include "options.h"
 #include "version.h"
@@ -165,6 +166,12 @@ static void do_debugmsg( const char *arg )
 
     char *opt, *options = strdup(arg);
     int i;
+    /* defined in relay32/relay386.c */
+    extern char **debug_relay_includelist;
+    extern char **debug_relay_excludelist;
+    /* defined in relay32/snoop.c */
+    extern char **debug_snoop_includelist;
+    extern char **debug_snoop_excludelist;
 
     if (!(opt = strtok( options, "," ))) goto error;
     do
@@ -192,6 +199,48 @@ static void do_debugmsg( const char *arg )
         {
             if (*p == '+') set = ~0;
             else clear = ~0;
+	    if (!strncasecmp(p+1, "relay=", 6) ||
+		!strncasecmp(p+1, "snoop=", 6))
+		{
+		    int i, l;
+		    char *s, *s2, ***output, c;
+
+		    if (strchr(p,','))
+			l=strchr(p,',')-p;
+		    else
+			l=strlen(p);
+		    set = ~0;
+		    clear = 0;
+		    output = (*p == '+') ?
+			((*(p+1) == 'r') ?
+			 &debug_relay_includelist :
+			 &debug_snoop_includelist) :
+			((*(p+1) == 'r') ?
+			 &debug_relay_excludelist :
+			 &debug_snoop_excludelist);
+		    s = p + 7;
+		    /* if there are n ':', there are n+1 modules, and we need
+                       n+2 slots, last one being for the sentinel (NULL) */
+		    i = 2;	
+		    while((s = strchr(s, ':'))) i++, s++;
+		    *output = malloc(sizeof(char **) * i);
+		    i = 0;
+		    s = p + 7;
+		    while((s2 = strchr(s, ':'))) {
+			c = *s2;
+			*s2 = '\0';
+			*((*output)+i) = _strupr(strdup(s));
+			*s2 = c;
+			s = s2 + 1;
+			i++;
+		    }
+		    c = *(p + l);
+		    *(p + l) = '\0';
+		    *((*output)+i) = _strupr(strdup(s));
+		    *(p + l) = c;
+		    *((*output)+i+1) = NULL;
+		    *(p + 6) = '\0';
+		}
         }
         p++;
         if (!strcmp( p, "all" )) p = "";  /* empty string means all */
-- 
GitLab