Sharing Variables Between Units . . . . . . . . . . . . . . . . . . . . . .

71

 

Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

74

5.

Separate Compilation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

75

 

Working with Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

75

 

Using Program Units. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

76

 

Using Module Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

76

 

Sharing Variables and Routines Across Multiple Units . . . . . .

76

 

Compiling without the -xlOption. . . . . . . . . . . . . . . . . . . .

77

 

Using the -xlOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

80

 

Sharing Declarations in Multiple Units. . . . . . . . . . . . . . . . . . . .

87

6.

The C–Pascal Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

89

 

Compilation of Mixed-Language Programs . . . . . . . . . . . . . . . .

89

 

Compatibility of Types for C and Pascal. . . . . . . . . . . . . . . . . . .

90

 

Precautions with Compatible Types . . . . . . . . . . . . . . . . . . .

91

 

Incompatibilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

92

 

General Parameter Passing in C and Pascal . . . . . . . . . . . . . . . .

93

 

Procedure Calls: C–Pascal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

93

 

Variable Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

94

 

Value Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

112

 

Function Return Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

115

 

Input and Output. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

116

 

Procedure Calls: Pascal–C. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

117

 

Variable Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

117

 

Value Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

129

Contents

ix