C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

In addition, if ?BLOCKGLOBALS is in effect and a data block contains one data declaring item,
the name exported to C/C++ is the name of the block. This method makes it easy to change the
name of a global declaration which cannot be described in C/C++ to a legal C/C++ name. With
this method, you do not need to change all uses of the global declaration in the pTAL source. For
pTAL programs, P-relative arrays allocate space in the read-only data area of process memory
space. For example:
pTAL Code C/C++ Code
?BLOCKGLOBALS
?EXPORTGLOBALS
name x;
block b;
int i^1; extern short b;
end block;
block c;
int .i [0:9]; extern short c [10];
end block;
block d;
int j = 'P' := [1, 2, 3]; extern short d [3] := {1, 2, 3};
end block;
block b1;
/* Names are not changed because there */
/* is more than one data declaring item */
/* in the block. */
int k; extern short k;
int l; extern short l;
end block;
block b2;
/* Names are not changed because there */
/* is more than one data declaring item */
/* in the block. */
int .m [0:9]; extern short m [0:9];
int n; extern short n;
end block;
block b3;
/* Names are not changed because there */
/* is more than one data declaring item */
/* in the block. */
int o = 'P' := [1, 2, 3]; extern short o [3] := {1, 2, 3};
int p; extern short p;
end block;
block b4;
/* Names are not changed because there */
/* is more than one data declaring item */
/* in the block. */
int q = 'P' := [1, 2, 3]; extern short q [3] := {1, 2, 3};
int .r [0:9]; extern short r [10];
end block;
block b5;
/* Names are not changed because there */
/* is more than one data declaring item */
/* in the block. */
int s = 'P' := [1, 2, 3]; extern short s [3] := {1, 2, 3};
int t = 'P' := [1, 2, 3]; extern short t [3] := {1, 2, 3};
end block;
block e;
/* Only one data declaring item. */
int u; extern short e;
int v = u;
end block;
Considerations When Interfacing to pTAL 133