mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 08:46:45 +00:00
Add an nseU_opttarget function.
This commit is contained in:
parent
d319f8bf56
commit
9b28bc8ed5
2 changed files with 20 additions and 0 deletions
|
|
@ -121,6 +121,17 @@ void nseU_checktarget (lua_State *L, int idx, const char **address, const char *
|
|||
}
|
||||
}
|
||||
|
||||
void nseU_opttarget (lua_State *L, int idx, const char **address, const char **targetname)
|
||||
{
|
||||
if (lua_isnoneornil(L, idx)) {
|
||||
*address = NULL;
|
||||
*targetname = NULL;
|
||||
return;
|
||||
} else {
|
||||
return nseU_checktarget(L, idx, address, targetname);
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t nseU_checkport (lua_State *L, int idx, const char **protocol)
|
||||
{
|
||||
uint16_t port;
|
||||
|
|
|
|||
|
|
@ -108,6 +108,15 @@ void *nseU_checkudata (lua_State *L, int idx, int upvalue, const char *name);
|
|||
*/
|
||||
void nseU_checktarget (lua_State *L, int idx, const char **address, const char **targetname);
|
||||
|
||||
/* void nseU_opttarget (lua_State *L, int idx, [-0, +0, v]
|
||||
* const char **address,
|
||||
* const char **targetname)
|
||||
*
|
||||
* Like nseU_checktarget, but sets *address and *targetname to NULL and returns
|
||||
* success if the argument at idx is none or nil.
|
||||
*/
|
||||
void nseU_opttarget (lua_State *L, int idx, const char **address, const char **targetname);
|
||||
|
||||
/* uint16_t nseU_checkport (lua_State *L, int idx, [-0, +0, v]
|
||||
* const char **protocol)
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue