GetConfigListByKey
Returns a comma separated list of filtered configuration section names. The filter is based on a key name and value pair, if the configuration section contains a key with the given value then it will appear on the list.
Parameters:
keyName
The name of the key the section must contain.
keyValue:
The value the key must be set to, to be included in the list.
buffer
The buffer that will contain the comma separated list.
bufferLen
The size of the buffer (used to prevent an overrun).
Return Value:
The number of characters that were copied into the buffer (including the termination character).
Prototype Signature:
int GetConfigListByKey(const char *keyName, const char* keyValue, char* buffer, int bufferLen);
An example of how this function could be used is shown below.
If a list of calibrations by PNA name were desired then one would use the function as such:
#include <malloc.h>
#include <string.h>
#include "api.h"
int main()
{
success successful;
int bufferLen = 1024;
char* responseBuffer = malloc(bufferLen);
int bytesCopied;
//Initialize the library with a specific configuration file
successful = Initialize("C:\\Temp\\MyConfig.ini");
if(successful)
{
//Get the comma separated list of calibrations using PNA-2 in buffer
bytesCopied = GetConfigListByKey("PNA","PNA-2", responseBuffer, bufferLen);
}
}