On standard Linux setups you have two general paste buffers, the main copy(^C)/paste(^V) one and the select-text/middle-click one. For both of these buffers:
At what level in the environment are these buffers stored/managed; the kernel, the X server, KDE/Gnome, or some other service somewhere?
Can they be programmatically accessed somehow using some standard library?