1megaco_flex_scanner(3)     Erlang Module Definition     megaco_flex_scanner(3)
2
3
4

NAME

6       megaco_flex_scanner  -  Interface  module to the flex scanner linked in
7       driver.
8

DESCRIPTION

10       This module contains the public interface to the flex scanner linked in
11       driver.  The  flex  scanner performs the scanning phase of text message
12       decoding.
13
14       The flex scanner is written using a tool called flex. In  order  to  be
15       able to compile the flex scanner driver, this tool has to be available.
16
17       By default the flex scanner reports line-number of an error. But it can
18       be built without line-number reporting. Instead token number  is  used.
19       This  will speed up the scanning some 5-10%. Use --disable-megaco-flex-
20       scanner-lineno when configuring the application.
21
22       The scanner will, by default, be built as a reentrant  scanner  if  the
23       flex  utility  supports this (it depends on the version of flex). It is
24       possible to explicitly disable this even when flex  support  this.  Use
25       --disable-megaco-reentrant-flex-scanner  when  configuring the applica‐
26       tion.
27

DATA TYPES

29       megaco_ports() = term()
30       megaco_version() = integer() >= 1
31
32
33

EXPORTS

35       start() -> {ok, PortOrPorts} | {error, Reason}
36
37              Types:
38
39                 PortOrPorts = megaco_ports()
40                 Reason = term()
41
42              This function is used to start the flex scanner. It locates  the
43              library and loads the linked in driver.
44
45              On  a  single  core system or if it's a non-reentrant scanner, a
46              single port is created. On a multi-core system with a  reentrant
47              scanner, several ports will be created (one for each scheduler).
48
49              Note  that  the  process that calls this function must be perma‐
50              nent. If it dies, the port(s) will exit and the driver unload.
51
52       stop(PortOrPorts) -> stopped
53
54              Types:
55
56                 PortOrPorts = megaco_ports()
57
58              This function is used to stop the flex scanner. It also  unloads
59              the driver.
60
61       is_reentrant_enabled() -> Boolean
62
63              Types:
64
65                 Boolean = boolean()
66
67              Is the flex scanner reentrant or not.
68
69       is_scanner_port(Port, PortOrPorts) -> Boolean
70
71              Types:
72
73                 Port = port()
74                 PortOrPorts = megaco_ports()
75                 Boolean = boolean()
76
77              Checks if a port is a flex scanner port or not (useful when if a
78              port exits).
79
80       scan(Binary, PortOrPorts) -> {ok, Tokens, Version, LatestLine}  |  {er‐
81       ror, Reason, LatestLine}
82
83              Types:
84
85                 Binary = binary()
86                 PortOrPorts = megaco_ports()
87                 Tokens = list()
88                 Version = megaco_version()
89                 LatestLine = integer()
90                 Reason = term()
91
92              Scans  a  megaco message and generates a token list to be passed
93              on the parser.
94
95
96
97Ericsson AB                       megaco 4.3            megaco_flex_scanner(3)
Impressum