mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-25 05:55:13 +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;
|
int index = 0;
|
||||||
|
|
||||||
auto peek = [&]() -> char {
|
auto peek = [&](int offset = 0) -> char {
|
||||||
if (index < file_contents.size())
|
if ((index + offset) < file_contents.size())
|
||||||
return file_contents[index];
|
return file_contents[index + offset];
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -85,6 +85,10 @@ int main(int argc, char** argv)
|
||||||
auto consume_whitespace = [&] {
|
auto consume_whitespace = [&] {
|
||||||
while (isspace(peek()))
|
while (isspace(peek()))
|
||||||
++index;
|
++index;
|
||||||
|
if (peek() == '/' && peek(1) == '/') {
|
||||||
|
while (peek() != '\n')
|
||||||
|
++index;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
auto parse_parameter = [&](Vector<Parameter>& storage) {
|
auto parse_parameter = [&](Vector<Parameter>& storage) {
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
endpoint AudioServer
|
endpoint AudioServer
|
||||||
{
|
{
|
||||||
|
// Basic protocol
|
||||||
Greet(i32 client_pid) => (i32 server_pid, i32 client_id)
|
Greet(i32 client_pid) => (i32 server_pid, i32 client_id)
|
||||||
|
|
||||||
|
// Mixer functions
|
||||||
GetMainMixVolume() => (i32 volume)
|
GetMainMixVolume() => (i32 volume)
|
||||||
SetMainMixVolume(i32 volume) => ()
|
SetMainMixVolume(i32 volume) => ()
|
||||||
|
|
||||||
|
// Buffer playback
|
||||||
EnqueueBuffer(i32 buffer_id) => (bool success)
|
EnqueueBuffer(i32 buffer_id) => (bool success)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue