Menu

[424828]: / src / rtlib / strw_asc.c  Maximize  Restore  History

Download this file

27 lines (22 with data), 502 Bytes

 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
/* ascw function */
#include "fb.h"
FBCALL unsigned int fb_WstrAsc( const FB_WCHAR *str, ssize_t pos )
{
ssize_t len;
if( str == NULL )
return 0;
len = fb_wstr_Len( str );
if( (len == 0) || (pos <= 0) || (pos > len) )
return 0;
else
/* on DOS, FB_WCHAR is a 'char' which is
typically signed. To avoid an undesired
sign extension for chars >= 128, cast
to unsigned char first
*/
#if defined HOST_DOS
return (unsigned char)str[pos-1];
#else
return str[pos-1];
#endif
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.