FreeBASIC  0.91.0
str_tempdescv.c
Go to the documentation of this file.
1 /* temp string descriptor allocation for var-len strings */
2 
3 #include "fb.h"
4 
6 {
7  FBSTRING *dsc;
8 
9  FB_STRLOCK();
10 
11  /* alloc a temporary descriptor */
12  dsc = fb_hStrAllocTmpDesc( );
13 
14  FB_STRUNLOCK();
15 
16  if( dsc == NULL )
17  return &__fb_ctx.null_desc;
18 
19  dsc->data = str->data;
20  dsc->len = FB_STRSIZE( str );
21  dsc->size = str->size;
22 
23  return dsc;
24 }