IPCCompiler+AudioServer: Accept "//"-style comments in IPC defintions

This commit is contained in:
Andreas Kling 2019-08-03 21:29:09 +02:00
parent 0f0b00dc1f
commit 3100e8dee5
Notes: sideshowbarker 2024-07-19 12:54:46 +09:00
2 changed files with 10 additions and 3 deletions

View file

@ -51,9 +51,9 @@ int main(int argc, char** argv)
int index = 0;
auto peek = [&]() -> char {
if (index < file_contents.size())
return file_contents[index];
auto peek = [&](int offset = 0) -> char {
if ((index + offset) < file_contents.size())
return file_contents[index + offset];
return 0;
};
@ -85,6 +85,10 @@ int main(int argc, char** argv)
auto consume_whitespace = [&] {
while (isspace(peek()))
++index;
if (peek() == '/' && peek(1) == '/') {
while (peek() != '\n')
++index;
}
};
auto parse_parameter = [&](Vector<Parameter>& storage) {

View file

@ -1,9 +1,12 @@
endpoint AudioServer
{
// Basic protocol
Greet(i32 client_pid) => (i32 server_pid, i32 client_id)
// Mixer functions
GetMainMixVolume() => (i32 volume)
SetMainMixVolume(i32 volume) => ()
// Buffer playback
EnqueueBuffer(i32 buffer_id) => (bool success)
}