~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to lib/megaco/doc/src/megaco_flex_scanner.xml

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-08-05 20:54:29 UTC
  • mfrom: (6.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090805205429-pm4pnwew8axraosl
Tags: 1:13.b.1-dfsg-5
* Fixed parentheses in Emacs mode (closes: #536891).
* Removed unnecessary conflicts with erlang-manpages package.
* Added workaround for #475459: disabled threads on sparc architecture.
  This breaks wxErlang, so it's only a temporary solution.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    <docno></docno>
28
28
    <approved>Micael Karlberg</approved>
29
29
    <checked></checked>
30
 
    <date>2007-06-15</date>
 
30
    <date>2009-05-04</date>
31
31
    <rev>%VSN%</rev>
32
32
    <file>megaco_flex_scanner.xml</file>
33
33
  </header>
37
37
    <p>This module contains the public interface to the flex scanner 
38
38
      linked in driver. The flex scanner performs the scanning phase
39
39
      of text message decoding.</p>
 
40
 
40
41
    <p>The flex scanner is written using a tool called <em>flex</em>. 
41
42
      In order to be able to compile the flex scanner driver, this
42
43
      tool has to be available. </p>
 
44
 
43
45
    <p>By default the flex scanner reports line-number of an error.
44
46
      But it can be built without line-number reporting. Instead
45
47
      token number is used. This will speed up the scanning some
46
48
      5-10%. Use <c><![CDATA[--disable-megaco-flex-scanner-lineno]]></c> when
47
49
      configuring the application.</p>
 
50
 
 
51
    <p>The scanner will, by default, be built as a reentrant scanner <em>if</em> the 
 
52
      flex utility supports this (it depends on the version of flex). 
 
53
      It is possible to explicitly disable this even when flex support this.
 
54
      Use <c><![CDATA[--disable-megaco-reentrant-flex-scanner]]></c> when
 
55
      configuring the application.</p>
 
56
 
48
57
  </description>
 
58
 
 
59
  <section>
 
60
    <title>DATA TYPES</title>
 
61
    <code type="none"><![CDATA[
 
62
 
 
63
megaco_ports() = term()
 
64
megaco_version() = integer() >= 1
 
65
 
 
66
    ]]></code>
 
67
 
 
68
    <marker id="start"></marker>
 
69
  </section>
 
70
 
 
71
 
49
72
  <funcs>
50
73
    <func>
51
 
      <name>start() -> {ok, Port} | {error, Reason}</name>
 
74
      <name>start() -> {ok, PortOrPorts} | {error, Reason}</name>
52
75
      <fsummary></fsummary>
53
76
      <type>
54
 
        <v>Port = port()</v>
 
77
        <v>PortOrPorts = megaco_ports()</v>
55
78
        <v>Reason = term()</v>
56
79
      </type>
57
80
      <desc>
58
81
        <p>This function is used to start the flex scanner. 
59
82
          It locates the library and loads the linked in driver.</p>
 
83
 
 
84
        <p>On a single core system or if it's a non-reentrant scanner,
 
85
          a single port is created. On a multi-core system with a reentrant 
 
86
          scanner, several ports will be created (one for each scheduler). </p>
 
87
 
60
88
        <p>Note that the process that calls this function <em>must</em> 
61
 
          be permament. If it dies, the port will exit and the driver unload.</p>
62
 
      </desc>
63
 
    </func>
 
89
          be permament. If it dies, the port(s) will exit and the driver unload.</p>
 
90
 
 
91
        <marker id="stop"></marker>
 
92
      </desc>
 
93
    </func>
 
94
 
 
95
    <func>
 
96
      <name>stop(PortOrPorts) -> stopped</name>
 
97
      <fsummary></fsummary>
 
98
      <type>
 
99
        <v>PortOrPorts = megaco_ports()</v>
 
100
      </type>
 
101
      <desc>
 
102
        <p>This function is used to stop the flex scanner. It also
 
103
          unloads the driver.</p>
 
104
 
 
105
        <marker id="is_reentrant_enabled"></marker>
 
106
      </desc>
 
107
    </func>
 
108
 
 
109
    <func>
 
110
      <name>is_reentrant_enabled() -> Boolean</name>
 
111
      <fsummary></fsummary>
 
112
      <type>
 
113
        <v>Boolean = boolean()</v>
 
114
      </type>
 
115
      <desc>
 
116
        <p>Is the flex scanner reentrant or not.</p>
 
117
 
 
118
        <marker id="is_scanner_port"></marker>
 
119
      </desc>
 
120
    </func>
 
121
 
 
122
    <func>
 
123
      <name>is_scanner_port(Port, PortOrPorts) -> Boolean</name>
 
124
      <fsummary></fsummary>
 
125
      <type>
 
126
        <v>Port = port()</v>
 
127
        <v>PortOrPorts = megaco_ports()</v>
 
128
        <v>Boolean = boolean()</v>
 
129
      </type>
 
130
      <desc>
 
131
        <p>Checks if a port is a flex scanner port or not (usefull when 
 
132
          if a port exits). </p>
 
133
 
 
134
        <marker id="scan"></marker>
 
135
      </desc>
 
136
    </func>
 
137
 
 
138
    <func>
 
139
      <name>scan(Binary, PortOrPorts) -> {ok, Tokens, Version, LatestLine} | {error, Reason, LatestLine} </name>
 
140
      <fsummary></fsummary>
 
141
      <type>
 
142
        <v>Binary = binary()</v>
 
143
        <v>PortOrPorts = megaco_ports()</v>
 
144
        <v>Tokens = list()</v>
 
145
        <v>Version = megaco_version()</v>
 
146
        <v>LatestLine = integer()</v>
 
147
        <v>Reason = term()</v>
 
148
      </type>
 
149
      <desc>
 
150
        <p>Scans a megaco message and generates a token list to be passed on the parser. </p>
 
151
      </desc>
 
152
    </func>
 
153
 
64
154
  </funcs>
65
155
 
66
156
</erlref>