1、INTERNATIONAL STANDARD ISO/IEC 14364 First edition 1996-06-01 Information technology - Open Systems Interconnection (03) abstract data manipulation C language interfaces - Binding for Application Program Interface (API) Technologies de /information - Interfaces de langage C pour la manipulation de d
2、on FAX: +1202 728-9614. Introduction vii INTERNATIONAL STANDARD OISO/IEC ISO/IEC 14364:1996(E) 1 Information technology-Open Systems 2 Interconnection (OSI) abstract data 3 manipulation C language 4 interfaces-Binding for Application Program 5 Interface (API) 6 Section 1: General 7 8 This Internatio
3、nal Standard defines an ISO/IEC 9989 (111 C language binding to 9 the language-independent API defined in ISO/IEC 14360 (2). It is intended to sup- 10 port application portability at the source-code level and to be used by application 11 developers, system implementors, test method writers, and user
4、s. 12 1.2 Normative References 13 The following standards contain provisions which, through reference in this text, 14 constitute provisions of this International Standard. At the time of publication, 15 the editions indicated were valid. All standards are subject to revision, and parties 16 to agre
5、ements based on this International Standard are encouraged to investigate 17 the possibility of applying the most recent editions of the standards indicated 18 below. Members of IEC and IS0 maintain registers of currently valid Interna- 19 tional Standards. 20 (11 ISO/IEC 9899: 1990,2 Programming La
6、nguages-C. 21 1) The numbers in curly brackets correspond to those of the references in 1.2. 22 2) ISO/IEC documents can be obtained from the IS0 Central Secretariat, 1 Rue de VarembB, Case 23 Postale 56, CH-1211, Gen see ISO/IEC 8824 249 Bll). 250 251 OISOLIEC ISODEX 14364:1996(E) 2.2.2.59 workspac
7、e: A repository for instances of classes in the closures of one or more packages associated with the workspace. ISOLIEC 14360 a 2.2.3 Abbreviations For the purposes of this International Standard, the following abbreviations apply: 2.2.3.1 API: Application Program Interface. 2.2.3.6 OM: OS1 abstract
8、 data Manipulation. 2.2.3.7 OSI: Open Systems Interconnection. 252 2.2.3.8 UTC: Universal Coordinated Time. 2.2 Definitions 13 0 ISO/IEC ISOLIEC 14364:1996(E) Section 3: Service Interface 2 3.1 Introduction 3 This section defines the C language binding to the service interface. 4 3.2 Datatypes 5 Thi
9、s section defines the datatypes of the C language binding to the service 6 interface. 7 3.2.1 Intermediate Datatypes 8 Some datatypes are defined in terms of the following “intermediate datatypes,” 9 whose precise definitions in C are system defined: 10 11 OM-sin t The positive and negative integers
10、 that can be represented in 16 b. 12 13 OMgintl6 The positive and negative integers that can be represented in 16 b. 14 15 OM-sint32 The positive and negative integers that can be represented in 32 b. 16 17 18 19 20 OM-uint OM-uint16 OM-uint32 OM-double The nonnegative integers that can be represent
11、ed in 16 b. The nonnegative integers that can be represented in 16 b. The nonnegative integers that can be represented in 32 b. The positive and negative floating point numbers representable in 64 b. 21 22 23 24 25 The range of integers for OM-uint shall encompass the range for OM-sint . NOTE: The O
12、M-sint and OM-uint datatypes are defined above by the ranges of integers they have to accommodate. Implementations can define them by the range of integers the word size of the host machine permits. The OM-double datatype is defined by the range and precision of real numbers that it has to accommoda
13、te. The following examples will work on most machines. 3.2 Datatypes 15 ISO/IEX 14364:1996(E) OISO/IEC 26 27 28 29 30 31 32 3.2.2 Boolean 33 34 35 3.2.2.2 C Declaration 36 37 38 39 3.2.2.3 Description 40 A data value of this datatype is a Boolean, i.e., either false or true. 41 In the C interface, f
14、alse is denoted by zero OM-FALSE, and true is denoted by 42 any other integer (although the symbolic constant OM-TRUE refers to the 43 integer one specifically). 44 3.2.3 Descriptor 45 3.2.3.1 Name 46 Descriptor-Type definition for describing an attribute type and value. 47 3.2.3.2 C Declaration 48
15、49 50 51 52 53 typedef int OM-sint; typedef int OM-sintl6; typedef long int OM-sint32; typedef unsigned OM-uint; typedef unsigned OM-uint16; typedef long unsigned OM-uint32; typedef double OM-double; 3.2.2.1 Name Boolean-Type definition for a Boolean data value. typedef OM-uint32 OM-boolean; NOTE: T
16、he type is defined as 32 b in order to facilitate aggregate initialization of the OM-value union. typedef struct OM-descriptor-struct OM-type OM-syntax OM-value OM-descriptor; tme ; syntax; value ; 54 NOTE: Other components are encoded in the syntax member. 16 3 Service Interface OISO/IEC ISOklEC 14
17、364:1996(E) 55 A data value of this datatype is a descriptor, which embodies an attribute value. A 56 sequence of descriptors (an array in C) can represent all the values of all the attri- 57 butes of an object, and is the representation called a Public Object. A descriptor 58 has the following comp
18、onents: 59 60 61 62 63 value (Value) 64 The attribute value. 65 Additional information is encoded in the syntax structure member. The syntax 66 should always be masked with the constant OM-S-SYNTAX) because of this. For 67 example: 68 my-syntax = mygublic_object3.syntax 69 mygublic_object4.syntax =
19、70 my-syntax + (mygublic_object4.syntax 71 Alternatively, the macros OM-SYNTAX(d) and OM-SYNTAX-ASSIGN(d,s) may 72 be used for this purpose: 73 74 75 The additional information can be obtained by masking the syntax with the follow- 76 ing constants: 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
20、 94 95 96 3.2.3.3 Description type (Type) Identifies the type of the attribute value. syntax (Syntax) Identifies the syntax of the attribute value and contains addi- tional information, as described below. my-syntax = OM-SYNTAX( my_public_object3) ; OM-SYNTAX-ASSIGN( myqublic_object4, my-syntax) ; O
21、M-S-LONG-STRING True (i.e., nonzero) if, and only if, the descriptor is service gen- erated and the length of the value is greater than an implementation-defined limit. The macro OM-IS-LONG-STRING(d) may be used to test this flag. Only true if the descriptor is service generated and the value is not
22、 present because OM-EXCLUDE-VALUES) or OM-EXCLUDE-MULTIPLES was set in the call to om-getf). The macro OM-HAS-VALUE(d) may be used to test this flag. OM-S-LOCAL-STRING Only significant if the Syntax is String(*). True if, and only if, the string is represented in an implementation-defined local char
23、- acter set. The local character set may be more amenable for use as keyboard input or display output than the nonlocal character set, and it may include specific treatment of line termination sequences. Certain interface functions may convert information in string syntaxes to or from the local repr
24、esentation, which may result in a loss of information. 3.2 Datatypes 17 ISO/lEC 14364:1996(E) OISO/IEC 97 The macro OMJS-LOCAL-STRING(d) may be used to test this flag and OM-SET-LONG-STRING(d) to set it. 98 OMSSERVICEGENEIWTED 99 True if, and only if, the descriptor is service-generated and is 100 e
25、ither the first descriptor of a public object or the defined part of a 101 private object (see 4.2). 102 The macro OM-IS-SERVICE-GENERATED(d) may be used to 103 test this flag. 104 105 106 107 OM-S-PRIVATE True if, and only if, the descriptor is in the service-generated pub- lic object and contains
26、a reference to the handle of a private subobject, or is in the defined part of a private object. 108 This applies only when the descriptor is service-generated. The 109 client need not set this bit in a client-generated descriptor con- 110 taining a reference to a private object. 111 The macro OMJS-
27、PRIVATE(d) may be used to test this flag. 112 3.2.4 Enumeration 113 3.2.4.1 Name 114 Enumeration-Type definition for an Enumerated data value. 115 3.2.4.2 C Declaration 116 typedef OM-sint32 OM-enumeration; 117 3.2.4.3 Description 118 A data value of this datatype is an attribute value whose syntax
28、is an Enumeration 119 syntax. 120 NOTE: The type is defined as 32 b in order to facilitate aggregate initialization of the OM-value 121 union. 122 3.2.5 Exclusions 123 3.2.5.1 Name 124 Exclusions-Type definition for the “exclusions” argument of the Get function. 125 3.2.5.2 C Declaration 126 typedef
29、 OM-uint OM-exclusions; 18 3 Service Interface OISO/IEC ISO/IEC 14364:1996(E) 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 3.2.6 Integer 145 3.2.6.1 Name 146 Integer-Type definition for an Integer data value. 147 3.2.6.2 C Declaration 148 typedef OM-sint32 OM-integer; 149
30、150 151 3.2.7 Modification 152 153 3.2.5.3 Description A data value of this datatype is an unordered set of one or more values, all of which are distinct. Each value denotes an exclusion, as defined by the Get function, and is chosen from the following set: - OM-EXCLUDE-ALL-BUT-THESE-TYPES) - OM-EXC
31、LUDE-MULTIPLES) - OM-EXCLUDE-ALL-BUT-THESE-VALUES - OM-EXCLUDE-VALUES - OM-EXCLUDE-SUBOBJECTS - OMEXCLUDEDESCRIPTORS) Alternatively, the single value - OM-NO-EXCLUSIONS) may be chosen, which selects the entire object. Each value except OM-NO-EXCLUSIONS) is represented by a distinct bit, the presence
32、 of the value being represented as one and its absence as zero. Thus, mul- tiple exclusions are requested by adding or, equivalently, or-ing the values that denote the individual exclusions. A symbolic constant (with a name as above) shall be defined for each exclusion. 3.2.6.3 Description A data va
33、lue of this datatype is an attribute value whose syntax is Integer. 3.2.7.1 Name Modification-Type definition for the “modifications” argument of the Put function. 3.2 Datatypes 19 154 typedef OM-uint OM-modification; ISO/IEC 14364:1996(E) OISO/IEC 3.2.7.2 C Declaration 155 3.2.7.3 Description 156 1
34、57 158 159 160 161 162 163 A data value of this datatype denotes a kind of modification, as defined by the Put function. The following values shall be defined, corresponding to the values of om-modification-type of ISO/IEC 14360 (21: - OMJNSERT-AT-BEGINNING) - OMINSERTATCERTAIN_POINT - OM-INSERT-AT-
35、END) - OM-REPLACE-ALL) - (OMREPLACECERTAINVALUES 164 3.2.8 Object 165 3.2.8.1 Name 166 Object-Type definition for a handle to either a private or a public object. 167 3.2.8.2 C Declaration 168 typedef struct OM-descriptor-struct *OM-object; 169 3.2.8.3 Description 170 A data value of this datatype r
36、epresents an object, public or private. It is an 171 ordered sequence of one or more instances of the Descriptor datatype. See the 172 Private Object and Public Object datatypes for constraints upon that sequence. 173 3.2.9 Object Identifier 174 175 176 3.2.9.2 C Declaration 3.2.9.1 Name Object Iden
37、tifier-Type definition for an Object Identifier data value. 177 typedef OM-string OM-object-identifier; 20 3 Service Interface OISO/IEC ISOAEC 14364:1996(E) 178 A data value of this datatype contains an octet string that consists of the contents 179 octets of the BER encoding of an ASN.l object iden
38、tifier. 180 3.2.9.3.1 C Declaration of Object Identifiers 181 Every application program that makes use of a class or other Object Identifier 182 shall explicitly import it into every compilation unit (C! source module) that uses it. 183 Each such class or Object Identifier name shall be explicitly e
39、xported from just one 184 compilation module. Most application programs will find it convenient to export all 185 the names they use from the same compilation unit. Exporting and importing is 186 done by the following two macros: 187 188 189 190 191 OM-EXPORT(class-name) 192 OM-EXPORT(OID-name) 193
40、This macro allocates memory for the constants that represent the class or other 194 Object Identifier. 195 3.2.9.3.2 Use of Object Identifiers in C 196 Symbolic names for object identifiers shall be defined as shown in Table 3-1. 197 198 199 200 201 202 205 204 205 206 207 208 209 210 211 212 213 21
41、4 215 3.2.9.3 Description OM-IMPORT(classpame) OMIMPORT(OIDname) This macro makes the class or other Object Identifier constants available within a compilation unit. Table 3-1 - Symbolic Names for Object Identifiers Object Identifier Name OM package OMP-O-OM-OM Encoding class OMPOOMCENCODING Externa
42、l class OMP-O-OM-C-EXTERNAL Object class OMP-O-OM-C-OBJECT BER OMP-O-OM-BER Canonical BER OMPOOMCANONICALBER The following macros shall be provided by the implementation to assist the appli- cation to handle object identifiers. OMP-LENGTH(oid-string) This macro calculates the length of an object ide
43、ntifier. OM-OID-DESC(type, OID-name) This macro initializes a descriptor for a value of syntax String(Object- Identifier). It sets the type component to that given, sets the syntax component to OMSOBJECTIDENTIFIERSTRING, and sets the value component to be the given Object Identifier. OM-OBJ-DESC(typ
44、e, value) 3.2 Datatypes 21 ISO/IEC 14364:1996(E) OISO/IEC 216 217 This macro initializes a descriptor for a value of syntax Object(*). It sets the type component to that given, sets the syntax component to OM-S-OBJECT), and sets the value component to that given. 218 OM-NULL-DESCRIPTOR 219 220 This
45、macro initializes a descriptor to mark the end of a client-allocated public object. 221 OM-C-class-name 222 For each class, and for other Object Identifiers, there is a global variable with the 223 same name (e.g., the External class has a variable called OM-C-EXTERNAL; the 224 Object Identifier for
46、 BER rules has a variable called OM_BER). This variable can 225 be supplied as an argument to functions when required. 226 Figure 3-l provides examples of the use of these macros. 227 3.2.10 Private Object 228 3.2.10.1 Name 229 Private Object-Type definition for a handle to an object in an implement
47、ation- 230 defined, or private, representation. 231 3.2.10.2 C Declaration 232 typedef OM-object OM_private-object; 233 3.2.10.3 Description 234 A data value of this datatype is the designator or handle for a private object. It 235 consists of a single descriptor whose Type component is OM-PRIVATE-O
48、BJECT) 236 and whose Representation, Syntax, and Value components are unspecified. 237 NOTE: The Representation, Syntax, and Value components of the descriptor are essential to the 238 proper operation of the service with respect to the private object. Of no concern to the client, their 239 nature i
49、s of concern to service implementors and is therefore further specified in Section 4. 240 3.2.11 Public Object 241 3.2.11.1 Name 242 Public Object-Type definition for a defined representation of an object that can be 243 directly interrogated by a programmer. 244 3.2.11.2 C Declaration 245 typedef OM-object OM_public-object; 22 3 Service Interface OISO/IEC ISO/IEC 14364:1996(E) 246 /* Examples of the use of the macros and constants. */ 247 #include 248 249 250 251 252 253 254 255 256 257 258 259 260 261
copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1