Thursday
Feb212013
SquidBatch
- Executes a delimited set of SQUID functions.
- Does not allow nested SQUID calls (SQUID functions as parameters to other SQUID functions).
- All batched SQUID functions act on the iSquid instance passed into SquidBatch.
- All SQUID functions available except: SquidBatch, SquidConnect, SquidDisconnect.
Prototype
int SquidBatch(int iSquid, char* sCommands, char* sDelimiter);
- Parameters
iSquid Squid Connection Handle sCommands String containing the delimited set of SQUID functions sDelimiter Delimiter used to separate the SQUID commands and their parameters
- Return Values
"" Operation successful char* String containing command errors
Example
int iSquid;
int i;
char *ptr;
char strCommand[8192];
lr_load_dll("SQUID-REST.dll");
iSquid = SquidConnect("http://localhost:8000");
strCommand[0] = 0;
ptr = strCommand;
for (i=1; i<=100; i++)
{
ptr += sprintf(ptr, "SquidSendData;Column1;LR-BATCH-%d;", i);
}
lr_output_message("SquidBatch command = %s", strCommand);
lr_output_message("SquidBatch=%s", SquidBatch(iSquid,strCommand,";"));
lr_output_message("SquidGetLastError = %s", SquidGetLastError(iSquid));
SquidDisconnect(iSquid);