I made a leap there without explaining. You can copyright code the same way you copyright a book. But in doing so you protect the text but not inherently the IP. Copyrighted code has a whole "originality" argument in it's defensibility. Patents do too, but they would never patent the code itself. If you want to protect yourself... it's belt and suspenders.