SpaceControl DLL  Version 2.8.9
API documentation for the SpaceControl 3D input devices
Functions not listed in other sections

These functions could not meaningful be sorted into the other sections. More...

Functions

ScStatus scIsProcessRunning (char *processName, bool *isRunningP)
 Checks if the process with the given name is running or not. More...
 
ScStatus scSetCurrentUserRegValue (char *keyP, char *nameP, char *valueP)
 Sets a new string value into the Windows registry under the base key HKEY_CURRENT_USER. More...
 
ScStatus scQueryCurrentUserRegValue (char *keyP, char *nameP, int len, char *valueP)
 Queries a string value from the Windows registry under the base key HKEY_CURRENT_USER. More...
 
ScStatus scDelCurrentUserRegValue (char *keyP, char *nameP)
 Deletes a string value in the Windows registry under the base key HKEY_CURRENT_USER. More...
 
ScStatus scGetDllLogPars (char logFile[gMaxFileNameLen], int *maxSizeP, bool *isLogToFileP, bool *isLogToCnslP, bool *isWrnP, bool *isCrtP, bool *isTrcP, bool *isDcmP, bool *isIcmP, bool *isInfP, bool *isDbgP, bool *isTmpP, char exclFileToLog[gMaxFileNameLen])
 Retrieves the logging parameters and filenames actually used by the internal DLL functions. More...
 
ScStatus scSetDllLogPars (char logFile[gMaxFileNameLen], int maxSize, bool isLogToFile, bool isLogToCnsl, bool isWrn, bool isCrt, bool isTrc, bool isDcm, bool isIcm, bool isInf, bool isDbg, bool isTmp, char exclFileToLog[gMaxFileNameLen])
 Sets the logging parameters actually used by the internal DLL functions. More...
 

Detailed Description

These functions could not meaningful be sorted into the other sections.

Function Documentation

◆ scDelCurrentUserRegValue()

ScStatus scDelCurrentUserRegValue ( char *  keyP,
char *  nameP 
)

Deletes a string value in the Windows registry under the base key HKEY_CURRENT_USER.

The following example deletes the entry "sc_daemon.exe" in "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run" making the sc_daemon.exe not autostart any longer.
This function does nothing used under Linux and returns SC_REGISTRY_ERROR.
Example:

char* keyP = "Software\\Microsoft\\Windows\\CurrentVersion\\Run"
char* nameP = "sc_daemon.exe"
ScStatus status = scDelCurrentUserRegValue(keyP, nameP);
if (status != SC_OK)
printf("error\n");
Parameters
keyPpath to the requested registry key (without "HKEY_CURRENT_USER")
namePname of the registry entry to be deleted
Returns
SC_OK, SC_REGISTRY_ERROR

References SC_OK, and SC_REGISTRY_ERROR.

◆ scGetDllLogPars()

ScStatus scGetDllLogPars ( char  logFile[gMaxFileNameLen],
int *  maxSizeP,
bool *  isLogToFileP,
bool *  isLogToCnslP,
bool *  isWrnP,
bool *  isCrtP,
bool *  isTrcP,
bool *  isDcmP,
bool *  isIcmP,
bool *  isInfP,
bool *  isDbgP,
bool *  isTmpP,
char  exclFileToLog[gMaxFileNameLen] 
)

Retrieves the logging parameters and filenames actually used by the internal DLL functions.


The Daemon and the API are using the same routines and have the same initializing logging parameters at program start but are executing in there own address space and have there own copies of all variables.
Example:

char logFile [MAX_FILE_NAME_LEN];
char exclFileToLog[MAX_FILE_NAME_LEN];
int maxSize;
bool isLogToFile;
bool isLogToCnsl;
bool isWrn;
bool isCrt;
bool isTrc;
bool isDcm;
bool isIcm;
bool isInf;
bool isDbg;
bool isTmp;
char logFile[MAX_FILE_NAME_LEN];
char exclFileToLog[MAX_FILE_NAME_LEN];
ScStatus status;
status = scGetDllLogPars(logFile, &maxSize, &isLogToFile, &isLogToCnsl,
&isWrn, &isCrt, &isTrc, &isDcm,
&isIcm, &isInf, &isDbg, &isTmp,
exclFileToLog);
if (status == SC_OK)
printf("isWarn: %d\n", isWrn);
else
printf("this can not happen\n");
Return values
logFilepointer to a string containing the log file's name and path
maxSizePmax. size of the log file in kB before it is renamed to *.bak
isLogToFilePif true logging is directed into a log file
isLogToCnslPif true logging is directed to the console
isWrnPif true warnings are logged
isCrtPif true creation and destruction of objects are logged
isTrcPif true trace messages are logged
isDcmPif true communication between driver and device is logged
isIcmPif true driver internal communication is logged
isInfPif true information messages are logged
isDbgPif true debug messages are logged
isTmpPif true data of temporal interest is logged
exclFileToLogPpointer to a string containing a file's name and path, which will be exclusively logged
Returns
always SC_OK (no communication with the daemon is necessary)

References SC_OK.

◆ scIsProcessRunning()

ScStatus scIsProcessRunning ( char *  processName,
bool *  isRunningP 
)

Checks if the process with the given name is running or not.


Example:

bool isRunning;
ScStatus status = scIsProcessRunning("someProcess.exe", &isRunning);
if (isRunning)
printf("process is running\n");
else
printf("process is not running\n");
Return values
isRunningPpointer to the result
Returns
always SC_OK (no communication with the daemon is necessary)

References SC_OK.

◆ scQueryCurrentUserRegValue()

ScStatus scQueryCurrentUserRegValue ( char *  keyP,
char *  nameP,
int  len,
char *  valueP 
)

Queries a string value from the Windows registry under the base key HKEY_CURRENT_USER.

If the entry is not there the function returns SC_REGISTRY_ERROR.
The following example queries the entry "sc_daemon.exe" under the key "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run".
This function does nothing used under Linux and returns SC_REGISTRY_ERROR.
Example:

char* keyP = "Software\\Microsoft\\Windows\\CurrentVersion\\Run";
char* nameP = "sc_daemon.exe";
int len = 123; // size of the expected string value
char value[len];
ScStatus status = scQueryCurrentUserRegValue(keyP, nameP, len, value);
if (status == SC_OK)
printf("value is %s\n", value);
else
printf("error\n");
Parameters
keyPpath to the requested registry key (without "HKEY_CURRENT_USER")
namePname of the registry entry to be created or modified
lenexpected size of the return value (max. 256)
Return values
valuePvalue of the entry to be queried
Returns
SC_OK, SC_REGISTRY_ERROR

References SC_OK, and SC_REGISTRY_ERROR.

◆ scSetCurrentUserRegValue()

ScStatus scSetCurrentUserRegValue ( char *  keyP,
char *  nameP,
char *  valueP 
)

Sets a new string value into the Windows registry under the base key HKEY_CURRENT_USER.

The following example sets the entry "sc_daemon.exe" into "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run" making the sc_daemon.exe autostarting.
This function does nothing used under Linux and returns SC_REGISTRY_ERROR.
Example:

char* keyP = "Software\\Microsoft\\Windows\\CurrentVersion\\Run";
char* nameP = "sc_daemon.exe";
char* valueP = "C:\\Program files (x86)\\SpaceControl\\sc_daemon.exe";
ScStatus status = scSetCurrentUserRegValue(keyP, nameP, valueP);
if (status != SC_OK)
printf("error\n");
Parameters
keyPpath to the requested registry key (without "HKEY_CURRENT_USER")
namePname of the registry entry to be created or modified
valuePvalue of the entry to be created or modified
Returns
SC_OK, SC_REGISTRY_ERROR

References SC_OK, and SC_REGISTRY_ERROR.

◆ scSetDllLogPars()

ScStatus scSetDllLogPars ( char  logFile[gMaxFileNameLen],
int  maxSize,
bool  isLogToFile,
bool  isLogToCnsl,
bool  isWrn,
bool  isCrt,
bool  isTrc,
bool  isDcm,
bool  isIcm,
bool  isInf,
bool  isDbg,
bool  isTmp,
char  exclFileToLog[gMaxFileNameLen] 
)

Sets the logging parameters actually used by the internal DLL functions.


The Daemon and the DLL are using the same routines and have the same initializing logging parameters at program start but are executing in there own address space and have there own copies of all variables. Therefore you can set the DLL's logging parameters separately here. As in the daemon's configuration file you can provide the parameter logFile with a full path or with a pure file name. In the latter case the log file will be written in your home directory into the folder "SpaceController".
With the parameter exclFileToLog you can specify a source code file. If you do so only the output of this file will be logged, all other logging will be suppressed. To log all files set this parameter to "" as shown in the example.
Attention: This function has to be called after scConnect() because the logging parameters are reinitialized there with those out of the configuration file daemon.ini.
Example:

char* logFile = "/home/myDir/my_log.txt";
int maxSize = 500; // max. size will be 500 kB
bool isLogToFile = false;
bool isLogToCnsl = true;
bool isWrn = true;
bool isCrt = true;
bool isTrc = false;
bool isDcm = false;
bool isIcm = false;
bool isInf = false;
bool isDbg = false;
bool isTmp = false;
char* exclFileToLog = ""; // log all files
ScStatus status;
status = scSetDllLogPars(logFile, maxSize, isLogToFile, isLogToCnsl,
isWrn, isCrt, isTrc, isDcm,
isIcm, isInf, isDbg, isTmp,
exclFileToLog);
if (status == SC_OK)
printf("success\n");
else
printf("this can not happen\n");
Parameters
logFilecharacter string containing the log file's name and path
maxSizemax. size of the log file in kB before it is renamed to *.bak
isLogToFileif true logging is directed into a log file
isLogToCnslif true logging is directed to the console
isWrnif true warnings are logged
isCrtif true creation and destruction of objects are logged
isTrcif true trace messages are logged
isDcmif true communication between driver and device is logged
isIcmif true driver internal communication is logged
isInfif true information messages are logged
isDbgif true debug messages are logged
isTmpif true data of temporal interest is logged
exclFileToLogcharacter string containing a file's name and path, which will be exclusively logged
Returns
always SC_OK

References SC_OK.

SC DLL

SpaceControl Copyright (c) SpaceControl GmbH & Co. KG, Am Technologiepark 10, D-82229 Seefeld
Generated by Doxygen