Style cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34319 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
b79c499571
commit
0dfceb2b8a
@ -1,7 +1,8 @@
|
||||
// gensyscallinfos.cpp
|
||||
//
|
||||
// Copyright (c) 2004, Ingo Weinhold <bonefish@cs.tu-berlin.de>
|
||||
// All rights reserved. Distributed under the terms of the OpenBeOS License.
|
||||
/*
|
||||
* Copyright 2004-2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
@ -14,29 +15,31 @@
|
||||
|
||||
#include "gensyscalls_common.h"
|
||||
|
||||
// usage
|
||||
|
||||
const char* kUsage =
|
||||
"Usage: gensyscallinfos <header> <syscall infos>\n"
|
||||
"\n"
|
||||
"Given the (preprocessed) header file that defines the syscall prototypes the\n"
|
||||
"command generates a source file consisting of syscall infos, which is needed\n"
|
||||
"Given the (preprocessed) header file that defines the syscall prototypes "
|
||||
"the\n"
|
||||
"command generates a source file consisting of syscall infos, which is "
|
||||
"needed\n"
|
||||
"to build gensyscalls, which in turn generates the assembly syscall\n"
|
||||
"definitions and code for the kernelland syscall dispatcher.\n"
|
||||
"\n"
|
||||
" <header> - Input: The preprocessed header file with the\n"
|
||||
" syscall prototypes.\n"
|
||||
" <syscall infos> - Output: The syscall infos source file needed to\n"
|
||||
" <syscall infos> - Output: The syscall infos source file needed "
|
||||
"to\n"
|
||||
" build gensyscalls.";
|
||||
|
||||
// print_usage
|
||||
static
|
||||
void
|
||||
|
||||
static void
|
||||
print_usage(bool error)
|
||||
{
|
||||
fprintf((error ? stderr : stdout), kUsage);
|
||||
}
|
||||
|
||||
// Type
|
||||
|
||||
struct Type {
|
||||
Type(const char* type) : type(type) {}
|
||||
Type(const string& type) : type(type) {}
|
||||
@ -44,7 +47,7 @@ struct Type {
|
||||
string type;
|
||||
};
|
||||
|
||||
// NamedType
|
||||
|
||||
struct NamedType : Type {
|
||||
NamedType(const char* type, const char* name)
|
||||
: Type(type), name(name) {}
|
||||
@ -54,7 +57,7 @@ struct NamedType : Type {
|
||||
string name;
|
||||
};
|
||||
|
||||
// Function
|
||||
|
||||
class Function {
|
||||
public:
|
||||
Function() : fReturnType("") {}
|
||||
@ -100,7 +103,7 @@ protected:
|
||||
Type fReturnType;
|
||||
};
|
||||
|
||||
// Syscall
|
||||
|
||||
class Syscall : public Function {
|
||||
public:
|
||||
string GetKernelName() const
|
||||
@ -116,7 +119,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// Tokenizer
|
||||
|
||||
class Tokenizer {
|
||||
public:
|
||||
Tokenizer(istream& input)
|
||||
@ -271,7 +274,6 @@ private:
|
||||
};
|
||||
|
||||
|
||||
// Main
|
||||
class Main {
|
||||
public:
|
||||
|
||||
@ -292,7 +294,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
void _ParseSyscalls(const char* filename)
|
||||
{
|
||||
@ -488,7 +489,6 @@ private:
|
||||
};
|
||||
|
||||
|
||||
// main
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
@ -499,4 +499,3 @@ main(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user