68 size_t len = *pValuelen *
sizeof(
FB_WCHAR );
132 size_t i, port, uiOption;
141 i = sprintf( achDev,
"COM%u:", (
int)port );
145 i = (strchr( filename,
':' ) -
filename);
146 strncpy( achDev, filename, i );
169 pchPos = strchr( filename,
':' );
176 size_t uiOptionLength;
177 const char *pchPosEnd, *pchPosNext;
181 while( *pchPos==
' ' || *pchPos==
'\t' )
195 pchPosNext = strchr( pchPos,
',' );
196 if( pchPosNext==
NULL ) {
197 pchPosNext = filename + filename_len;
198 pchPosEnd = pchPosNext - 1;
200 pchPosEnd = pchPosNext - 1;
205 while( *pchPosEnd==
' ' || *pchPosEnd==
'\t' )
210 uiOptionLength = pchPosEnd - pchPos;
211 pszOption = malloc( uiOptionLength + 1 );
212 memcpy( pszOption, pchPos, uiOptionLength );
213 pszOption[uiOptionLength] = 0;
216 switch ( uiOption ) {
220 if( *pchPosTmp!=0 ) {
227 if( strcasecmp( pszOption,
"N" )==0 ) {
229 }
else if( strcasecmp( pszOption,
"E" )==0 ) {
231 }
else if( strcasecmp( pszOption,
"PE" )==0 ) {
235 }
else if( strcasecmp( pszOption,
"O" )==0 ) {
237 }
else if( strcasecmp( pszOption,
"S" )==0 ) {
239 }
else if( strcasecmp( pszOption,
"M" )==0 ) {
249 if( *pchPosTmp!=0 ) {
257 double dblStopBits = strtod( pszOption, &pchPosTmp );
258 if( *pchPosTmp!=0 ) {
261 if( dblStopBits==1.0 ) {
263 }
else if( dblStopBits==1.5 ) {
265 }
else if( dblStopBits==2.0 ) {
276 if( strncasecmp( pszOption,
"CS", 2 )==0 ) {
278 if( *pchPosTmp!=0 ) {
281 }
else if( strncasecmp( pszOption,
"DS", 2 )==0 ) {
283 if( *pchPosTmp!=0 ) {
286 }
else if( strncasecmp( pszOption,
"CD", 2 )==0 ) {
288 if( *pchPosTmp!=0 ) {
291 }
else if( strncasecmp( pszOption,
"OP", 2 )==0 ) {
293 if( *pchPosTmp!=0 ) {
296 }
else if( strncasecmp( pszOption,
"TB", 2 )==0 ) {
298 if( *pchPosTmp!=0 ) {
301 }
else if( strncasecmp( pszOption,
"RB", 2 )==0 ) {
303 if( *pchPosTmp!=0 ) {
306 }
else if( strcasecmp( pszOption,
"RS" )==0 ) {
308 }
else if( strcasecmp( pszOption,
"LF" )==0 ) {
311 }
else if( strcasecmp( pszOption,
"ASC" )==0 ) {
313 }
else if( strcasecmp( pszOption,
"BIN" )==0 ) {
315 }
else if( strcasecmp( pszOption,
"PE" )==0 ) {
317 }
else if( strcasecmp( pszOption,
"DT" )==0 ) {
319 }
else if( strcasecmp( pszOption,
"FE" )==0 ) {
321 }
else if( strcasecmp( pszOption,
"ME" )==0 ) {
323 }
else if( strncasecmp( pszOption,
"IR", 2 )==0 ) {
325 if( *pchPosTmp!=0 ) {
340 if( iStopBits==-1 ) {
375 int cur = ((default_width==-1) ? 0 : default_width);
382 i = sprintf( achDev,
"COM%u:", (
int)port );
391 if( tmp_handle->
hooks==&hooks_dev_com
395 if( strcmp(tmp_info->
pszDevice, achDev)==0 ) {
397 tmp_handle->
width = width;
398 cur = tmp_handle->
width;