[Mistat-cvs] mistat/src input.h,NONE,1.1 .indent.pro,1.1,1.2 Makefile.am,1.6,1.7 Makefile.in,1.12,1.
Status: Pre-Alpha
Brought to you by:
bikepunk005
|
From: Mike H. B. <bik...@us...> - 2004-07-05 04:30:28
|
Update of /cvsroot/mistat/mistat/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27484 Modified Files: .indent.pro Makefile.am Makefile.in file_ops.c file_ops.h main.c menu.c menu.h output.c statistics.c statistics.h system.h Added Files: input.h Log Message: Removed libtecla, now using readline. Put all file operations in file_ops.c. Finished regression work. Index: .indent.pro =================================================================== RCS file: /cvsroot/mistat/mistat/src/.indent.pro,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .indent.pro 9 Jun 2004 17:00:05 -0000 1.1 --- .indent.pro 5 Jul 2004 04:28:57 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- + +verbose +blank-lines-after-procedures +brace-indent0 /*0 from 2*/ *************** *** 4,12 **** +braces-after-struct-decl-line +break-before-boolean-operator +continuation-indentation4 /**/ +continue-at-parentheses +declaration-indentation2 +dont-cuddle-else ! +dont-format-comments +dont-format-first-column-comments +else-endif-column1 --- 5,14 ---- +braces-after-struct-decl-line +break-before-boolean-operator + +comment-line-length80 /**/ +continuation-indentation4 /**/ +continue-at-parentheses +declaration-indentation2 +dont-cuddle-else ! +format-all-comments +dont-format-first-column-comments +else-endif-column1 *************** *** 23,25 **** +space-after-cast +space-after-procedure-calls ! +tab-size4 /**/ \ No newline at end of file --- 25,28 ---- +space-after-cast +space-after-procedure-calls ! +tab-size4 /**/ ! -T _Bool \ No newline at end of file --- NEW FILE: input.h --- /* Just find O/S and then include the right source file. ** ** Copyright (C) 2004 Mike H. Benton ** Mike H. Benton <bik...@us...>, 2004. ** ** 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 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* * input.h. USAGE: Include in any files that need input from the user. */ #ifdef __CYGWIN__ # include "cygwin_input.c" #endif /* Here ends input.h. */ Index: file_ops.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/file_ops.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** file_ops.h 9 Jun 2004 17:00:05 -0000 1.12 --- file_ops.h 5 Jul 2004 04:28:57 -0000 1.13 *************** *** 1,3 **** ! /* Header for file_ops.c in mistat. ** ** Copyright (C) 2003, 2004 Mike H. Benton --- 1,4 ---- ! /* ! ** Header for file_ops.c in mistat. ** ** Copyright (C) 2003, 2004 Mike H. Benton *************** *** 17,25 **** ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! */ /* ! * file_ops.h USAGE: Doing anything with a file, also when using Nrows or Columns. ! */ #ifndef FILE_OPS_H --- 18,26 ---- ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! */ /* ! * file_ops.h. USAGE: Doing anything with a file, also when using Nrows or Columns. ! */ #ifndef FILE_OPS_H *************** *** 27,38 **** /* ! * Defines ! */ ! # define MAXLINE 50000 /* Current limit of max. data file lines. */ /* ! * Current limit of max. data file rows (cases)Based on max. number in Excel * 2 + 1. ! */ # define MAXROWS 131073 ! # define MAXCOLS 400 /* Current limit of max. data file cols (variables). */ /* Defines used for Data_Type. */ --- 28,40 ---- /* ! * Defines. ! */ ! # define MAXLINE 50000 /* Current limit of max. data file lines. */ /* ! * Current limit of max. data file rows (cases)Based on max. number in Excel * 2 + 1. ! */ # define MAXROWS 131073 ! # define MAXCOLS 400 /* Current limit of max. data file cols ! (variables). */ /* Defines used for Data_Type. */ *************** *** 42,66 **** /* ! * Prototypes ! */ /*FIXME: why so many?*/ FILE *open_file (char *file_name, int open_mode); void file_close (FILE * fp, char *file_name); void read_data_file (FILE * fp); int getwords (char *line, char *words[], int maxwords); int fgetline (FILE * fp, char line[], int max); void view_log_file (void); void update_logfile (char *message); int getit (FILE * file_name, int element, long double t[]); /* ! * Extern data ! */ ! extern int Nrows; /* Number of rows in data file. */ ! extern int Columns; /* Number of columns in a data file. */ /* ! * Data_Type is an array containing the type of data for each respective variable. ! * 1 is int, 2 is float, 3 is character. ! */ extern int Data_Type[]; --- 44,71 ---- /* ! * Prototypes. ! */ /*FIXME: why so many?*/ FILE *open_file (char *file_name, int open_mode); void file_close (FILE * fp, char *file_name); void read_data_file (FILE * fp); + int getwords (char *line, char *words[], int maxwords); int fgetline (FILE * fp, char line[], int max); + void view_log_file (void); void update_logfile (char *message); int getit (FILE * file_name, int element, long double t[]); + void do_file_menu (int not_read); /* ! * Extern data. ! */ ! extern int Nrows; /* Number of rows in data file. */ ! extern int Columns; /* Number of columns in a data file. */ /* ! * Data_Type is an array containing the type of data for each respective variable. ! * 1 is int, 2 is float, 3 is character. ! */ extern int Data_Type[]; Index: Makefile.in =================================================================== RCS file: /cvsroot/mistat/mistat/src/Makefile.in,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Makefile.in 9 Jun 2004 17:00:05 -0000 1.12 --- Makefile.in 5 Jul 2004 04:28:57 -0000 1.13 *************** *** 1,7 **** ! # Makefile.in generated by automake 1.8.3 from Makefile.am. # @configure_input@ ! # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, ! # 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, --- 1,7 ---- ! # Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ ! # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 ! # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, *************** *** 35,40 **** # Process with automake to produce Makefile.in. - SOURCES = $(mistat_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ --- 35,38 ---- *************** *** 44,47 **** --- 42,46 ---- pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ *************** *** 57,94 **** PRE_UNINSTALL = : POST_UNINSTALL = : - bin_PROGRAMS = mistat$(EXEEXT) - subdir = src - DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in - ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 - am__aclocal_m4_deps = $(top_srcdir)/configure.ac - am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) - mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs - CONFIG_HEADER = $(top_builddir)/config.h - CONFIG_CLEAN_FILES = - am__installdirs = "$(DESTDIR)$(bindir)" - binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) - PROGRAMS = $(bin_PROGRAMS) - am_mistat_OBJECTS = cmdline.$(OBJEXT) error.$(OBJEXT) \ - file_ops.$(OBJEXT) main.$(OBJEXT) menu.$(OBJEXT) \ - output.$(OBJEXT) statistics.$(OBJEXT) memwatch.$(OBJEXT) - mistat_OBJECTS = $(am_mistat_OBJECTS) - mistat_LDADD = $(LDADD) - DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) - depcomp = $(SHELL) $(top_srcdir)/config/depcomp - am__depfiles_maybe = depfiles - @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cmdline.Po ./$(DEPDIR)/error.Po \ - @AMDEP_TRUE@ ./$(DEPDIR)/file_ops.Po ./$(DEPDIR)/main.Po \ - @AMDEP_TRUE@ ./$(DEPDIR)/memwatch.Po ./$(DEPDIR)/menu.Po \ - @AMDEP_TRUE@ ./$(DEPDIR)/output.Po ./$(DEPDIR)/statistics.Po - COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) - CCLD = $(CC) - LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ - SOURCES = $(mistat_SOURCES) - DIST_SOURCES = $(mistat_SOURCES) - ETAGS = etags - CTAGS = ctags - DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ --- 56,59 ---- *************** *** 152,156 **** localstatedir = @localstatedir@ mandir = @mandir@ - mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ prefix = @prefix@ --- 117,120 ---- *************** *** 160,200 **** sysconfdir = @sysconfdir@ target_alias = @target_alias@ ! mistat_SOURCES = cmdline.c error.c file_ops.c main.c menu.c output.c statistics.c cmdline.h error.h file_ops.h main.h menu.h output.h statistics.h system.h memwatch.c all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj ! $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) ! @for dep in $?; do \ ! case '$(am__configure_deps)' in \ ! *$$dep*) \ ! cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ ! && exit 0; \ ! exit 1;; \ ! esac; \ ! done; \ ! echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile ! .PRECIOUS: Makefile ! Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status ! @case '$?' in \ ! *config.status*) \ ! cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ ! *) \ ! echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ ! cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ ! esac; ! ! $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) ! cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ! ! $(top_srcdir)/configure: $(am__configure_deps) ! cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ! $(ACLOCAL_M4): $(am__aclocal_m4_deps) ! cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) ! test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ --- 124,174 ---- sysconfdir = @sysconfdir@ target_alias = @target_alias@ ! ! bin_PROGRAMS = mistat ! mistat_SOURCES = cmdline.c error.c file_ops.c main.c menu.c output.c statistics.c cmdline.h error.h file_ops.h main.h menu.h output.h statistics.h system.h memwatch.c input.h ! subdir = src ! ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ! mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs ! CONFIG_HEADER = $(top_builddir)/config.h ! CONFIG_CLEAN_FILES = ! bin_PROGRAMS = mistat$(EXEEXT) ! PROGRAMS = $(bin_PROGRAMS) ! ! am_mistat_OBJECTS = cmdline.$(OBJEXT) error.$(OBJEXT) file_ops.$(OBJEXT) \ ! main.$(OBJEXT) menu.$(OBJEXT) output.$(OBJEXT) \ ! statistics.$(OBJEXT) memwatch.$(OBJEXT) ! mistat_OBJECTS = $(am_mistat_OBJECTS) ! mistat_LDADD = $(LDADD) ! mistat_DEPENDENCIES = ! mistat_LDFLAGS = ! ! DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) ! depcomp = $(SHELL) $(top_srcdir)/config/depcomp ! am__depfiles_maybe = depfiles ! @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cmdline.Po ./$(DEPDIR)/error.Po \ ! @AMDEP_TRUE@ ./$(DEPDIR)/file_ops.Po ./$(DEPDIR)/main.Po \ ! @AMDEP_TRUE@ ./$(DEPDIR)/memwatch.Po ./$(DEPDIR)/menu.Po \ ! @AMDEP_TRUE@ ./$(DEPDIR)/output.Po ./$(DEPDIR)/statistics.Po ! COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ ! $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) ! CCLD = $(CC) ! LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ ! DIST_SOURCES = $(mistat_SOURCES) ! DIST_COMMON = $(srcdir)/Makefile.in Makefile.am ! SOURCES = $(mistat_SOURCES) ! all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj ! $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile ! Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status ! cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) ! binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) ! $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ *************** *** 202,207 **** ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ ! echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ ! $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done --- 176,181 ---- ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ ! echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ ! $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ else :; fi; \ done *************** *** 211,216 **** @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ ! echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ ! rm -f "$(DESTDIR)$(bindir)/$$f"; \ done --- 185,190 ---- @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ ! echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ ! rm -f $(DESTDIR)$(bindir)/$$f; \ done *************** *** 222,226 **** mostlyclean-compile: ! -rm -f *.$(OBJEXT) distclean-compile: --- 196,200 ---- mostlyclean-compile: ! -rm -f *.$(OBJEXT) core *.core distclean-compile: *************** *** 237,256 **** .c.o: ! @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ ! @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ! @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: ! @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ ! @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ! @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ --- 211,244 ---- .c.o: ! @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ ! @am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ ! @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ ! @am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ ! @am__fastdepCC_TRUE@ fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ! @am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: ! @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ ! @am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ ! @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ ! @am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ ! @am__fastdepCC_TRUE@ fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ ! @am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` uninstall-info-am: + ETAGS = etags + ETAGSFLAGS = + + CTAGS = ctags + CTAGSFLAGS = + + tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ *************** *** 261,265 **** END { for (i in files) print i; }'`; \ mkid -fID $$unique - tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ --- 249,252 ---- *************** *** 276,279 **** --- 263,267 ---- || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique + ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ *************** *** 298,301 **** --- 286,293 ---- distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + + top_distdir = .. + distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) *************** *** 311,315 **** if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ ! $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ --- 303,307 ---- if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ ! $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ *************** *** 329,336 **** check: check-am all-am: Makefile $(PROGRAMS) installdirs: ! for dir in "$(DESTDIR)$(bindir)"; do \ ! test -z "$$dir" || $(mkdir_p) "$$dir"; \ ! done install: install-am install-exec: install-exec-am --- 321,327 ---- check: check-am all-am: Makefile $(PROGRAMS) + installdirs: ! $(mkinstalldirs) $(DESTDIR)$(bindir) install: install-am install-exec: install-exec-am *************** *** 371,376 **** dvi-am: - html: html-am - info: info-am --- 362,365 ---- *************** *** 408,416 **** .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ ! distclean-generic distclean-tags distdir dvi dvi-am html \ ! html-am info info-am install install-am install-binPROGRAMS \ ! install-data install-data-am install-exec install-exec-am \ ! install-info install-info-am install-man install-strip \ ! installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ --- 397,405 ---- .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ ! distclean-generic distclean-tags distdir dvi dvi-am info \ ! info-am install install-am install-binPROGRAMS install-data \ ! install-data-am install-exec install-exec-am install-info \ ! install-info-am install-man install-strip installcheck \ ! installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ Index: system.h =================================================================== RCS file: /cvsroot/mistat/mistat/src/system.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** system.h 9 Jun 2004 17:00:05 -0000 1.7 --- system.h 5 Jul 2004 04:28:57 -0000 1.8 *************** *** 1,3 **** ! /* Shared definitions for mistat. ** ** Copyright (C) 2003, 2004 Mike H. Benton --- 1,4 ---- ! /* ! ** Shared definitions for mistat. ** ** Copyright (C) 2003, 2004 Mike H. Benton *************** *** 17,25 **** ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! */ /* ! * system.h USAGE: bool, flags, and MLINE. ! */ #ifndef SYSTEM_H --- 18,26 ---- ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! */ /* ! * system.h. USAGE: bool, flags, and MLINE. ! */ #ifndef SYSTEM_H *************** *** 35,38 **** --- 36,45 ---- # include <stdbool.h> # else + # if ! HAVE__BOOL + # ifdef __cplusplus + typedef bool _Bool; + # else typedef unsigned char _Bool; + # endif + # endif # define bool _Bool # define false 0 *************** *** 44,57 **** /* ! * Defines ! */ ! # define MLINE 255 /* Maximum input line length. */ /* ! * Variables ! */ ! bool Bell; /* Determine to see if sound system bell. */ bool Log_File_Flag; ! bool bTest; /* Test mode enabled. */ extern bool Data_File_Exist; --- 51,64 ---- /* ! * Defines. ! */ ! # define MLINE 255 /* Maximum input line length. */ /* ! * Variables. ! */ ! bool Bell; /* Determine to see if sound system bell. */ bool Log_File_Flag; ! bool bTest; /* Test mode enabled. */ extern bool Data_File_Exist; Index: statistics.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/statistics.c,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** statistics.c 9 Jun 2004 17:00:05 -0000 1.35 --- statistics.c 5 Jul 2004 04:28:57 -0000 1.36 *************** *** 1,3 **** ! /* Matrix, vector building, and statistical analysis for mistat. ** ** Copyright (C) 2003, 2004 Mike H. Benton --- 1,4 ---- ! /* ! ** Matrix, vector building, and statistical analysis for mistat. ** ** Copyright (C) 2003, 2004 Mike H. Benton *************** *** 17,66 **** ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! */ /* ! * statistics.c USAGE: stats_main must be called to build a vector or matrix that is used for analysis. ! * Then, call the various statistical routines. All routines must be supplied ! * with a boolean value: true for vector, false for matrix. ! * The routines write to supplied array. ! */ #include <stdio.h> #include <stdlib.h> ! #include <math.h> /* For pow and sqrt. */ ! #include <assert.h> /* The error checks. */ ! #include <libmistat/matrix.h> /* Vector and matrix functions. */ ! #include <libmistat/descriptives.h> /* Mean. */ ! #include <libmistat/sort.h> /* Sorts. */ ! #include <libmistat/linear.h> /* Regression. */ ! #include "error.h" /* Calls to error routines (so called custom). */ ! #include "file_ops.h" /* Calls to data file for matrix or vector building, and Data_Type. */ #include "statistics.h" ! #include "main.h" /* Use of data file name from main. */ /* Set up the matrix and vector variables.*/ ! vector_int *vta; /* Vector integer data. */ ! vector_ld *vldta; /* Vector long double data. */ ! matrix_int *mta; /* Matrix integer data. */ ! matrix_ld *mldta; /* Matrix long double data. */ ! bool make_vector (int row); /* Create vector of variable row. */ ! bool make_matrix (int x[], bool type, int how_much); /* Create matrix of variables stored in x. */ /* ! * Populate vector or matrix before calling stat functions. ! * Using as a central call point. ! * Return false if cannot make a vector or matrix. ! */ bool stats_main (int x[], bool vector, bool type, int how_much) { ! int variable; /* Only used in vector. */ ! bool verified; /* Status of making vector or matrix. */ ! verified = false; /* Set as false, called proceures will change to true if succesful. */ ! if (vector) /* Make a vector. */ { variable = x[0]; --- 18,71 ---- ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! */ /* ! * statistics.c USAGE: stats_main must be called to build a vector or matrix that is used for analysis. ! * Then, call the various statistical routines. All routines must be supplied ! * with a boolean value: true for vector, false for matrix. ! * The routines write to supplied array. ! */ #include <stdio.h> #include <stdlib.h> ! #include <math.h> /* For pow and sqrt. */ ! #include <assert.h> /* The error checks. */ ! #include <libmistat/matrix.h> /* Vector and matrix functions. */ ! #include <libmistat/descriptives.h> /* Mean. */ ! #include <libmistat/sort.h> /* Sorts. */ ! #include <libmistat/linear.h> /* Regression. */ ! #include "error.h" /* Calls to error routines. */ ! #include "file_ops.h" /* Calls to data file for matrix or vector ! building, and Data_Type. */ #include "statistics.h" ! #include "main.h" /* Use of data file name from main. */ /* Set up the matrix and vector variables.*/ ! vector_int *vta; /* Vector integer data. */ ! vector_ld *vldta; /* Vector long double data. */ ! matrix_int *mta; /* Matrix integer data. */ ! matrix_ld *mldta; /* Matrix long double data. */ ! bool make_vector (int row); /* Create vector of variable row. */ ! bool make_matrix (int x[], bool type, int how_much); /* Create matrix of ! variables stored in ! x. */ /* ! * Populate vector or matrix before calling stat functions. ! * Using as a central call point. ! * Return false if cannot make a vector or matrix. ! */ bool stats_main (int x[], bool vector, bool type, int how_much) { ! int variable; /* Only used in vector. */ ! bool verified; /* Status of making vector or matrix. */ ! verified = false; /* Set as false, called proceures will change ! to true if succesful. */ ! if (vector) /* Make a vector. */ { variable = x[0]; *************** *** 70,74 **** } ! else /* Make a matrix. */ { verified = make_matrix (x, type, how_much); --- 75,79 ---- } ! else /* Make a matrix. */ { verified = make_matrix (x, type, how_much); *************** *** 82,93 **** /* ! * Basic statistical functions. ! * Supply is_vector. ! * Return to true/false. ! */ /* ! * Calculates all moments. ! */ bool get_mean (bool is_vector, int for_type, int index, long double results[]) --- 87,98 ---- /* ! * Basic statistical functions. ! * Supply is_vector. ! * Return to true/false. ! */ /* ! * Calculates all moments. ! */ bool get_mean (bool is_vector, int for_type, int index, long double results[]) *************** *** 96,100 **** long double ld_sum; ! if (is_vector) /*Just get moments for one variable. */ { if (Data_Type[for_type] == INT_DATA) --- 101,105 ---- long double ld_sum; ! if (is_vector) /* Just get moments for one variable. */ { if (Data_Type[for_type] == INT_DATA) *************** *** 130,134 **** } ! else /*Get moments from matrix. */ { if (Data_Type[for_type] == INT_DATA) --- 135,139 ---- } ! else /* Get moments from matrix. */ { if (Data_Type[for_type] == INT_DATA) *************** *** 172,176 **** /* ! * Sorted type statistics and tails. */ bool --- 177,181 ---- /* ! * Sorted type statistics and tails. */ bool *************** *** 178,182 **** long double results[]) { ! if (is_vector) /*Process vector data. */ { if (Data_Type[for_type] == INT_DATA) --- 183,187 ---- long double results[]) { ! if (is_vector) /* Process vector data. */ { if (Data_Type[for_type] == INT_DATA) *************** *** 206,210 **** } ! else /*We have a matrix. */ { if (Data_Type[for_type] == INT_DATA) --- 211,215 ---- } ! else /* We have a matrix. */ { if (Data_Type[for_type] == INT_DATA) *************** *** 240,249 **** /* ! * Autocorrelation. */ bool get_auto_cor (bool is_vector, int for_type, int index, long double results[]) { ! if (is_vector) /*Process vector data. */ { if (Data_Type[for_type] == INT_DATA) --- 245,254 ---- /* ! * Autocorrelation. FIXME: Broken at the moment? */ bool get_auto_cor (bool is_vector, int for_type, int index, long double results[]) { ! if (is_vector) /* Process vector data. */ { if (Data_Type[for_type] == INT_DATA) *************** *** 264,268 **** } ! else /*We have a matrix. */ { if (Data_Type[for_type] == INT_DATA) --- 269,273 ---- } ! else /* We have a matrix. */ { if (Data_Type[for_type] == INT_DATA) *************** *** 288,309 **** /* ! int regression_int_matrix (matrix_int * data, int variable_list[], long double *results, int number_cases); ! */ bool regression (bool is_vector, int for_type, int index, long double results[], ! int v[]) { int test; if (is_vector) ! return false; /* Regression only does matrix! */ if (for_type == INT_DATA) { ! test = regression_int_matrix (mta, v, results, Nrows); } else if (for_type == FLOAT_DATA) { ! test = regression_ld_matrix (mldta, v, results, Nrows); } else --- 293,320 ---- /* ! * Perfroms simple regression with and without origin as set by origin. ! */ bool regression (bool is_vector, int for_type, int index, long double results[], ! int v[], int origin) { int test; if (is_vector) ! return false; /* Regression only does matrix! */ if (for_type == INT_DATA) { ! if (origin == 0) ! test = regression_int_matrix (mta, v, results, Nrows); ! else ! test = regression_norig_int_matrix (mta, v, results, Nrows); } else if (for_type == FLOAT_DATA) { ! if (origin == 0) ! test = regression_ld_matrix (mldta, v, results, Nrows); ! else ! test = regression_norig_ld_matrix (mldta, v, results, Nrows); } else *************** *** 318,325 **** /* ! * Fill up vector for analysis. ! * Use var_column is for the particular variable. ! * Returns false if not enough calloc fails. ! */ bool make_vector (int var_column) --- 329,336 ---- /* ! * Fill up vector for analysis. ! * Use var_column is for the particular variable. ! * Returns false if not enough calloc fails. ! */ bool make_vector (int var_column) *************** *** 360,367 **** } ! /*Fill t with data. */ getit (Data_File, var_column, t); ! /*Put t into a vector. */ while (i < Nrows) --- 371,378 ---- } ! /* Fill t with data. */ getit (Data_File, var_column, t); ! /* Put t into a vector. */ while (i < Nrows) *************** *** 391,395 **** i = 0; ! /*Allocate matrix */ if (type == true) --- 402,406 ---- i = 0; ! /* Allocate matrix. */ if (type == true) *************** *** 417,421 **** } ! /*Read data into matrix */ while (i < how_much) { --- 428,432 ---- } ! /* Read data into matrix. */ while (i < how_much) { *************** *** 445,451 **** /* ! * Free allocated vector/matrix. ! * No return. ! */ void free_data (int what_to_free) --- 456,462 ---- /* ! * Free allocated vector/matrix. ! * No return. ! */ void free_data (int what_to_free) Index: file_ops.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/file_ops.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** file_ops.c 9 Jun 2004 17:00:05 -0000 1.13 --- file_ops.c 5 Jul 2004 04:28:57 -0000 1.14 *************** *** 1,3 **** ! /* File operations for mistat. ** ** Copyright (C) 2003, 2004 Mike H. Benton --- 1,4 ---- ! /* ! ** File operations for mistat. ** ** Copyright (C) 2003, 2004 Mike H. Benton *************** *** 17,30 **** ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! */ /* ! * file_ops.c USAGE: getting there. ! */ #include <errno.h> #include <stdio.h> #include <stdlib.h> ! #include <ctype.h> /* Conversions and class testing. */ #include <string.h> --- 18,31 ---- ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! */ /* ! * file_ops.c. USAGE: getting there. ! */ #include <errno.h> #include <stdio.h> #include <stdlib.h> ! #include <ctype.h> /* Conversions and class testing. */ #include <string.h> *************** *** 32,47 **** #include "system.h" #include "main.h" ! int Nrows; /* The number of rows in the data file. */ ! int Columns; /* The number of Columns in the data file. */ ! int Data_Type[MAXCOLS]; /* The type of data for each variable. */ void printline (FILE * fp); /* ! * Close file *file_name pointed by to *fp. ! * No return. ! */ void file_close (FILE * fp, char *file_name) --- 33,49 ---- #include "system.h" #include "main.h" + #include "input.h" /* For input routines. */ ! int Nrows; /* The number of rows in the data file. */ ! int Columns; /* The number of Columns in the data file. */ ! int Data_Type[MAXCOLS]; /* The type of data for each variable. */ void printline (FILE * fp); /* ! * Close file *file_name pointed by to *fp. ! * No return. ! */ void file_close (FILE * fp, char *file_name) *************** *** 57,64 **** /* ! * Opens file_name as a file. ! * Returns a file pointer. ! * FIXME: need to add type of flag input ! */ FILE * open_file (char *file_name, int open_mode) --- 59,66 ---- /* ! * Opens file_name as a file. ! * Returns a file pointer. ! * FIXME: need to add type of flag input ! */ FILE * open_file (char *file_name, int open_mode) *************** *** 93,107 **** /* ! * Returns void. ! * Counts the number of cases, and sets VARIABLE_TYPE. ! * Calls fgetline () and getwords(). ! * ! * FIXME: Need to set blank to missing. Need to define missing! Reads data that is not there, as above ! * FIXME: Reads . as a line!!!!! ! */ void read_data_file (FILE * file_name) { ! static FILE *temp_fp; /*used for passing between read functions */ char line[MAXLINE]; char *words[MAXLINE]; --- 95,109 ---- /* ! * Returns void. ! * Counts the number of cases, and sets VARIABLE_TYPE. ! * Calls fgetline () and getwords(). ! * ! * FIXME: Need to set blank to missing. Need to define missing! Reads data that is not there, as above. ! * FIXME: Reads . as a line!!!!! ! */ void read_data_file (FILE * file_name) { ! static FILE *temp_fp; /* Used for passing between read functions. */ char line[MAXLINE]; char *words[MAXLINE]; *************** *** 117,121 **** "\n\nDatafile is not open for some reason?\n\nFatal ERROR: %s\n\n", strerror (errno)); ! Nrows = Columns = -1; /* Set to -1 for error checks elsewhere. */ } --- 119,123 ---- "\n\nDatafile is not open for some reason?\n\nFatal ERROR: %s\n\n", strerror (errno)); ! Nrows = Columns = -1; /* Set to -1 for error checks elsewhere. */ } *************** *** 149,155 **** /* ! * Return the number of words from fgetline(). ! * Replaced \0 with \t in parts. ! */ int --- 151,157 ---- /* ! * Return the number of words from fgetline(). ! * Replaced \0 with \t in parts. ! */ int *************** *** 163,177 **** nwords = 0; ! /* Infinite. Break within. */ while (1) { ! /* Set to false for first run of word. */ is_int = is_float = is_char = false; ! /* If a space, go until not. */ while (isspace (*p)) p++; ! /* If end of line, go home with results. */ if (*p == '\0') return nwords; --- 165,179 ---- nwords = 0; ! /* Infinite. Break within. */ while (1) { ! /* Set to false for first run of word. */ is_int = is_float = is_char = false; ! /* If a space, go until not. */ while (isspace (*p)) p++; ! /* If end of line, go home with results. */ if (*p == '\0') return nwords; *************** *** 214,218 **** } ! /* Set the Data_Type. */ if (is_float == true && Data_Type[location] != CHAR_DATA) { --- 216,220 ---- } ! /* Set the Data_Type. */ if (is_float == true && Data_Type[location] != CHAR_DATA) { *************** *** 232,244 **** } ! /* If end, go back. */ if (*p == '\0') return nwords; ! /* Need and error here. */ if (nwords >= maxwords) return nwords; ! /* We need to go back look at next word. */ p++; } --- 234,246 ---- } ! /* If end, go back. */ if (*p == '\0') return nwords; ! /* Need and error here. */ if (nwords >= maxwords) return nwords; ! /* We need to go back look at next word. */ p++; } *************** *** 248,256 **** /* ! * Gets a line of data from a file. ! * Return EOF if end of file or number of characters. ! * Writes values of line to line[] array. ! * max is maximum line length. ! */ int --- 250,258 ---- /* ! * Gets a line of data from a file. ! * Return EOF if end of file or number of characters. ! * Writes values of line to line[] array. ! * max is maximum line length. ! */ int *************** *** 283,290 **** /* ! * Just shows the log file. ! * Very sloppy for the moment. ! * Need to be more interactive (up/down/copy). ! */ void --- 285,292 ---- /* ! * Just shows the log file. ! * Very sloppy for the moment. ! * Need to be more interactive (up/down/copy). ! */ void *************** *** 299,304 **** /* ! * Currently print a file. ! */ void --- 301,306 ---- /* ! * Currently print a file. ! */ void *************** *** 313,318 **** /* ! * Update the log file. ! */ void --- 315,320 ---- /* ! * Update the log file. ! */ void *************** *** 332,337 **** fprintf (Log_File, "%s", message); ! /* Only need for Cygwin */ ! /* Seems to do no harm in Linux */ if ((fflush (Log_File)) == EOF) { --- 334,339 ---- fprintf (Log_File, "%s", message); ! /* Only need for Cygwin */ ! /* Seems to do no harm in Linux */ if ((fflush (Log_File)) == EOF) { *************** *** 343,355 **** /* ! * Use to read only certain Columns. ! * Fills t[]. Element is column of data set. ! * Returns to be worked out ! */ int getit (FILE * file_name, int element, long double t[]) { ! static FILE *temp_fp; /* Used for passing between read functions. */ char line[MAXLINE]; char *words[MAXLINE]; --- 345,357 ---- /* ! * Use to read only certain Columns. ! * Fills t[]. Element is column of data set. ! * Returns to be worked out ! */ int getit (FILE * file_name, int element, long double t[]) { ! static FILE *temp_fp; /* Used for passing between read functions. */ char line[MAXLINE]; char *words[MAXLINE]; *************** *** 370,374 **** else { - rewind (Data_File); --- 372,375 ---- *************** *** 397,399 **** --- 398,454 ---- } + /* + * Close open file if necessary. + * Get name of file to open and open it! + * This function will also be called from main. + */ + void + do_file_menu (int not_read) + { + char *temp; + + /* Close open data file if necessary. */ + if (Data_File_Exist) + { + file_close (Data_File, Data_File_Name); + Data_File_Exist = false; + } + + temp = readline ("Enter the name of a file or Enter for none\n->"); + + strcpy (Data_File_Name, temp); + + /* Determine if user just hit Enter. */ + if (strlen (Data_File_Name) <= 1) + Data_File_Exist = 0; + + /* We have a file name, now see if it is there. */ + else + { + + Data_File_Name[strlen (Data_File_Name) - 1] = '\0'; + Data_File = open_file (Data_File_Name, 1); + + /* Check to see if opened file. */ + if (Data_File == NULL) + { + Data_File_Exist = false; + printf ("%s not found!\n", Data_File_Name); + } + + /* We have a valid file and it is opened! */ + else + Data_File_Exist = true; + + } + + /* Lastly, read the data file if not called from main. */ + if (!not_read) + { + printf ("Reading the data file\n\n"); + read_data_file (Data_File); + } + + } + /* Here ends file_ops.c. */ Index: output.c =================================================================== RCS file: /cvsroot/mistat/mistat/src/output.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** output.c 9 Jun 2004 17:00:05 -0000 1.31 --- output.c 5 Jul 2004 04:28:57 -0000 1.32 *************** *** 1,3 **** ! /* Output formatter and printer for mistat. ** ** Copyright (C) 2003, 2004 Mike H. Benton --- 1,4 ---- ! /* ! ** Output formatter and printer for mistat. ** ** Copyright (C) 2003, 2004 Mike H. Benton *************** *** 17,73 **** ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! */ /* ! * output.c. USAGE: Go here to get stats and print. ! */ ! #include <stdio.h> /* Various types of printf. */ ! #include <stdlib.h> /* Allocation calls. */ ! #include <string.h> /* Various uses of string functions. */ ! #include <assert.h> /* The error checks. */ ! #include <math.h> /* The log function is used in desc to determine v length. */ ! #include <float.h> /* For use of DBL_DIG. */ #include "output.h" ! #include "statistics.h" /* Calls to statistical routines. */ ! #include "main.h" /* Flag variables (print_digits). */ ! #include "menu.h" /* Enumeration values, and MAX_VAR_INPUT. */ ! #include "file_ops.h" /* Sending data to the Log_File. */ ! #include "system.h" /* Bool and config.h calls; bTest flag. */ - /*FIXME: Need alternate for MSDOS or w/o libtecla. */ - #ifndef MSDOS - # ifdef HAVE_LIBTECLA - # include <libtecla.h> /* Use for input. Use -ltecla for linking. */ - # endif - /* #elif include"myinput.h" */ - #endif /* ! * Variables ! */ ! bool Flag_Vector; /* Vector or matrix (number of variables = 1). */ ! /* FIXME: Consider makeing local and passing. */ ! int Num_Vars; /* Number of variables for analysis. */ ! extern GetLine *gl; /* The getline variable for libtecla. */ ! int Count_Int, Count_Ld; /* Counts of respective types for making a matrix. */ ! int Stop_Me; /* When to stop printing. */ ! int Output_Size; /* Size of output string. */ ! long double Results[20]; /* Results of analysis. */ /* ! * Functions ! */ ! void build_data_list (int v[], int int_count[], int ld_count[]); /* Fill the count vectors. */ ! bool setup_data (int vect_var[], int int_vars[], int ld_vars[]); /* Determine what to make (matrix/vector) and ask to make. */ ! bool desc (bool all_stats, int v[], int matrix_int_vars[], int matrix_ld_vars[]); /* Print descriptive tables. */ bool regress (int stats_to_do, int v[], int matrix_int_vars[], int matrix_ld_vars[]); ! void print_handler (int v[], int im, char stats_label[][MLABEL], char table_subheader[], char table_header[]); /* All printing is sent here. */ ! void format_output (char *input, double value); /* Adjust for number of sig digits. */ ! void free_which_data (int v[]); /* Frees up the build vector/matrix. */ bool --- 18,87 ---- ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. ! */ /* ! * output.c. USAGE: Go here to get stats and print. ! */ ! #include <stdio.h> /* Various types of printf. */ ! #include <stdlib.h> /* Allocation calls. */ ! #include <string.h> /* Various uses of string functions. */ ! #include <assert.h> /* The error checks. */ ! #include <math.h> /* The log function is used in desc to ! determine v length, and fpclassify. */ ! #include <float.h> /* For use of DBL_DIG. */ + #include <libmistat/labels.h> /* For Linear_Labels and Number_Linear_Labels. + */ #include "output.h" ! #include "statistics.h" /* Calls to statistical routines. */ ! #include "main.h" /* Flag variables (print_digits). */ ! #include "menu.h" /* Enumeration values, and MAX_VAR_INPUT. */ ! #include "file_ops.h" /* Sending data to the Log_File. */ ! #include "system.h" /* Bool and config.h calls; bTest flag. */ ! #include "input.h" /* For "Hit anykey". . . */ /* ! * Variables ! */ ! bool Flag_Vector; /* Vector or matrix (number of variables = 1). */ ! /* FIXME: Consider making local and passing. */ ! int Num_Vars; /* Number of variables for analysis. */ ! static int Count_Int, Count_Ld; /* Counts of respective types for making a ! matrix. */ ! int Stop_Me; /* When to stop printing. */ ! int Output_Size; /* Size of output string. */ ! long double Results[30]; /* Results of analysis. */ /* ! * Functions. ! */ ! ! /* Fill the count vectors. */ ! void build_data_list (int v[], int int_count[], int ld_count[]); ! ! /* Determine what to make (matrix/vector) and ask to make. */ ! bool setup_data (int vect_var[], int int_vars[], int ld_vars[]); ! ! /* Print descriptive tables. */ ! bool desc (bool all_stats, int v[], int matrix_int_vars[], ! int matrix_ld_vars[]); ! ! /* Regression routine. */ bool regress (int stats_to_do, int v[], int matrix_int_vars[], int matrix_ld_vars[]); ! ! /* All printing is sent here. */ ! void print_handler (int v[], int im, char *stats_label[], ! char table_subheader[], char table_header[]); ! ! /* Adjust for number of sig digits. */ ! void format_output (char *input, double value); ! ! /* Frees up the build vector/matrix. */ ! void free_which_data (int v[]); bool *************** *** 79,99 **** assert (routine >= 100 && routine <= 103); ! Flag_Vector = true; /* Default is just true because most people will just look at one variable:D */ Num_Vars = Count_Int = Count_Ld = 0; ! /* Double check to make sure we have something. */ i = 0; if (v[i] == -1) return true; ! /* Use v to fill ct_int and ct_ld. */ build_data_list (v, ct_int, ct_ld); ! /* Lets make a vector or matrix. */ verify = setup_data (v, ct_int, ct_ld); if (verify == false) return verify; ! /*Now we can go on to the analysis. */ switch (routine) { --- 93,114 ---- assert (routine >= 100 && routine <= 103); ! Flag_Vector = true; /* Default is just true because most people ! will just look at one variable:D */ Num_Vars = Count_Int = Count_Ld = 0; ! /* Double check to make sure we have something. */ i = 0; if (v[i] == -1) return true; ! /* Use v to fill ct_int and ct_ld. */ build_data_list (v, ct_int, ct_ld); ! /* Lets make a vector or matrix. */ verify = setup_data (v, ct_int, ct_ld); if (verify == false) return verify; ! /* Now we can go on to the analysis. */ switch (routine) { *************** *** 107,110 **** --- 122,126 ---- case simple_regression: + case regression_origion: verify = regress (stats_to_do, v, ct_int, ct_ld); break; *************** *** 115,119 **** } ! /* All finished so free up the matrix/vector. */ free_which_data (v); return verify; --- 131,135 ---- } ! /* All finished so free up the matrix/vector. */ free_which_data (v); return verify; *************** *** 145,149 **** } ! ct_int[Count_Int] = ct_ld[Count_Ld] = -1; /* Last value set to -1 for checks. */ } --- 161,166 ---- } ! ct_int[Count_Int] = ct_ld[Count_Ld] = -1; /* Last value set to -1 for ! checks. */ } *************** *** 154,163 **** bool verify; ! if (Num_Vars == 1) /* Vector is simple! Just up and go. */ { verify = stats_main (vect_var, true, true, Count_Int); } ! else /* Make relevant matrix/vectors. */ { Flag_Vector = false; --- 171,180 ---- bool verify; ! if (Num_Vars == 1) /* Vector is simple! Just up and go. */ { verify = stats_main (vect_var, true, true, Count_Int); } ! else /* Make relevant matrix/vectors. */ { Flag_Vector = false; *************** *** 188,223 **** int im, offset, num_int, num_ld; ! /* ! * Set up the hard table values. */ ! char stats_label[][MLABEL] = { ! {"Mean\t\t"}, ! {"SD\t\t"}, ! {"Skewness\t"}, ! {"Kurtosis\t"}, ! {"Sum\t\t"}, ! {"Min\t\t"}, ! {"Max\t\t"}, ! {"Median\t\t"}, ! {"Lower Quartile\t"}, ! {"Upper Quartile\t"}, ! {"IQR\t\t"}, ! {"ACOR\t\t"} }; char table_header[] = "\nDescriptive Statistics for"; char table_subheader[] = "Statistics\tValue\n"; ! Stop_Me = 4; /* That is, only do until Sum. */ ! /* Populate the first row with title. */ Output_Size = sizeof (table_header); num_int = num_ld = offset = 0; ! /* ! * Loop through the variables, and print output. */ for (im = 0; im <= Num_Vars - 1; im++) { ! /* Get the stats. */ ! if (Flag_Vector) /* Vector for analysis. */ { stat_test = get_mean (Flag_Vector, im, im, Results); --- 205,240 ---- int im, offset, num_int, num_ld; ! /* ! * Set up the hard table values. */ ! char *stats_label[] = { ! "Mean\t\t", ! "SD\t\t", ! "Skewness\t", ! "Kurtosis\t", ! "Sum\t\t", ! "Min\t\t", ! "Max\t\t", ! "Median\t\t", ! "Lower Quartile\t", ! "Upper Quartile\t", ! "IQR\t\t", ! "ACOR\t\t" }; char table_header[] = "\nDescriptive Statistics for"; char table_subheader[] = "Statistics\tValue\n"; ! Stop_Me = 4; /* That is, only do until Sum. */ ! /* Populate the first row with title. */ Output_Size = sizeof (table_header); num_int = num_ld = offset = 0; ! /* ! * Loop through the variables, and print output. */ for (im = 0; im <= Num_Vars - 1; im++) { ! /* Get the stats. */ ! if (Flag_Vector) /* Vector for analysis. */ { stat_test = get_mean (Flag_Vector, im, im, Results); *************** *** 245,320 **** } ! else /* We have a matrix! Off to fun land! */ { if (num_ld < Count_Ld) ! { stat_test = get_mean (Flag_Vector, matrix_ld_vars[num_ld], num_ld, Results); - if (stat_test == false) - return false; ! if (all_stats == true || bTest == true) ! { stat_test = get_sorted_stats (Flag_Vector, matrix_ld_vars[num_ld], num_ld, Results); ! ! if (stat_test == false) ! return false; ! ! Stop_Me = 10; ! } ! ! if (bTest) ! { stat_test = ! get_auto_cor (Flag_Vector, matrix_ld_vars[num_ld], ! num_ld, Results); - if (stat_test == false) - return false; ! Stop_Me = 11; ! } ! offset = matrix_ld_vars[num_ld]; ! num_ld++; } ! else if (num_int < Count_Int) { ! stat_test = ! get_mean (Flag_Vector, matrix_int_vars[num_int], num_int, ! Results); ! if (stat_test == false) ! return false; ! ! if (all_stats == true || bTest == true) ! { stat_test = ! get_sorted_stats (Flag_Vector, matrix_int_vars[num_int], ! num_int, Results); ! ! if (stat_test == false) ! return false; ! ! Stop_Me = 10; ! ! } ! ! if (bTest) ! { stat_test = get_auto_cor (Flag_Vector, matrix_int_vars[num_int], num_int, Results); ! if (stat_test == false) ! return false; ! ! Stop_Me = 11; ! } ! offset = matrix_int_vars[num_int]; num_int++; --- 262,336 ---- } ! else /* We have a matrix! Off to fun land! */ { + /* + * Start by setting ld_data to true if data is ld. + * The seriers of if/else call the correct procedure. + */ + + bool ld_data; + if (num_ld < Count_Ld) ! ld_data = true; ! else ! ld_data = false; ! ! /* Get the basic stats. */ ! if (ld_data) stat_test = get_mean (Flag_Vector, matrix_ld_vars[num_ld], num_ld, Results); + else + stat_test = + get_mean (Flag_Vector, matrix_int_vars[num_int], num_int, + Results); ! if (stat_test == false) ! return false; ! ! /* Get sorted type stats. */ ! if (all_stats == true || bTest == true) ! { ! if (ld_data) stat_test = get_sorted_stats (Flag_Vector, matrix_ld_vars[num_ld], num_ld, Results); ! else stat_test = ! get_sorted_stats (Flag_Vector, matrix_int_vars[num_int], ! num_int, Results); ! if (stat_test == false) ! return false; ! /* Set to ensure all calculated output is printed. */ ! Stop_Me = 10; } ! if (bTest) /* For accuracy testing. */ { ! if (ld_data) stat_test = ! get_auto_cor (Flag_Vector, matrix_ld_vars[num_ld], ! num_ld, Results); ! else stat_test = get_auto_cor (Flag_Vector, matrix_int_vars[num_int], num_int, Results); + if (stat_test == false) + return false; + Stop_Me = 11; + } ! /* Set offset for printing correct variable name. */ ! if (ld_data) ! { ! offset = matrix_ld_vars[num_ld]; ! num_ld++; ! } ! else ! { offset = matrix_int_vars[num_int]; num_int++; *************** *** 322,332 **** } ! /* Lets get the title in. Determine how big the variable name is! */ ! /* Pad for log, space, and \n. */ Output_Size += sizeof (table_subheader) + log (offset + 1) + 3; ! ! ! /* Print output. */ print_handler (v, im, stats_label, table_subheader, table_header); } --- 338,346 ---- } ! /* Lets get the title in. Determine how big the variable name is! */ ! /* Pad for log, space, and \n. */ ... [truncated message content] |