FreeBASIC  0.91.0
strw_instr.c
Go to the documentation of this file.
1 /* instrw function */
2 
3 #include "fb.h"
4 
5 FBCALL ssize_t fb_WstrInstr( ssize_t start, const FB_WCHAR *src, const FB_WCHAR *patt )
6 {
7  ssize_t r;
8  FB_WCHAR *p;
9 
10  if( (src == NULL) || (patt == NULL) )
11  return 0;
12 
13  if( (start > 0) && (start <= fb_wstr_Len( src )) && (fb_wstr_Len( patt ) != 0 ))
14  {
15  p = fb_wstr_Instr( &src[start-1], patt );
16  if( p != NULL )
17  r = fb_wstr_CalcDiff( src, p ) + 1;
18  else
19  r = 0;
20  }
21  else
22  r = 0;
23 
24  return r;
25 }