1libpicl(3PICL) PICL Library Functions libpicl(3PICL)
2
3
4
6 libpicl - PICL interface library
7
9 cc [ flag ... ] file ... -lpicl [ library ... ]
10 #include <picl.h>
11
12
14 The PICL interface is the platform-independent interface for clients to
15 access the platform information. The set of functions and data struc‐
16 tures of this interface are defined in the <picl.h> header.
17
18
19 The information published through PICL is organized in a tree, where
20 each node is an instance of a well-defined PICL class. The functions in
21 the PICL interface allow the clients to access the properties of the
22 nodes.
23
24
25 The name of the base PICL class is picl, which defines a basic set of
26 properties that all nodes in the tree must possess. The following table
27 shows the property set of a picl class node.
28
29
30
31
32 ┌─────────────────────────────┬────────────────────────────────────┐
33 │ Property Name │ Property Value │
34 ├─────────────────────────────┼────────────────────────────────────┤
35 │name │The name of the node │
36 ├─────────────────────────────┼────────────────────────────────────┤
37 │_class │The PICL class name of the node │
38 ├─────────────────────────────┼────────────────────────────────────┤
39 │_parent │Node handle of the parent node │
40 ├─────────────────────────────┼────────────────────────────────────┤
41 │_child │Node handle of the first child node │
42 ├─────────────────────────────┼────────────────────────────────────┤
43 │_peer │Node handle of the next peer node │
44 └─────────────────────────────┴────────────────────────────────────┘
45
46
47 Property names with a a leading underscore ('_') are reserved for use
48 by the PICL framework. The property names _class, _parent, _child, and
49 _peer are reserved names of the PICL framework, and are used to refer
50 to a node's parent, child, and peer nodes, respectively. A client
51 shall access a reserved property by their names only as they do not
52 have an associated handle. The property name is not a reserved prop‐
53 erty, but a mandatory property for all nodes.
54
55
56 Properties are classified into different types. Properties of type
57 integer, unsigned-integer, and float have integer, unsigned integer,
58 and floating-point values, respectively. A table property type has the
59 handle to a table as its value. A table is a matrix of properties. A
60 reference property type has a handle to a node in the tree as its
61 value. A reference property may be used to establish an association
62 between any two nodes in the tree. A timestamp property type has the
63 value of time in seconds since Epoch. A bytearray property type has an
64 array of bytes as its value. A charstring property type has a nul (' ')
65 terminated sequence of ASCII characters. The size of a property speci‐
66 fies the size of its value in bytes. A void property type denotes a
67 property that exists but has no value.
68
69
70 The following table lists the different PICL property types enumerated
71 in picl_prop_type_t.
72
73
74
75
76 ┌─────────────────────────────┬─────────────────────────────┐
77 │ Property Type │ Property Value │
78 ├─────────────────────────────┼─────────────────────────────┤
79 │PICL_PTYPE_VOID │None │
80 ├─────────────────────────────┼─────────────────────────────┤
81 │PICL_PTYPE_INT │Is an integer │
82 ├─────────────────────────────┼─────────────────────────────┤
83 │PICL_PTYPE_UNSIGNED_INT │Is an unsigned integer │
84 ├─────────────────────────────┼─────────────────────────────┤
85 │PICL_PTYPE_FLOAT │Is a floating-point number │
86 ├─────────────────────────────┼─────────────────────────────┤
87 │PICL_PTYPE_REFERENCE │Is a PICL node handle │
88 └─────────────────────────────┴─────────────────────────────┘
89
90 Reference Property Naming Convention
91 Reference properties may be used by plug-ins to publish properties in
92 nodes of different classes. To make these property names unique, their
93 names must be prefixed by _picl_class_name_, where picl_class_name is
94 the class name of the node referenced by the property. Valid PICL class
95 names are combinations of uppercase and lowercase letters 'a' through
96 'z', digits '0' through '9', and '-' (minus) characters. The string
97 that follows the '_picl_class_name_' portion of a reference property
98 name may be used to indicate a specific property in the referenced
99 class, when applicable.
100
101 Property Information
102 The information about a node's property that can be accessed by PICL
103 clients is defined by the picl_propinfo_t structure.
104
105 typedef struct {
106 picl_prop_type_t type; /* property type */
107 unsigned int accessmode; /* read, write */
108 size_t size; /* item size or
109 string size */
110 char name[PICL_PROPNAMELEN_MAX];
111 } picl_propinfo_t;
112
113
114
115 The type member specifies the property value type and the accessmode
116 specifies the allowable access to the property. The plug-in module that
117 adds the property to the PICL tree also sets the access mode of that
118 property. The volatile nature of a property created by the plug-in is
119 not visible to the PICL clients. The size member specifies the number
120 of bytes occupied by the property's value. The maximum allowable size
121 of property value is PICL_PROPSIZE_MAX, which is set to 512KB.
122
123 Property Access Modes
124 The plug-in module may publish a property granting a combination of the
125 following access modes to the clients:
126
127 #define PICL_READ 0x1 /* read permission */
128 #define PICL_WRITE 0x2 /* write permission */
129
130
131 Property Names
132 The maximum length of the name of any property is specified by
133 PICL_PROPNAMELEN_MAX.
134
135 Class Names
136 The maximum length of a PICL class name is specified by PICL_CLASSNAME‐
137 LEN_MAX.
138
140 See attributes(5) for descriptions of the following attributes:
141
142
143
144
145 ┌─────────────────────────────┬─────────────────────────────┐
146 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
147 ├─────────────────────────────┼─────────────────────────────┤
148 │MT-Level │MT-Safe │
149 └─────────────────────────────┴─────────────────────────────┘
150
152 libpicl(3LIB), attributes(5)
153
154
155
156SunOS 5.11 28 Mar 2000 libpicl(3PICL)