3 source/server_common.c | 47 ++++++++++++++++++++++++++++++++++++++---------
4 1 file changed, 38 insertions(+), 9 deletions(-)
6 diff --quilt old/source/server_common.c new/source/server_common.c
7 --- old/source/server_common.c
8 +++ new/source/server_common.c
10 #include "server_common.h"
11 #include "../util/utils.h"
13 +#define NEDIT_VERSION_STRING "5.7"
14 +#define NEDIT_VERSION_STRING_LEN 3
17 * Create the server property atoms for the server with serverName.
18 * Atom names are generated as follows:
19 @@ -56,13 +59,19 @@ void CreateServerPropertyAtoms(const cha
20 Atom *serverExistsAtomReturn,
21 Atom *serverRequestAtomReturn)
23 - char propName[20+1+MAXNODENAMELEN+1+MAXUSERNAMELEN+1+MAXSERVERNAMELEN];
25 + NEDIT_VERSION_STRING_LEN+1+
28 + MAXSERVERNAMELEN+1];
29 const char *userName = GetUserName();
30 const char *hostName = GetNameOfHost();
32 - sprintf(propName, "NEDIT_SERVER_EXISTS_%s_%s_%s", hostName, userName, serverName);
33 + sprintf(propName, "NEDIT_%s_SERVER_EXISTS_%s_%s_%s",
34 + NEDIT_VERSION_STRING, hostName, userName, serverName);
35 *serverExistsAtomReturn = XInternAtom(TheDisplay, propName, False);
36 - sprintf(propName, "NEDIT_SERVER_REQUEST_%s_%s_%s", hostName, userName, serverName);
37 + sprintf(propName, "NEDIT_%s_SERVER_REQUEST_%s_%s_%s",
38 + NEDIT_VERSION_STRING, hostName, userName, serverName);
39 *serverRequestAtomReturn = XInternAtom(TheDisplay, propName, False);
42 @@ -86,12 +95,19 @@ void CreateServerPropertyAtoms(const cha
43 Atom CreateServerFileOpenAtom(const char *serverName,
46 - char propName[10+1+MAXNODENAMELEN+1+MAXUSERNAMELEN+1+MAXSERVERNAMELEN+1+MAXPATHLEN+1+7];
48 + NEDIT_VERSION_STRING_LEN+1+
54 const char *userName = GetUserName();
55 const char *hostName = GetNameOfHost();
58 - sprintf(propName, "NEDIT_FILE_%s_%s_%s_%s_WF_OPEN", hostName, userName, serverName, path);
59 + sprintf(propName, "NEDIT_%s_FILE_%s_%s_%s_%s_WF_OPEN",
60 + NEDIT_VERSION_STRING, hostName, userName, serverName, path);
61 atom = XInternAtom(TheDisplay, propName, False);
64 @@ -100,12 +116,19 @@ Atom CreateServerFileClosedAtom(const ch
68 - char propName[10+1+MAXNODENAMELEN+1+MAXUSERNAMELEN+1+MAXSERVERNAMELEN+1+MAXPATHLEN+1+9];
70 + NEDIT_VERSION_STRING_LEN+1+
76 const char *userName = GetUserName();
77 const char *hostName = GetNameOfHost();
80 - sprintf(propName, "NEDIT_FILE_%s_%s_%s_%s_WF_CLOSED", hostName, userName, serverName, path);
81 + sprintf(propName, "NEDIT_%s_FILE_%s_%s_%s_%s_WF_CLOSED",
82 + NEDIT_VERSION_STRING, hostName, userName, serverName, path);
83 atom = XInternAtom(TheDisplay, propName, only_if_exist);
86 @@ -116,10 +139,16 @@ Atom CreateServerFileClosedAtom(const ch
88 void DeleteServerFileAtoms(const char* serverName, Window rootWindow)
90 - char propNamePrefix[10+1+MAXNODENAMELEN+1+MAXUSERNAMELEN+1+MAXSERVERNAMELEN+1];
91 + char propNamePrefix[10+1+
92 + NEDIT_VERSION_STRING_LEN+1+
97 const char *userName = GetUserName();
98 const char *hostName = GetNameOfHost();
99 - int length = sprintf(propNamePrefix, "NEDIT_FILE_%s_%s_%s_", hostName, userName, serverName);
100 + int length = sprintf(propNamePrefix, "NEDIT_%s_FILE_%s_%s_%s_",
101 + NEDIT_VERSION_STRING, hostName, userName, serverName);
104 Atom* atoms = XListProperties(TheDisplay, rootWindow, &nProperties);