forked from ImortisInglorian/fbrtLib
-
Notifications
You must be signed in to change notification settings - Fork 1
/
data.bas
35 lines (27 loc) · 814 Bytes
/
data.bas
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
27
28
29
30
31
32
33
34
35
/' DATA core '/
#include "fb.bi"
dim shared as FB_DATADESC ptr __fb_data_ptr = NULL
extern "C"
private sub hSkipLink( )
/' If a link was reached, move to the next non-link, or NULL ("EOF") '/
while ( __fb_data_ptr <> NULL and (__fb_data_ptr->len = FB_DATATYPE_LINK) )
__fb_data_ptr = __fb_data_ptr->next
wend
DBG_ASSERT( (__fb_data_ptr = NULL) or (__fb_data_ptr->len <> FB_DATATYPE_LINK) )
end sub
sub fb_DataRestore FBCALL ( labeladdr as FB_DATADESC ptr )
FB_LOCK()
__fb_data_ptr = labeladdr
hSkipLink( )
FB_UNLOCK()
end sub
/' Callers are expected to FB_LOCK/FB_UNLOCK '/
sub fb_DataNext( )
/' Move forward in current DATA table, if any '/
if ( __fb_data_ptr <> NULL ) then
DBG_ASSERT( __fb_data_ptr->len <> FB_DATATYPE_LINK )
__fb_data_ptr += 1
hSkipLink( )
end if
end sub
end extern