33 |
|
|
34 |
#include "dgmxDecode.h" |
#include "dgmxDecode.h" |
35 |
#include "dgmxDoc.h" |
#include "dgmxDoc.h" |
36 |
|
#include "clientGen.h" |
37 |
#include "dgreadenv.h" |
#include "dgreadenv.h" |
38 |
#include "htmlTemplate.h" |
#include "htmlTemplate.h" |
39 |
|
|
71 |
void *stream = NULL; |
void *stream = NULL; |
72 |
|
|
73 |
CString uriCS = CSInit; |
CString uriCS = CSInit; |
74 |
|
CString typeCS = CSInit; |
75 |
CString xmlCS = CSInit; |
CString xmlCS = CSInit; |
76 |
CString fileCS = CSInit; |
CString fileCS = CSInit; |
77 |
CString ASCII0 = CSInit; |
CString ASCII0 = CSInit; |
127 |
break; |
break; |
128 |
} |
} |
129 |
|
|
130 |
WrapCString( xmlCS, "xml" ); |
WrapCString( typeCS, "xml" ); |
131 |
|
|
132 |
/* See if we've been explicitly asked for XML documentation |
/* See if we've been explicitly asked for XML documentation |
133 |
*/ |
*/ |
134 |
if( args && strcmpCS( &xmlCS, args ) == 0 ) { /* XML */ |
if( args && strcmpCS( &typeCS, args ) == 0 ) { /* XML */ |
135 |
|
|
136 |
WrapCStringLen( xmlCS, dgmx, len ); |
WrapCStringLen( xmlCS, dgmx, len ); |
137 |
htmlCS = &xmlCS; |
htmlCS = &xmlCS; |
139 |
gwmc_add_data( request, DGF_CONTENT_TYPE, MIME_TEXT_PLAIN, |
gwmc_add_data( request, DGF_CONTENT_TYPE, MIME_TEXT_PLAIN, |
140 |
MIME_TEXT_XML, strlen(MIME_TEXT_XML) ); |
MIME_TEXT_XML, strlen(MIME_TEXT_XML) ); |
141 |
|
|
142 |
} else { /* HTML */ |
} else { |
143 |
|
|
144 |
|
WrapCString( typeCS, "csharp" ); |
145 |
|
if( args && strcmpCS( &typeCS, args ) == 0 ) { /* CSharp Client */ |
146 |
|
|
147 |
|
html_fh = dgmx2client( dgmx, len ); |
148 |
|
gwmc_add_data( request, DGF_CONTENT_TYPE, MIME_TEXT_PLAIN, |
149 |
|
MIME_X_CSHARP_SRC, strlen(MIME_X_CSHARP_SRC) ); |
150 |
|
} else { |
151 |
|
/* Convert dgmx to html |
152 |
|
*/ |
153 |
|
html_fh = dgmx2html( dgmx, len ); |
154 |
|
gwmc_add_data( request, DGF_CONTENT_TYPE, MIME_TEXT_PLAIN, |
155 |
|
MIME_TEXT_HTML, strlen(MIME_TEXT_HTML) ); |
156 |
|
} |
157 |
|
|
|
/* Convert dgmx to html |
|
|
*/ |
|
|
html_fh = dgmx2html( dgmx, len ); |
|
158 |
if( html_fh == NULL ) { |
if( html_fh == NULL ) { |
159 |
gw_logf( LOG_ERROR, "DGMX -> HTML failed" ); |
gw_logf( LOG_ERROR, "DGMX -> HTML failed" ); |
160 |
gwusrerr = ERR_BAD_XML; |
gwusrerr = ERR_BAD_XML; |
163 |
|
|
164 |
htmlCS = HTML_get_outputCS( html_fh ); |
htmlCS = HTML_get_outputCS( html_fh ); |
165 |
|
|
166 |
gwmc_add_data( request, DGF_CONTENT_TYPE, MIME_TEXT_PLAIN, |
} |
|
MIME_TEXT_HTML, strlen(MIME_TEXT_HTML) ); |
|
|
} |
|
167 |
|
|
168 |
/* Add Document to request buffer and return it |
/* Add Document to request buffer and return it |
169 |
*/ |
*/ |