| M O D _ F I N D K T P R E S B Y ( )
| | | | | SOURCE: qdev_autodocs.txt 1.163 (12/09/2014) English
AMIGA - MOD_#?
----------------------------------------------------------------------------
NAME
mod_findktpresby() - Finds 'KickTagPtr' linked module in
one of six ways.
SYNOPSIS
rt = mod_findktpresby(mode, ptr);
struct Resident *mod_findktpresby(LONG, UBYTE *);
FUNCTION
This function is able to find 'KickTagPtr' module by: its
version or name or idstring or data pointer or type or by
doing compare on data.
INPUTS
mode - Searching mode, see header file for defines. If you
pass positive value(data length) here then you have
to pass a pointer to this much data as well.
ptr - Pointer to either NULL term. string or value as
a pointer in case of version or type.
RETURNS
Returns standard 'Resident' structure or NULL if it was
unable to find anything.
BASES
SysBase, (DOSBase)
NOTES
When searching for mod. name or idstring standard AmigaDOS
patterns can be used. Searching is case in-sensitive.
Data compare is being done against 'rt->rt_Init' and its
size is being determined by subtracting it from
'rt->rt_EndSkip', so it may not always be what you want
if certain module has more than one 'MemEntry'! Also, data
compare is case sensitive!
SEE ALSO
EXAMPLE
...
/*
* Value below is: moveq #MEMF_PUBLIC!MEMF_FAST,d1
* moveq #10,d2
*/
#define MYCODESEQ 0x7205740A
struct Resident *rt;
ULONG codeseq = MYCODESEQ;
Forbid();
/*
* Search for a module that has a ver. of 44.
*/
if ((rt = mod_findktpresby(QDEV_MOD_FSB_ME_VER,
(UBYTE *)44)))
{
...
}
/*
* Search for a module with this date.
*/
if ((rt = mod_findktpresby(QDEV_MOD_FSB_ME_IDSTR,
"#?5.6.96#?")))
{
...
}
/*
* Search for a module that contains this code
* sequence. It need not to be code, it can be
* text as well.
*/
if ((rt = mod_findktpresby(sizeof(codeseq),
(UBYTE *)&codeseq)))
{
...
}
Permit();
BUGS
None known.
----------------------------------------------------------------------------
| |
| |