In the following example, the gateway application sets up Open Data Services.
SRV_SERVER *server; // The service process
SRV_CONFIG *config; // The configuration structure
DBCHAR *RegistryName = "Gateway"; // Registry lookup name
DBCHAR *SrvrName = ""; // Default remote server name
// Read any command-line arguments.
getargs(argc, argv);
// Send the name retrieved to the gateway's DLL module.
set_remote_server_name(SrvrName);
// Allocate a configuration structure that is used to initialize
// the Open Data Services server application.
config = srv_config_alloc();
// Allow 20 connections at a time.
srv_config(config, (DBINT)SRV_CONNECTIONS, "20", SRV_NULLTERM);
// Set the log file.
srv_config(config, (DBINT)SRV_LOGFILE, "gateway.log", SRV_NULLTERM);