Are you always limited to a small alphabet, with a limited string length?
I doubt you'll get a unique function that will work on any length of string (lets say a DNA fragment).
One simple way would be to strcat() a copy of one string to itself, then use strstr() on the other.
Say
Code:strcpy(temp,"cdeab"); strcat(temp,"cdeab"); // find cdeabcdeab if ( strstr( temp, "abcde" ) ) { // match }