Before

…lines 1–26 unchanged (26 lines)
27 {
28 m_play = false;
29 AddHelpCommand();
30 AddCommand("Clear", static_cast<CModCommand::ModCmdFunc>(&CPlaybackMod::ClearCommand), "<buffer(s)>", "Clears playback for given buffers.");
31 AddCommand("Play", static_cast<CModCommand::ModCmdFunc>(&CPlaybackMod::PlayCommand), "<buffer(s)> [from] [to]", "Sends playback for given buffers.");
32 AddCommand("List", static_cast<CModCommand::ModCmdFunc>(&CPlaybackMod::ListCommand), "[buffer(s)]", "Lists available/matching buffers.");
33 }
34
35 void OnClientCapLs(CClient* client, SCString& caps) override
36 {
37 caps.insert(PlaybackCap);
38 caps.insert(EchoMessageCap);
39 }
…lines 40–91 unchanged (52 lines)
92 if (arg.empty() || !line.Token(4).empty())
93 return;
94 double from = line.Token(2).ToDouble();
95 double to = DBL_MAX;
96 if (!line.Token(3).empty())
97 to = line.Token(3).ToDouble();
98 std::vector<CChan*> chans = FindChans(arg);
99 for (CChan* chan : chans) {
100 if (chan->IsOn() && !chan->IsDetached()) {
101 CBuffer lines = GetLines(chan->GetBuffer(), from, to);
102 m_play = true;
103 chan->SendBuffer(GetClient(), lines);
104 m_play = false;
105 }
106 }
107 std::vector<CQuery*> queries = FindQueries(arg);
108 for (CQuery* query : queries) {
109 CBuffer lines = GetLines(query->GetBuffer(), from, to);
110 m_play = true;
111 query->SendBuffer(GetClient(), lines);
112 m_play = false;
113 }
114 }
115
…lines 116–136 unchanged (21 lines)
137 timeval from = UniversalTime(buffer.GetBufLine(0).GetTime());
138 timeval to = UniversalTime(buffer.GetBufLine(buffer.Size() - 1).GetTime());
139 PutModule(query->GetName() + " " + CString(Timestamp(from)) + " " + CString(Timestamp(to)));
140 }
141 }
142 }
143
144 EModRet OnSendToClient(CString& line, CClient& client) override
145 {
146 if (client.IsAttached() && client.IsCapEnabled(PlaybackCap) && !line.Token(0).Equals("CAP")) {
147 MCString tags = CUtils::GetMessageTags(line);
148 if (tags.find("time") == tags.end()) {
149 // CUtils::FormatServerTime() converts to UTC
…lines 150–245 unchanged (96 lines)
246 std::vector<CQuery*> found = network->FindQueries(name);
247 queries.insert(queries.end(), found.begin(), found.end());
248 }
249 }
250 return queries;
251 }
252
253 static CBuffer GetLines(const CBuffer& buffer, double from, double to)
254 {
255 CBuffer lines(buffer.Size());
256 for (size_t i = 0; i < buffer.Size(); ++i) {
257 const CBufLine& line = buffer.GetBufLine(i);
258 timeval tv = UniversalTime(line.GetTime());
259 if (from < Timestamp(tv) && to >= Timestamp(tv))
260 lines.AddLine(line.GetFormat(), line.GetText(), &tv);
261 }
262 return lines;
263 }
264
265 bool m_play;
266};
267
268GLOBALMODULEDEFS(CPlaybackMod, "An advanced playback module for ZNC")
269

After

…lines 1–26 unchanged (26 lines)
27 {
28 m_play = false;
29 AddHelpCommand();
30 AddCommand("Clear", static_cast<CModCommand::ModCmdFunc>(&CPlaybackMod::ClearCommand), "<buffer(s)>", "Clears playback for given buffers.");
31 AddCommand("Play", static_cast<CModCommand::ModCmdFunc>(&CPlaybackMod::PlayCommand), "<buffer(s)> [from] [to]", "Sends playback for given buffers.");
32 AddCommand("List", static_cast<CModCommand::ModCmdFunc>(&CPlaybackMod::ListCommand), "[buffer(s)]", "Lists available/matching buffers.");
33 AddCommand("Limit", static_cast<CModCommand::ModCmdFunc>(&CPlaybackMod::LimitCommand), "<client> [limit]", "Get/set the buffer limit (<= 0 to clear) for the given client.");
34 }
35
36 void OnClientCapLs(CClient* client, SCString& caps) override
37 {
38 caps.insert(PlaybackCap);
39 caps.insert(EchoMessageCap);
…lines 40–92 unchanged (53 lines)
93 if (arg.empty() || !line.Token(4).empty())
94 return;
95 double from = line.Token(2).ToDouble();
96 double to = DBL_MAX;
97 if (!line.Token(3).empty())
98 to = line.Token(3).ToDouble();
99 int limit = -1;
100 if (CClient* client = GetClient())
101 limit = GetLimit(client->GetIdentifier());
102 std::vector<CChan*> chans = FindChans(arg);
103 for (CChan* chan : chans) {
104 if (chan->IsOn() && !chan->IsDetached()) {
105 CBuffer lines = GetLines(chan->GetBuffer(), from, to, limit);
106 m_play = true;
107 chan->SendBuffer(GetClient(), lines);
108 m_play = false;
109 }
110 }
111 std::vector<CQuery*> queries = FindQueries(arg);
112 for (CQuery* query : queries) {
113 CBuffer lines = GetLines(query->GetBuffer(), from, to, limit);
114 m_play = true;
115 query->SendBuffer(GetClient(), lines);
116 m_play = false;
117 }
118 }
119
…lines 120–141 unchanged (22 lines)
142 timeval to = UniversalTime(buffer.GetBufLine(buffer.Size() - 1).GetTime());
143 PutModule(query->GetName() + " " + CString(Timestamp(from)) + " " + CString(Timestamp(to)));
144 }
145 }
146 }
147
148 void LimitCommand(const CString& line)
149 {
150 // LIMIT <client> [limit]
151 const CString client = line.Token(1);
152 if (client.empty()) {
153 PutModule("Usage: LIMIT <client> [limit]");
154 return;
155 }
156 const CString arg = line.Token(2);
157 int limit = GetLimit(client);
158 if (!arg.empty()) {
159 limit = arg.ToInt();
160 SetLimit(client, limit);
161 }
162 if (limit <= 0)
163 PutModule(client + " buffer limit: -");
164 else
165 PutModule(client + " buffer limit: " + CString(limit));
166 }
167
168 EModRet OnSendToClient(CString& line, CClient& client) override
169 {
170 if (client.IsAttached() && client.IsCapEnabled(PlaybackCap) && !line.Token(0).Equals("CAP")) {
171 MCString tags = CUtils::GetMessageTags(line);
172 if (tags.find("time") == tags.end()) {
…lines 173–270 unchanged (98 lines)
271 queries.insert(queries.end(), found.begin(), found.end());
272 }
273 }
274 return queries;
275 }
276
277 int GetLimit(const CString& client) const
278 {
279 return GetNV(client).ToInt();
280 }
281
282 void SetLimit(const CString& client, int limit)
283 {
284 if (limit > 0)
285 SetNV(client, CString(limit));
286 else
287 DelNV(client);
288 }
289
290 static CBuffer GetLines(const CBuffer& buffer, double from, double to, int limit)
291 {
292 CBuffer lines(buffer.Size());
293 for (size_t i = 0; i < buffer.Size(); ++i) {
294 const CBufLine& line = buffer.GetBufLine(i);
295 timeval tv = UniversalTime(line.GetTime());
296 if (from < Timestamp(tv) && to >= Timestamp(tv))
297 lines.AddLine(line.GetFormat(), line.GetText(), &tv);
298 }
299 if (limit > 0)
300 lines.SetLineCount(limit);
301 return lines;
302 }
303
304 bool m_play;
305};
306
307GLOBALMODULEDEFS(CPlaybackMod, "An advanced playback module for ZNC")
308

Before

translation_unit
comment "/*\n * Copyright (C) 2004-2014 See the AUTHORS file for deta"...
preproc_include
#include "#include"
system_lib_string "<znc/Modules.h>"
preproc_include
#include "#include"
system_lib_string "<znc/IRCNetwork.h>"
preproc_include
#include "#include"
system_lib_string "<znc/Client.h>"
preproc_include
#include "#include"
system_lib_string "<znc/Buffer.h>"
preproc_include
#include "#include"
system_lib_string "<znc/Utils.h>"
preproc_include
#include "#include"
system_lib_string "<znc/Query.h>"
preproc_include
#include "#include"
system_lib_string "<znc/Chan.h>"
preproc_include
#include "#include"
system_lib_string "<znc/znc.h>"
preproc_include
#include "#include"
system_lib_string "<sys/time.h>"
preproc_include
#include "#include"
system_lib_string "<cfloat>"
declaration
storage_class_specifier
static "static"
type_qualifier
const "const"
primitive_type "char"
init_declarator
pointer_declarator
* "*"
identifier "PlaybackCap"
= "="
string_literal
" "\""
string_content "znc.in/playback"
" "\""
; ";"
declaration
storage_class_specifier
static "static"
type_qualifier
const "const"
primitive_type "char"
init_declarator
pointer_declarator
* "*"
identifier "EchoMessageCap"
= "="
string_literal
" "\""
string_content "znc.in/echo-message"
" "\""
; ";"
class_specifier
class "class"
type_identifier "CPlaybackMod"
base_class_clause
: ":"
access_specifier
public "public"
type_identifier "CModule"
field_declaration_list
{ "{"
access_specifier
public "public"
: ":"
function_definition
function_declarator
identifier "MODCONSTRUCTOR"
parameter_list
( "("
parameter_declaration
type_identifier "CPlaybackMod"
) ")"
compound_statement
{ "{"
expression_statement
assignment_expression
identifier "m_play"
= "="
false "false"
; ";"
expression_statement
call_expression
identifier "AddHelpCommand"
argument_list
( "("
) ")"
; ";"
expression_statement (+42 nodes collapsed)
expression_statement (+42 nodes collapsed)
expression_statement (+42 nodes collapsed)
} "}"
function_definition (+45 nodes collapsed)
function_definition (+52 nodes collapsed)
function_definition (+50 nodes collapsed)
function_definition (+56 nodes collapsed)
function_definition (+50 nodes collapsed)
function_definition (+50 nodes collapsed)
function_definition (+157 nodes collapsed)
function_definition
primitive_type "void"
function_declarator
field_identifier "PlayCommand"
parameter_list
( "("
parameter_declaration
type_qualifier
const "const"
type_identifier "CString"
reference_declarator
& "&"
identifier "line"
) ")"
compound_statement
{ "{"
comment "// PLAY <buffer(s)> [from] [to]"
declaration
type_qualifier
const "const"
type_identifier "CString"
init_declarator
identifier "arg"
= "="
call_expression
field_expression
identifier "line"
. "."
field_identifier "Token"
argument_list
( "("
number_literal "1"
) ")"
; ";"
if_statement (+36 nodes collapsed)
declaration (+22 nodes collapsed)
declaration
primitive_type "double"
init_declarator
identifier "to"
= "="
identifier "DBL_MAX"
; ";"
if_statement (+44 nodes collapsed)
declaration (+23 nodes collapsed)
for_range_loop
for "for"
( "("
type_identifier "CChan"
pointer_declarator
* "*"
identifier "chan"
: ":"
identifier "chans"
) ")"
compound_statement
{ "{"
if_statement
if "if"
condition_clause (+23 nodes collapsed)
compound_statement
{ "{"
declaration
type_identifier "CBuffer"
init_declarator
identifier "lines"
= "="
call_expression
identifier "GetLines"
argument_list
( "("
call_expression
field_expression
identifier "chan"
-> "->"
field_identifier "GetBuffer"
argument_list
( "("
) ")"
, ","
identifier "from"
, ","
identifier "to"
) ")"
; ";"
expression_statement
assignment_expression
identifier "m_play"
= "="
true "true"
; ";"
expression_statement
call_expression
field_expression
identifier "chan"
-> "->"
field_identifier "SendBuffer"
argument_list
( "("
call_expression
identifier "GetClient"
argument_list
( "("
) ")"
, ","
identifier "lines"
) ")"
; ";"
expression_statement
assignment_expression
identifier "m_play"
= "="
false "false"
; ";"
} "}"
} "}"
declaration (+23 nodes collapsed)
for_range_loop
for "for"
( "("
type_identifier "CQuery"
pointer_declarator
* "*"
identifier "query"
: ":"
identifier "queries"
) ")"
compound_statement
{ "{"
declaration
type_identifier "CBuffer"
init_declarator
identifier "lines"
= "="
call_expression
identifier "GetLines"
argument_list
( "("
call_expression
field_expression
identifier "query"
-> "->"
field_identifier "GetBuffer"
argument_list
( "("
) ")"
, ","
identifier "from"
, ","
identifier "to"
) ")"
; ";"
expression_statement
assignment_expression
identifier "m_play"
= "="
true "true"
; ";"
expression_statement
call_expression
field_expression
identifier "query"
-> "->"
field_identifier "SendBuffer"
argument_list
( "("
call_expression
identifier "GetClient"
argument_list
( "("
) ")"
, ","
identifier "lines"
) ")"
; ";"
expression_statement
assignment_expression
identifier "m_play"
= "="
false "false"
; ";"
} "}"
} "}"
function_definition (+453 nodes collapsed)
function_definition (+163 nodes collapsed)
function_definition (+47 nodes collapsed)
function_definition (+47 nodes collapsed)
function_definition (+55 nodes collapsed)
access_specifier
private "private"
: ":"
function_definition (+163 nodes collapsed)
function_definition (+31 nodes collapsed)
function_definition (+66 nodes collapsed)
function_definition (+176 nodes collapsed)
function_definition (+170 nodes collapsed)
function_definition (+170 nodes collapsed)
function_definition
storage_class_specifier
static "static"
type_identifier "CBuffer"
function_declarator
field_identifier "GetLines"
parameter_list
( "("
parameter_declaration
type_qualifier
const "const"
type_identifier "CBuffer"
reference_declarator
& "&"
identifier "buffer"
, ","
parameter_declaration
primitive_type "double"
identifier "from"
, ","
parameter_declaration
primitive_type "double"
identifier "to"
) ")"
compound_statement
{ "{"
declaration
type_identifier "CBuffer"
init_declarator
identifier "lines"
argument_list
( "("
call_expression
field_expression
identifier "buffer"
. "."
field_identifier "Size"
argument_list
( "("
) ")"
) ")"
; ";"
for_statement (+123 nodes collapsed)
return_statement
return "return"
identifier "lines"
; ";"
} "}"
field_declaration
primitive_type "bool"
field_identifier "m_play"
; ";"
} "}"
; ";"
expression_statement
call_expression
identifier "GLOBALMODULEDEFS"
argument_list
( "("
identifier "CPlaybackMod"
, ","
string_literal
" "\""
string_content "An advanced playback module for ZNC"
" "\""
) ")"
; ""

After

translation_unit
comment "/*\n * Copyright (C) 2004-2014 See the AUTHORS file for deta"...
preproc_include
#include "#include"
system_lib_string "<znc/Modules.h>"
preproc_include
#include "#include"
system_lib_string "<znc/IRCNetwork.h>"
preproc_include
#include "#include"
system_lib_string "<znc/Client.h>"
preproc_include
#include "#include"
system_lib_string "<znc/Buffer.h>"
preproc_include
#include "#include"
system_lib_string "<znc/Utils.h>"
preproc_include
#include "#include"
system_lib_string "<znc/Query.h>"
preproc_include
#include "#include"
system_lib_string "<znc/Chan.h>"
preproc_include
#include "#include"
system_lib_string "<znc/znc.h>"
preproc_include
#include "#include"
system_lib_string "<sys/time.h>"
preproc_include
#include "#include"
system_lib_string "<cfloat>"
declaration
storage_class_specifier
static "static"
type_qualifier
const "const"
primitive_type "char"
init_declarator
pointer_declarator
* "*"
identifier "PlaybackCap"
= "="
string_literal
" "\""
string_content "znc.in/playback"
" "\""
; ";"
declaration
storage_class_specifier
static "static"
type_qualifier
const "const"
primitive_type "char"
init_declarator
pointer_declarator
* "*"
identifier "EchoMessageCap"
= "="
string_literal
" "\""
string_content "znc.in/echo-message"
" "\""
; ";"
class_specifier
class "class"
type_identifier "CPlaybackMod"
base_class_clause
: ":"
access_specifier
public "public"
type_identifier "CModule"
field_declaration_list
{ "{"
access_specifier
public "public"
: ":"
function_definition
function_declarator
identifier "MODCONSTRUCTOR"
parameter_list
( "("
parameter_declaration
type_identifier "CPlaybackMod"
) ")"
compound_statement
{ "{"
expression_statement
assignment_expression
identifier "m_play"
= "="
false "false"
; ";"
expression_statement
call_expression
identifier "AddHelpCommand"
argument_list
( "("
) ")"
; ";"
expression_statement (+42 nodes collapsed)
expression_statement (+42 nodes collapsed)
expression_statement (+42 nodes collapsed)
expression_statement
call_expression
identifier "AddCommand"
argument_list
( "("
string_literal
" "\""
string_content "Limit"
" "\""
, ","
call_expression
template_function
identifier "static_cast"
template_argument_list
< "<"
type_descriptor
qualified_identifier
namespace_identifier "CModCommand"
:: "::"
type_identifier "ModCmdFunc"
> ">"
argument_list
( "("
pointer_expression
& "&"
qualified_identifier
namespace_identifier "CPlaybackMod"
:: "::"
identifier "LimitCommand"
) ")"
, ","
string_literal
" "\""
string_content "<client> [limit]"
" "\""
, ","
string_literal
" "\""
string_content "Get/set the buffer limit (<= 0 to clear) for the given clien"...
" "\""
) ")"
; ";"
} "}"
function_definition (+45 nodes collapsed)
function_definition (+52 nodes collapsed)
function_definition (+50 nodes collapsed)
function_definition (+56 nodes collapsed)
function_definition (+50 nodes collapsed)
function_definition (+50 nodes collapsed)
function_definition (+157 nodes collapsed)
function_definition
primitive_type "void"
function_declarator
field_identifier "PlayCommand"
parameter_list
( "("
parameter_declaration
type_qualifier
const "const"
type_identifier "CString"
reference_declarator
& "&"
identifier "line"
) ")"
compound_statement
{ "{"
comment "// PLAY <buffer(s)> [from] [to]"
declaration
type_qualifier
const "const"
type_identifier "CString"
init_declarator
identifier "arg"
= "="
call_expression
field_expression
identifier "line"
. "."
field_identifier "Token"
argument_list
( "("
number_literal "1"
) ")"
; ";"
if_statement (+36 nodes collapsed)
declaration (+22 nodes collapsed)
declaration
primitive_type "double"
init_declarator
identifier "to"
= "="
identifier "DBL_MAX"
; ";"
if_statement (+44 nodes collapsed)
declaration
primitive_type "int"
init_declarator
identifier "limit"
= "="
number_literal "-1"
; ";"
if_statement
if "if"
condition_clause
( "("
declaration
type_identifier "CClient"
pointer_declarator
* "*"
identifier "client"
= "="
call_expression
identifier "GetClient"
argument_list
( "("
) ")"
) ")"
expression_statement
assignment_expression
identifier "limit"
= "="
call_expression
identifier "GetLimit"
argument_list
( "("
call_expression
field_expression
identifier "client"
-> "->"
field_identifier "GetIdentifier"
argument_list
( "("
) ")"
) ")"
; ";"
declaration (+23 nodes collapsed)
for_range_loop
for "for"
( "("
type_identifier "CChan"
pointer_declarator
* "*"
identifier "chan"
: ":"
identifier "chans"
) ")"
compound_statement
{ "{"
if_statement
if "if"
condition_clause (+23 nodes collapsed)
compound_statement
{ "{"
declaration
type_identifier "CBuffer"
init_declarator
identifier "lines"
= "="
call_expression
identifier "GetLines"
argument_list
( "("
call_expression
field_expression
identifier "chan"
-> "->"
field_identifier "GetBuffer"
argument_list
( "("
) ")"
, ","
identifier "from"
, ","
identifier "to"
, ","
identifier "limit"
) ")"
; ";"
expression_statement
assignment_expression
identifier "m_play"
= "="
true "true"
; ";"
expression_statement
call_expression
field_expression
identifier "chan"
-> "->"
field_identifier "SendBuffer"
argument_list
( "("
call_expression
identifier "GetClient"
argument_list
( "("
) ")"
, ","
identifier "lines"
) ")"
; ";"
expression_statement
assignment_expression
identifier "m_play"
= "="
false "false"
; ";"
} "}"
} "}"
declaration (+23 nodes collapsed)
for_range_loop
for "for"
( "("
type_identifier "CQuery"
pointer_declarator
* "*"
identifier "query"
: ":"
identifier "queries"
) ")"
compound_statement
{ "{"
declaration
type_identifier "CBuffer"
init_declarator
identifier "lines"
= "="
call_expression
identifier "GetLines"
argument_list
( "("
call_expression
field_expression
identifier "query"
-> "->"
field_identifier "GetBuffer"
argument_list
( "("
) ")"
, ","
identifier "from"
, ","
identifier "to"
, ","
identifier "limit"
) ")"
; ";"
expression_statement
assignment_expression
identifier "m_play"
= "="
true "true"
; ";"
expression_statement
call_expression
field_expression
identifier "query"
-> "->"
field_identifier "SendBuffer"
argument_list
( "("
call_expression
identifier "GetClient"
argument_list
( "("
) ")"
, ","
identifier "lines"
) ")"
; ";"
expression_statement
assignment_expression
identifier "m_play"
= "="
false "false"
; ";"
} "}"
} "}"
function_definition (+453 nodes collapsed)
function_definition
primitive_type "void"
function_declarator
field_identifier "LimitCommand"
parameter_list
( "("
parameter_declaration
type_qualifier
const "const"
type_identifier "CString"
reference_declarator
& "&"
identifier "line"
) ")"
compound_statement
{ "{"
comment "// LIMIT <client> [limit]"
declaration
type_qualifier
const "const"
type_identifier "CString"
init_declarator
identifier "client"
= "="
call_expression
field_expression
identifier "line"
. "."
field_identifier "Token"
argument_list
( "("
number_literal "1"
) ")"
; ";"
if_statement
if "if"
condition_clause
( "("
call_expression
field_expression
identifier "client"
. "."
field_identifier "empty"
argument_list
( "("
) ")"
) ")"
compound_statement
{ "{"
expression_statement
call_expression
identifier "PutModule"
argument_list
( "("
string_literal
" "\""
string_content "Usage: LIMIT <client> [limit]"
" "\""
) ")"
; ";"
return_statement
return "return"
; ";"
} "}"
declaration
type_qualifier
const "const"
type_identifier "CString"
init_declarator
identifier "arg"
= "="
call_expression
field_expression
identifier "line"
. "."
field_identifier "Token"
argument_list
( "("
number_literal "2"
) ")"
; ";"
declaration
primitive_type "int"
init_declarator
identifier "limit"
= "="
call_expression
identifier "GetLimit"
argument_list
( "("
identifier "client"
) ")"
; ";"
if_statement
if "if"
condition_clause
( "("
unary_expression
! "!"
call_expression
field_expression
identifier "arg"
. "."
field_identifier "empty"
argument_list
( "("
) ")"
) ")"
compound_statement
{ "{"
expression_statement
assignment_expression
identifier "limit"
= "="
call_expression
field_expression
identifier "arg"
. "."
field_identifier "ToInt"
argument_list
( "("
) ")"
; ";"
expression_statement
call_expression
identifier "SetLimit"
argument_list
( "("
identifier "client"
, ","
identifier "limit"
) ")"
; ";"
} "}"
if_statement
if "if"
condition_clause
( "("
binary_expression
identifier "limit"
<= "<="
number_literal "0"
) ")"
expression_statement
call_expression
identifier "PutModule"
argument_list
( "("
binary_expression
identifier "client"
+ "+"
string_literal
" "\""
string_content " buffer limit: -"
" "\""
) ")"
; ";"
else_clause
else "else"
expression_statement
call_expression
identifier "PutModule"
argument_list
( "("
binary_expression
binary_expression
identifier "client"
+ "+"
string_literal
" "\""
string_content " buffer limit: "
" "\""
+ "+"
call_expression
identifier "CString"
argument_list
( "("
identifier "limit"
) ")"
) ")"
; ";"
} "}"
function_definition (+163 nodes collapsed)
function_definition (+47 nodes collapsed)
function_definition (+47 nodes collapsed)
function_definition (+55 nodes collapsed)
access_specifier
private "private"
: ":"
function_definition (+163 nodes collapsed)
function_definition (+31 nodes collapsed)
function_definition (+66 nodes collapsed)
function_definition (+176 nodes collapsed)
function_definition (+170 nodes collapsed)
function_definition (+170 nodes collapsed)
function_definition
primitive_type "int"
function_declarator
field_identifier "GetLimit"
parameter_list
( "("
parameter_declaration
type_qualifier
const "const"
type_identifier "CString"
reference_declarator
& "&"
identifier "client"
) ")"
type_qualifier
const "const"
compound_statement
{ "{"
return_statement
return "return"
call_expression
field_expression
call_expression
identifier "GetNV"
argument_list
( "("
identifier "client"
) ")"
. "."
field_identifier "ToInt"
argument_list
( "("
) ")"
; ";"
} "}"
function_definition
primitive_type "void"
function_declarator
field_identifier "SetLimit"
parameter_list
( "("
parameter_declaration
type_qualifier
const "const"
type_identifier "CString"
reference_declarator
& "&"
identifier "client"
, ","
parameter_declaration
primitive_type "int"
identifier "limit"
) ")"
compound_statement
{ "{"
if_statement
if "if"
condition_clause
( "("
binary_expression
identifier "limit"
> ">"
number_literal "0"
) ")"
expression_statement
call_expression
identifier "SetNV"
argument_list
( "("
identifier "client"
, ","
call_expression
identifier "CString"
argument_list
( "("
identifier "limit"
) ")"
) ")"
; ";"
else_clause
else "else"
expression_statement
call_expression
identifier "DelNV"
argument_list
( "("
identifier "client"
) ")"
; ";"
} "}"
function_definition
storage_class_specifier
static "static"
type_identifier "CBuffer"
function_declarator
field_identifier "GetLines"
parameter_list
( "("
parameter_declaration
type_qualifier
const "const"
type_identifier "CBuffer"
reference_declarator
& "&"
identifier "buffer"
, ","
parameter_declaration
primitive_type "double"
identifier "from"
, ","
parameter_declaration
primitive_type "double"
identifier "to"
, ","
parameter_declaration
primitive_type "int"
identifier "limit"
) ")"
compound_statement
{ "{"
declaration
type_identifier "CBuffer"
init_declarator
identifier "lines"
argument_list
( "("
call_expression
field_expression
identifier "buffer"
. "."
field_identifier "Size"
argument_list
( "("
) ")"
) ")"
; ";"
for_statement (+123 nodes collapsed)
if_statement
if "if"
condition_clause
( "("
binary_expression
identifier "limit"
> ">"
number_literal "0"
) ")"
expression_statement
call_expression
field_expression
identifier "lines"
. "."
field_identifier "SetLineCount"
argument_list
( "("
identifier "limit"
) ")"
; ";"
return_statement
return "return"
identifier "lines"
; ";"
} "}"
field_declaration
primitive_type "bool"
field_identifier "m_play"
; ";"
} "}"
; ";"
expression_statement
call_expression
identifier "GLOBALMODULEDEFS"
argument_list
( "("
identifier "CPlaybackMod"
, ","
string_literal
" "\""
string_content "An advanced playback module for ZNC"
" "\""
) ")"
; ""