12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- BEGIN {
- FS = ",[ ]*";
- print "/*";
- print " * wrappers.c (Automatically generated)";
- print " *";
- print " * Copyright (C) 2017 Aleksandar Andrejevic <theflash@sdf.lonestar.org>";
- print " *";
- print " * This program is free software: you can redistribute it and/or modify";
- print " * it under the terms of the GNU Affero General Public License as";
- print " * published by the Free Software Foundation, either version 3 of the";
- print " * License, or (at your option) any later version.";
- print " *";
- print " * This program is distributed in the hope that it will be useful,";
- print " * but WITHOUT ANY WARRANTY; without even the implied warranty of";
- print " * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the";
- print " * GNU Affero General Public License for more details.";
- print " *";
- print " * You should have received a copy of the GNU Affero General Public License";
- print " * along with this program. If not, see <http://www.gnu.org/licenses/>.";
- print " */";
- print "";
- print "#include <sdk/monolithium.h>";
- print "";
- }
- /sysret_t syscall_[a-zA-Z0-9_]+\(.*\);/ {
- print substr($0, 1, length - 1);
- print "{";
- match($0, /\(.*\)/);
- printf " return syscall(" toupper(substr($0, 10, RSTART - 10));
- $0 = substr($0, RSTART + 1, RLENGTH - 2);
- if ($0 != "void") {
- for (i = 1; i <= NF; i++) {
- match($i, /[a-zA-Z0-9_]*$/);
- printf ", " substr($i, RSTART);
- }
- }
- print ");";
- print "}";
- print "";
- }
|