FreeBASIC  0.91.0
io_print_wstr.c
Go to the documentation of this file.
1 /* print [#] wstring functions */
2 
3 #include "fb.h"
4 
5 /*:::::*/
6 static void fb_hPrintWstrEx
7  (
9  const FB_WCHAR *s,
10  size_t len, int mask
11  )
12 {
13  /* add a lock here or the new-line won't be printed in the right
14  place if PRINT is been used in multiple threads and a context
15  switch happens between FB_PRINT_EX() and PrintVoidEx() */
16  FB_LOCK( );
17 
18  if( len != 0 )
19  FB_PRINTWSTR_EX( handle, s, len, 0 );
20 
21  fb_PrintVoidWstrEx( handle, mask );
22 
23  FB_UNLOCK( );
24 }
25 
26 /*:::::*/
27 void fb_PrintWstrEx
28  (
29  FB_FILE *handle,
30  const FB_WCHAR *s,
31  int mask
32  )
33 {
34  if( s == NULL )
35  fb_PrintVoidWstrEx( handle, mask );
36  else
37  fb_hPrintWstrEx( handle, s, fb_wstr_Len( s ), mask );
38 }
39 
40 /*:::::*/
42  (
43  int fnum,
44  const FB_WCHAR *s,
45  int mask
46  )
47 {
48  fb_PrintWstrEx(FB_FILE_TO_HANDLE(fnum), s, mask);
49 }