Micro Focus RM/COBOL CodeBridge User’s Guide Micro Focus The Lawn 22-30 Old Bath Road Newbury, Berkshire RG14 1QN UK http://www.microfocus.com © Copyright 2017-2020 Micro Focus or one of its affiliates. The only warranties for products and services of Micro Focus and its affiliates and licensors (“Micro Focus”) are as may be set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. Micro Focus shall not be liable for technical or editorial errors or omissions contained herein. The information contained herein is subject to change without notice. Revised 2020-05-06 for version 12.17 Contents Preface ...................................................................................................... 1 Welcome to CodeBridge ............................................................................................................ 1 Who Should Use CodeBridge .................................................................................................... 1 Organization of Information ...................................................................................................... 2 Related Publications................................................................................................................... 3 Symbols and Conventions .......................................................................................................... 3 Technical Support ...................................................................................................................... 4 Support Guidelines ............................................................................................................. 5 Test Cases ........................................................................................................................... 5 Chapter 1: Introduction .......................................................................... 7 What is CodeBridge? ................................................................................................................. 7 CodeBridge Components .................................................................................................... 8 Benefits of Using CodeBridge ............................................................................................ 8 Requirements for Developing Applications Using CodeBridge ......................................... 8 Using this Manual ...................................................................................................................... 9 Developers Who are New to C Programming .................................................................... 9 Developers Who are Evaluating CodeBridge ..................................................................... 9 Developers Who Wish to Use Existing C Libraries or Write New Non-COBOL Subprograms ..................................................................................................................... 10 Developers Who Have Written Non-COBOL Subprograms for Previous Versions of RM/COBOL ..................................................................................................................... 10 Developers Who Need Assistance in Testing and Debugging .......................................... 10 Typical Development Procedure .............................................................................................. 11 Typical Development Example ................................................................................................ 13 Example 1: Calling a Standard C Library Function ......................................................... 13 Chapter 2: Concepts ............................................................................. 17 Using Template File Components ............................................................................................ 17 Attributes .......................................................................................................................... 18 Attribute Lists ................................................................................................................... 18 Parameter Attribute Lists ........................................................................................... 18 Global Attribute Lists ................................................................................................ 20 Passing Information to a C Function ........................................................................................ 20 Passing COBOL Arguments ............................................................................................. 21 Passing COBOL Numeric Arguments ....................................................................... 21 Passing COBOL Non-Numeric Arguments ............................................................... 24 Passing COBOL Pointer Arguments ......................................................................... 25 Passing Null-Valued Pointer Arguments ................................................................... 26 Passing COBOL Argument Properties ............................................................................. 27 Passing COBOL Descriptor Data .............................................................................. 27 Passing String Length Information ............................................................................ 28 CodeBridge User's Guide Contents • iii Passing Miscellaneous Information .................................................................................. 29 Managing Omitted Arguments ......................................................................................... 29 Returning C Error Values ........................................................................................................ 30 Consistent Return Values.................................................................................................. 30 Specifying Both errno and get_last_error ......................................................................... 31 Function Return Value (Status) Versus Error Values ....................................................... 31 Associating C Parameters with COBOL Arguments ............................................................... 32 Explicit Association .......................................................................................................... 32 Automatic Association ...................................................................................................... 33 Automatic Association of the C Function Return Value with a COBOL Argument . 33 Automatic Association of C Parameters with COBOL Arguments ........................... 33 Examples of Associating Parameters with Arguments ..................................................... 34 Example 1: Automatic Versus Explicit Association ................................................. 34 Example 2: Multiple Attribute Lists for a C Parameter ............................................ 35 Example 3: No Attribute List for a C Parameter ...................................................... 36 Working with a Variable Number of C Parameters ................................................................. 37 Repeating C Numeric Parameters ..................................................................................... 37 Repeating C String Parameters ......................................................................................... 37 numeric_string ........................................................................................................... 38 general_string ............................................................................................................ 38 string .......................................................................................................................... 38 Modifying COBOL Data Areas ............................................................................................... 38 Using the out Direction Attribute ..................................................................................... 38 Passing the Address of COBOL Data ............................................................................... 40 Passing Buffer Addresses .......................................................................................... 40 Using P-Scaling ....................................................................................................................... 40 Working with Arrays ............................................................................................................... 41 Numeric Arrays ................................................................................................................ 41 String Arrays ..................................................................................................................... 42 COBOL Array References ................................................................................................ 43 CodeBridge Builder ................................................................................................................. 44 Using the CodeBridge Builder .......................................................................................... 44 Appendix A: CodeBridge Errors .......................................................... 47 CodeBridge Builder Error Messages ....................................................................................... 47 CodeBridge Builder Exit Codes
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages243 Page
-
File Size-