| N F O _ S C A N M L ( )
| | | | | SOURCE: qdev_autodocs.txt 1.163 (12/09/2014) English
PORTA - NFO_#?
----------------------------------------------------------------------------
NAME
nfo_scanml() - Allows to scan and inspect Mountlist
entries.
SYNOPSIS
res = nfo_scanml(buflen, file, fd, termsig, pattern,
defde, userdata,
usercode);
LONG nfo_scanml(LONG, UBYTE *, LONG, ULONG, UBYTE *,
struct DosEnvec *, void *,
LONG (*)(struct nfo_sml_cb *));
FUNCTION
This function allows to scan and inspect Ml. entries.
Mountlist args will be put into logical vars as found in
the callback structure. Each callback call will be done
as soon as new device entry will be encountered or upon
EOF.
INPUTS
buflen - How long one line can be(in bytes). See src.
code of 'a-mem_scanlbl.c' for absolute min.
file - Mountlist file name(this is just to skip name
from lock extraction, so this function can
also work with emulated file descriptors).
fd - File descriptor as obtained with 'Open()'.
termsig - Additional termination signal.
pattern - AmigaOS pattern syntax to include or exclude
some devices. Passing NULL or "#?" means list
all devices. Devices must not be suffixized
with the colon ':' . If you need to preset
the 'sd_dosdevice' in the CB then stuff '\e'
(ESC character) as a first byte and append
the handler name, like '\eMYDEVICE'.
defde - Default 'DosEnvec' that will be set per entry
before filling it with the data obtained from
file. Can be NULL so all the members will be
0.
userdata - User variable.
usercode - User callback.
RETURNS
Function may -2 if there was an error, -1 if cb didnt
terminate iterator(not an error, it means file was read
until EOF), and 0 and up if user requested term. of the
call.
BASES
SysBase, (DOSBase)
NOTES
Important! Following callback members: 'sc_sd.sd_unit',
'sc_sd.sd_flags' & 'sc_sd.sd_startup' are of mixed type!
They can hold either string or integer! If the first byte
is 0 then integer value should be inspected at bytes 1 to
4, like this: '*((LONG *)&sc->sc_sd.sd_unit[1])' .
Please note, every string you read from the callback must
be copied before passing somewhere else! Do not adapt raw
'sc', copy it with 'mem_copysmlcb()' first!
It also informs about the errors in the 'sd_errors'('\n'
separated keys who have broken data).
This func. uses 'mem_scanlblncc()' to filter out C style
comments, so 0 in return is considered "comments in bad
shape"!!!
SEE ALSO
nfo_grepml(), mem_copysmlcb(), mem_freesmlcb()
EXAMPLE
None.
BUGS
None known.
----------------------------------------------------------------------------
| |
| |