~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/file/dicom.old/CTN/dcmcond.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2           Copyright (C) 1993, 1994, RSNA and Washington University
  3 
  4           The software and supporting documentation for the Radiological
  5           Society of North America (RSNA) 1993, 1994 Digital Imaging and
  6           Communications in Medicine (DICOM) Demonstration were developed
  7           at the
  8                   Electronic Radiology Laboratory
  9                   Mallinckrodt Institute of Radiology
 10                   Washington University School of Medicine
 11                   510 S. Kingshighway Blvd.
 12                   St. Louis, MO 63110
 13           as part of the 1993, 1994 DICOM Central Test Node project for, and
 14           under contract with, the Radiological Society of North America.
 15 
 16           THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND NEITHER RSNA NOR
 17           WASHINGTON UNIVERSITY MAKE ANY WARRANTY ABOUT THE SOFTWARE, ITS
 18           PERFORMANCE, ITS MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR
 19           USE, FREEDOM FROM ANY COMPUTER DISEASES OR ITS CONFORMITY TO ANY
 20           SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND PERFORMANCE OF
 21           THE SOFTWARE IS WITH THE USER.
 22 
 23           Copyright of the software and supporting documentation is
 24           jointly owned by RSNA and Washington University, and free access
 25           is hereby granted as a license to use this software, copy this
 26           software and prepare derivative works based upon this software.
 27           However, any distribution of this software source code or
 28           supporting documentation or derivative works (source code and
 29           supporting documentation) must include the three paragraphs of
 30           the copyright notice.
 31 */
 32 /* Copyright marker.  Copyright will be inserted above.  Do not remove */
 33 
 34 /*
 35 **                              DICOM 93
 36 **                   Electronic Radiology Laboratory
 37 **                 Mallinckrodt Institute of Radiology
 38 **              Washington University School of Medicine
 39 **
 40 ** Module Name(s):      DCM_Message
 41 ** Author, Date:        Stephen M. Moore, 27-Apr-93
 42 ** Intent:              Define the ASCIZ messages that go with each DCM
 43 **                      error number and provide a function for looking up
 44 **                      the error message.
 45 ** Last Update:         $Author: smm $, $Date: 1998/07/31 19:39:19 $
 46 ** Source File:         $RCSfile: dcmcond.c,v $
 47 ** Revision:            $Revision: 1.22 $
 48 ** Status:              $State: Exp $
 49 */
 50 
 51 static char rcsid[] = "$Revision: 1.22 $ $RCSfile: dcmcond.c,v $";
 52 
 53 #include <stdio.h>
 54 #include <sys/types.h>
 55 #include "dicom.h"
 56 #include "lst.h"
 57 #include "dicom_objects.h"
 58 #include "dcmprivate.h"
 59 
 60 typedef struct vector {
 61     CONDITION cond;
 62     char *message;
 63 }   VECTOR;
 64 
 65 static VECTOR messageVector[] = {
 66     {DCM_NORMAL, "Normal return from DCM routine"},
 67     {DCM_FILEOPENFAILED, "DCM failed to open file: %s in %s"},
 68     {DCM_FILEACCESSERROR, "DCM failed to access file: %s in %s"},
 69     {DCM_OBJECTCREATEFAILED, "DCM failed to create object in %s"},
 70     {DCM_NULLOBJECT, "NULL object passed to routine %s"},
 71     {DCM_ILLEGALOBJECT, "Illegal object passed to routine %s"},
 72     {DCM_ELEMENTNOTFOUND, "Requested element (%x %x) not found in %s"},
 73     {DCM_ILLEGALSTREAMLENGTH,
 74     "DCM Illegal Stream Length (%ld) (Not enough data to define a full element) in %s"},
 75     {DCM_ELEMENTCREATEFAILED, "DCM failed to create element in %s (%04x %04x %d)"},
 76     {DCM_UNRECOGNIZEDGROUP, "DCM unrecognized group: %04x in %s"},
 77     {DCM_UNRECOGNIZEDELEMENT, "DCM unrecognized element: (%04x %04x) in %s"},
 78     {DCM_ELEMENTOUTOFORDER, "DCM group/element out of order (%04x %04x) in %s"},
 79     {DCM_LISTFAILURE, "DCM routine failed on list operation in %s"},
 80     {DCM_ILLEGALOPTION, "DCM illegal stream option: %s"},
 81     {DCM_ILLEGALADD, "DCM attempt to add illegal element: %x %x in %s"},
 82     {DCM_GETINCOMPLETE, "DCM Get Element incomplete in %s"},
 83     {DCM_ILLEGALCONTEXT, "DCM Illegal context value in %s"},
 84     {DCM_ILLEGALREPRESENTATION,
 85     "DCM Caller specified illegal representation for element (%04x %04x) in %s"},
 86     {DCM_UNEVENELEMENTLENGTH,
 87     "DCM attempt to add data element (%x %x) with uneven length (%ld)  in %s"},
 88     {DCM_ELEMENTLENGTHERROR,
 89     "DCM Data Element (%04x %04x) longer (%ld) than remaining length (%ld) of \
 90 data in stream or file in %s"},
 91     {DCM_GROUPNOTFOUND, "Requested group (%x) not found in %s"},
 92     {DCM_FILECREATEFAILED, "DCM failed to create file %s (%s)"},
 93     {DCM_FILEIOERROR, "DCM io error on file %s (%s)"},
 94     {DCM_INSERTFAILED,
 95     "DCM failed to insert new element (%04x %04x) in %s"},
 96     {DCM_CANNOTGETSEQUENCEVALUE,
 97     "DCM Cannot retrieve value of element with SQ representation (%08x) in (%s)"},
 98     {DCM_FILEDELETEFAILED, "DCM Failed to delete file %s in %s"},
 99     {DCM_MALLOCFAILURE, "DCM Failed to malloc %ld bytes in %s"},
100     {DCM_NULLADDRESS, "DCM NULL address passed to routine %s"},
101     {DCM_UNEXPECTEDREPRESENTATION,
102     "DCM Routine %s expected %s representation for element %04x %04x"},
103     {DCM_BADELEMENTINGROUP,
104     "DCM Bad element (%04x %04x) found in group %04x in %s"},
105     {DCM_CALLBACKABORTED, "DCM Callback aborted by user in %s"},
106     {DCM_READSTREAMFAILED, "DCM Failed to read stream in %s"},
107     {DCM_UNRECOGNIZEDVRCODE, "DCM Unrecognized VR code (%s) in %s"},
108     {DCM_VRMISMATCH, "DCM Incorrect VR (%s) for attribute with tag %08x"},
109     {DCM_EXPORTBUFFERTOOSMALL,
110     "DCM Caller's export buffer length (%d) is too short in %s"},
111     {DCM_BADOFFSET,
112     "DCM Offset value (%d) larger than attribute length (%d) in %s"},
113     {DCM_BADLENGTH,
114     "DCM Combination of offset, length (%d %d) is longer than element length (%d) in %s"},
115     {DCM_NOTASEQUENCE,
116     "DCM Attempt to perform sequence operation on element (%04x %04x) not a sequence in %s"},
117     {DCM_GENERALWARNING, "DCM General warning in %s: %s"},
118     {0, NULL}
119 
120 };
121 
122 
123 /* DCM_Message
124 **
125 ** Purpose:
126 **      Find the ASCIZ message that goes with an DCM error number and
127 **      return a pointer to static memory containing that error message.
128 **
129 ** Parameter Dictionary:
130 **      condition       The error condition for which the message is to be
131 **                      returned
132 **
133 ** Return Values:
134 **      The error message if a valid error condition was reported else NULL.
135 **
136 ** Algorithm:
137 **      Description of the algorithm (optional) and any other notes.
138 */
139 
140 char *
141 DCM_Message(CONDITION condition)
142 {
143     int
144         index;
145 
146     for (index = 0; messageVector[index].message != NULL; index++)
147         if (condition == messageVector[index].cond)
148             return messageVector[index].message;
149 
150     return NULL;
151 }
152 
153 DCM_DumpVector()
154 {
155     int index;
156 
157     for (index = 0; index < (int) DIM_OF(messageVector); index++) {
158         if (messageVector[index].message != NULL)
159             printf("%8x %8d %s\n", messageVector[index].cond,
160                    messageVector[index].cond,
161                    messageVector[index].message);
162     }
163 }
164 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.