C code for window functions, and SQL to install and uninstall them