Skip to content

Commit

Permalink
fix api to use the other public facing name
Browse files Browse the repository at this point in the history
  • Loading branch information
Green-Sky committed Mar 29, 2023
1 parent 42a7d9e commit 8a051f3
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 25 deletions.
34 changes: 17 additions & 17 deletions other/event_tooling/generate_event_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ void generate_event_impl(const std::string& event_name, std::vector<EventType> e
},
[&](const EventTypeByteRange& t) {
//f << "non_null()\n"; // TODO: is this missing in the original?
f << "size_t tox_event_" << event_name_l << "_get_" << t.name_length;
f << "size_t tox_event_" << event_name_l << "_get_" << t.name_length_cb;
f << "(const Tox_Event_" << event_name << " *" << event_name_l << ")\n";
f << "{\n assert(" << event_name_l << " != nullptr);\n";
f << " return " << event_name_l << "->" << t.name_length << ";\n}\n";
Expand Down Expand Up @@ -635,50 +635,50 @@ int main(int argc, char** argv) {
}
},
{
"Group_Topic",
"Group_Topic",
{
EventTypeTrivial{"uint32_t", "group_number"},
EventTypeTrivial{"uint32_t", "peer_id"},
EventTypeByteRange{"topic", "topic_length", "length"}, // the later two are idealy the same
}
},
{
"Group_Privacy_State",
"Group_Privacy_State",
{
EventTypeTrivial{"uint32_t", "group_number"},
EventTypeTrivial{"Tox_Group_Privacy_State", "privacy_state"},
}
},
{
"Group_Voice_State",
"Group_Voice_State",
{
EventTypeTrivial{"uint32_t", "group_number"},
EventTypeTrivial{"Tox_Group_Voice_State", "voice_state"},
}
},
{
"Group_Topic_Lock",
"Group_Topic_Lock",
{
EventTypeTrivial{"uint32_t", "group_number"},
EventTypeTrivial{"Tox_Group_Topic_Lock", "topic_lock"},
}
},
{
"Group_Peer_Limit",
"Group_Peer_Limit",
{
EventTypeTrivial{"uint32_t", "group_number"},
EventTypeTrivial{"uint32_t", "peer_limit"},
}
},
{
"Group_Password",
"Group_Password",
{
EventTypeTrivial{"uint32_t", "group_number"},
EventTypeByteRange{"password", "password_length", "length"}, // the later two are idealy the same
}
},
{
"Group_Message",
"Group_Message",
{
EventTypeTrivial{"uint32_t", "group_number"},
EventTypeTrivial{"uint32_t", "peer_id"},
Expand All @@ -688,7 +688,7 @@ int main(int argc, char** argv) {
}
},
{
"Group_Private_Message",
"Group_Private_Message",
{
EventTypeTrivial{"uint32_t", "group_number"},
EventTypeTrivial{"uint32_t", "peer_id"},
Expand All @@ -697,38 +697,38 @@ int main(int argc, char** argv) {
}
},
{
"Group_Custom_Packet",
"Group_Custom_Packet",
{
EventTypeTrivial{"uint32_t", "group_number"},
EventTypeTrivial{"uint32_t", "peer_id"},
EventTypeByteRange{"data", "data_length", "length"}, // the later two are idealy the same
}
},
{
"Group_Custom_Private_Packet",
"Group_Custom_Private_Packet",
{
EventTypeTrivial{"uint32_t", "group_number"},
EventTypeTrivial{"uint32_t", "peer_id"},
EventTypeByteRange{"data", "data_length", "length"}, // the later two are idealy the same
}
},
{
"Group_Invite",
"Group_Invite",
{
EventTypeTrivial{"uint32_t", "friend_number"},
EventTypeByteRange{"invite_data", "invite_data_length", "length"}, // the later two are idealy the same
EventTypeByteRange{"group_name", "group_name_length", "group_name_length"}, // they are :)
}
},
{
"Group_Peer_Join",
"Group_Peer_Join",
{
EventTypeTrivial{"uint32_t", "group_number"},
EventTypeTrivial{"uint32_t", "peer_id"},
}
},
{
"Group_Peer_Exit",
"Group_Peer_Exit",
{
EventTypeTrivial{"uint32_t", "group_number"},
EventTypeTrivial{"uint32_t", "peer_id"},
Expand All @@ -738,20 +738,20 @@ int main(int argc, char** argv) {
}
},
{
"Group_Self_Join",
"Group_Self_Join",
{
EventTypeTrivial{"uint32_t", "group_number"},
}
},
{
"Group_Join_Fail",
"Group_Join_Fail",
{
EventTypeTrivial{"uint32_t", "group_number"},
EventTypeTrivial{"Tox_Group_Join_Fail", "fail_type"},
}
},
{
"Group_Moderation",
"Group_Moderation",
{
EventTypeTrivial{"uint32_t", "group_number"},
EventTypeTrivial{"uint32_t", "source_peer_id"},
Expand Down
2 changes: 1 addition & 1 deletion toxcore/events/group_custom_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static bool tox_event_group_custom_packet_set_data(Tox_Event_Group_Custom_Packet
group_custom_packet->data_length = data_length;
return true;
}
size_t tox_event_group_custom_packet_get_data_length(const Tox_Event_Group_Custom_Packet *group_custom_packet)
size_t tox_event_group_custom_packet_get_length(const Tox_Event_Group_Custom_Packet *group_custom_packet)
{
assert(group_custom_packet != nullptr);
return group_custom_packet->data_length;
Expand Down
2 changes: 1 addition & 1 deletion toxcore/events/group_custom_private_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static bool tox_event_group_custom_private_packet_set_data(Tox_Event_Group_Custo
group_custom_private_packet->data_length = data_length;
return true;
}
size_t tox_event_group_custom_private_packet_get_data_length(const Tox_Event_Group_Custom_Private_Packet *group_custom_private_packet)
size_t tox_event_group_custom_private_packet_get_length(const Tox_Event_Group_Custom_Private_Packet *group_custom_private_packet)
{
assert(group_custom_private_packet != nullptr);
return group_custom_private_packet->data_length;
Expand Down
2 changes: 1 addition & 1 deletion toxcore/events/group_invite.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static bool tox_event_group_invite_set_invite_data(Tox_Event_Group_Invite *group
group_invite->invite_data_length = invite_data_length;
return true;
}
size_t tox_event_group_invite_get_invite_data_length(const Tox_Event_Group_Invite *group_invite)
size_t tox_event_group_invite_get_length(const Tox_Event_Group_Invite *group_invite)
{
assert(group_invite != nullptr);
return group_invite->invite_data_length;
Expand Down
2 changes: 1 addition & 1 deletion toxcore/events/group_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ static bool tox_event_group_message_set_message(Tox_Event_Group_Message *group_m
group_message->message_length = message_length;
return true;
}
size_t tox_event_group_message_get_message_length(const Tox_Event_Group_Message *group_message)
size_t tox_event_group_message_get_length(const Tox_Event_Group_Message *group_message)
{
assert(group_message != nullptr);
return group_message->message_length;
Expand Down
2 changes: 1 addition & 1 deletion toxcore/events/group_password.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static bool tox_event_group_password_set_password(Tox_Event_Group_Password *grou
group_password->password_length = password_length;
return true;
}
size_t tox_event_group_password_get_password_length(const Tox_Event_Group_Password *group_password)
size_t tox_event_group_password_get_length(const Tox_Event_Group_Password *group_password)
{
assert(group_password != nullptr);
return group_password->password_length;
Expand Down
2 changes: 1 addition & 1 deletion toxcore/events/group_peer_name.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static bool tox_event_group_peer_name_set_name(Tox_Event_Group_Peer_Name *group_
group_peer_name->name_length = name_length;
return true;
}
size_t tox_event_group_peer_name_get_name_length(const Tox_Event_Group_Peer_Name *group_peer_name)
size_t tox_event_group_peer_name_get_length(const Tox_Event_Group_Peer_Name *group_peer_name)
{
assert(group_peer_name != nullptr);
return group_peer_name->name_length;
Expand Down
2 changes: 1 addition & 1 deletion toxcore/events/group_private_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ static bool tox_event_group_private_message_set_message(Tox_Event_Group_Private_
group_private_message->message_length = message_length;
return true;
}
size_t tox_event_group_private_message_get_message_length(const Tox_Event_Group_Private_Message *group_private_message)
size_t tox_event_group_private_message_get_length(const Tox_Event_Group_Private_Message *group_private_message)
{
assert(group_private_message != nullptr);
return group_private_message->message_length;
Expand Down
2 changes: 1 addition & 1 deletion toxcore/events/group_topic.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static bool tox_event_group_topic_set_topic(Tox_Event_Group_Topic *group_topic,
group_topic->topic_length = topic_length;
return true;
}
size_t tox_event_group_topic_get_topic_length(const Tox_Event_Group_Topic *group_topic)
size_t tox_event_group_topic_get_length(const Tox_Event_Group_Topic *group_topic)
{
assert(group_topic != nullptr);
return group_topic->topic_length;
Expand Down

0 comments on commit 8a051f3

Please sign in to comment.