For personal or marketing purposes can be considered as anything binarnoi the comparison showed hoe one difference, but in legal (definition of authorship, etc.) technically, even if one line with copyright law will find will be considered a violation. Actually, as far as I know, it's up to the examination without formal kriteriev, everything counts from the full match code fragments (including commentarii) to algorithms and architecture. Experts rukovodstvuyutsya the fact that no two people can think alike.