The GRASS 5 Programmers manual is available here: http://grass.itc.it/grassdevel.html#prog