Commit c9979fe3 authored by François Grisez's avatar François Grisez

Add support of contracted syntax for 'Event' header.

parent 2d5f4bfb
Pipeline #346 failed with stage
in 0 seconds
......@@ -77,6 +77,7 @@ static struct header_name_func_pair header_table[] = {
,{PROTO_SIP, BELLE_SIP_P_PREFERRED_IDENTITY, (header_parse_func)belle_sip_header_p_preferred_identity_parse}
,{PROTO_SIP, BELLE_SIP_PRIVACY, (header_parse_func)belle_sip_header_privacy_parse}
,{PROTO_SIP, BELLE_SIP_EVENT, (header_parse_func)belle_sip_header_event_parse}
,{PROTO_SIP, "o", (header_parse_func)belle_sip_header_event_parse}
,{PROTO_SIP, BELLE_SIP_SUPPORTED, (header_parse_func)belle_sip_header_supported_parse}
,{PROTO_SIP, "k", (header_parse_func)belle_sip_header_supported_parse}
,{PROTO_SIP, BELLE_SIP_REQUIRE, (header_parse_func)belle_sip_header_require_parse}
......
......@@ -2,7 +2,7 @@
* This C source file was generated by $ANTLR version 3.4
*
* - From the grammar source file : ../grammars/belle_sdp.g
* - On : 2018-08-08 15:41:42
* - On : 2018-09-19 17:07:21
* - for the lexer : belle_sdpLexerLexer
*
* Editing it, at least manually, is not wise.
......
......@@ -2,7 +2,7 @@
* This C header file was generated by $ANTLR version 3.4
*
* - From the grammar source file : ../grammars/belle_sdp.g
* - On : 2018-08-08 15:41:42
* - On : 2018-09-19 17:07:21
* - for the lexer : belle_sdpLexerLexer
*
* Editing it, at least manually, is not wise.
......
......@@ -2,7 +2,7 @@
* This C source file was generated by $ANTLR version 3.4
*
* - From the grammar source file : ../grammars/belle_sdp.g
* - On : 2018-08-08 15:41:41
* - On : 2018-09-19 17:07:21
* - for the parser : belle_sdpParserParser
*
* Editing it, at least manually, is not wise.
......
......@@ -2,7 +2,7 @@
* This C header file was generated by $ANTLR version 3.4
*
* - From the grammar source file : ../grammars/belle_sdp.g
* - On : 2018-08-08 15:41:41
* - On : 2018-09-19 17:07:21
* - for the parser : belle_sdpParserParser
*
* Editing it, at least manually, is not wise.
......
......@@ -1461,7 +1461,7 @@ catch [ANTLR3_RECOGNITION_EXCEPTION]
header_event returns [belle_sip_header_event_t* ret]
scope { belle_sip_header_event_t* current; }
@init { $header_event::current = belle_sip_header_event_new();$ret = $header_event::current; }
: {IS_TOKEN(Event)}? token /*"Event"*/
: {IS_HEADER_NAMED(Event,o)}? token /*"Event"*/
hcolon event_package {belle_sip_header_event_set_package_name($header_event::current,(const char*)$event_package.text->chars);}
(semi generic_param [BELLE_SIP_PARAMETERS($header_event::current)])* ;
catch [ANTLR3_RECOGNITION_EXCEPTION]
......
......@@ -2,7 +2,7 @@
* This C source file was generated by $ANTLR version 3.4
*
* - From the grammar source file : ../grammars/belle_sip_message.g
* - On : 2018-08-08 15:41:56
* - On : 2018-09-19 17:07:29
* - for the lexer : belle_sip_messageLexerLexer
*
* Editing it, at least manually, is not wise.
......
......@@ -2,7 +2,7 @@
* This C header file was generated by $ANTLR version 3.4
*
* - From the grammar source file : ../grammars/belle_sip_message.g
* - On : 2018-08-08 15:41:56
* - On : 2018-09-19 17:07:29
* - for the lexer : belle_sip_messageLexerLexer
*
* Editing it, at least manually, is not wise.
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* This C header file was generated by $ANTLR version 3.4
*
* - From the grammar source file : ../grammars/belle_sip_message.g
* - On : 2018-08-08 15:41:53
* - On : 2018-09-19 17:07:28
* - for the parser : belle_sip_messageParserParser
*
* Editing it, at least manually, is not wise.
......
......@@ -1194,6 +1194,15 @@ static void test_event_header(void) {
BC_ASSERT_STRING_EQUAL(belle_sip_header_event_get_package_name(L_event), "presence");
BC_ASSERT_STRING_EQUAL(belle_sip_header_event_get_id(L_event), "blabla1");
belle_sip_object_unref(BELLE_SIP_OBJECT(L_event));
L_event = belle_sip_header_event_parse("o: presence;id=blabla1");
BC_ASSERT_PTR_NOT_NULL(L_event);
if (L_event) {
BC_ASSERT_STRING_EQUAL(belle_sip_header_event_get_package_name(L_event), "presence");
BC_ASSERT_STRING_EQUAL(belle_sip_header_event_get_id(L_event), "blabla1");
belle_sip_object_unref(BELLE_SIP_OBJECT(L_event));
}
BC_ASSERT_PTR_NULL(belle_sip_header_event_parse("nimportequoi"));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment