|
Purpose |
Ensures DP4 "service" is running. This function does not establish a connection to DP4 | |
|
Syntax (CCOWN) |
int srv_load_srv(void); |
|
|
Syntax (DP4DBAPI) |
int dp4_srv_load_srv(int argc,char **argv,dp4_name_string version_info); | |
|
Parameters |
int argc |
If desired you can pass a set of command line arguments to the DP4 loader. Typically you would simply pass on the arguments passed to your application, but you can pass a synthetic set if desired (though in this case you should bear in mind that DP4 will only be loaded in the specified configuration if it is not already running. Specifies the number of arguments to pass the loader if DP4 is not running already. |
|
char **argv |
Pointer to an array of char * variables containing the command line arguments as null terminated strings. These arguments can be used to over-ride the default DP4 startup - specify one or more arguments normally used with the DP4 loaded (srvw32.exe,srvwce.exe or dbdaemon). | |
|
dp4_name_string version_info |
const char * to the programs version information. This information will be passed to the dp4 error log if it is in use and will be displayed if debug_version=1 is set. DP4 utilities are all linked with the verstamp.c source module and call vs_verstring() (prototyped in verstamp.h) to obtain the version string. verstamp.c is in the src subdirectory of each DP4 release on the DP4 CD ROM, and verstamp.h is in the include subdirectory. Windows executables should also contain a Windows version resource. | |
|
Description |
srv_load_srv() checks that the DP4 service or daemon is running, and attempts to start it if not using the default configuration as specified in the DP4 configuration file (possibly over-ridden by command line arguments inherited from the calling application if these are known). On legacy versions of DP4 this function is responsible for providing the "auto-load" feature. However in Win32 DP4, and DP4 for Linux or Unix from 4.525 there is usually no need to call this function as lower level DP4 functions will ensure that DP4 is running when you make the first call to it. This function might still be useful if you have an application that wants to check that DP4 is running, but does not actually connect to it itself, or if you want the application to be able to start DP4 in a specific configuration based on command line arguments. You can see an example of the use of command line inherited arguments in the install.cfg files on the DP4 CD ROM file for Win32 DP4 releases from 4.621 on. | |
|
Return values |
Returns 1 if the DP4 service is already running (or can be started successfully), and 0 otherwise. This function may return 1 to programs built with a pre 4.620 DP4 C library even if the DP4 service cannot be started, in order to prevent them executing start-up code that was in the library at that time that is no longer appropriate. | |
|
See also |
||