File: 02_dcmtk_3.5.4-3.patch

package info (click to toggle)
dcmtk 3.5.4-4
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 23,784 kB
  • ctags: 22,942
  • sloc: cpp: 165,761; ansic: 46,396; sh: 3,808; perl: 3,465; makefile: 3,097
file content (336 lines) | stat: -rw-r--r-- 10,792 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
Author: Jürgen Salk <jsa@debian.org>
Description: The original maintainer Jürgen Salk applied
 a set of patches to the original code.  This file contains
 changes to C++ code

--- dcmtk-3.5.4.orig/dcmqrdb/etc/dcmqrscp.cfg
+++ dcmtk-3.5.4/dcmqrdb/etc/dcmqrscp.cfg
@@ -10,6 +10,8 @@
 MaxPDUSize      = 16384
 MaxAssociations = 16
 Display         = "no"
+UserName        = "dcmtk"
+GroupName       = "dcmtk"
 
 HostTable BEGIN
 #
@@ -25,38 +27,42 @@
 # NOTE: in the current implementation you cannot substitute an IP address
 # for a hostname.
 #
-acme1           = (ACME1, acmehost1, 5678)
-acme2           = (ACME2, acmehost2, 5678)
-acmeCTcompany   = acme1, acme2
-united1         = (UNITED1, unitedhost1, 104)
-united2         = (UNITED2, unitedhost2, 104)
-unitedMRcompany = united1, united2
+# Example:
+#
+#acme1           = (ACME1, acmehost1, 5678)
+#acme2           = (ACME2, acmehost2, 5678)
+#acmeCTcompany   = acme1, acme2
+#united1         = (UNITED1, unitedhost1, 104)
+#united2         = (UNITED2, unitedhost2, 104)
+#unitedMRcompany = united1, united2
 #
 HostTable END
 
 VendorTable BEGIN
 #
-# The VendorTable is used by the dcmqrdb and dcmqrti applications.
-# You can give a vendor name (r.h.s. entry below) to the dcmqrti 
+# The VendorTable is used by the imagectn and ti applications.
+# You can give a vendor name (r.h.s. entry below) to the ti 
 # program and it will talk to all hosts and AEs of the vendor.
-# The dcmqrdb program can use the vendor table to restrict move destination
+# The imagectn program can use the vendor table to restrict move destination
 # to hosts belonging to a vendor.
-# Also, the dcmqrti and dcmqrdb programs use the name defined on the left hand side
+# Also, the ti and imagectn programs use the name defined on the left hand side
 # as the vendor name to display above images.
 #
 # The format: 
 #       VendorName = SymbolicName
 # The symbolic name should be defined in the HostTable.
 #
-"Acme CT Company"   = acmeCTcompany
-"United MR Company" = unitedMRcompany
+# Example:
+#
+#"Acme CT Company"   = acmeCTcompany
+#"United MR Company" = unitedMRcompany
 #
 VendorTable END
 
 AETable BEGIN
 #
 # Each row of the AETable defines an Application Entities (AE) Title known
-# to the dcmqrdb application.  Each AE Title represents a separate
+# to the imagectn application.  Each AE Title represents a separate
 # image database located in the specified file system directory (storage area).
 # Each AE Title has read/write, quota and peer access restrictions.
 #
@@ -67,8 +73,13 @@
 #               Entry in HostTable                      |
 #               ANY
 #
-COMMON       /home/dicom/db/COMMON       R  (200, 1024mb) ANY
-ACME_STORE   /home/dicom/db/ACME_STORE   RW (9, 1024mb)   acmeCTcompany
-UNITED_STORE /home/dicom/db/UNITED_STORE RW (9, 1024mb)   unitedMRcompany
+# Example:
+#
+#ACME_STORE   /var/lib/dcmtk/db/ACME_STORE   RW (9, 1024mb)   acmeCTcompany
+#UNITED_STORE /var/lib/dcmtk/db/UNITED_STORE RW (9, 1024mb)   unitedMRcompany
+#
+# Uncomment and adjust the following lines for a common r/rw storage area:
+#READWRITE     /var/lib/dcmtk/db/READWRITE    RW (10, 1024mb)  ANY
+#READ          /var/lib/dcmtk/db/READ         R  (200, 1024mb) ANY
 #
 AETable END
--- dcmtk-3.5.4.orig/dcmqrdb/docs/dcmqrcnf.txt
+++ dcmtk-3.5.4/dcmqrdb/docs/dcmqrcnf.txt
@@ -46,8 +46,8 @@
 NetworkTCPPort  = 104
 MaxPDUSize      = 8192
 MaxAssociations = 20
-UserName        = (do not change user)
-GroupName       = (do not change group)
+UserName        = "dcmtk"
+GroupName       = "dcmtk"
 
 NOTE: You must have root privileges to bind port 104 for DICOM association 
 requests on Unix/Linux/Posix platforms as this is a privileged port number 
--- dcmtk-3.5.4.orig/dcmnet/apps/findscu.cc
+++ dcmtk-3.5.4/dcmnet/apps/findscu.cc
@@ -21,10 +21,10 @@
  *
  *  Purpose: Query/Retrieve Service Class User (C-FIND operation)
  *
- *  Last Update:      $Author: meichel $
- *  Update Date:      $Date: 2005/12/08 15:44:19 $
+ *  Last Update:      $Author: onken $
+ *  Update Date:      $Date: 2006/01/17 15:38:50 $
  *  Source File:      $Source: /share/dicom/cvs-depot/dcmtk/dcmnet/apps/findscu.cc,v $
- *  CVS/RCS Revision: $Revision: 1.47 $
+ *  CVS/RCS Revision: $Revision: 1.48 $
  *  Status:           $State: Exp $
  *
  *  CVS/RCS Log at end of file
@@ -111,7 +111,6 @@
     fprintf(stderr, "\n");
 }
 
-
 static void
 addOverrideKey(OFConsoleApplication& app, const char* s)
 {
@@ -119,18 +118,28 @@
     unsigned int e = 0xffff;
     int n = 0;
     char val[1024];
+    OFString dicName, valStr;
     OFString msg;
     char msg2[200];
-
     val[0] = '\0';
+
     // try to parse group and element number
     n = sscanf(s, "%x,%x=%s", &g, &e, val);
-
-    if (n != 2) {
-      // not a group-element pair, try to lookup in dictionary
+    if (n < 2) {
+      // try to parse dictionary name and value instead
+      OFString toParse = s;
+      size_t eqPos = toParse.find('=');
+      if (eqPos != string::npos)
+      {
+        dicName = toParse.substr(0,eqPos).c_str();
+        valStr = toParse.substr(eqPos+1,toParse.length());
+      }
+      else
+        dicName = s; // only dictionary name given (without value)
+      // try to lookup in dictionary
       DcmTagKey key(0xffff,0xffff);
       const DcmDataDictionary& globalDataDict = dcmDataDict.rdlock();
-      const DcmDictEntry *dicent = globalDataDict.findEntry(s);
+      const DcmDictEntry *dicent = globalDataDict.findEntry(dicName.c_str());
       dcmDataDict.unlock();
       if (dicent!=NULL) {
         // found dictionary name, copy group and element number
@@ -141,24 +150,12 @@
       else {
         // not found in dictionary
         msg = "bad key format or dictionary name not found in dictionary: ";
-        msg += s;
+        msg += dicName;
         app.printError(msg.c_str());
       }
     }
-    const char* spos = s;
-    char ccc;
-    do
-    {
-      ccc = *spos;
-      if (ccc == '=') break;
-      if (ccc == 0) { spos = NULL; break; }
-      spos++;
-    } while(1);
-
-    if (spos && *(spos+1)) {
-        strcpy(val, spos+1);
-    }
-
+    else
+      valStr = val;
     DcmTag tag(g,e);
     if (tag.error() != EC_Normal) {
         sprintf(msg2, "unknown tag: (%04x,%04x)", g, e);
@@ -169,13 +166,13 @@
         sprintf(msg2, "cannot create element for tag: (%04x,%04x)", g, e);
         app.printError(msg2);
     }
-    if (strlen(val) > 0) {
-        elem->putString(val);
+    if (valStr.length() > 0) {
+        elem->putString(valStr.c_str());
         if (elem->error() != EC_Normal)
         {
             sprintf(msg2, "cannot put tag value: (%04x,%04x)=\"", g, e);
             msg = msg2;
-            msg += val;
+            msg += valStr;
             msg += "\"";
             app.printError(msg.c_str());
         }
@@ -189,6 +186,7 @@
     }
 }
 
+
 static OFCondition addPresentationContext(T_ASC_Parameters *params);
 
 static OFCondition
@@ -1164,6 +1162,10 @@
 /*
 ** CVS Log
 ** $Log: findscu.cc,v $
+** Revision 1.48  2006/01/17 15:38:50  onken
+** Fixed "--key" option, which was broken when using the optional assignment ("=")
+** operation inside the option value
+**
 ** Revision 1.47  2005/12/08 15:44:19  meichel
 ** Changed include path schema for all DCMTK header files
 **
--- dcmtk-3.5.4.orig/dcmnet/apps/movescu.cc
+++ dcmtk-3.5.4/dcmnet/apps/movescu.cc
@@ -21,10 +21,10 @@
  *
  *  Purpose: Query/Retrieve Service Class User (C-MOVE operation)
  *
- *  Last Update:      $Author: meichel $
- *  Update Date:      $Date: 2005/12/08 15:44:20 $
+ *  Last Update:      $Author: onken $
+ *  Update Date:      $Date: 2006/01/17 15:38:50 $
  *  Source File:      $Source: /share/dicom/cvs-depot/dcmtk/dcmnet/apps/movescu.cc,v $
- *  CVS/RCS Revision: $Revision: 1.59 $
+ *  CVS/RCS Revision: $Revision: 1.60 $
  *  Status:           $State: Exp $
  *
  *  CVS/RCS Log at end of file
@@ -148,17 +148,28 @@
     unsigned int e = 0xffff;
     int n = 0;
     char val[1024];
+    OFString dicName, valStr;
     OFString msg;
     char msg2[200];
-
     val[0] = '\0';
-    n = sscanf(s, "%x,%x=%s", &g, &e, val);
 
-    if (n != 2) {
-      // not a group-element pair, try to lookup in dictionary
+    // try to parse group and element number
+    n = sscanf(s, "%x,%x=%s", &g, &e, val);
+    if (n < 2) {
+      // try to parse dictionary name and value instead
+      OFString toParse = s;
+      size_t eqPos = toParse.find('=');
+      if (eqPos != string::npos)
+      {
+        dicName = toParse.substr(0,eqPos).c_str();
+        valStr = toParse.substr(eqPos+1,toParse.length());
+      }
+      else
+        dicName = s; // only dictionary name given (without value)
+      // try to lookup in dictionary
       DcmTagKey key(0xffff,0xffff);
       const DcmDataDictionary& globalDataDict = dcmDataDict.rdlock();
-      const DcmDictEntry *dicent = globalDataDict.findEntry(s);
+      const DcmDictEntry *dicent = globalDataDict.findEntry(dicName.c_str());
       dcmDataDict.unlock();
       if (dicent!=NULL) {
         // found dictionary name, copy group and element number
@@ -168,25 +179,13 @@
       }
       else {
         // not found in dictionary
-        msg = "bad key format or key not found in dictionary: ";
-        msg += s;
+        msg = "bad key format or dictionary name not found in dictionary: ";
+        msg += dicName;
         app.printError(msg.c_str());
       }
     }
-    const char* spos = s;
-    char ccc;
-    do
-    {
-      ccc = *spos;
-      if (ccc == '=') break;
-      if (ccc == 0) { spos = NULL; break; }
-      spos++;
-    } while(1);
-
-    if (spos && *(spos+1)) {
-        strcpy(val, spos+1);
-    }
-
+    else
+      valStr = val;
     DcmTag tag(g,e);
     if (tag.error() != EC_Normal) {
         sprintf(msg2, "unknown tag: (%04x,%04x)", g, e);
@@ -197,13 +196,13 @@
         sprintf(msg2, "cannot create element for tag: (%04x,%04x)", g, e);
         app.printError(msg2);
     }
-    if (strlen(val) > 0) {
-        elem->putString(val);
+    if (valStr.length() > 0) {
+        elem->putString(valStr.c_str());
         if (elem->error() != EC_Normal)
         {
             sprintf(msg2, "cannot put tag value: (%04x,%04x)=\"", g, e);
             msg = msg2;
-            msg += val;
+            msg += valStr;
             msg += "\"";
             app.printError(msg.c_str());
         }
@@ -1407,6 +1406,10 @@
 ** CVS Log
 **
 ** $Log: movescu.cc,v $
+** Revision 1.60  2006/01/17 15:38:50  onken
+** Fixed "--key" option, which was broken when using the optional assignment ("=")
+** operation inside the option value
+**
 ** Revision 1.59  2005/12/08 15:44:20  meichel
 ** Changed include path schema for all DCMTK header files
 **
--- /dev/null
+++ dcmtk-3.5.4/dcmwlm/wlistdb/OFFIS/lockfile
@@ -0,0 +1 @@
+