megaco_flex_scanner(3erl)
π NAME π
Hey bestie, megaco_flex_scanner is the interface module to the flex scanner linked in driver. This page lives in the Erlang Module Definition manual, and the page title is megaco_flex_scanner(3erl) β yes, that one π
β¨.
πΈ DESCRIPTION πΈ
okay so this module contains the public interface to the flex scanner linked in driver. The flex scanner performs the scanning phase of text message decoding. Iconic scanning behavior, honestly π¦.
The flex scanner is written using a tool called flex. In order to be able to compile the flex scanner driver, this tool has to be available. No flex, no driver, periodt π«Ά.
By default the flex scanner reports line-number of an error. But it can be built without line-number reporting. Instead token number is used. This will speed up the scanning some 5-10%. Use --disable-megaco-flex-scanner-lineno when configuring the application. That's the whole flag, no cap π.
The scanner will, by default, be built as a reentrant scanner if the flex utility supports this (it depends on the version of flex). It is possible to explicitly disable this even when flex supports this. Use --disable-megaco-reentrant-flex-scanner when configuring the application. Opt-out rights, secured π
.
𧬠DATA TYPES π§¬
These are the types hanging out in this module:
megaco_ports() = term()
megaco_version() = integer() >= 1
π EXPORTS π
β¨ start() -> {ok, PortOrPorts} | {error, Reason} β¨
Types:
PortOrPorts = megaco_ports()
Reason = term()
This function is used to start the flex scanner. It locates the library and loads the linked in driver. Go off, scanner π₯.
On a single core system or if it's a non-reentrant scanner, a single port is created. On a multi-core system with a reentrant scanner, several ports will be created (one for each scheduler). Parallel port energy π.
β οΈ Note that the process that calls this function must be permanent. If it dies, the port(s) will exit and the driver unload. That's a big deal, bestie β keep that process alive π.
β¨ stop(PortOrPorts) -> stopped β¨
Types:
PortOrPorts = megaco_ports()
This function is used to stop the flex scanner. It also unloads the driver. Clean exit, no mess π§Ή.
β¨ is_reentrant_enabled() -> Boolean β¨
Types:
Boolean = boolean()
Is the flex scanner reentrant or not. That's the vibe check π.
β¨ is_scanner_port(Port, PortOrPorts) -> Boolean β¨
Types:
Port = port()
PortOrPorts = megaco_ports()
Boolean = boolean()
Checks if a port is a flex scanner port or not (useful when if a port exits). Yes, "when if" β we said what we said π.
β¨ scan(Binary, PortOrPorts) -> {ok, Tokens, Version, LatestLine} | {error, Reason, LatestLine} β¨
Types:
Binary = binary()
PortOrPorts = megaco_ports()
Tokens = list()
Version = megaco_version()
LatestLine = integer()
Reason = term()
Scans a megaco message and generates a token list to be passed on the parser. Token list delivery service, at your service π.
Catch you later β the footer energy is Ericsson AB, megaco 4.4.3, and the page is megaco_flex_scanner(3erl); no separate date is listed. Bye bestie, go scan something cute π
β¨π¦.
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms