Mercurial > hg > octave-lojdl
changeset 1186:d94bcafabac2
[project @ 1995-03-30 04:57:32 by jwe]
author | jwe |
---|---|
date | Thu, 30 Mar 1995 05:00:41 +0000 |
parents | 669750cfad84 |
children | 93dd8c8af4a0 |
files | configure.in src/Makefile.in src/pr-output.cc |
diffstat | 3 files changed, 44 insertions(+), 56 deletions(-) [+] |
line wrap: on
line diff
--- a/configure.in +++ b/configure.in @@ -21,7 +21,7 @@ ### along with Octave; see the file COPYING. If not, write to the Free ### Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -AC_REVISION($Revision: 1.105 $) +AC_REVISION($Revision: 1.106 $) AC_PREREQ(2.0) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) @@ -341,7 +341,6 @@ AC_ISC_POSIX AC_MINIX AC_AIX -AC_FUNC_STRFTIME AC_CHECK_LIB(sun, getpwnam) ### How big are ints and how are they oriented? These could probably @@ -641,6 +640,7 @@ ### Checks for OS specific cruft. AC_STRUCT_TM +AC_STRUCT_TIMEZONE AC_FUNC_SETVBUF_REVERSED TERMLIBS="" for termlib in termcap terminfo curses termlib ; do
--- a/src/Makefile.in +++ b/src/Makefile.in @@ -80,12 +80,12 @@ getopt.c getopt1.c gripes.cc help.cc idx-vector.cc \ input.cc lex.l load-save.cc mappers.cc octave.cc \ octave-hist.cc oct-obj.cc pager.cc parse.y pr-output.cc \ - procstream.cc sighandlers.cc strcasecmp.c strncase.c strfns.cc \ - symtab.cc sysdep.cc tc-rep.cc tc-rep-ass.cc tc-rep-idx.cc \ - tempname.c timefns.cc tempnam.c token.cc tree-base.cc \ - tree-cmd.cc tree-const.cc tree-expr.cc tree-misc.cc \ - tree-plot.cc unwind-prot.cc user-prefs.cc utils.cc \ - variables.cc xdiv.cc xpow.cc Map.cc SLStack.cc + procstream.cc sighandlers.cc strcasecmp.c strncase.c \ + strfns.cc strftime.c symtab.cc sysdep.cc tc-rep.cc \ + tc-rep-ass.cc tc-rep-idx.cc tempname.c timefns.cc tempnam.c \ + token.cc tree-base.cc tree-cmd.cc tree-const.cc tree-expr.cc \ + tree-misc.cc tree-plot.cc unwind-prot.cc user-prefs.cc \ + utils.cc variables.cc xdiv.cc xpow.cc Map.cc SLStack.cc OBJECTS_4 := $(SOURCES) builtins.o OBJECTS_3 := $(patsubst %.l, %.o, $(OBJECTS_4))
--- a/src/pr-output.cc +++ b/src/pr-output.cc @@ -54,12 +54,15 @@ // Current format string for the imaginary part of complex numbers. static char *curr_imag_fmt = 0; -// Nonzero means don\'t do any fancy formatting. +// Nonzero means don't do any fancy formatting. static int free_format = 0; // Nonzero means print plus sign for nonzero, blank for zero. static int plus_format = 0; +// Nonzero means don't put newlines around the column number headers. +static int compact_format = 0; + // Nonzero means always print like dollars and cents. static int bank_format = 0; @@ -878,6 +881,29 @@ } } +static void +pr_col_num_header (ostream& os, int total_width, int max_width, + int lim, int col) +{ + if (total_width > max_width && user_pref.split_long_rows) + { + if (col != 0 && ! compact_format) + os << "\n"; + + int num_cols = lim - col; + + if (num_cols == 1) + os << " Column " << col + 1 << ":\n"; + else if (num_cols == 2) + os << " Columns " << col + 1 << " and " << lim << ":\n"; + else + os << " Columns " << col + 1 << " through " << lim << ":\n"; + + if (! compact_format) + os << "\n"; + } +} + void octave_print_internal (ostream& os, double d, int pr_as_read_syntax) { @@ -1002,21 +1028,7 @@ { int lim = col + inc < nc ? col + inc : nc; - if (total_width > max_width && user_pref.split_long_rows) - { - if (col != 0) - os << "\n"; - - int num_cols = lim - col; - if (num_cols == 1) - os << " Column " << col + 1 << ":\n\n"; - else if (num_cols == 2) - os << " Columns " << col + 1 << " and " << lim - << ":\n\n"; - else - os << " Columns " << col + 1 << " through " << lim - << ":\n\n"; - } + pr_col_num_header (os, total_width, max_width, lim, col); for (int i = 0; i < nr; i++) { @@ -1161,21 +1173,7 @@ { int lim = col + inc < nc ? col + inc : nc; - if (total_width > max_width && user_pref.split_long_rows) - { - if (col != 0) - os << "\n"; - - int num_cols = lim - col; - if (num_cols == 1) - os << " Column " << col + 1 << ":\n\n"; - else if (num_cols == 2) - os << " Columns " << col + 1 << " and " << lim - << ":\n\n"; - else - os << " Columns " << col + 1 << " through " << lim - << ":\n\n"; - } + pr_col_num_header (os, total_width, max_width, lim, col); for (int i = 0; i < nr; i++) { @@ -1265,21 +1263,7 @@ { int lim = col + inc < num_elem ? col + inc : num_elem; - if (total_width > max_width && user_pref.split_long_rows) - { - if (col != 0) - os << "\n"; - - int num_cols = lim - col; - if (num_cols == 1) - os << " Column " << col + 1 << ":\n\n"; - else if (num_cols == 2) - os << " Columns " << col + 1 << " and " << lim - << ":\n\n"; - else - os << " Columns " << col + 1 << " through " << lim - << ":\n\n"; - } + pr_col_num_header (os, total_width, max_width, lim, col); for (int i = col; i < lim; i++) { @@ -1418,9 +1402,13 @@ free_format = 1; } else if (strcmp (*argv, "compact") == 0) - error ("format: format state `compact' not implemented yet"); + { + compact_format = 1; + } else if (strcmp (*argv, "loose") == 0) - error ("format: format state `loose' not implemented yet"); + { + compact_format = 0; + } else error ("format: unrecognized format state `%s'", *argv); }