From owner-dev-commits-doc-all@freebsd.org Mon May 31 23:23:55 2021 Return-Path: Delivered-To: dev-commits-doc-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DDD206330AE for ; Mon, 31 May 2021 23:23:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FvBF75s8rz3QCG; Mon, 31 May 2021 23:23:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B216A1920F; Mon, 31 May 2021 23:23:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14VNNt74066394; Mon, 31 May 2021 23:23:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14VNNtCK066393; Mon, 31 May 2021 23:23:55 GMT (envelope-from git) Date: Mon, 31 May 2021 23:23:55 GMT Message-Id: <202105312323.14VNNtCK066393@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Warner Losh Subject: git: 5fdd3fefdd - main - arch-handbook: Document kobj HEADER keyword MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5fdd3fefdd8c5ded4821f9969c650fc0ed9ba642 Auto-Submitted: auto-generated X-BeenThere: dev-commits-doc-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the doc repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2021 23:23:55 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/doc/commit/?id=5fdd3fefdd8c5ded4821f9969c650fc0ed9ba642 commit 5fdd3fefdd8c5ded4821f9969c650fc0ed9ba642 Author: Warner Losh AuthorDate: 2021-04-27 21:00:46 +0000 Commit: Warner Losh 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]] };`