I think people (including, I suspect, the OP) are getting confused between copyright and patent.
Copyright, as has been said, is automatic. Anything you write is yours, and nobody can sell it or give it away without your say-so. This permission may have (almost certainly will have, in fact) been given when you signed your contract with the client. What copyright doesn't prevent is somebody else writing something to do the same job and selling it.
Patent is entirely different and needs to show originality. It's also very difficult and expensive to obtain, but once you've got your patent nobody else is allowed to reproduce the same work, even if the work is done entirely separately and without any reference to your patent.
Copyright, as has been said, is automatic. Anything you write is yours, and nobody can sell it or give it away without your say-so. This permission may have (almost certainly will have, in fact) been given when you signed your contract with the client. What copyright doesn't prevent is somebody else writing something to do the same job and selling it.
Patent is entirely different and needs to show originality. It's also very difficult and expensive to obtain, but once you've got your patent nobody else is allowed to reproduce the same work, even if the work is done entirely separately and without any reference to your patent.
Comment