[Mistat-cvs] mistat/src main.c,1.11,1.12 main.h,1.9,1.10 menu.c,1.20,1.21
Status: Pre-Alpha
Brought to you by:
bikepunk005
|
From: Mike H. B. <bik...@us...> - 2004-05-05 08:05:53
|
Update of /cvsroot/mistat/mistat/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11160/src Modified Files: main.c main.h menu.c Log Message: Fixed problem with the loss of datafile name. Index: main.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/main.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** main.c 30 Mar 2004 15:49:48 -0000 1.11 --- main.c 5 May 2004 08:05:43 -0000 1.12 *************** *** 1,17 **** /* Entry point for mistat. ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. ! This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software --- 1,17 ---- /* Entry point for mistat. ! Copyright (C) 2003, 2004 Mike H. Benton Mike H. Benton <bik...@us...>, 2003. ! This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. ! This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software *************** *** 65,69 **** static struct gengetopt_args_info args_info; /*command line structure */ bool data_file_exist; /*flag to indicate data file can be opened */ ! char *data_file_name; /*holds name of the data file */ int print_digit; /*Number of digits to print. */ GetLine *gl; /*For libtecla GetLine functions. */ --- 65,69 ---- static struct gengetopt_args_info args_info; /*command line structure */ bool data_file_exist; /*flag to indicate data file can be opened */ ! char data_file_name[MAXFILENAME]; /* Name of data file. */ int print_digit; /*Number of digits to print. */ GetLine *gl; /*For libtecla GetLine functions. */ *************** *** 80,89 **** set_signals (); - /*Turn off gsl error handler. */ - /*This will allow to use custom error handler. */ - /*gsl_error aborts on error and may not be necessary. */ - /*See Error Handling in gsl reference. */ - /*gsl_set_error_handler_off ();*/ - /*Need to make sure gl not initialized! */ /*Otherwise, need to make it so. */ --- 80,83 ---- *************** *** 102,107 **** do_args (argc, argv); ! /*Off to process land. We shall not return here! ! *The problem is a SEG violations becasue argc and argv get lost.*/ menu_main (); --- 96,100 ---- do_args (argc, argv); ! /* Off to process land. We shall not return here! */ menu_main (); *************** *** 224,231 **** else { ! data_file_name = *args_info.inputs; ! /*Hmmmmm...this stopped working and gave SEGV */ ! /*Now do above */ ! /*strcpy (data_file_name, *args_info.inputs); */ data_file = open_file (data_file_name, 1); --- 217,223 ---- else { ! ! strcpy (data_file_name, *args_info.inputs); ! data_file = open_file (data_file_name, 1); Index: menu.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/menu.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** menu.c 17 Apr 2004 15:36:38 -0000 1.20 --- menu.c 5 May 2004 08:05:43 -0000 1.21 *************** *** 18,34 **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ ! /*USAGE: Call menu_main. Exit from mistat is from menu_main as well. FIXME: some file ops are here!*/ /*menu.c*/ ! #include <stdio.h> /* Various printf and some file stuff (for the moment). */ ! #include <ctype.h> #include <stdlib.h> ! #include <string.h> /* Some string minipulations. */ /*Use -ltecla for linking*/ ! #include <libtecla.h> /* Use for input. */ #include "menu.h" --- 18,34 ---- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ ! /*USAGE: Call menu_main. Exit from mistat is from menu_main as well. FIXME: some file ops are here!*/ /*menu.c*/ ! #include <stdio.h> /* Various printf and some file stuff (for the moment). */ ! #include <ctype.h> #include <stdlib.h> ! #include <string.h> /* Some string minipulations. */ /*Use -ltecla for linking*/ ! #include <libtecla.h> /* Use for input. */ #include "menu.h" *************** *** 66,72 **** { choice = get_choice (main_menu, MIN_MENU, MAX_MENU); ! if (choice >= 2) ! do_menu_choice (choice); } --- 66,72 ---- { choice = get_choice (main_menu, MIN_MENU, MAX_MENU); ! if (choice >= 2) ! do_menu_choice (choice); } *************** *** 106,110 **** do_stats_choice (choice); ! break; --- 106,110 ---- do_stats_choice (choice); ! break; *************** *** 121,128 **** if (log_file_flag) view_log_file (); ! else printf ("Log file not open. Use -l in the command line to open\n\n"); ! break; --- 121,128 ---- if (log_file_flag) view_log_file (); ! else printf ("Log file not open. Use -l in the command line to open\n\n"); ! break; *************** *** 217,220 **** --- 217,222 ---- do_file_menu (int not_read) { + char *temp; + /*Close open data file if necessary. */ if (data_file_exist) *************** *** 225,232 **** ! data_file_name = gl_get_line (gl, "Enter the name of a file or Enter for none->", NULL, -1); /*Determine if user just hit Enter. */ if (strlen (data_file_name) <= 1) --- 227,236 ---- ! temp = gl_get_line (gl, "Enter the name of a file or Enter for none->", NULL, -1); + strcpy (data_file_name, temp); + /*Determine if user just hit Enter. */ if (strlen (data_file_name) <= 1) *************** *** 266,270 **** * Returns a verified choice. * -1 is a return and -2 indicates a negative number ! * -999 indicates character or choice. * or invalid selection for variable input. * Supply menu_number based on enum, min, and max possible values. --- 270,274 ---- * Returns a verified choice. * -1 is a return and -2 indicates a negative number ! * -999 indicates character or choice. * or invalid selection for variable input. * Supply menu_number based on enum, min, and max possible values. *************** *** 352,357 **** /* ! * Check if digits is within allowable values. ! * The various switch parts do addition to choice. */ if (digits == 0 && menu_number != options_menu) --- 356,361 ---- /* ! * Check if digits is within allowable values. ! * The various switch parts do addition to choice. */ if (digits == 0 && menu_number != options_menu) Index: main.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/main.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** main.h 15 Mar 2004 15:07:26 -0000 1.9 --- main.h 5 May 2004 08:05:43 -0000 1.10 *************** *** 25,28 **** --- 25,34 ---- /* + * Defines + */ + + #define MAXFILENAME 100 + + /* * Prototypes */ *************** *** 35,39 **** FILE *logfile; extern int print_digit; ! extern char *data_file_name; #endif --- 41,46 ---- FILE *logfile; extern int print_digit; ! extern char *ptr_data_file_name; ! extern char data_file_name[]; #endif |