| N F O _ G R E P M L ( )
| | | | | SOURCE: qdev_autodocs.txt 1.163 (12/09/2014) English
AMIGA - NFO_#?
----------------------------------------------------------------------------
NAME
nfo_grepml() - Allows to scan and inspect Mountlist
entries.
SYNOPSIS
res = nfo_grepml(buflen, file, fd, termsig, pattern,
range, userdata,
usercode);
LONG nfo_grepml(LONG, UBYTE *, LONG, ULONG, UBYTE *,
LONG, void *,
LONG (*)(struct nfo_sml_cb *));
FUNCTION
This function is 'nfo_scanml()' wrapper with the addition
of ability to determine if Mountlist entry is a filesystem
and if it can be considered valid before mounting.
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 suffixed
with the colon ':' .
range - Range that certain filesystem must not exceed.
Values must be expressed in gigabytes. Passing
neg. values, like -4 for instance will impose
4 gigs boundary, and also will enforce magic
checks against physical medium to make sure it
does not end unexpectedly(incl. 64bit command
tests). Passing 0 wont impose any limitations
and passing positive value will enforce checks
for the range only(no medium tests).
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"!!!
This function sets 'sc_gerror' in the callback struct.,
thus you have to look in there to determine what happend!
See header file for error codes.
SEE ALSO
nfo_scanml(), mem_copysmlcb(), mem_freesmlcb()
EXAMPLE
None.
BUGS
None known.
----------------------------------------------------------------------------
| |
| |