X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/a2a31a5d46c651d36ee2be58fa31588fca4840bd..a7560f9e0cbe73a552e1cbb59d00838db1bb126e:/doc/output.tex?ds=sidebyside

diff --git a/doc/output.tex b/doc/output.tex
index b7bfa74..1615119 100644
--- a/doc/output.tex
+++ b/doc/output.tex
@@ -414,6 +414,18 @@ The following notes may be helpful.
   %
   (:classes :end)                                               \\ \hlx{v/}
   %
+  (:static-instances :start)    & static-instance, :h
+        & \begin{nprog} \banner{Public static instances} \\ \end{nprog}
+                                                                \\*\hlx{v}
+  :static-instances             & static-instance, :h
+        & \begin{nprog}
+            extern $[@"const"]$ struct @<class>{}__ilayout
+              @<inst>{}__instance;                              \\
+            \#define @<inst> (\&@<inst>{}__instance.@<h>.@<c>)
+          \end{nprog}                                           \\*
+  (:static-instances :end)      & static-instance, :h
+        &                                                       \\ \hlx{v/}
+  %
   (:user :start)                                                \\*
   :user                                                         \\*
   (:user :end)                                                  \\ \hlx{v/}
@@ -464,6 +476,39 @@ The following notes may be helpful.
   :early                                                        \\*
   (:early-user :end)                                            \\ \hlx{v/}
   %
+  (:static-instances :start)    & static-instance, :c
+        & \begin{nprog} \banner{Static instance definitions} \\ \end{nprog}
+                                                                \\*\hlx{v}
+  (:static-instances :decls)    & static-instance, :c
+        & \begin{nprog}
+            /* Forward declarations. */                         \\+
+            static $[@"const"]$ struct @<class>{}__ilayout
+              @<inst>{}__instance;                              \\
+            \#define @<inst> (\&@<inst>{}__instance.@<h>.@<c>)
+          \end{nprog}                                           \\*
+  (:static-instances :gap)      & static-instance, :c
+        &                                                       \\
+  (@<inst> :start)              & sod-class, 'static-instance
+        & \begin{nprog}
+            /* Static instance `@<inst>'. */                    \\
+            $[@"static"]$ $[@"const"]$ struct @<inst>{}__ilayout
+              @<inst>{}__instance = \{
+          \end{nprog}                                           \\*\hlx{v}
+  (@<inst> :chain @<chain-head> :start) & ichain, 'static-instance
+        & \quad \{ \{ /* @<n> ichain */                         \\*
+  (@<inst> :vtable @<chain-head>) & vtable-pointer, 'static-instance
+        & \slotlabel{3}{_vt} \&@<class>{}__vtable_@<h>.@<c>,    \\*
+  (@<inst> :slots @<super> :start) & islots, 'static-instance
+        & \quad\quad \{ /* Class @<super> */                    \\*
+  (@<inst> :slots @<super>)     & effective-slot, 'static-instance
+        & \slotlabel{4}{@<slot>} @<value>,                      \\*
+  (@<inst> :slots @<super> :end) & islots, 'static-instance
+        & \quad\quad \},                                        \\*
+  (@<inst> :chain @<chain-head> :end) & ichain, 'static-instance
+        & \quad \} \},                                          \\*
+  (@<inst> :end)                & sod-class, 'static-instance
+        & \begin{nprog} \}; \\ \end{nprog}                      \\ \hlx{v/}
+  %
   (:classes :start)                                             \\*\hlx{v}
   %
   (@<class> :banner)            & sod-class, :c
@@ -579,7 +624,7 @@ The following notes may be helpful.
     (@<class> \=:object                                         \\
               \>@<meta-head> :ichain :start)
   \end{nprog}                   & vtable-pointer, 'class
-        & \slotlabel{3}{_vt} \&@<meta>{}__vtable_@<n>,          \\*
+        & \slotlabel{3}{_vt} \&@<meta>{}__vtable_@<n>.@<m>,     \\*
   \begin{nprog}
     (@<class> \=:object                                         \\
               \>@<meta> :slots :start)
@@ -686,6 +731,17 @@ The following notes may be helpful.
                   \>@<in-names> @<out-names> @<stream>}}
 \end{describe*}
 
+\begin{describe}{var}{*static-instance*}
+\end{describe}
+
+\begin{describe}{gf}{declare-static-instance @<static-instance> @<stream>}
+\end{describe}
+
+\begin{describe}{gf}
+    {output-static-instance-initializer @<static-instance> @<effective-slot>
+                                        @<stream>}
+\end{describe}
+
 %%%----- That's all, folks --------------------------------------------------
 
 %%% Local variables:
