mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
IPCCompiler+AudioServer: Accept "//"-style comments in IPC defintions
This commit is contained in:
parent
0f0b00dc1f
commit
3100e8dee5
Notes:
sideshowbarker
2024-07-19 12:54:46 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/3100e8dee52
2 changed files with 10 additions and 3 deletions
|
@ -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) {
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue