Does anyone know in what file the 'add to cart' process is performed?

Ive been modding a copy of OSC 2.2 for the last few weeks, but have come to a stand still in creating some custom 'buy now' links.

Basically from product_info page i want to replicate the action of the 'add to cart' button. I have a list of the attributes rather than a drop down, so i need to find out how the 'add to cart' process works, in order that i can add a product with a specified attribute to the cart -- without the user selecting from the attribute drop down first.

Does that make sense??

Any help/pointers are appreciated.