public inbox for dtrace@lists.linux.dev
 help / color / mirror / Atom feed
From: eugene.loh@oracle.com
To: dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: [PATCH v2 14/20] doc: Link to "Character Escape Sequences" table
Date: Tue, 21 Oct 2025 23:22:44 -0400	[thread overview]
Message-ID: <20251022032251.2010-9-eugene.loh@oracle.com> (raw)
In-Reply-To: <20251022032251.2010-1-eugene.loh@oracle.com>

From: Eugene Loh <eugene.loh@oracle.com>

A link to this table did not work since it referenced an ID that did not
exist.  Add an anchor ID by the table and use it.

While we're at it, convert the table from HTML to Markdown and break up
some longer lines, improving readability and maintainability of the
Markdown source file.

Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
---
 ...dtrace-ref-TypesOperatorsandExpressions.md | 140 ++----------------
 .../dtrace_builtin_variable_reference.md      |  11 +-
 2 files changed, 20 insertions(+), 131 deletions(-)

diff --git a/doc/userguide/reference/dtrace-ref-TypesOperatorsandExpressions.md b/doc/userguide/reference/dtrace-ref-TypesOperatorsandExpressions.md
index c76d293c7..bb1c49949 100644
--- a/doc/userguide/reference/dtrace-ref-TypesOperatorsandExpressions.md
+++ b/doc/userguide/reference/dtrace-ref-TypesOperatorsandExpressions.md
@@ -474,135 +474,18 @@ D type
 </td></tr><tbody></table>
 Character constants are written as a single character or escape sequence that's inside a pair of single quotes \(`'a'`\). Character constants are assigned the `int` type rather than `char` and are equivalent to an integer constant with a value that's determined by that character's value in the ASCII character set. See the `ascii(7)` manual page for a list of characters and their values. You can also use any of the special escape sequences that are listed in the following table. D uses the same escape sequences as those found in ANSI C.
 
-<table><thead><tr><th>
-
-Escape Sequence
-
-</th><th>
-
-Represents
-
-</th><th>
-
-Escape Sequence
-
-</th><th>
-
-Represents
-
-</th></tr></thead><tbody><tr><td>
-
-`\a`
-
-</td><td>
-
-alert
-
-</td><td>
-
-`\\`
-
-</td><td>
-
-backslash
-
-</td></tr><tr><td>
-
-`\b`
-
-</td><td>
-
-backspace
-
-</td><td>
-
-`\?`
-
-</td><td>
-
-question mark
-
-</td></tr><tr><td>
-
-`\f`
-
-</td><td>
-
-form feed
-
-</td><td>
-
-`\'`
-
-</td><td>
-
-single quote
-
-</td></tr><tr><td>
+**Table:**  Character Escape Sequences<a id="char_esc_seqs">
+
+| Escape Sequence | Represents      |     | Escape Sequence | Represents               |
+| :---            | :---            | --- | :---            | :---                     |
+| `\a`            | alert           |     | `\\`            | backslash                |
+| `\b`            | backspace       |     | `\?`            | question mark            |
+| `\f`            | form feed       |     | `\'`            | single quote             |
+| `\n`            | newline         |     | `\"`            | double quote             |
+| `\r`            | carriage return |     | `\0`*oo*        | octal value 0*oo*        |
+| `\t`            | horizontal tab  |     | `\x`*hh*        | hexadecimal value 0x*hh* |
+| `\v`            | vertical tab    |     | `\0`            | null character           |
 
-`\n`
-
-</td><td>
-
-newline
-
-</td><td>
-
-`\"`
-
-</td><td>
-
-double quote
-
-</td></tr><tr><td>
-
-`\r`
-
-</td><td>
-
-carriage return
-
-</td><td>
-
-`\0*oo*`
-
-</td><td>
-
-octal value 0*oo*
-
-</td></tr><tr><td>
-
-`\t`
-
-</td><td>
-
-horizontal tab
-
-</td><td>
-
-`\x*hh*`
-
-</td><td>
-
-hexadecimal value 0x*hh*
-
-</td></tr><tr><td>
-
-`\v`
-
-</td><td>
-
-vertical tab
-
-</td><td>
-
-`\0`
-
-</td><td>
-
-null character
-
-</td></tr><tbody></table>
 You can include more than one character specifier inside single quotes to create integers with individual bytes that are initialized according to the corresponding character specifiers. The bytes are read left-to-right from a character constant and assigned to the resulting integer in the order corresponding to the native endianness of the operating environment. Up to eight character specifiers can be included in a single character constant.
 
 Strings constants of any length can be composed by enclosing them in a pair of double quotes \(`"hello"`\). A string constant can't contain a literal newline character. To create strings containing newlines, use the `\n` escape sequence instead of a literal newline. String constants can contain any of the special character escape sequences that are shown for character constants before. Similar to ANSI C, strings are represented as arrays of characters that end with a null character \(`\0`\) that's implicitly added to each string constant you declare. String constants are assigned the special D type `string`. The D compiler provides a set of special features for comparing and tracing character arrays that are declared as strings.
@@ -1407,4 +1290,3 @@ The D type namespace is initially populated with the D type intrinsics, such as
 When the D compiler encounters a type declaration that doesn't specify an explicit namespace using the back quote operator, the compiler searches the set of active type namespaces to find a match by using the specified type name. The C namespace is always searched first, followed by the D namespace. If the type name isn't found in either the C or D namespace, the type namespaces of the active kernel modules are searched in load address order, which doesn't guarantee any ordering properties among the loadable modules. To avoid type name conflicts with other kernel modules, use the scoping operator when accessing types that are defined in loadable kernel modules.
 
 The D compiler uses the compressed ANSI C debugging information that's provided with the core Linux kernel modules to access the types that are associated with the OS source code, without the need to access the corresponding C include files. Note that this symbolic debugging information might not be available for all kernel modules on the system. The D compiler reports an error if you try to access a type within the namespace of a module that lacks the compressed C debugging information that's intended for use with DTrace.
-
diff --git a/doc/userguide/reference/dtrace_builtin_variable_reference.md b/doc/userguide/reference/dtrace_builtin_variable_reference.md
index 787137929..aecd2308c 100644
--- a/doc/userguide/reference/dtrace_builtin_variable_reference.md
+++ b/doc/userguide/reference/dtrace_builtin_variable_reference.md
@@ -221,7 +221,15 @@ The macro argument values must match the form of an integer, identifier, or stri
 sudo ./foo '"a string argument"'
 ```
 
-If you want D macro arguments to be interpreted as string tokens, even if they match the form of an integer or identifier, prefix the macro variable or argument name with two leading dollar signs, for example, `$$1`, which forces the D compiler to interpret the argument value as if it were a string surrounded by double quotes. All the usual D string escape sequences, per [Table 5](dtrace-ref-TypesOperatorsandExpressions.md#dt_t6_dlang), are expanded inside any string macro arguments, regardless of whether they're referenced by using the `$arg` or `$$arg` form of the macro. If the `defaultargs` option is set, unspecified arguments that are referenced with the `$$arg` form have the value of the empty string \(`""`\).
+If you want D macro arguments to be interpreted as string tokens,
+even if they match the form of an integer or identifier,
+prefix the macro variable or argument name with two leading dollar signs,
+for example, `$$1`, which forces the D compiler to interpret the argument value as if it were a string surrounded by double quotes.
+All the usual D string escape sequences, in the table of [Character Escape Sequences](dtrace-ref-TypesOperatorsandExpressions.md#char_esc_seqs),
+are expanded inside any string macro arguments,
+regardless of whether they're referenced by using the `$arg` or `$$arg` form of the macro.
+If the `defaultargs` option is set,
+unspecified arguments that are referenced with the `$$arg` form have the value of the empty string \(`""`\).
 
 ### Target Process ID
 
@@ -474,4 +482,3 @@ int64_t walltimestamp
 ```
 
 The built-in variable `walltimestamp` references the current number of nanoseconds since 00:00 Universal Coordinated Time, January 1, 1970.
-
-- 
2.47.3


  parent reply	other threads:[~2025-10-22  3:23 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22  3:22 [PATCH v2 05/20] doc: Replace duplicate id eugene.loh
2025-10-22  3:22 ` [PATCH v2 06/20] doc: Clean up dangling anchor links eugene.loh
2025-10-23 19:53   ` Elena Zannoni
2025-10-22  3:22 ` [PATCH v2 08/20] doc: Fix anchor links for built-in variables eugene.loh
2025-10-23 19:26   ` Elena Zannoni
2025-10-22  3:22 ` [PATCH v2 09/20] doc: Fix anchor links for providers eugene.loh
2025-10-23 19:27   ` [DTrace-devel] " Elena Zannoni
2025-10-22  3:22 ` [PATCH v2 10/20] doc: Fix anchor links for explanation/ eugene.loh
2025-10-23 19:27   ` Elena Zannoni
2025-10-22  3:22 ` [PATCH v2 11/20] doc: Fix anchor links for how-to/ eugene.loh
2025-10-23 19:28   ` [DTrace-devel] " Elena Zannoni
2025-10-22  3:22 ` [PATCH v2 12/20] doc: Fix anchor links for reference/ eugene.loh
2025-10-23 19:28   ` [DTrace-devel] " Elena Zannoni
2025-10-22  3:22 ` [PATCH v2 13/20] doc: Clean up the table for string relational operators eugene.loh
2025-10-23 19:30   ` [DTrace-devel] " Elena Zannoni
2025-10-22  3:22 ` eugene.loh [this message]
2025-10-23 19:32   ` [DTrace-devel] [PATCH v2 14/20] doc: Link to "Character Escape Sequences" table Elena Zannoni
2025-10-22  3:22 ` [PATCH v2 15/20] doc: Clean up profile unit table eugene.loh
2025-10-23 19:33   ` [DTrace-devel] " Elena Zannoni
2025-10-22  3:22 ` [PATCH v2 16/20] doc: Clean up undefined anchor links eugene.loh
2025-10-23 19:34   ` Elena Zannoni
2025-10-22  3:22 ` [PATCH v2 17/20] doc: Add IP provider documentation eugene.loh
2025-10-22  3:22 ` [PATCH v2 18/20] doc: Add TCP " eugene.loh
2025-10-22  3:22 ` [PATCH v2 19/20] doc: Add UDP " eugene.loh
2025-10-22  3:22 ` [PATCH v2 20/20] doc: Add rawfbt " eugene.loh
2025-10-22  3:22 ` [PATCH 21/20] doc: Add blank line before section head so it is recognized eugene.loh
2025-10-23 19:35   ` [DTrace-devel] " Elena Zannoni
2025-10-23 19:23 ` [PATCH v2 05/20] doc: Replace duplicate id Elena Zannoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251022032251.2010-9-eugene.loh@oracle.com \
    --to=eugene.loh@oracle.com \
    --cc=dtrace-devel@oss.oracle.com \
    --cc=dtrace@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox