Warner Losh
2021-05-31 23:23:55 UTC
The branch main has been updated by imp:
URL: https://cgit.FreeBSD.org/doc/commit/?id=5fdd3fefdd8c5ded4821f9969c650fc0ed9ba642
commit 5fdd3fefdd8c5ded4821f9969c650fc0ed9ba642
Author: Warner Losh <***@FreeBSD.org>
AuthorDate: 2021-04-27 21:00:46 +0000
Commit: Warner Losh <***@FreeBSD.org>
CommitDate: 2021-05-31 23:23:34 +0000
arch-handbook: Document kobj HEADER keyword
The HEADER keyword is like the CODE keyword, except the lines go into
the .h file.
Sponsored by: Netflix
---
.../content/en/books/arch-handbook/kobj/_index.adoc | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/documentation/content/en/books/arch-handbook/kobj/_index.adoc b/documentation/content/en/books/arch-handbook/kobj/_index.adoc
index 8a91c0132c..32b64e3bbd 100644
--- a/documentation/content/en/books/arch-handbook/kobj/_index.adoc
+++ b/documentation/content/en/books/arch-handbook/kobj/_index.adoc
@@ -118,7 +118,7 @@ KOBJMETHOD(NAME, FUNC)
The first step in using Kobj is to create an Interface.
Creating the interface involves creating a template that the script [.filename]#src/sys/kern/makeobjops.pl# can use to generate the header and code for the method declarations and method lookup functions.
-Within this template the following keywords are used: `#include`, `INTERFACE`, `CODE`, `METHOD`, `STATICMETHOD`, and `DEFAULT`.
+Within this template the following keywords are used: `#include`, `INTERFACE`, `CODE`, `HEADER`, `METHOD`, `STATICMETHOD`, and `DEFAULT`.
The `#include` statement and what follows it is copied verbatim to the head of the generated code file.
@@ -155,6 +155,20 @@ CODE {
};
....
+The `HEADER` keyword copies its arguments verbatim into the header file.
+Its syntax is `HEADER { [whatever] };`
+
+For example:
+
+[.programlisting]
+....
+HEADER {
+ struct mumble;
+ struct grumble;
+}
+};
+....
+
The `METHOD` keyword describes a method.
Its syntax is `METHOD [return type] [method name] { [object [, arguments]] };`
URL: https://cgit.FreeBSD.org/doc/commit/?id=5fdd3fefdd8c5ded4821f9969c650fc0ed9ba642
commit 5fdd3fefdd8c5ded4821f9969c650fc0ed9ba642
Author: Warner Losh <***@FreeBSD.org>
AuthorDate: 2021-04-27 21:00:46 +0000
Commit: Warner Losh <***@FreeBSD.org>
CommitDate: 2021-05-31 23:23:34 +0000
arch-handbook: Document kobj HEADER keyword
The HEADER keyword is like the CODE keyword, except the lines go into
the .h file.
Sponsored by: Netflix
---
.../content/en/books/arch-handbook/kobj/_index.adoc | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/documentation/content/en/books/arch-handbook/kobj/_index.adoc b/documentation/content/en/books/arch-handbook/kobj/_index.adoc
index 8a91c0132c..32b64e3bbd 100644
--- a/documentation/content/en/books/arch-handbook/kobj/_index.adoc
+++ b/documentation/content/en/books/arch-handbook/kobj/_index.adoc
@@ -118,7 +118,7 @@ KOBJMETHOD(NAME, FUNC)
The first step in using Kobj is to create an Interface.
Creating the interface involves creating a template that the script [.filename]#src/sys/kern/makeobjops.pl# can use to generate the header and code for the method declarations and method lookup functions.
-Within this template the following keywords are used: `#include`, `INTERFACE`, `CODE`, `METHOD`, `STATICMETHOD`, and `DEFAULT`.
+Within this template the following keywords are used: `#include`, `INTERFACE`, `CODE`, `HEADER`, `METHOD`, `STATICMETHOD`, and `DEFAULT`.
The `#include` statement and what follows it is copied verbatim to the head of the generated code file.
@@ -155,6 +155,20 @@ CODE {
};
....
+The `HEADER` keyword copies its arguments verbatim into the header file.
+Its syntax is `HEADER { [whatever] };`
+
+For example:
+
+[.programlisting]
+....
+HEADER {
+ struct mumble;
+ struct grumble;
+}
+};
+....
+
The `METHOD` keyword describes a method.
Its syntax is `METHOD [return type] [method name] { [object [, arguments]] };`