SQUID Functions

 

  • The SQUID functions, and their examples, assume that the SQUID server has been started with an address of http://localhost:8000.
  • Validation of the function calls can be handled by checking the return value and calling SquidGetLastError().

 

Entries in SquidBatch (1)

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
iSquidSquid Connection Handle
sCommandsString containing the delimited set of SQUID functions
sDelimiterDelimiter 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);