Skip to content

Commit e098445

Browse files
committed
docs: add the yrx_scanner_on_console_log to the documentation.
1 parent e883f6b commit e098445

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

  • site/content/docs/api

site/content/docs/api/c.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,19 @@ about matching rules.
658658

659659
See [YRX_ON_MATCHING_RULE](#yrx_on_matching_rule) for more details.
660660

661+
#### yrx_scanner_on_console_log
662+
663+
```c
664+
enum YRX_RESULT yrx_scanner_on_console_log(
665+
struct YRX_SCANNER *scanner,
666+
YRX_CONSOLE_CALLBACK callback);
667+
```
668+
669+
Sets a callback function that is called for each message produced in a
670+
rule with the `console.log()` function.
671+
672+
See [YRX_CONSOLE_CALLBACK](#yrx_on_matching_rule) for more details.
673+
661674
#### yrx_scanner_scan
662675
663676
```c
@@ -1128,6 +1141,21 @@ typedef enum YRX_RESULT {
11281141
} YRX_RESULT;
11291142
```
11301143

1144+
### YRX_CONSOLE_CALLBACK
1145+
1146+
```c
1147+
typedef void (*YRX_CONSOLE_CALLBACK)(
1148+
const char *message);
1149+
```
1150+
1151+
Callback function passed to [yrx_scanner_on_console_log](#yrx_scanner_on_console_log).
1152+
1153+
The callback is invoked every time a rule uses the `console.log(..)` function, and
1154+
receives a pointer to the message being logged.This pointer is guaranteed to be valid
1155+
while the callback function is being executed, but it may be freed after the callback
1156+
function returns, so you cannot use the pointer outside the callback.
1157+
1158+
11311159
### YRX_RULE_CALLBACK
11321160
11331161
```c

0 commit comments

Comments
 (0)