Gentee Programming Language > Documentation > Libraries | Download documentation |
The spattern type is used to search through the buffer for another one. Before search start-up, call the spattern.init method in order to initialize the search pattern.
uint spattern.search( uint src, uint size )
src Pointer to the beginning of data in order to start a search. size Data size.
The offset of the found fragment. If the offset is equal to size, no fragment is found.
uint spattern.search( buf src, uint offset )
src Buffer where the specified data (search pattern) will be searched. offset Offset where the search must be started or proceeded.
The offset of the found fragment. If the offset is equal to the buffer size, no fragment is found.
spattern sp buf pattern src ... sp.init( pattern, 0 ) if sp.search( src, 0 ) < *src { print("The pattern has been found in src buffer!\n") }
See also
![]() |
![]() Copyright © 2004-2006 Gentee Inc. All rights reserved. ![]() |