OpenVAS Scanner  21.4.1
Functions
nasl_isotime.h File Reference

Protos and data structures for ISOTIME functions used by NASL scripts. More...

#include "nasl_lex_ctxt.h"

Go to the source code of this file.

Functions

tree_cellnasl_isotime_now (lex_ctxt *lexic)
 Return the current time in ISO format. More...
 
tree_cellnasl_isotime_is_valid (lex_ctxt *lexic)
 Check whether an ISO time string is valid. More...
 
tree_cellnasl_isotime_scan (lex_ctxt *lexic)
 Convert a string into an ISO time string. More...
 
tree_cellnasl_isotime_print (lex_ctxt *lexic)
 Convert an SIO time string into a better readable string. More...
 
tree_cellnasl_isotime_add (lex_ctxt *lexic)
 Add days or seconds to an ISO time string. More...
 

Detailed Description

Protos and data structures for ISOTIME functions used by NASL scripts.

This file contains the protos for nasl_isotime.c

Function Documentation

◆ nasl_isotime_add()

tree_cell* nasl_isotime_add ( lex_ctxt lexic)

Add days or seconds to an ISO time string.

NASL Function: isotime_add\n

This function adds days or seconds to an ISO time string and returns the resulting time string. The number of days or seconds are given using the named parameters; if none are given nothing is added; if both are given both additions are performed. This function won't work for dates before the Gregorian calendar switch.

NASL Unnamed Parameters:\n
  • An ISO time string
NASL Named Parameters:\n
  • years An integer with the number of years to add to the timestamp.
  • days An integer with the number of days to add to the timestamp.
  • seconds An integer with the number of seconds to add to the timestamp.
NASL Returns:\n The resulting ISO time string or NULL if the provided ISO
time string is not valid or the result would overflow (i.e. year > 9999).
Parameters
[in]lexicLexical context of the NASL interpreter.
Returns
A tree cell.

◆ nasl_isotime_is_valid()

tree_cell* nasl_isotime_is_valid ( lex_ctxt lexic)

Check whether an ISO time string is valid.

NASL Function: isotime_is_valid\n
NASL Unnamed Parameters:\n
  • A string. Both, the standard 15 byte string and the better human readable up to 19 byte format are accepted here. If a plain data type is is provided only the 15 byte format is accepted.
NASL Returns:\n True is this is an ISO string; false if not.
Parameters
[in]lexicLexical context of the NASL interpreter.
Returns
A tree cell.

◆ nasl_isotime_now()

tree_cell* nasl_isotime_now ( lex_ctxt lexic)

Return the current time in ISO format.

NASL Function: isotime_now\n
NASL Unnamed Parameters:\n
  • None
NASL Returns:\n A string with the ISO time. If the current time is not
available an empty string is returned.
Parameters
[in]lexicLexical context of the NASL interpreter.
Returns
A tree cell.

◆ nasl_isotime_print()

tree_cell* nasl_isotime_print ( lex_ctxt lexic)

Convert an SIO time string into a better readable string.

NASL Function: isotime_print\n
NASL Unnamed Parameters:\n
  • An ISO time string.
NASL Returns:\n A string in the format "YYYY-MM-DD HH:MM:SS" or "[none]"
if the provided time string is not valid.
Parameters
[in]lexicLexical context of the NASL interpreter.
Returns
A tree cell.

◆ nasl_isotime_scan()

tree_cell* nasl_isotime_scan ( lex_ctxt lexic)

Convert a string into an ISO time string.

NASL Function: isotime_scan\n
NASL Unnamed Parameters:\n
  • A string
NASL Returns:\n A ISO time string on success or NULL on error.
Parameters
[in]lexicLexical context of the NASL interpreter.
Returns
A tree cell.