Information technology — Portable Common Tool Environment (PCTE) — Part 2: C programming language binding

Technologies de l'information — Environnement d'outil courant portable (PCTE) — Partie 2: Interface de programmation en langage de programmation C

General Information

Status
Withdrawn
Publication Date
31-May-1995
Withdrawal Date
31-May-1995
Current Stage
9599 - Withdrawal of International Standard
Completion Date
15-Oct-1998
Ref Project

Relations

Buy Standard

Standard
ISO/IEC 13719-2:1995 - Information technology -- Portable Common Tool Environment (PCTE)
English language
152 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (Sample)

I NTERNATI O NAL
ISO/IEC
STANDARD
13719-2
First edition
1995-06-01
Information technology - Portable
Tool Environment (PCTE) -
Common
Part 2:
C programming language binding
Technologies de l’information - Environnement d‘outil courant portable
(PCTE) -
Partie 2: Liant de langage de programmation C
Reference number
ISO/IEC 1371 9-2 1995(E)

---------------------- Page: 1 ----------------------
ISOAEC 13719-2:1995(E)
Contents
1
1 Scope
1
2 Conformance
1
Normative references
3
2
4 Definitions
2
5 Formal notations
2
6 Outline of the standard
3
7 Binding strategy
3
C Programming Language Standard
7.1
3
7.2 General Principles
3
7.3 Sets and Sequences
4
7.4 Character Strings
4
7.5 Memory Allocation
5
7.6 References and Names
5
7.7 Operation Return Values
5
7.8 Error Conditions
5
7.9 Identifiers
6
7.10 Implementation Limits.
6
8
Datatype mapping
6
8.1 Maminn of PCTE DatatvPes to LI Datatypes
O ISO/IEC 1995
All rights reserved. Unless otherwise specified, no part of this publication may be
reproduced or utilized in any form or by any means, electronic or mechanical, including
photocopying and microfilm, without permission in writing from the publisher.
HSO/IEC Copyright Office Case postale 56 CH-121 1 Genève 20 Switzerland
Printed in Switzerland
..
11

---------------------- Page: 2 ----------------------
0 ISO/IEC ISOnEC 13719-2:1995(E)
6
8.1.1 Mapping of Predefined PCTE Datatypes
8
8.1.2 Mapping of Private PCTE Datatypes
8
8.1.3 Mapping of Complex PCTE Datatypes
8.1.4 New LI Datatype Generators 8
10
8.2 Mapping of LI Datatypes to C Datatypes
LI Datatype: boolean 10
8.2.1
11
8.2.2 LI Datatype: pcte-integer
12
8.2.3 LI Datatype: pcte-natural
13
8.2.4 LI Datatype: pcte-float
14
8.2.5 LI Datatype: pcte-time
15
8.2.6 LI Datatype: pcte-text
16
8.2.7 LI Datatype: octet
16
8.2.8 LI Enumerated Datatype: pcte-xxx
16
8.2.9 LI Private Datatypes
17
8.2.10 LI Datatype Generator: pcte-sequence
18
8.2.11 LI Datatype: pcte-string
20
8.2.12 LI Datatype Generator: bounded-set
21
8.2.13 LI Datatype Generator: choice
22
8.2.14 LI Datatype: record
23
Private Datatypes
8.3
23
8.4 References and Names
24
8.5 C Private Type: Pcte sequence
27
on Sequences
8.5.1 Operations
31
Error Conditions for Sequence Operators
8.5.2
32
C Function Semantics From Abstract Specification.
8.6 Deriving
32
8.7 Headers
33
8.7.1 The Global Pcte Header
33
The Pcte Basic Type Header
8.7.2
34
8.7.3 The Pcte Sequence Header
38
9 Object management
38
9.1 Object Management Datatypes
41
9.2 Link Operations
46
9.3 Object Operations
53
9.4 Version Operations
55
10 Schema management
55
10.1 Schema Management Datatypes
57
10.2 Update Operations
65
10.3 Usage Operations

---------------------- Page: 3 ----------------------
O ISO/IEC
ISO/IEC 13719-2: 1995(E)
68
10.4 Working Schema Operations
72
11 Volumes, devices and archives
72
1 1.1 Volume, Device, and Archive Datatypes
72
1 1.2 Volume, Device and Archive Operations
75
12 Files, pipes and devices
75
12.1 File, Pipe and Device Datatypes
75
12.2 File, Pipe and Device Operations
78
13 Process execution
78
13.1 Process Execution Datatypes
79
13.2 Process Execution Operations
83
13.3 Security Operations
84
13.4 Profiling Operations
85
13.5 Monitoring Operations
86
14 Message queues
86
14.1 Message Queue Datatypes
87
14.2 Message Queue Operations
89
15 Notification
90
15.1 Notification Datatypes
90
15.2 Notification Operations
90
16 Concurrency and integrity control
91
16.1 Concurrency and Integrity Control Datatypes
91
16.2 Concurrency and Integrity Control Operations
92
17 Replication
92
17.1 Replication Datatypes
92
17.2 Replication Operations
94
18 Network connection
94
18.1 Network Connection Datatypes
95
18.2 Network Connection Operations
97
18.3 Foreign System Operations
97

---------------------- Page: 4 ----------------------
O ISO/IEC
ISO/IEC 13719-2:1995(E)
19 Discretionary security
97
19.1 Discretionary Security Datatypes
98
19.2 Discretionary Access Control Operations
100
19.3 Discretionary Security Administration Operations
1 O0
20 Mandatory security 102
20.1 Mandatory Security Datatypes 102
20.2 Mandatory Security Operations 102
20.3 Mandatory Security Administration Operations 104
20.4 Mandatory Security Operations for Processes
105
21 Auditing 106
2 1.1 Auditing Datatypes 106
2 1.2 Auditing Operations 110
22 Accounting 112
22.1 Accounting Datatypes 112
22.2 Accounting Administration Operations 114
22.3 Consumer Identity Operations 116
23 References 116
23.1 Reference Datatypes 116
23.2 Object Reference Operations 117
23.3 Link Reference Operations 119
23.4 Type Reference Operations 121
24 Implementation limits 122
24.1 Implementation Limit Datatypes 122
24.2 Implementation Limit Operations 124
25 Error conditions 124
25.1 Error Condition Datatypes
124
25.2 Error Condition Operations
132
Index of abstract operations
133
Index of c subprograms 141
Index of c datatypes 149
V

---------------------- Page: 5 ----------------------
O ISO/EC
ISO/IEC 13719-2:1995(E)
Foreword
IS0 (the International Organization for Standardization) and IEC (the Inter-
national Electrotechnical Commission) form the specialized system for worldwide
standardization. National bodies that are members of IS0 or IEC participate in the
development of International Standards through technical committees established
by the respective organization to deal with particular fields of technical activity.
IS0 and IEC technical committees collaborate in fields of mutual interest. Other
international organizations, governmental and non-governmental, in liaison with
IS0 and IEC, also take part in the work.
In the field of information technology, IS0 and IEC have established a joint
technical committee, ISO/IEC JTC 1. Draft International Standards adopted by the
joint technical committee are circulated to national bodies for voting. Publication
as an International Standard requires approval by at least 75 % of the national
bodies casting a vote.
International Standard ISO/IEC 13719-2 was prepared by the European Computer
Manufacturers Association (ECMA) (as Standard ECMA- 158) and was adopted,
under a special “fast-track procedure”, by Joint Technical Committee ISOAEC
JTC 1, Znformation technology, in parallel with its approval by national bodies of
IS0 and IEC.
ISOAEC 13719 consists of the following parts, under the general title Znformation
technology - Portable Common Tool Environment (PCTE):
- Part 1 : Abstract specification
- Part 2: C programming language binding
- Part 3: Ada programming language binding
vi

---------------------- Page: 6 ----------------------
INTERNATIONAL STANDARD O ISO/IEC
ISOhEC 13719-2: 1995(E)
Information technology - Portable Common Tool
Environment (PCTE) -
Part 2:
C programming language binding
1 Scope
This part of ISO/IEC 13719 defines the standard binding of the Portable Common Tool
Environment (PCTE), as specified in ISO/IEC 13719-1, to the C Programming Language.
A number of features are not completely defined in ISO/IEC 13719-1, some freedom being
allowed to the implementor. Some of these features are specified as implementation limits.
Some constraints are placed on these implementation limits by this C Language Binding
Standard. These constraints are specified in clause 24, Implementation Limits.
PCTE is an interface to a set of facilities that forms the basis for constructing environments
supporting systems engineering projects. These facilities are designed particularly to provide
an infrastructure for programs which may be part of such environments. Such programs,
which are used as aids to system development, are often referred to as tools.
2 Conformance
An implementation of PCTE conforms to this part of ISO/IEC 13719 if it conforms to 2.2
of ISO/IEC 13719-1, where the binding referred to there is taken to be the C Language
Binding defined in clauses 1 to 5 and 8 to 25 of this part of ISO/IEC 13719. All other
clauses in this part of ISO/IEC 13719 are provided as assistance to the reader and are not
normative.
The C Language Binding defined in this part of ISO/IEC 13719 conforms to 2.1 of
ISO/IEC 13719-1.
3 Normative references
The following standards contain provisions which, through reference in this text, constitute
provisions of this part of ISO/IEC 13719. At the time of publication, the editions indicated
were valid. All standards are subject to revision, and parties to agreements based on this
part of ISO/IEC 13719 are encouraged to investigate the possibility of applying the most
recent editions of the standards indicated below. Members of IEC and IS0 maintain
registers of currently valid International Standards.

---------------------- Page: 7 ----------------------
ISO/IEC 13719-2:1995(E) O ISO/IEC
IS0 8601: 1988, Data elements and interchange formats - Information
interchange - Representation of dates and times.
IS0 8859-1:1987, Information processing - 8-bit single-byte coded graphic
character sets - Part 1: Latin alphabet No. 1.
IS0 9899: 1990, Programming languages - C.
ISO/IEC TR 10182: 1993, Information technology - Programming languages , their
environments and system sojiware integaces - Guidelines for
language bindings.
- Programming languages their
ISO/IEC 11404:-'), Information technology
environments and system sojiware integaces - Language-
independent datatypes.
ISO/IEC 13719-1: 1995, Information technology - Portable Common Tool
Environment (PCTE) - Part 1: Abstract specification.
4 Definitions
Definitions used in this part of ISO/IEC 137 19 are those defined in ISO/IEC 137 19- 1.
5 Formal notations
Two formal notations are used in this part of ISO/IEC 13719. For each bound operation,
the abstract specification is given using a subset of the Vienna Development Method
Specification Language (or VDM-SL), exactly as it is specified in ISO/IEC 13719-1. For
the C Language binding for each operation, the function prototype syntax is used as defined
in IS0 9899.
6 Outline of the standard
Clause 7 describes the strategy used to develop this binding specification.
Clause 8 contains the mapping from the datatypes that are used in the Abstract
to C Language datatypes.
Specification
Clauses 9 to 22 define the binding of datatypes and operations in the corresponding clauses
of ISO/IEC 137 19- 1.
Clause 23 defines the binding of object, attribute, link, and type references, as specified in
23.1.2 and 23.2 of ISO/IEC 13719-1.
Clause 24 defines the binding of the implementation limit functions described in ISO/IEC
13719-1, clause 24.
Clause 25 defines the binding of the error conditions specified in ISO/IEC 13719-1,
appendix C, and defines binding-defined error conditions for the C Binding.
1) To be published
2

---------------------- Page: 8 ----------------------
O ISO/IEC ISO/IEC 13719-2:1995(E)
7 Binding strategy
7.1 C Programming Language Standard
This part of ISO/IEC 13719 is a conforming program according to IS0 9899.
7.2 General Principles
The following general principles were applied when generating the binding in this part of
ISO/IEC 13719.
ISO/IEC TR 10182 should be followed as far as possible for binding method 1: provide a
completely defined procedural interface.
Each operation in ISO/IEC 13719-1 should be represented by exactly one operation in
this part of ISO/IEC 13719 except possibly when the abstract operation has distinct
functionality depending on the values of one or more parameters.
of ISOBIEC 13719 should have the same number of parameters
Each operation in this part
as does the corresponding operation in ISO/IEC 13719-1.
All operations in this part of ISO/IEC 13719 should return an integer status value. All
other values returned by the operation should be passed back to the caller via an output
parameter. The return value of the operation should indicate success or failure only.
Operation and parameter names should be the same in this part of ISO/IEC 13719 as
they are in ISO/IEC 13719-1, with the exception that identifiers with file scope should
begin ’Pcte ’ and otherwise consist of lowercase letters and underscores. The PCTE
standard guarantees that there are no ambiguities in names prefixed by ’Pcte - ’.
All additional names introduced in this part of ISOBIEC 13719 which are visible across
the interface (except header names, see 8.5) should begin ’Pcte ’ and otherwise consist
of lowercase letters, underscores and digits, or begin ’PCTE ’ ind otherwise consist of
uppercase letters, underscores and digits. The PCTE standard guarantees that there are
no ambiguities in names prefixed by ’PCTE - ’ or ’Pcte - ’.
Wherever practical, types introduced for passing complex data entities between caller and
operation (and vice versa) should be private types defined by this part of ISO/IEC 13719.
The principle should only be ignored for reasons of ease of use and efficiency of
implementation.
Each simple datatype in ISOAEC 13719-1 should be mapped to a corresponding type
defined in this part of ISO/lEC 13719. Each implementation of the binding should then
be free to map the binding-defined type to an efficient C Language basic type appropriate
for the platform of the implementation, within the constraints specified in this part of
IS O/IEC 137 19.
A general policy of memory allocation should be adopted; see 7.5
7.3 Sets and Sequences
Some Complex data entities to be passed into or retrieved from an operation are defined
as sets or sequences of a base type in ISO/IEC 13719-1. Bounded set types are mapped
individually to bit-significant natural numbers; unbounded set and sequence types are
3

---------------------- Page: 9 ----------------------
ISO/IEC 13719-2:1995(E) O ISOAEC
mapped to a private type, Pcte sequence with operations for creation, population,
retrieval and deletion. These operations allow multiple elements of sets and sequences to
be set and read in a single operation, from or to an array object of an appropriate base
type. Thus, the data for sets and sequences can be easily manipulated using standard C
Language paradigms, while allowing the implementation to choose the best
implementation for such sets and sequences.
7.4 Character Strings
In ISODEC 13719-1, two different types are used to represent sequences of characters.
String is a sequence of Octets allowing all 8-bit values and Text is a sequence of latin 1
graphic characters. Contents, string attributes etc., are of type String; keys, type names
etc., are of type Text.
In the C Bindings, String is mapped to Pcte string (see 8.2.1 1). Text is mapped to the
native C language string with a possibly-fixed length, i.e. char * with operations
depending on NUL ('\O,) character termination (see 8.2.6).
7.5 Memory Allocation
Communication between caller and operation is effected by the transfer of data into an
operation via an input parameter or back from an operation via an output parameter.
There are two types of such parameters: public and private.
All instances of a public type are allocated and managed by the caller of the operation.
All instances of a private type are allocated and managed by the implementation.
However, the extraction of data from a private type is again by data transfer in instances
of a public type via an operation on the private type. In these cases also, the caller of the
operation is required to allocate and manage the instances of the public type. The caller
is further required to allocate sufficient space to contain a handle to the private type, the
type of which is always a pointer to an internal data structure of undefined form.
Operations on the private type are provided to create and discard these internal data
structures,
Data stored in an instance of a private type is owned by the implementation. The
implementation is responsible for allocating, managing and deallocating the memory used
to store this data. Furthermore, after a handle to an instance of a private type has been
returned to the caller of an operation, via an output parameter, the implementation is
responsible for maintaining the data stored therein, until the caller explicitly indicates that
the data is no longer needed, by invoking the discard operation on that instance.
Data stored in an instance of a public type and passed into an operation via an input
parameter, is owned by the caller of the operation. The caller is responsible for
allocating, managing and deallocating the memory used to store this data. The caller is
further responsible for maintaining the data stored therein for the duration of the
operation. If the implementation needs to access the data after the operation has
completed, the implementation is responsible for allocating additional memory and
storing therein a copy of the data.
All the operations that have sequences as "out" parameters will allocate the sequence and
return it as result of operation. The user does not need to allocate the sequence in
4

---------------------- Page: 10 ----------------------
O ISOIIEC ISO/IEC 13719-2:1995(E)
advance: the user only needs to declare a Pcte - sequence variable and pass the address of
that variable.
7.6 References and Names
Objects, attributes, links, and types are referred to in this part of ISO/IEC 13719 using
object references, attribute references, link references and type references, respectively.
References are mapped to private datatypes encapsulating two ways of designating an
object, attribute, link, or type: by an external and by an internal reference (see ISO/IEC
13719-1, clause 23).
Beside these references, in this part of ISO/IEC 13719 also attribute names, link names
and type names are used to refer to attributes, links, or types. These names represent
external references and they are mapped to the native C language string type.
Therefore two different interfaces are provided in this Binding for clauses 9 to 22:
- one interface using names for attributes, links, and types.
- one interface using references for attributes, links, and types. All operations of this
interface begin 'Pcte h '. These operations are defined if an operation of the
previous interface uses attributes, links, or types. Whenever new datatypes are
necessary, they also begin 'Pcte -- h ' (see 8.7).
7.7 Operation Return Values
All the operations are mapped to functions which return a Pcte error type value, which
indicates success (PCTE NO ERROR equivalent to PCTE OK) or failure (one of the
other enumeration valuesof Kte error type) of the operation. All other information that
is passed between the caller and the operation is passed via "out" or "in-out" parameters.
The error code PCTE -- NO ERROR is equivalent to PCTE - OK (as both have the value
zero).
Additionally the global variable Pcte error number is set to the same return value of the
function after each PCTE call, but it should be noted that in case of multi-threading or
queue handlers this global variable cannot relied upon.
7.8 Error Conditions
Error conditions which are defined in ISO/IEC 13719-1 and which can be established and
returned by the operations defined in this part of ISO/IEC 13719 are described in clause
25.
All binding defined errors are defined in 25.1(2).
7.9 Identifiers
Many of the identifiers in ISO/IEC 13719-1 are longer than 31 characters, but no two
identifiers are exactly the same within the first 31 characters. The C Programming
Language Standard requires that an internal name (i.e., a macro name or an identifier that
does not have external linkage) be unique within the first 31 characters. Thus there is no
need for any identifiers to be abbreviated in this Binding.
5

---------------------- Page: 11 ----------------------
ISO/IEC 13719-2:1995(E) O ISOrnC
IS0 9899 requires all identifiers of enumeration values to be distinct. Where ISO/IEC
13719-1 uses the same identifier for values of enumeration types bound to different C
Language enumeration types, new names have been invented.
In a few cases an abstract operation has been bound to more than one C Language
function, to cater for optional parameters; in these cases also, new names have been
invented.
7.10 Implementation Limits.
ISO/IEC 13719-1 defines a set of limits that must be honored by all implementations of
the Language Bindings. Clause 24 describes the binding-defined identifiers for these
limit values and the way in which these limits can be retrieved.
8 Datatype mapping
This clause defines the mapping of the parameter and result datatypes of the operations of
ISO/IEC 13719-1 (PCTE datatypes) to the parameter and result datatypes of the operations
of this part of ISO/IEC 13719 (C datatypes).
PCTE datatype names are printed in normal characters.
LI Datatypes names are printed in italics.
C datatype names are printed in bold except in displayed fragments of C.
The mapping from PCTE datatypes to C datatypes is done in two stages via LI datatypes
defined in CD1 1404.2.
8.1 Mapping of PCTE Datatypes to LI Datatypes
As far as possible the names of PCTE datatypes are retained for the corresponding LI
datatypes, but some new names are introduced.
The general strategy of this mapping is as follows.
- To select for each PCTE datatype a LI datatype definition which matches the
requirements of the PCTE datatype defined in ISO/IEC 13719-1. The LI datatype
definition is, where possible, a primitive LI datatype or otherwise a generated LI
datatype.
- To define new datatype generators where needed.
- To map PCTE datatypes with the same properties to the same LI datatype.
8.1.1 Mapping of Predefined PCTE Datatypes
The mapping of these PCTE datatypes is as defined in ISO/IEC 13719-1, clause 23
and is summarized in table 1.
6

---------------------- Page: 12 ----------------------
O ISO/IEC
ISO/IEC 63719-2:1995(E)
Table 1 - Mapping of predefined PCTE datatypes
PCTE datatype LI datatype
Boolean boolean
Integer pcte-integer = integer
range (MIN INTEGER ATTRIBUTE.
MAX - INTEGER - ATTRIBUTE)
Natural pcte-natural = integer
range (O.MAX - NATURAL - ATTRIBUTE)
Float pcte-$oat =
real (10, MAX DIGITS FLOAT ATTRIBUTE)
range (MIN FLOAT ATTRIBUTE.
MAX FLOAT ATTRÏBUTE)
Time pcte-time =
time (second, 10, Pcte accuracy factor)
range (MIN TIME ATTRIBUTE:
MAX TIME- ATTRIBUTE)
Octet I octet
Text pcte-text = character string (repertoire)
Enumerated type xxx =
pcte-xxx = enumerated(value1, value2, .)
VALUE 1 hALUE21. .

---------------------- Page: 13 ----------------------
ISO/IEC 13719-2:1995(E) O 1somc
8.1.2 Mapping of Private PCTE Datatypes
Table 2 - Mapping of private PCTE datatypes
Address
contents - handle
Contents - handle
handler
Handler
Object - reference object - reference
Link reference link - reference
-
Position - handle position - handle
Profile - handle profile - handle
Type - reference type reference
-
PCTE union datatypes other than enumerations are mapped via the datatype generator
Choice.
PCTE composite and bracketed datatypes (except private PCTE datatypes, for which
see 8.1.2) are mapped to the datatype generator Record.
8.1.4 New LI Datatype Generators
Pcte-Sequence
Description: Pcte-sequence is a datatype generator derived from Sequence by adding
further characterizing operations. In some operations, an index of LI datatype pcte-

---------------------- Page: 14 ----------------------
O ISO/IEC ISOnEC 13719-2: 1995(E)
natural is used to identify elements in the sequence. The first element is always
indexed from O.
The characterizing operations are IsEmpty, Head, Tail, Equal, Empty, and Append
from Sequence plus Get, Put, Copy, LengthOf, and IndexOf.
Get(s: sequence of base, index: Natural): base is undefined if InOrder(LengthOf(s),
index) is true or is Head(s) if Equal(index, O) is true; otherwise Get(Tail(s),
Add(index, negate( 1))).
Put(s: sequence of base, e: base, index: Natural): sequence of base is undefined if
InOrder(Add(LengthOf(s), 1), index) is true or is Append(Create(e), s) if Equal(index,
O) is true; otherwise Append(Head(s), Put(Tail(s), e, Add(index, Negate( 1)))).
sequence of base): sequence of base is Create() if IsEmpty(s) is true;
Copy (s:
otherwise Append(Head( s), Copy (Tail( s))).
LengthOf(s: sequence of base): Natural is O if IsEmpty(s); otherwise
1).
Add(LengthOf(Tail(s)),
IndexOf(s: sequence of base, e: base): Natural is undefined if IsEmpty(s0 is true or is
1 if Equal(Head(s), e) is true; otherwise Add(IndexOf(Tail(s), e), 1).
Bounded-set
Description: Bounded-set is a datatype generator derived from Set by restricting the
cardinality of the values to 32 or less.
bounded-set of (base) = new set of (base) : size (0.32);
The characterizing operations are IsIn, Subset, Equal, Difference, Union, Intersection,
Empty, SetOf, Select from Set.
9

---------------------- Page: 15 ----------------------
ISO/IEC 13719-2:1995(E)
O ISO/IEC
8.2 Mapping of LI Datatypes to C Datatypes
8.2.1 LI Datatype: boolean
The LI datatype boolean is mapped to the C datatype Pcte - boolean.
typedef Pcte - boolean;
where is a C integer type.
TRUE is represented by PCTE - TRUE, FALSE is represented by PCTE - FALSE:
#define PCTE TRUE (Pcte boolean) 1
#define PCTEFALSE - (Pcte-boolean) - O
In addition, if a value of type Pcte boolean is supplied as or as part of an input
parameter, it is taken as TRUE if it isnot O.
Characterizing Operations
I Operation 1 c Operation I
rEqÜal(bl,b2):b I if (bl == b2)
I
b = PCTE TRUE;
-
I else
b = PCTE - FALSE;
if (bl == PCTE FALSE)
Not(b1):b
b = PCTE - TRUE;
else
b = PCTE FALSE:
And(bl,b2):b b = bl && b2;
b = bl I b2;
Or(b1 ,b2):b
10

---------------------- Page: 16 ----------------------
O ISO/IEC ISOnEC 13719-2:1995(E)
8.2.2 LI Datatype: pcte-integer
The LI datatype pcte-integer is mapped to the C datatype Pcte integer.
-
typedef Pcte - integer;
where is a C integer type including the range
MIN INTEGER ATTRIBUTE to MAX INTEGER ATTRIBUTE inclusive.
- - -
-
Characterizing Operations
Operation
C Operation
Equal(i 1 ,i2):b if (il == i2)
b = PCTE - TRUE;
else
b = PCTE FALSE;
InOrder(i 1 ,i2):b if (il <= i2)
b = PCTE - TRUE;
a
else
b = PCTE FALSE;
NonNegative(i): b if (i >= O)
b = PCTE - TRUE;
else
b = PCTE FALSE;
i = -il
Negate(i1):i
Add(il,i2):i i=il +i2
Multiply(i 1 ,i2):i i=il *i2
a
11

---------------------- Page: 17 ----------------------
PSO/IE@ 13719-2:1995(E) O ISO/IEC
8.2.3 LI Datatype: pcte-natura1
The LI datatype pcte-natural is mapped to the C datatype Pcte - natural.
typedef Pcte - natural;
where is a C unsigned integer type including the range O to
MAX - NATURAL - ATTRIBUTE inclusive.
Furthermore, the unsigned integral datatype in C Language operates under modular
arithmetic rules; i.e. the result of any arithmetic operation is always reduced modulo
the largest representable value. Therefore, ULONG MAX + 1 = O, where
ULONG - MAX is the largest value of the chosen base unsigned integer value.
Characterizing Operations
Operation 1 C Operation I
Equal(n1 ,n2):b if (ni == n2)
b = PCTE TRUE;
-
else
b = PCTE FALSE:
InOrder(nl,n2):b if (ni <= n2)
b = PCTE - TRUE;
else
b = PCTE FALSE;
Add(n1 ,n2):n I n=ni+n2 I
Multiply(nl,n2):n I n = nl * n2

---------------------- Page: 18 ----------------------
O ISO/IEC ISO/IEC 13719-2:1995(E)
8.2.4 LI Datatype: pcte-float
The LI datatype pcte-$oat is mapped to the C datatype Pcte - float.
typedef Pcte - float;
where is a C floating type including the range
MIN FLOAT ATTRIBUTE to MAX FLOAT ATTRIBUTE inclusive, with an
accuracy of atleast MAX DIGITS FL6AT ATTRIBUTE decimal digits, and able to
represent SMALLEST - FLGAT - ATTRIBUTE.
Characterizing Operations
Operation C Operation
Equal(f l,f2):b if (fl == f2)
b = PCTE - TRUE;
else
b = PCTE FALSE;
InOrder(f 1 ,f2):b
if (fl <= f2)
b = PCTE - TRUE;
else
b = PCTE - FALSE;
NonNegative(i): b if (f >= 0.0)
b = PCTE - TRUE;
else
b = PCTE - FALSE;
Negate(f 1 ) : f f = -fl
Add(f 1 ,f2):f f=fl +f2
Multiply(f1 ,f2):f f = fl * f2
Reciprocal(f 1):f f = 1.0 / fl:
13

---------------------- Page: 19 ----------------------
ISODEC 13719-2:1995(E) O ISO/IEC
8.2.5 LI Datatype: pcte-time
The LI datatype pcte-time is mapped to the C datatype Pcte time, where
Pcte time accuracy - factor is an implementation-defined constant for the resolution of
for time attributes.
typedef time - t Pcte - time;
#define Pcte - time - accuracy - factor (Pcte - natural)
#define Pcte - reference - time (Pcte - time)
time t is an arithmetic datatype that holds values representing time. The
The datatype
encoding of the calendar time within a value of type time t is undefined. Functions
on values of type time t are provided to convert such a v&e into a meaningful and
usable representation ofcalendar time.
The implementation shall provide a constant defining an optional time parameter in
the operation Pcte - object -- set time - attributes.
a
#define Pcte -- null time (Pcte - time)
Characterizing Operations
I Operation I C Operation
Equal( t 1 ,t2): b if (difftime(tlJ2) < radix - factor)
b = PCTE - TRUE;
else
b = PCTE - FALSE;
InOrder(t 1 ,t2):b if (difftime(tl,t2) >= O)
b = PCTE - TRUE;
else
b = PCTE - FALSE;
Difference(t1 ,t2):i i = (Pcte - integer) difftime(tl,t2);
Extend.res 1 tores2(t 1):t2 t2 = t 1 * radix - factor;
Round.resltores2(tl):t2 t2 = floor (tl + radix factor);
a
14

---------------------- Page: 20 ----------------------
O ISO/IEC
ISOJIE
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.