FreeBASIC  0.91.0
file_input_ushort.c
Go to the documentation of this file.
1 /* input function for usigned shorts */
2 
3 #include "fb.h"
4 #include <math.h>
5 
6 FBCALL int fb_InputUshort( unsigned short *dst )
7 {
9  ssize_t len;
10  int isfp;
11 
12  len = fb_FileInputNextToken( buffer, FB_INPUT_MAXNUMERICLEN, FB_FALSE, &isfp );
13 
14  if( isfp == FALSE )
15  *dst = (unsigned short)fb_hStr2UInt( buffer, len );
16  else
17  *dst = (unsigned short)rint( fb_hStr2Double( buffer, len ) );
18 
19  return fb_ErrorSetNum( FB_RTERROR_OK );
20 }