LZW C implementation