main.c
// This method searches for a match from str[] in window[] of strLen length.
// Returns the position of the match starting from the beginning of window[],
// or -1 if no match is found.
// Is invoked during every iteration of the compression algorithm.
This method searches for a match from str[] in window[] of strLen length.
Returns the position of the match starting from the beginning of window[],
or -1 if no match is found.
Is invoked during every iteration of the compression algorithm.
This method searches for a match from str [] in window [] of strLen length . Returns the position of the match starting from the beginning of window [] or - 1 if no match is found . Is invoked during every iteration of the compression algorithm .
int findMatch(unsigned char window[], unsigned char str[], int strLen) {
    int j, k, pos = -1;
    for (int i = 0; i <= windowSize - strLen; i++) {
        pos = k = i;
        for (j = 0; j < strLen; j++) {
            if (str[j] == window[k])
                k++;
            else
                break;
        }
        if (j == strLen)
            return pos;
    }
    return -1;
}
int findMatch ( unsigned char window [ ] , unsigned char str [ ] , int strLen ) { int j , k , pos = -1 ; for ( int i = 0 ; i <= windowSize - strLen ; i ++ ) { pos = k = i ; for ( j = 0 ; j < strLen ; j ++ ) { if ( str [ j ] == window [ k ] ) k ++ ; else break ; } if ( j == strLen ) return pos ; } return -1 ; }
This method searches for a match from str[] in window[] of strLen length.
This method searches for a match from str [] in window [] of strLen length .