# classname_indexname_pattern_size

> Prior to using the pattern search interfaces, you need to allocate a buffer that is used for a state machine within eXtremeDB during pattern search navigation. You pass the buffer to`classname_indexname_pattern_search()` and `classname_indexname_pattern_next()`. It’s your responsibility to free the buffer memory at the end of the pattern search. See the User Guide and SDK sample applications.

### Prototype

>         MCO_RET	classname_indexname_pattern_size(	/*IN*/ [<type> key1 | const <type> *key1],
>                                   [/*IN*/ uint2 sizeof_key1, ]
>                                  [/*IN*/[<type> key2 | const <type> *key2],
>                                   /*IN*/ uint2 sizeof_key2, …],
>                                   /*OUT*/ uint4 *pattern_size);

### Arguments

key1 | The <type> of key1 corresponds to the type of the first field in the index indexname. If key1 is a char or string type, then key1 contains a wildcard (regular expression) pattern to be matched, for example, “foo*
sizeof_key1 | If key1 is a char or string, this argument is present and is the string length of key1. For non-char/string types, this parameter is not present
key2 | The <type> of key2 corresponds to the type of the second field in the index indexname. If key2 is a char or string type, then key2 contains a wildcard (regular expression) pattern to be matched, for example, “bar*”
sizeof_key2 | If key2 is a char or string, this argument is present and is the string length of key2. For non-char/string types, this parameter is not present
… | Each additional element of indexname is represented by an argument
pattern_size | A pointer to an unsigned 4-byte integer into which eXtremeDB returns the size of the buffer you need to allocate

### Description

> Prior to using the pattern search interfaces, you need to allocate a buffer that is used for a state machine within eXtremeDB during pattern search navigation. You pass the buffer to `classname_indexname_pattern_search()` and `classname_indexname_pattern_next()`. It’s your responsibility to free the buffer memory at the end of the pattern search. See the User Guide and SDK sample applications.

### Return Codes

MCO_S_OK | The cursor was positioned successfully

Related Topics