home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
c2pli.zip
/
C2PREAD.ME
< prev
Wrap
Text File
|
1998-04-20
|
6KB
|
102 lines
IBM C to PL/I Conversion Aid for OS/2
=====================================
Tips on Using C2PLI
1. This Conversion aid recognizes only intrinsic C keywords
in the cases of struct, union, enum, and not predefined values
for these keywords.
For example the following is not recognized:
Example 1:
#define SQL_STRUCT struct
SQL_STRUCT color
{
.......
......
};
Example 2:
#define SOMEXTERN extern
SOMEXTERN struct color
{
......
......
};
These predefined values could be replaced or eliminated with the
appropriate change, and then converted through the utility.
2. User defined variables for linkage conventions need to be manually
added to the c2pli.cmd code.
/*********************************************************/
/* !!!!!!! IMPORTANT !!!!!!! */
/* PLEASE READ THE FOLLOWING NOTE BELOW IF YOUR FILE USES */
/* PREDEFINED SYSTEM LINKAGE CONVENTIONS AND MAKE CHANGES */
/* AS REQUIRED. */
/**********************************************************/
Please include your predefined system linkage conventions in the original
source code, if it is not already in the list :
ex: If you defined CALLP16 to be _Far16 _Pascal then the following
would be the mapping:
ex in C: #define CALLP16 _Far16 _Pascal
ex in PL\I : %dcl CALLP16 char scan;
%CALLP16 = options(linkage(pascal16) byvalue nodescriptor) external;
If you then used CALLP16 in a function declaration, you would need to manually
add it to the list below in order for the aid to recognize the predefined linkage
name.
ex in C : int CALLP16 fun1( );
ex in PL/I: dcl fun1 entry ( )
returns (fixed bin(31) byvalue)
CALLP16
The list below looks like the following after CALLP16 is added to the list:
linkages = "_System _Optlink _Pascal",
"_Far16 _Pascal _Far16 _Cdecl",
"_Far16 _Fastcall _Far16",
"APIENTRY EXPENTRY APIENTRY16",
"PASCAL16 CDECL16 DSQ_API_FN",
"SQL_API_FN _Seg16 SOMLINK",
"CALLP16"
This aids in getting a lot of the functions with the linkage conventions set
through #define, to be converted by this aid.
3. Structs, unions, and enums without tags are given the dummy#n tagname,
where n is the number of occurences of the aggregate type without tag:
Example 1:
struct define structure
{ 1 dummy#1,
int a; 2 a fixed bin(31);
};
4. Nested structs, and unions without tags are given the outer struct or union
tag name concatenated with a # symbol. The number of #'s increases
with the number of nested constructs.
Example 2:
struct level1 define structure
{ 1 level1#,
long b; 2 b char;
struct
{ define structure
char b; 1 level1,
}; 2 b fixed bin(31);
};