home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / c2pli.zip / C2PREAD.ME < prev   
Text File  |  1998-04-20  |  6KB  |  102 lines

  1. IBM C to PL/I Conversion Aid for OS/2  
  2. =====================================
  3. Tips on Using C2PLI
  4.  
  5.  
  6. 1. This Conversion aid recognizes only intrinsic C keywords
  7.    in the cases of struct, union, enum, and not predefined values
  8.    for these keywords.
  9.  
  10.    For example the following is not recognized:
  11.    Example 1:
  12.  
  13.      #define SQL_STRUCT struct
  14.  
  15.       SQL_STRUCT color
  16.        {
  17.          .......
  18.          ......
  19.        };
  20.  
  21.    Example 2:
  22.  
  23.      #define SOMEXTERN extern
  24.  
  25.        SOMEXTERN struct color
  26.         {
  27.           ......
  28.           ......
  29.         };
  30.    These predefined values could be replaced or eliminated with the 
  31.    appropriate change, and then converted through the utility.
  32.  
  33. 2. User defined variables for linkage conventions need to be manually
  34.    added to the c2pli.cmd code.
  35.  
  36.  
  37.   /*********************************************************/                                                                
  38.   /*                          !!!!!!!  IMPORTANT  !!!!!!!                                   */                                
  39.   /* PLEASE READ THE FOLLOWING NOTE BELOW IF YOUR FILE USES     */                                                            
  40.   /* PREDEFINED SYSTEM LINKAGE CONVENTIONS AND MAKE CHANGES   */                                                              
  41.   /*  AS REQUIRED.                                                                        */                                  
  42.   /**********************************************************/                                                                
  43.                                                                                                                               
  44.     Please include your predefined system linkage conventions in the original            
  45.     source code, if it is not already in the list :
  46.                                                                                                                           
  47.     ex: If you defined  CALLP16 to be _Far16 _Pascal then the following                                                   
  48.     would be the mapping:                                                                                                 
  49.     ex in C:   #define CALLP16 _Far16 _Pascal                                                                             
  50.     ex in PL\I : %dcl CALLP16 char scan;                                                                                  
  51.                     %CALLP16 = options(linkage(pascal16) byvalue nodescriptor) external;                                  
  52.                                                                                                                           
  53.     If you then used CALLP16 in a function declaration, you would need to manually
  54.     add it to the list below in order for the aid to recognize the predefined linkage                                     
  55.     name.                                                                                                                 
  56.     ex in C :      int CALLP16 fun1( );                                                                                   
  57.     ex in PL/I:   dcl fun1 entry ( )                                                                                      
  58.                             returns (fixed bin(31) byvalue)                                                               
  59.                              CALLP16                                                                                      
  60.                                                                                                                           
  61.    The list below looks like the following after CALLP16 is added to the list:
  62.           linkages = "_System _Optlink _Pascal",                                                                          
  63.                          "_Far16 _Pascal _Far16 _Cdecl",                                                                  
  64.                           "_Far16 _Fastcall _Far16",                                                                      
  65.                           "APIENTRY EXPENTRY APIENTRY16",                                                                
  66.                           "PASCAL16 CDECL16 DSQ_API_FN",                                                                  
  67.                           "SQL_API_FN _Seg16 SOMLINK",                                                                  
  68.                           "CALLP16"                                                                            
  69.                                                                                                                           
  70.                                                                                                                               
  71.  
  72.     This aids in getting a lot of the functions with the linkage conventions set
  73.     through #define, to be converted by this aid.
  74.  
  75.  
  76. 3. Structs, unions, and enums without tags are given the dummy#n tagname,
  77.    where n is the number of occurences of the aggregate type without tag:
  78.  
  79.    Example 1:
  80.  
  81.     struct                           define structure
  82.     {                                    1 dummy#1,
  83.      int a;                                2 a fixed bin(31);
  84.     };
  85.  
  86.  
  87. 4. Nested structs, and unions without tags are given the outer struct or union
  88.    tag name concatenated with a # symbol. The number of #'s increases
  89.    with the number of nested constructs.
  90.  
  91.    Example 2:
  92.  
  93.    struct level1                define structure               
  94.     {                                   1 level1#,
  95.      long b;                            2 b char;
  96.       struct
  97.         {                           define structure
  98.            char b;                    1 level1,
  99.         };                                 2 b fixed bin(31);
  100.      };
  101.  
  102.