Using the Repository subroutine library
The subroutines in the Repository subroutine library provide read-only access to Repository information about structures, enumerations, files, templates, fields, keys, relations, formats, tags, and aliases. Most of these subroutines have more than one function, which enables them to obtain a variety of data.
Requirements
To use the Repository subroutine library you must do the following:
- Include the file RPSLIB:ddinfo.def in your calling program using the .INCLUDE statement. (See below for more information on using ddinfo.def.)
- Call the DD_INIT subroutine before other Repository subroutines, and call DD_EXIT after the other Repository subroutines.
- On Windows and Unix, link the file RPSLIB:ddlib.elb with your program. On OpenVMS, link the file TKLIB_SH.EXE with your program. See Building and Running Synergy Applications for the link commands for your operating system.
- On Windows, if you are doing traditional Synergy development in Visual Studio, reference RPSLIB:ddlib.elb in your project.
- On Synergy .NET, reference Synergex.SynergyDE.ddlib.dll in your .NET Framework project in Visual Studio, or add the Synergex.SynergyDE.ddlib NuGet package to your .NET or .NET Standard project.
The ddinfo.def file
You can use the ddinfo.def file for informational purposes, but you should not change its contents. This file is distributed in your rps\lib directory. |
Your calling program and the Repository subroutines communicate with each other through ddinfo.def, which contains definitions of the function codes, flags, and record layouts used by the subroutine library. One of these record layouts is the repository control structure (dcs), which is passed to all Repository subroutines as the first argument. The first two bytes of the control structure hold the error code that is set by each subroutine. You should check the error code after each subroutine returns. It will be zero if no error has occurred.
You can include and exclude parts of ddinfo.def by using DDINFO_DEFINES_ONLY and DDINFO_INGLOBAL:
- To include only the Repository definitions (not the record layouts), define DDINFO_DEFINES_ONLY before including ddinfo.def.
- To exclude STACK records and STRUCTUREs, which are not allowed when including ddinfo.def within a global data section, define DDINFO_INGLOBAL before including ddinfo.def.
You can change the way data structures are included by using DDINFO_STRUCTURE:
- To define all data structures as STRUCTUREs, define DDINFO_STRUCTURE before including ddinfo.def. The elements of each data structure will be enclosed in a STRUCTURE-ENDSTRUCTURE statement.
- To define all data structures as RECORDs, leave DDINFO_STRUCTURE undefined, or undefine it if it was previously defined. The elements of each data structure will be enclosed in a RECORD-ENDRECORD statement.
Defining DDINFO_STRUCTURE also affects how arrays within data structures are handled. When DDINFO_STRUCTURE is defined, arrays within data structures are defined as real arrays, because pseudo arrays are not allowed within a STRUCTURE statement. When DDINFO_STRUCTURE is not defined, arrays within data structures are defined as pseudo arrays for compatibility with existing code.