82
This is the addr ess of an o pt ional AST pr oced ure t o execu te wh en a req ues t is received . I f t his par amet er is
not passed or is passed as zero, FDB_GET operates synchronously. Therefore it does not return until a
request is received. If an AST routine is passed, F D B_GE T returns as soon as the operation is begun and the
AST is delivered when a requ est is r eceived.
name: astprm
type: longword
access: read only
mechanism: by value
This value is passed to the user's AST routine when the AST is delivered. It is not otherwise used and may be
anything the user desires. If the AST is not specified this parameter is ignored. If the AST is passed and this
parameter is not sp ecif ied, t h en the AST rout ine is called with zero as the par am et er.
Return Value:
The VMS status of the operation. If the operation is synchronous, this is the completion status. Otherwise, it
is the status of initiating the operation. If the server has shut down since the last GET operation and an AST
routin e was sp ecif ied , t he n t h e f un ct io n r et u rn valu e will b e n o rm al an d t he c om p let ion st at us a rgu m en t will
be set to FDB$_SERDOWN.
If a stream is bein g closed by the o riginat or (m eaning n o mo re loo kup re quest s will be is sued f or it ) this
function returns FDB$_CLOSE (a success status). In this case, the user should perform any cleanup
necessary, then call FDB_CLOSE to allow FDB to deallocat e inter nal con text . I f FD B$_ CLO SE is retu rn ed,
the only outpu t p arameters that are valid ar e t h e s t r eam I D and th e status.
For succes s the co mple tion sta tus will be F D B$_N E WSTRE AM if t his d atab ase s trea m was n ot pre viou sly
open or FDB$_N O RMAL if the stream was already active. Note: If co ntext is b eing saved acro ss runs (see
FDB_IN I T) it is po ssible that streams m ay be in progr ess that are n o lo nger valid. Th ese st reams m ay be
flushed out by retu r nin g F D B$ _C LO SE for th es e st re ams d ur in g th e in it ial calls to F D B _G ET u n til a ll su ch
streams have been closed .
10.1.3.4 FDB_GET_CONTEXT
This is a function which retu rn s th e user con text as sociated with a given dat abase st ream. T his con text mu st
have been previously saved with FDB_SAVE_CONTEXT. This function would normally be used if
program context is being saved across runs (see FDB_INIT.) It may also be used if context is not being saved
as a convenient way of keeping tr ack of mult iple streams. Gen erally the user con text f or a stream is s aved
after processing a lookup request. Then before processing the next lookup request, it may be retrieved with
this function.
Calling Sequen ce:
FDB_GET_CONTE XT stream_id, context [, max_size [, size]]
Arguments
name: stream_id
type: longword signed
access: read only
mec han ism : by re f eren ce
The identifier of t h e stream for which co ntext is to be retr ieved.
name: context
type: userdefined
access: write only
mec han ism : by re f eren ce