vars.am, lib/: Add some manual pages for the library.
[sod] / lib / sod-structs.3
CommitLineData
47de28ae
MW
1.\" -*-nroff-*-
2.\"
3.\" Description of the main Sod data structures
4.\"
5.\" (c) 2015 Straylight/Edgeware
6.\"
7.
8.\"----- Licensing notice ---------------------------------------------------
9.\"
10.\" This file is part of the Sensble Object Design, an object system for C.
11.\"
12.\" SOD is free software; you can redistribute it and/or modify
13.\" it under the terms of the GNU General Public License as published by
14.\" the Free Software Foundation; either version 2 of the License, or
15.\" (at your option) any later version.
16.\"
17.\" SOD is distributed in the hope that it will be useful,
18.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
19.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20.\" GNU General Public License for more details.
21.\"
22.\" You should have received a copy of the GNU General Public License
23.\" along with SOD; if not, write to the Free Software Foundation,
24.\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25.
26.\"\X'tty: sgr 1'
27.\" String definitions and font selection.
28.ie t \{\
29. ds o \(bu
30. if \n(.g .fam P
31.\}
32.el \{\
33. ds o o
34.\}
35.
36.\" .hP TEXT -- start an indented paragraph with TEXT hanging off to the left
37.de hP
38.IP
39\h'-\w'\fB\\$1\ \fP'u'\fB\\$1\ \fP\c
40..
41.
42.\"--------------------------------------------------------------------------
43.TH sod-structs 3 "8 September 2015" "Straylight/Edgeware" "Sensible Object Design"
44.
45.SH NAME
46sod-structs \- main Sod data structures
47.
48.\"--------------------------------------------------------------------------
49.SH SYNOPSIS
50.nf
51.ft B
52#include <sod/sod.h>
53
54typedef struct SodObject__ichain_obj SodObject;
55typedef struct SodClass__ichain_obj SodClass;
56
57struct sod_instance {
58\h'2n'const struct sod_vtable *_vt;
59};
60
61struct sod_vtable {
62\h'2n'const SodClass *_class;
63\h'2n'size_t _base;
64};
65
66struct SodObject__vt_obj {
67\h'2n'const SodClass *_class;
68\h'2n'size_t _base;
69};
70
71struct SodObject__ilayout {
72\h'2n'union {
73\h'4n'struct SodObject__ichain_obj {
74\h'6n'const struct SodObject__vt_obj *_vt;
75\h'4n'};
76\h'2n'} obj;
77};
78
79extern const struct SodClass__ilayout SodObject__classobj;
80#define SodObject__class (&SodObject__classobj.obj.cls)
81
82struct SodClass__vt_obj {
83\h'2n'const SodClass *_class;
84\h'2n'size_t _base;
85};
86
87struct SodObject__ilayout {
88\h'2n'union {
89\h'4n'struct SodClass__ichain_obj {
90\h'6n'const struct SodClass__vt_obj *_vt;
91\h'6n'struct SodClass__islots {
92\h'8n'const char *name;
93\h'8n'const char *nick;
94\h'8n'size_t initsz;
95\h'8n'void *(*imprint)(void *\fIp\fB);
96\h'8n'void *(*init)(void *\fIp\fB);
97\h'8n'size_t n_supers;
98\h'8n'const SodClass *const *supers;
99\h'8n'size_t n_cpl;
100\h'8n'const SodClass *const *cpl;
101\h'8n'const SodClass *link;
102\h'8n'const SodClass *head;
103\h'8n'size_t level;
104\h'8n'size_t n_chains;
105\h'8n'const struct sod_chain *chains;
106\h'8n'size_t off_islots;
107\h'8n'size_t islotsz;
108\h'6n'} cls;
109\h'4n'};
110\h'4n'SodObject obj;
111\h'2n'} obj;
112};
113
114struct sod_chain {
115\h'2n'size_t n_classes;
116\h'2n'const SodClass *const *classes;
117\h'2n'size_t off_ichain;
118\h'2n'const struct sod_vtable *vt;
119\h'2n'size_t ichainsz;
120};
121
122extern const struct SodClass__ilayout SodClass__classobj;
123#define SodClass__class (&SodClass__classobj.obj.cls)
124.fi
125.ft P
126.
127.\"--------------------------------------------------------------------------
128.SH DESCRIPTION
129.
130This page describes the structure and layout
131of standard Sod objects, classes and associated metadata.
132Note that Sod's object system is very flexible
133and it's possible for an extension
134to define a new root class
135which works very differently from the standard
136.B SodObject
137described here.
138.
139.\"--------------------------------------------------------------------------
140.SH COMMON INSTANCE STRUCTURE
141.
142As described below,
143a pointer to an instance actually points to an
144.I "instance chain"
145structure within the instances overall layout structure.
146.PP
147Instance chains contain slots and vtable pointers,
148as described below.
149All instances have the basic structure of a
150.BR "struct sod_instance" ,
151which has the following members.
152.TP
153.B "const struct sod_vtable *_vt"
154A pointer to a
155.IR vtable ,
156which has the basic structure of a
157.BR "struct sod_vtable" ,
158described below.
159.PP
160A vtable contains static metadata needed
161for efficient conversions and
162message dispatch,
163and pointers to the instance's class.
164Each chain points to a different vtable
165All vtables have the basic structure of a
166.BR "struct sod_vtable" ,
167which has the following members.
168.TP
169.B "const SodClass *_class"
170A pointer to the instance's class object.
171.TP
172.B "size_t _base;"
173The offset of this chain structure
174above the start of the overall instance layout, in bytes.
175Subtracting
176.B _base
177from the instance chain pointer
178finds the layout base address.
179.
180.\"--------------------------------------------------------------------------
181.SH BUILT-IN ROOT OBJECTS
182.
183This section describes the built-in classes
184.B SodObject
185and
186.BR SodClass ,
187which are the standard roots of the inheritance and metaclass graphs
188respectively.
189Specifically,
190.B SodObject
191has no direct superclasses,
192and
193.B SodClass
194is its own metaclass.
195It is not possible to define root classes because of circularities:
196.B SodObject
197has
198.B SodClass
199as its metaclass, and
200.B SodClass
201is a subclass of
202.BR SodObject .
203Extensions can define additional root classes,
204but this is tricky,
205and not really to be recommended.
206.
207.SS The SodObject class
208The
209.B SodObject
210class defines no slots or messages.
211Because
212.B SodObject
213has no direct superclasses,
214there is only one chain,
215and no inherited slots or messages,
216so the single chain contains only a vtable pointer.
217.PP
218Since there are no messages,
219and
220.B SodClass
221also has only one chain,
222the vtable contains only the standard class pointer and offset-to-base
223members.
224In an actual instance of
225.B SodObject
226(why would you want one?)
227the class pointer contains the address of
228.B SodObject__class
229and the offset is zero.
230.
231.SS The SodClass class
232The
233.B SodClass
234class defines no messages,
235but there are a number of slots.
236Its only direct superclass is
237.B SodObject
238and so (like its superclass) its vtable is trivial.
239.PP
240The slots defined are as follows.
241.TP
242.B const char *name;
243A pointer to the class's name.
244.TP
245.B const char *nick;
246A pointer to the class's nickname.
247.TP
248.B size_t initsz;
249The size in bytes required to store an instance of the class.
250.TP
251.BI "void *(*imprint)(void *" p );
252A pointer to a function:
253given a pointer
254.I p
255to at least
256.I initsz
257bytes of appropriately aligned memory,
258`imprint' this memory it so that it becomes a minimally functional
259instance of the class:
260all of the vtable and class pointers are properly initialized,
261but the slots are left untouched.
262The function returns its argument
263.IR p .
264.TP
265.BI "void *(*init)(void *" p );
266A pointer to a function:
267given a pointer
268.I p
269to at least
270.I initsz
271bytes of appropriately aligned memory,
272initialize an instance of the class in it:
273all of the vtable and class pointers are initialized,
274as are slots for which initializers are defined.
275Other slots are left untouched.
276The function returns its argument
277.IR p .
278.TP
279.B size_t n_supers;
280The number of direct superclasses.
281(This is zero exactly in the case of
282.BR SodObject .)
283.TP
284.B const SodClass *const *supers;
285A pointer to an array of
286.I n_supers
287pointers to class objects
288listing the class's direct superclasses,
289in the order in which they were listed in the class definition.
290If
291.I n_supers
292is zero,
293then this pointer is null.
294.TP
295.B size_t n_cpl;
296The number of superclasses in the class's class precedence list.
297.TP
298.B const SodClass *const *cpl;
299A pointer to an array of pointers to class objects
300listing all of the class's superclasses,
301from most- to least-specific,
302starting with the class itself,
303so
304.IB c ->cls.cpl[0]
305=
306.I c
307for all class objects
308.IR c .
309.TP
310.B const SodClass *link;
311If the class is a chain head, then this is a null pointer;
312otherwise it points to the class's distinguished link superclass
313(which might or might not be a direct superclass).
314.TP
315.B const SodClass *head;
316A pointer to the least-specific class in this class's chain;
317so
318.IB c ->cls.head->cls.link
319is always null,
320and either
321.IB c ->cls.link
322is null
323(in which case
324.IB c ->cls.head
325=
326.IR c )
327or
328.IB c ->cls.head
329=
330.IB c ->cls.link->cls.head \fR.
331.TP
332.B size_t level;
333The number of less specific superclasses in this class's chain.
334If
335.IB c ->cls.link
336is null then
337.IB c ->cls.level
338is zero;
339otherwise
340.IB c ->cls.level
341=
342.IB c ->cls.link->cls.level
343+ 1.
344.TP
345.B size_t n_chains;
346The number of chains formed by the class's superclasses.
347.TP
348.B const struct sod_chain *chains;
349A pointer to an array of
350.B struct sod_chain
351structures (see below) describing the class's superclass chains,
352in decreasing order of specificity of their most specific classes.
353It is always the case that
354.IB c ->cls.chains[0].classes[ c ->cls.level]
355=
356.IR c .
357.TP
358.B size_t off_islots;
359The offset of the class's
360.B islots
361structure relative to its containing
362.B ichain
363structure.
364The class doesn't define any slots if and only if this is zero.
365(The offset can't be zero because the vtable pointer is at offset zero.)
366.TP
367.B size_t islotsz;
368The size required to store the class's direct slots,
369i.e., the size of its
370.B islots
371structure.
372The class doesn't define any slots if and only if this is zero.
373.PP
374The
375.B struct sod_chain
376structure describes an individual chain of superclasses.
377It has the following members.
378.TP
379.B size_t n_classes;
380The number of classes in the chain.
381This is always at least one.
382.TP
383.B const SodClass *const *classes;
384A pointer to an array of class pointers
385listing the classes in the chain from least- to most-specific.
386So
387.IB classes [ i ]->cls.head
388=
389.IB classes [0]
390for all
3910 \(<=
392.I i
393<
394.IR n_classes ,
395.IB classes [0]->cls.link
396is always null,
397and
398.IB classes [ i ]->cls.link
399=
400.IB classes [ "i\fR \- 1" ]
401if
4021 \(<=
403.I i
404<
405.IR n_classes .
406.TP
407.B size_t off_ichain;
408The size of the
409.B ichain
410structure for this chain.
411.TP
412.B const struct sod_vtable *vt;
413The vtable for this chain.
414(It is possible, therefore, to duplicate the behaviour of the
415.I imprint
416function by walking the chain structure.
417The
418.I imprint
419function is much faster, though.)
420.TP
421.B size_t ichainsz;
422The size of the
423.B ichain
424structure for this chain.
425.
426.\"--------------------------------------------------------------------------
427.SH CLASS AND VTABLE LAYOUT
428.
429The layout algorithms for Sod instances and vtables are nontrivial.
430They are defined here in full detail,
431since they're effectively fixed by Sod's ABI compatibility guarantees,
432so they might as well be documented for the sake of interoperating
433programs.
434.PP
435Unfortunately, the descriptions are rather complicated,
436and, for the most part not necessary to a working understanding of Sod.
437The skeleton structure definitions shown should be more than enough
438for readers attempting to make sense of the generated headers and tables.
439.PP
440In the description that follows,
441uppercase letters vary over class names,
442while the corresponding lowercase letters indicate the class nicknames.
443Throughout, we consider a class
444.I C
445(therefore with nickname
446.IR c ).
447.
448.SS Generic instance structure
449The entire state of an instance of
450.I C
451is contained in a single structure of type
452.B struct
453.IB C __ilayout \fR.
454.IP
455.nf
456.ft B
457struct \fIC\fB__ilayout {
458\h'2n'union \fIC\fB__ichainu_\fIh\fB {
459\h'4n'struct \fIC\fB__ichain_\fIh\fB {
460\h'6n'const struct \fIC\fB__vt_\fIh\fB *_vt;
461\h'6n'struct \fIH\fB__islots \fIh\fB;
462\h'6n'\fR...\fB
463\h'6n'struct \fIC\fB__islots {
464\h'8n'\fItype\fB \fIslota\fB;
465\h'8n'\fR...\fB
466\h'6n'} \fIc\fB;
467\h'4n'} \fIc\fB;
468\h'4n'\fR...\fB
469\h'4n'struct \fIH\fB__ichain_\fIh\fB \fIh\fB;
470\h'2n'} \fIh\fB;
471\h'2n'union \fIB\fB__ichainu_\fIi\fB \fIi\fB;
472\h'2n'\fR...\fB
473};
474
475typedef struct \fIC\fB__ichain_\fIh\fB \fIC\fB;
476.ft P
477.fi
478.PP
479The set of superclasses of
480.IR C ,
481including itself,
482can be partitioned into chains
483by following their distinguished superclass links.
484(Formally, the chains are the equivalence classes determined by
485the reflexive, symmetric, transitive closure of
486the `links to' relation.)
487Chains are identified by naming their least specific classes;
488the least specific class in a chain is called the
489.IR "chain head" .
490Suppose that the chain head of the chain containing
491.I C
492itself is named
493.I H
494(though keep in mind that it's possible that
495.I H
496is in fact
497.I C
498itself.)
499.PP
500The
501.B ilayout
502structure contains one member for each of
503.IR C 's
504superclass chains.
505The first such member is
506.IP
507.B
508.B union
509.IB C __ichainu_ h
510.IB h ;
511.PP
512described below;
513this is followed by members
514.IP
515.B union
516.IB B __ichainu_ i
517.IB i ;
518.PP
519for each other chain,
520where
521.I I
522is the head
523and
524.I B
525the tail (most-specific) class of the chain.
526The members are in decreasing order
527of the specificity of the chains' most-specific classes.
528(Note that all but the first of these unions
529has already been defined as part of
530the definition of the corresponding
531.IR B .)
532.PP
533The
534.B ichainu
535union contains a member for each class in the chain.
536The first is
537.IP
538.B struct
539.IB C __ichain_ h
540.IB c ;
541.PP
542and this is followed by corresponding members
543.IP
544.B struct
545.IB A __ichain_ h
546.IB a ;
547.PP
548for each of
549.IR C 's superclasses
550.IR A
551in the same chain in some (unimportant) order.
552A `pointer to
553.IR C '
554is always assumed
555(and, indeed, defined in C's type system)
556to be a pointer to the
557.B struct
558.IB C __ichain_ h \fR.
559.PP
560The
561.B ichain
562structure contains (in order), a pointer
563.IP
564.B const
565.B struct
566.IB C __vt_ h
567.B *_vt;
568.PP
569followed by a structure
570.IP
571.B struct
572.IB A __islots
573.IB a ;
574.PP
575for each superclass
576.I A
577of
578.IR C
579in the same chain which defines slots,
580from least- to most-specific;
581if
582.I C
583defines any slots,
584then the last member is
585.IP
586.B struct
587.IB C __islots
588.IB c ;
589.PP
590Finally, the
591.B islots
592structure simply contains one member for each slot defined by
593.I C
594in the order they appear in the class definition.
595.
596.SS Generic vtable structure
597As described above,
598each
599.B ichain
600structure of an instance's storage
601has a vtable pointer
602.IP
603.B const
604.B struct
605.IB C __vt_ h
606.B *_vt;
607.PP
608In general,
609the vtables for the different chains
610will have
611.I different
612structures.
613.PP
614The instance layout split neatly into disjoint chains.
615This is necessary because
616each
617.B ichain
618must have as a prefix the
619.B ichain
620for each superclass in the same chain, and
621each slot must be stored in exactly one place.
622The layout of vtables doesn't have this second requirement:
623it doesn't matter that there are
624multiple method entry pointers
625for the same effective method
626as long as they all work correctly.
627.PP
628A vtable for a class
629.I C
630with chain head
631.I H
632has the following general structure.
633.IP
634.nf
635.ft B
636union \fIC\fB__vtu_\fIh\fB {
637\h'2n'struct \fIC\fB__vt_\fIh\fB {
638\h'4n'const \fIP\fB *_class;
639\h'4n'size_t _base;
640\h'4n'\fR...\fB
641\h'4n'const \fIQ\fB *_cls_\fIj\fB;
642\h'4n'\fR...\fB
643\h'4n'ptrdiff_t _off_\fIi\fB;
644\h'4n'\fR...\fB
645\h'4n'struct \fIC\fB__vtmsgs_\fIa\fB {
646\h'6n'\fItype\fB (*\fImsg\fB)(\fIC\fB *, \fR...\fB);
647\h'6n'\fR...\fB
648\h'4n'} \fIa\fB;
649\h'4n'\fR...\fB
650\h'2n'} \fIc\fB;
651};
652
653extern const union \fIC\fB__vtu_\fIh\fB \fIC\fB__vtable_\fIh\fB;
654.ft P
655.fi
656.PP
657The outer layer is a
658.IP
659.B union
660.IB C __vtu_ h
661.PP
662containing a member
663.IP
664.B struct
665.IB A __vt_ h
666.IB a ;
667.PP
668for each of
669.IR C 's
670superclasses
671.I A
672in the same chain,
673with
674.I C
675itself listed first.
676This is mostly an irrelevant detail,
677whose purpose is to defend against malicious compilers:
678pointers are always to one of the inner
679.B vt
680structures.
681It's important only because it's the outer
682.B vtu
683union which is exported by name.
684Specifically, for each chain of
685.IR C 's
686superclasses
687there is an external object
688.IP
689.B const union
690.IB A __vtu_ i
691.IB C __vtable_ i ;
692.PP
693where
694.I A
695and
696.I I
697are respectively the most and least specific classes in the chain.
698.PP
699The first member in the
700.B vt
701structure is the
702.I root class pointer
703.IP
704.B const
705.IR P
706.B *_class;
707.PP
708Among the superclasses of
709.I C
710there must be exactly one class
711.I O
712which itself has no direct superclasses;
713this is the
714.I root superclass
715of
716.IR C .
717(This is a rule enforced by the Sod translator.)
718The metaclass
719.I R
720of
721.IR O .
722is then the
723.I root metaclass
724of
725.IR C .
726The
727.B _class
728member points to the
729.B ichain
730structure of most specific superclass
731.I P
732of
733.I M
734in the same chain as
735.IR R .
736.PP
737This is followed by the
738.I base offset
739.IP
740.B size_t
741.B _base;
742.PP
743which is simply the offset of the
744.B ichain
745structure from the instance base.
746.PP
747The rest of the vtable structure is populated
748by walking the superclass chain containing
749.I C
750as follows.
751For each such superclass
752.IR B ,
753in increasing order of specificity,
754walk the class precedence list of
755.IR B ,
756again starting with its least-specific superclass.
757(This complex procedure guarantees that
758the vtable structure for a class is a prefix of
759the vtable structure for any of its subclasses in the same chain.)
760.PP
761So, let
762.I A
763be some superclass of
764.I C
765which has been encountered during this traversal.
766.hP \*o
767Let
768.I N
769be the metaclass of
770.IR A .
771Examine the superclass chains of
772.I N
773in order of decreasing specificity of their most-specific classes.
774Let
775.I J
776be the chain head of such a chain,
777and let
778.I Q
779be the most specific superclass of
780.I M
781in the same chain as
782.IR J .
783Then, if there is currently no class pointer of type
784.I Q
785then add a member
786.RS
787.IP
788.B const
789.I Q
790.BI *_cls_ j ;
791.PP
792to the vtable
793pointing to the appropriate
794.B islots
795structure within
796.IR M 's
797class object.
798.RE
799.hP \*o
800Examine the superclass chains of
801.I A
802in order of decreasing specificity of their most-specific classes.
803Let
804.I I
805be the chain head of such a chain.
806If there is currently no member
807.BI _off_ i
808then add a member
809.RS
810.IP
811.B ptrdiff_t
812.BI _off_ i ;
813.PP
814to the vtable,
815containing the (signed) offset from the
816.B ichain
817structure of the chain headed by
818.I h
819to that of the chain headed by
820.I i
821within the instance's layout.
822.RE
823.hP \*o
824If class
825.I A
826defines any messages,
827and there is currently no member
828.I a
829then add a member
830.RS
831.IP
832.B struct
833.IB C __vtmsgs_ a
834.IB a ;
835.PP
836to the vtable.
837See below.
838.RE
839.PP
840Finally, the
841.B vtmsgs
842structures contain pointers to the effective method entry functions
843for the messages defined by a superclass.
844There may be more than one method entry for a message,
845but all of the entry pointers for a message appear together,
846and entry pointers for separate messages appear
847in the order in which the messages are defined.
848If the receiver class has no applicable primary method for a message
849then it's usual for the method entry pointer to be null
850(though, as with a lot of things in Sod,
851extensions may do something different).
852.PP
853For a standard message which takes a fixed number of arguments,
854defined as
855.IP
856.I tr
857.IB m ( \c
858.I t1
859.IB a1 ,
860.RB ... ,
861.I tn
862.IB an );
863.PP
864there is always a `main' entry point,
865.IP
866.I tr
867.BI (* m )( \c
868.I C
869.BI * me ,
870.I t1
871.IB a1 ,
872.RB ... ,
873.I tn
874.IB an );
875.PP
876For a standard message which takes a variable number of arguments,
877defined as
878.IP
879.I tr
880.IB m ( \c
881.I t1
882.IB a1 ,
883.RB ... ,
884.I tn
885.IB an ,
886.B ...);
887.PP
888two entry points are defined:
889the usual `main' entry point
890which accepts a variable number of
891arguments,
892and a `valist' entry point
893which accepts an argument of type
894.B va_list
895in place of the variable portion of the argument list.
896.IP
897.I tr
898.BI (* m )( \c
899.I C
900.BI * me ,
901.I t1
902.IB a1 ,
903.RB ... ,
904.I tn
905.IB an ,
906.B ...);
907.br
908.I tr
909.BI (* m __v)( \c
910.I C
911.BI * me ,
912.I t1
913.IB a1 ,
914.RB ... ,
915.I tn
916.IB an ,
917.B va_list
918.IB sod__ap );
919.
920.SS Additional definitions
921In addition to the instance and vtable structures described above,
922the following definitions are made for each class
923.IR C .
924.PP
925For each message
926.I m
927directly defined by
928.I C
929there is a macro definition
930.IP
931.B #define
932.IB C _ m ( me ,
933.RB ... )
934.IB me ->_vt-> c . m ( me ,
935.RB ... )
936.PP
937which makes sending the message
938.I m
939to an instance of (any subclass of)
940.I C
941somewhat less ugly.
942If
943.I m
944takes a variable number of arguments,
945the macro is more complicated
946and is only available in compilers advertising C99 support,
947but the effect is the same.
948For each variable-argument message,
949there is also an additional macro
950for calling the `valist' entry point.
951.IP
952.B #define
953.IB C _ m __v( me ,
954.RB ...,
955.IB sod__ap )
956.if !t \{\
957\e
958.br
959\h'4m'\c
960.\}
961.IB me ->_vt-> c . m __v( me ,
962.RB ...,
963.IB sod__ap )
964.PP
965For each proper superclass
966.I A
967of
968.IR C ,
969there is a macro defined
970.IP
971.I A
972.BI * C __CONV_ a ( C
973.BI * _obj );
974.PP
975(named in
976.IR "upper case" )
977which converts a (static-type) pointer to
978.I C
979to a pointer to the same actual instance,
980but statically typed as a pointer to
981.IR A .
982This is most useful when
983.I A
984is not in the same chain as
985.I C
986since in-chain upcasts are both trivial and rarely needed,
987but the full set is defined for the sake of completeness.
988.PP
989Finally, the class object is defined as
990.IP
991.B extern const struct
992.IB R __ilayout
993.IB C __classobj;
994.br
995.B #define
996.IB C __class
997.BI (& C __classobj. j . r )
998.PP
999The exported symbol
1000.IB C __classobj
1001contains the entire class instance.
1002This is usually rather unwieldy.
1003The macro
1004.IB C __class
1005is usable as a pointer of type
1006.B const
1007.I R
1008.BR * ,
1009where
1010.I R
1011is the root metaclass of
1012.IR C ,
1013i.e., the metaclass of the least specific superclass of
1014.IR C ;
1015usually this is
1016.BR "const SodClass *" .
1017.
1018.\"--------------------------------------------------------------------------
1019.SH SEE ALSO
1020.BR sod (3).
1021.
1022.\"--------------------------------------------------------------------------
1023.SH AUTHOR
1024Mark Wooding, <mdw@distorted.org.uk>
1025.
1026.\"----- That's all, folks --------------------------------------------------