Concat

Concatenates several strings together.

Syntax

IppStatus ippsConcat_8u_D2L(const Ipp8u* const pSrc[], const int* pSrcLen[], int numSrc, Ipp8u* pDst);

IppStatus ippsConcat_16u_D2L(const Ipp16u* const pSrc[], const int* pSrcLen[], int numSrc, Ipp16u* pDst);

IppStatus ippsConcat_8u(const Ipp8u* pSrc1, int len1, const Ipp8u* pSrc2, int len2, Ipp8u* pDst);

IppStatus ippsConcat_16u(const Ipp16u* pSrc1, int len1, const Ipp16u* pSrc2, int len2, Ipp16u* pDst);

Parameters

pSrc1

Pointer to the first source string.

len1

Number of elements in the first string.

pSrc2

Pointer to the second source string.

len2

Number of elements in the second string.

pSrc

Pointer to the array of source strings.

pSrcLen

Pointer to the array of lengths of the source strings.

numSrc

Number of source strings.

pDst

Pointer to the destination string.

Description

The function ippsConcat is declared in the ippch.h file. This function concatenates several strings together. Functions with D2L suffix operate with multiple numSrc strings pSrc [], while functions without this suffix operate with two strings pSrc1 and pSrc2 only. Resulting string is stored in the pDst. Necessary memory blocks must be allocated for the destination string before the function is called. Summary length of the strings to be concatenated can not be greater than IPP_MAX_32S.

Example below shows how to use the functions ippsConcat_8u and ippsConcat_8u_D2L.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error condition if at least one of the specified pointers is NULL.

ippStsLengthErr

Indicates an error condition if len1 or len2 is negative, or srcLen[i] is negative for i < numSrc.

ippStsSizeErr

Indicates an error condition if numSrc is equal to or less than 0.

Using the functions ippsConcat and ippsConcatC

 Ipp8u string0[] = "This is the initial string.";
Ipp8u string1[] = "Extra text added to the string...";
Ipp8u* string_ptr [2] = { string0, string1 };
int string_len_ptr [2] = { sizeof (string0) - 1, sizeof (string1)};
Ipp8u dst_string [ sizeof (string0) + sizeof (string1)];
ippsConcat_8u( string0, sizeof (string0) - 1, string1, sizeof (string1), dst_string );
printf ("ippsConcat_8u said: %s\n", (char*) dst_string );
ippsConcat_8u_D2L( string_ptr , string_len_ptr , 2, dst_string );
printf ("ippsConcat_8u_D2L said: %s\n", (char*) dst_string );
ippsConcatC_8u_D2L( string_ptr , string_len_ptr, 2, '#', dst_string );
printf ("ippsConcatC_8u_D2L said: %s\n", (char*) dst_string );

		
Output:
ippsConcat_8u said: This is the initial string. Extra text added to the string...
ippsConcat_8u_D2L said: This is the initial string. Extra text added to the string...
ippsConcatC_8u_D2L said: This is the initial string. # Extra text added to the string...

Submit feedback on this help topic

Copyright © 2000 - 2010, Intel Corporation. All rights reserved.