The syntax for the Open Client/Server configuration file will match the existing syntax for Sybase localization and configuration files supported by CS-Library with minor variations.
The syntax is as follows:
; – Signifies a comment line.
[section_name] – Section names are wrapped in square brackets. The Open Client/Server configuration file comes with sections named DEFAULT and ANSI_ESQL. The application name will be used as the section name for an application that has been compiled with the -x option. For an application that has been compiled with the -e option, the server name will be used for the section name. Any name can be used as a section name for the sections that contain settings that will be used in multiple sections. The following example shows a section arbitrarily named “GENERIC,” and how that section is included in other sections:
[GENERIC]
CS_OPT_ANSINULL=CS_TRUE
[APP_PAYROLL]
include=GENERIC
CS_CAP_RESPONSE=CS_RES_NOSTRIPBLANKS
[APP_HR]
include=GENERIC
CS_OPT_QUOTED_IDENT=CS_TRUE
entry_name=entry_value
Entry values can be anything: integers, strings and so on. If an entry value line ends with '\'<newline> the entry value continues to the next line.
White spaces are trimmed from the beginning and end if entry values.
If white spaces are required at the beginning or end of an entry value, wrap them in double quotes.
An entry that begins with a double quote must end with a double quote. Two double quote characters in a row within a quoted string represent a single double quote in the value string. If a newline is encountered within double quotes, it is considered to be literally part of the value.
Entry names and section names can consist of alphabetic characters (both upper and lower case), the digits 0-9, and punctuation characters. The first letter MUST be alphabetic.
Entry and section names are case sensitive.
Include=earlier_section
If a section contains the entry include, then the entire contents of that previously defined section are considered to be replicated within this section. In other words, the properties defined in the previous section are inherited by this section.
Note that the included section must have been defined prior to it being included in another section. This allows the configuration file parsing to happen in a single pass and eliminates the need to detect recursive included directives.
If an included section in turn includes another section, the order of entry values is defined by a “depthfirst” search of the included sections.
Sections cannot include a reference to themselves. In other words, recursion is not possible because you must include a previously defined section—you cannot include the section being defined.
All direct entry values defined in a given section supersede any values which may have been included from another section. In the following example, CS_OPT_ANSINULL will be set to false in the APP.PAYROLL application. Note that the position of the include statement does not affect this rule.
[GENERIC]
CS_OPT_ANSINULL=CS_TRUE
[APP_PAYROLL]
CS_OPT_ANSINULL=CS_FALSE
include=GENERIC