try to look at this some sample code.

Code:
//---------------------------------
// main.c
//---------------------------------
#include <acknex.h>
#include <default.c>

#include "quit.c"  // other c file

//////////////////////////////////////////////////////////////////////
PANEL* main_pan =
{
  bmap = "main.pcx";
  pos_x = 250;     
  pos_y = 200;    
  button (250, 134, "quitclicked.pcx", "quitnormal.pcx", "quitover.pcx", quit_program, NULL, NULL); 
  flags = OVERLAY | VISIBLE;
}

////////////////////////////////////////////////////////////////////
function main()
{
  video_mode = 7; 
  screen_color.blue = 150;
  mouse_mode = 4;
}



Code:
//------------------------------------
// quit.c
//------------------------------------
function quit_program()
{
  while (key_any) { wait (1); }
  sys_exit(NULL);
}



hope that helps.