#include "main.h"


void configure_conf_file()
{
       FILE* outfd;
       
       int quit =0;
       char buf[MAXLEN];
       int i;
       
       DPRINTF(("Writing conf_file==:%s:\n",conf_file));

       if(!(outfd = fopen("../SRC/conf_file","w"))){
	    err_crit("Can't open ../SRC/conf_file for writing");
       }
       
       fprintf(outfd," QMASTER_SPOOL_DIR         %s\n",qmaster_spool_dir);
       fprintf(outfd," EXECD_SPOOL_DIR           %s\n",execd_spool_dir);
       fprintf(outfd," DEFAULT_CELL              %s\n",default_cell);
       fprintf(outfd," RESERVED_PORT             %s\n",reserved_port);
       fprintf(outfd," DQS_EXECD_SERVICE         %s\n",dqs_execd_service);
       fprintf(outfd," QMASTER_SERVICE           %s\n",qmaster_service);
       fprintf(outfd," INTERCELL_SERVICE         %s\n",intercell_service);
       fprintf(outfd," KLOG                      %s\n",klog);
       fprintf(outfd," REAUTH_TIME               %s\n",reauth_time);
       fprintf(outfd," MAILER                    %s\n",mailer);
       fprintf(outfd," DQS_BIN                   %s\n",dqs_bin);
       fprintf(outfd," ADMINISTRATOR             %s\n",administrator);
       fprintf(outfd," DEFAULT_ACCOUNT           %s\n",default_account);
       
       fprintf(outfd," LOGMAIL                   %s\n",log_mail); 
       fprintf(outfd," DEFAULT_RERUN             %s\n",default_rerun);
       fprintf(outfd," DEFAULT_SORT_SEQ_NO       %s\n",default_sort_seq_no);
       fprintf(outfd," SYNC_IO                   %s\n",sync_io);
       
       
       fprintf(outfd," USER_ACCESS               %s\n",user_access);
       fprintf(outfd," LOGFACILITY               %s\n",logfacility);
       fprintf(outfd," LOGLEVEL                  %s\n",loglevel);
       fprintf(outfd," MIN_UID                   %s\n",min_uid);
       fprintf(outfd," MIN_GID                   %s\n",min_gid);
       fprintf(outfd," MAXUJOBS                  %s\n",maxujobs);
       fprintf(outfd," OUTPUT_HANDLING           %s\n",output_handling);
       fprintf(outfd," ADDON_SCRIPT              %s\n",addon_script);
       fprintf(outfd," ADDON_INFO                %s\n",addon_info);       
       fprintf(outfd," LOAD_LOG_TIME             %s\n",load_log_time);
       fprintf(outfd," STAT_LOG_TIME             %s\n",stat_log_time);
       fprintf(outfd," SCHEDULE_TIME             %s\n",schedule_time);
       fprintf(outfd," MAX_UNHEARD               %s\n",max_unheard);
       fprintf(outfd," ALARMS                    %s\n",alarms);
       fprintf(outfd," ALARMM                    %s\n",alarmm);
       fprintf(outfd," ALARML                    %s\n",alarml);
       
       fclose(outfd);
       chmod(conf_file,0644);

}

