/********************************************/
/* User defined config routines             */
/*                                          */
/* Specify the actions to be performed on   */
/* occurance of a keyword. This could be    */
/* anything. Be sure you leave your routine */
/* with a value not equal 0, because this   */
/* will be interpret as a fatal.            */
/********************************************/

int Config_Routine1(char param[])
{
  strcpy(Doorpath,param);
  return(1);                        /* Returning not zero means OK */
}

int Config_Routine2(char param[])
{
  strcpy(defbcstring,param);
  return(1);                        /* Returning not zero means OK */
}

int Config_Routine3(char param[])
{
  strcpy(portlist,param);
  return(1);                        /* Returning not zero means OK */
}


/*************************************************/
/* Keywords_List structure (global!)             */
/*                                               */
/* _MUST_ be declared _AFTER_ the user defined   */
/* config routines, in order to enable the       */
/* compiler to establish the routine's addresses */
/*                                               */
/* All keywords must be in uppercase !           */
/*************************************************/

struct Keyword_List keywords[3] = {
  { &Config_Routine1, "DOORPATH" },
  { &Config_Routine2, "HELPLINE" },
  { &Config_Routine3, "PORTLIST" }
};

  /*************************************************************************/
  /* Reading a configuration file                                          */
  /*                                                                       */
  /* Well, you shoul'ave figured out the 1st parameter by yourself by now! */
  /* The second parameter is the Keyword_List structure to be used.        */
  /* The third parameter specifies the number of entries in the structure. */
  /*                                                                       */
  /* If the specified configuration file could not be found, no error will */
  /* be returned! Read_Config_File() assumes that you will use the default */
  /* values instead (as defined in the global variables part).             */
  /*************************************************************************/
  
/********************************************************************************/
/* Readconfig 									*/
/********************************************************************************/

void Readconfig()
{
  strcpy(portlist,"TL0TR0TR1TR2");
  strcpy(Doorpath,"DLGConfig:Red_Dwarf/");
  strcpy(defbcstring,"[1;33m                [R] Redraw, [S] Broadcast, [?] Help, [Q] Quit[1;37m[K");

  Read_Config_File("DLGConfig:Red_Dwarf/Config/RD_Monitor.cfg", keywords, 3);
  Read_Config_File("S:RD_Monitor.cfg", keywords, 3);
  Read_Config_File("Doors:Monitor/RD_Monitor.cfg", keywords, 3);
}
