mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Add an nseU_opttarget function.
This commit is contained in:
@@ -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)
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user