Required reading: http://www.tinaja.com/glib/casagpat.pdf
More on this page: http://www.tinaja.com/patnt01.asp Yes, the web page colour scheme is /terrible/, but it may save you a great deal of time, trouble and perhaps your sanity.
This resource might also be helpful: http://en.swpat.org/wiki/Software_patents_wiki:_home_page
tl;dr: Small scale patenting is a mug's game.