Intel® Integrated Performance Primitives (Intel® IPP) Developer Guide and Reference

ID 790148
Date 3/22/2024
Public
Document Table of Contents

SplitC

DEPRECATED. Splits source string into separate parts.

Syntax

IppStatus ippsSplitC_8u_D2L(const Ipp8u* pSrc, int srcLen, Ipp8u delim, Ipp8u* pDst[], int dstLen[], int* pNumDst);

Include Files

ippch.h

Domain Dependencies

Headers: ippcore.h, ippvm.h, ipps.h

Libraries: ippcore.lib, ippvm.lib, ipps.lib

Parameters

pSrc

Pointer to the source strings.

srcLen

Number of elements in the source string.

delim

Symbol delimiter.

pDst

Pointer to the array of the destination strings.

dstLen

Pointer to array of the destination string lengths.

pNumDst

Number of destination strings.

Description

NOTE:
This function is deprecated and will be removed in a future release. If you have concerns, open a ticket and provide feedback at https://supporttickets.intel.com/.

This function breaks source string pSrc into pNumDst separate strings pDst using a specified symbol delim as a delimiter. If n specified delimiters occur in the beginning or in the end of the source string, then n empty strings are appended to the array of destination strings. If n specified delimiters occur in a certain position within the source string, then (n-1) empty strings are inserted into the array of destination strings, where n is the number of delimiter occurrences in this position.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

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

ippStsLengthErr

Indicates an error condition if srcLen is negative, or dstLen is negative for i < pNumDst.

ippStsSizeErr

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

ippStsOvermatchStrings

Indicates a warning if number of output strings exceeds the initially specified number pNumDst; in this case odd strings are discarded.

ippStsOverlongString

Indicates a warning if in some output strings the number of elements exceeds the initially specified value dstLen; in this case corresponding strings are truncated to initial lengths.

Example

The code example below shows how to use the function ippsSplitC_8u_2DL.

 Ipp8u string[] = "1st string # 2nd string";
 Ipp8u dst_string0[ sizeof (string)];
 Ipp8u dst_string1[ sizeof (string)];
 Ipp8u* dst_string_ptr [] = { dst_string0, dst_string1 };
 int dst_string_len_ptr [] = { sizeof (dst_string0), sizeof (dst_string1) };
 int dst_string_num = 2;
 int i ;
 ippsSplitC_8u_D2L( string, sizeof (string) - 1, '#', dst_string_ptr, dst_string_len_ptr, & dst_string_num );
 printf ( "Destination strings number: %d\n", dst_string_num );
 for( i = 0; i < dst_string_num ; i ++ ) {
     dst_string_ptr [ i ][ dst_string_len_ptr [ i ]] = 0;
     printf ( "%d: %s.\n", i, (char*) dst_string_ptr [ i ] );
 }

 Output:
 Destination strings number: 2
 0: 1st string.
 1: 2nd string.