[Bro-Dev] [JIRA] (BIT-1107) Documentation of BIFs that take variable number of arguments

Robin Sommer (JIRA) jira at bro-tracker.atlassian.net
Fri Dec 6 09:33:45 PST 2013

    [ https://bro-tracker.atlassian.net/browse/BIT-1107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14918#comment-14918 ] 

Robin Sommer commented on BIT-1107:

The work-around of turning va_args function arguments into {{(...)}}}, along with a  manual textual description of how the parameters are supposed to look like in each case, would sound good to me.

Btw, I believe this is how Bro recognizes va_args functions: 

int check_and_promote_exprs(ListExpr*& elements, TypeList* types)
    if ( tl->length() == 1 && (*tl)[0]->Tag() == TYPE_ANY )
        return 1;

Would be nicer to have  some more explicit way some time.

> Documentation of BIFs that take variable number of arguments
> ------------------------------------------------------------
>                 Key: BIT-1107
>                 URL: https://bro-tracker.atlassian.net/browse/BIT-1107
>             Project: Bro Issue Tracker
>          Issue Type: Problem
>          Components: Bro
>            Reporter: Daniel Thayer
> The function prototype for BIFs that take a variable number of 
> arguments appears in an altered form in the online documentation.
> Here is a comparison of how these functions appear in the source code, 
> versus what they look like in the online documentation:
> md5_hash%(...%)  ===>  Type : function (va_args: any)
> order%(v: any, ...%)  ===>  Type : function (va_args: any)
> sort%(v: any, ...%)  ===>  Type : function (va_args: any)
> cat_sep%(sep: string, def: string, ...%)  ===>  Type :  function (va_args: any)
> The functions that have a named argument ("v" in sort, or "sep" in cat_sep)
> have those arguments described in the online documentation, but we
> cannot see them in the function prototype (only "va_args" is shown, 
> which isn't actually the name of any function argument).

This message was sent by Atlassian JIRA

More information about the bro-dev mailing list