This simple format is often supported by third party applications for import/export.

A fundamental limitation of this format is how to cope with the delimiter character appearing in the data.  Note that multilingual character sets (particularly multi-byte character sets) make this issue more complicated than it first seems. However, for applications where the data is known not to include certain characters (for example, the TAB character), it is simple to use.

Each parameter will be prefixed with the parameter name, separated by an "=" character (this character cannot be changed). Note that the parameter name could be in a multilingual (including multi-byte) character set. For example, assuming that the delimiter character is ",":

AccountId=12345,AccountName=Big Acct,Cmd=ADD,Amount=123.45

Indicate entire array parameters by appending the Task parameter name with open/close parentheses "( )". The opening delimiter for the entire array elements is an open parenthesis "(" and the closing delimiter is a close parenthesis ")".  The delimiter for each element is determined the same as with non-array parameters.  For example assuming that the delimiter character is ",":

Address()=(123 Any Street, Suite A, Hometown, State, Country)

You do not need to specify all elements of the array, but the elements listed will be placed consecutively into the array starting with the first element address.

Indicate individual elements of an array by appending the Task parameter name with open/close parentheses and the element number(one relative). For example, assuming that the delimiter character is ",":

Address(1)=123 Any Street, Address(2)=Suite A,Address(3)=Hometown

If the nParamLenIn parameter of p4TaskExec() is non-zero, then it is used to indicate the end of the parameter list. If it is zero, then the first NUL byte terminates the string.

On return, the parameter list will contain just a list of the OUT parameters with leading and trailing blanks stripped from each field.  The list is not null terminated: the length of the list is returned instead.

For additional information and examples, see Task/Function Parameter Definitions and P4API Parameter Passing.

Comment on this topic

Topic ID: 540038

 
 
 

Table of Contents

Index

Glossary

-Search-

Back