other files.
+Sat Mar 4 13:20:56 2006 Ben Pfaff <blp@gnu.org>
+
+ * configure.ac: Get rid of pref.h.orig.
+
+ * pref.h.orig: Removed. Moved SHORT_NAME_LEN, LONG_NAME_LEN to
+ src/data/variable.h. Removed GLOBAL_DEBUGGING entirely, changing
+ all references to DEBUGGING. Moved P_tmpdir to
+ src/data/make-file.c. Moved NO_CHARTS to
+ src/output/charts/automake.mk.
+
Sat Mar 4 12:58:34 2006 Ben Pfaff <blp@gnu.org>
* pref.h.orig: Move GCC attribute declarations to
AC_PROG_LN_S
-AH_BOTTOM([#include <pref.h>])
-
-
AM_CONDITIONAL(unix, test x"$host_os" != x"msdos" )
AM_CONDITIONAL(msdos, test x"$host_os" = x"msdos" )
AC_CONFIG_FILES([Makefile gl/Makefile intl/Makefile po/Makefile.in])
-AC_CONFIG_COMMANDS([pref.h],[
- # Copy pref.h from pref.h.orig if prudent
- if test ! -f pref.h; then
- echo "creating pref.h"
- cp $ac_top_srcdir/pref.h.orig pref.h
- elif test "`ls -t pref.h.orig pref.h 2>/dev/null | sed 1q`" = pref.h.orig; then
- echo "replacing pref.h with newer pref.h.orig"
- cp $ac_top_srcdir/pref.h.orig pref.h
- else
- echo "pref.h exists"
- fi
- if test -f pref.h; then touch pref.h; fi
- ])
AC_OUTPUT
dnl configure.ac ends here
+++ /dev/null
-/* -*- C -*- */
-
-/*
- *
- * Debugging
- *
- */
-
-/* Define to get lots of info printed by procedures. */
-/*#define DEBUGGING 1*/
-
-#if DEBUGGING
-#define GLOBAL_DEBUGGING 1
-#endif
-
-#if !HAVE_LIBPLOT
-#define NO_CHARTS 1
-#endif
-\f
-/* Filesystems. */
-
-/* Options. */
-
-/* Approximate amount of memory, in bytes, to allocate before paging
- to disk. */
-#define MAX_WORKSPACE (4*1024*1024) /* 4 MBytes */
-
-\f
-/* Non ansi compilers may set this */
-#ifndef P_tmpdir
-#define P_tmpdir "/tmp"
-#endif
-
-#define SHORT_NAME_LEN 8
-#define LONG_NAME_LEN 64
+Sat Mar 4 13:22:51 2006 Ben Pfaff <blp@gnu.org>
+
+ * sfm-private.h: Include variable.h, to get SHORT_NAME_LEN.
+
+ * value.h: Remove check on MAX_SHORT_STRING, which I don't think
+ really applies.
+
+ * variable.h: Move definition of SHORT_NAME_LEN, LONG_NAME_LEN
+ here from pref.h.orig.
+
Sat Mar 4 12:50:48 WST 2006 John Darrington <john@darrington.wattle.id.au>
* sys-file-reader.c: Fixed bug reading compressed files.
#include "str.h"
#include "variable.h"
-#ifdef GLOBAL_DEBUGGING
+#ifdef DEBUGGING
#undef NDEBUG
#else
#ifndef NDEBUG
+ value_cnt * sizeof (union value));
}
-#ifdef GLOBAL_DEBUGGING
+#ifdef DEBUGGING
/* Initializes C as a null case. */
void
case_nullify (struct ccase *c)
c->case_data = NULL;
c->this = c;
}
-#endif /* GLOBAL_DEBUGGING */
+#endif /* DEBUGGING */
-#ifdef GLOBAL_DEBUGGING
+#ifdef DEBUGGING
/* Returns true iff C is a null case. */
int
case_is_null (const struct ccase *c)
{
return c->case_data == NULL;
}
-#endif /* GLOBAL_DEBUGGING */
+#endif /* DEBUGGING */
/* Initializes C as a new case that can store VALUE_CNT values.
The values have indeterminate contents until explicitly
xalloc_die ();
}
-#ifdef GLOBAL_DEBUGGING
+#ifdef DEBUGGING
/* Initializes CLONE as a copy of ORIG. */
void
case_clone (struct ccase *clone, const struct ccase *orig)
}
orig->case_data->ref_cnt++;
}
-#endif /* GLOBAL_DEBUGGING */
+#endif /* DEBUGGING */
-#ifdef GLOBAL_DEBUGGING
+#ifdef DEBUGGING
/* Replaces DST by SRC and nullifies SRC.
DST and SRC must be initialized cases at entry. */
void
dst->this = dst;
case_nullify (src);
}
-#endif /* GLOBAL_DEBUGGING */
+#endif /* DEBUGGING */
-#ifdef GLOBAL_DEBUGGING
+#ifdef DEBUGGING
/* Destroys case C. */
void
case_destroy (struct ccase *c)
free (cd);
}
}
-#endif /* GLOBAL_DEBUGGING */
+#endif /* DEBUGGING */
/* Resizes case C from OLD_CNT to NEW_CNT values. */
void
c->case_data = malloc (case_size (value_cnt));
if (c->case_data != NULL)
{
-#ifdef GLOBAL_DEBUGGING
+#ifdef DEBUGGING
c->this = c;
#endif
c->case_data->value_cnt = value_cnt;
}
else
{
-#ifdef GLOBAL_DEBUGGING
+#ifdef DEBUGGING
c->this = c;
#endif
return 0;
return 1;
}
-#ifdef GLOBAL_DEBUGGING
+#ifdef DEBUGGING
/* Copies VALUE_CNT values from SRC (starting at SRC_IDX) to DST
(starting at DST_IDX). */
void
src->case_data->values + src_idx,
sizeof *dst->case_data->values * value_cnt);
}
-#endif /* GLOBAL_DEBUGGING */
+#endif /* DEBUGGING */
-#ifdef GLOBAL_DEBUGGING
+#ifdef DEBUGGING
/* Copies case C to OUTPUT.
OUTPUT_SIZE is the number of `union values' in OUTPUT,
which must match the number of `union values' in C. */
memcpy (output, c->case_data->values,
c->case_data->value_cnt * sizeof *output);
}
-#endif /* GLOBAL_DEBUGGING */
+#endif /* DEBUGGING */
-#ifdef GLOBAL_DEBUGGING
+#ifdef DEBUGGING
/* Copies INPUT into case C.
INPUT_SIZE is the number of `union values' in INPUT,
which must match the number of `union values' in C. */
memcpy (c->case_data->values, input,
c->case_data->value_cnt * sizeof *input);
}
-#endif /* GLOBAL_DEBUGGING */
+#endif /* DEBUGGING */
-#ifdef GLOBAL_DEBUGGING
+#ifdef DEBUGGING
/* Returns a pointer to the `union value' used for the
element of C numbered IDX.
The caller must not modify the returned data. */
return &c->case_data->values[idx];
}
-#endif /* GLOBAL_DEBUGGING */
+#endif /* DEBUGGING */
-#ifdef GLOBAL_DEBUGGING
+#ifdef DEBUGGING
/* Returns the numeric value of the `union value' in C numbered
IDX. */
double
return c->case_data->values[idx].f;
}
-#endif /* GLOBAL_DEBUGGING */
+#endif /* DEBUGGING */
-#ifdef GLOBAL_DEBUGGING
+#ifdef DEBUGGING
/* Returns the string value of the `union value' in C numbered
IDX.
(Note that the value is not null-terminated.)
return c->case_data->values[idx].s;
}
-#endif /* GLOBAL_DEBUGGING */
+#endif /* DEBUGGING */
-#ifdef GLOBAL_DEBUGGING
+#ifdef DEBUGGING
/* Returns a pointer to the `union value' used for the
element of C numbered IDX.
The caller is allowed to modify the returned data. */
case_unshare (c);
return &c->case_data->values[idx];
}
-#endif /* GLOBAL_DEBUGGING */
+#endif /* DEBUGGING */
/* Compares the values of the VAR_CNT variables in VP
in cases A and B and returns a strcmp()-type result. */
struct ccase
{
struct case_data *case_data; /* Actual data. */
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
struct ccase *this; /* Detects unauthorized move/copy. */
#endif
};
union value values[1]; /* Values. */
};
-#ifdef GLOBAL_DEBUGGING
+#ifdef DEBUGGING
#define CASE_INLINE
#else
#define CASE_INLINE static
void case_unshare (struct ccase *);
-#ifndef GLOBAL_DEBUGGING
+#ifndef DEBUGGING
#include <stdlib.h>
#include "str.h"
case_unshare (c);
return &c->case_data->values[idx];
}
-#endif /* !GLOBAL_DEBUGGING */
+#endif /* !DEBUGGING */
#endif /* case.h */
#include "gettext.h"
#define _(msgid) gettext (msgid)
+/* Non ansi compilers may set this */
+#ifndef P_tmpdir
+#define P_tmpdir "/tmp"
+#endif
+
/* Creates a temporary file and stores its name in *FILENAME and
a file descriptor for it in *FD. Returns success. Caller is
responsible for freeing *FILENAME. */
structures. */
#include "compiler.h"
+#include "variable.h"
/* This attribute might avoid some problems. On the other hand... */
#define P ATTRIBUTE ((packed))
/* Max string length. */
#define MAX_STRING 255
-/* FYI: It is a bad situation if sizeof(flt64) < MAX_SHORT_STRING:
- then short string missing values can be truncated in system files
- because there's only room for as many characters as can fit in a
- flt64. */
-#if MAX_SHORT_STRING > SHORT_NAME_LEN
-#error MAX_SHORT_STRING must be less than or equal to SHORT_NAME_LEN.
-#endif
-
/* Special values. */
#define SYSMIS (-DBL_MAX)
#define LOWEST second_lowest_value
const char *var_type_adj (enum var_type);
const char *var_type_noun (enum var_type);
+/* Maximum variable name lengths. */
+#define SHORT_NAME_LEN 8 /* Short name length. */
+#define LONG_NAME_LEN 64 /* Long name length. */
+
/* A variable's dictionary entry. */
struct variable
{
\f
/* Debug helpers. */
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
#undef NDEBUG
#include "message.h"
#include <stdio.h>
void *hsh_next (struct hsh_table *, struct hsh_iterator *);
/* Search and insertion with assertion. */
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
void hsh_force_insert (struct hsh_table *, void *);
void *hsh_force_find (struct hsh_table *, const void *);
void hsh_force_delete (struct hsh_table *, const void *);
size_t hsh_count (struct hsh_table *);
/* Debugging. */
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
void hsh_dump (struct hsh_table *);
#endif
void pool_mark (struct pool *, struct pool_mark *);
void pool_release (struct pool *, const struct pool_mark *);
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
void pool_dump (const struct pool *, const char *title);
#endif
int lines_cap; /* Number of lines allocated. */
int w, l; /* Actual width & length w/o margins, etc. */
int cur_font; /* Current font by OUTP_F_*. */
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
int debug; /* Set by som_text_draw(). */
#endif
};
x->lines = NULL;
x->lines_cap = 0;
x->cur_font = OUTP_F_R;
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
x->debug = 0;
#endif
return 1;
assert (this->driver_open && this->page_open);
if (x1 == x2)
return;
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
if (x1 > x2
|| x1 < 0 || x1 >= ext->w
|| x2 <= 0 || x2 > ext->w
assert (this->driver_open && this->page_open);
if (y1 == y2)
return;
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
if (y1 > y2
|| x1 < 0 || x1 >= ext->w
|| y1 < 0 || y1 >= ext->l
int l;
assert (this->driver_open && this->page_open);
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
if (x < 0 || x >= ext->w || y < 0 || y >= ext->l)
{
#if !SUPPRESS_WARNINGS
/* Temporary struct outp_text to pass to low-level function. */
struct outp_text temp;
-#if GLOBAL_DEBUGGING && 0
+#if DEBUGGING && 0
if (!ext->debug)
{
ext->debug = 1;
+Sat Mar 4 13:24:39 2006 Ben Pfaff <blp@gnu.org>
+
+ * automake.mk: Move definition of NO_CHARTS here from pref.h.orig.
+
Thu Mar 2 08:40:33 WST 2006 John Darrington <john@darrington.wattle.id.au>
* Moved files from src directory
EXTRA_DIST += $(chart_sources)
+AM_CPPFLAGS += -DNO_CHARTS
+
endif
void
som_submit (struct som_entity *t)
{
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
static int entry;
assert (entry++ == 0);
t->class->headers (&hl, &hr, &ht, &hb);
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
if (hl + hr > nc || ht + hb > nr)
{
printf ("headers: (l,r)=(%d,%d), (t,b)=(%d,%d) in table size (%d,%d)\n",
}
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
assert (--entry == 0);
#endif
}
struct outp_driver *
outp_drivers (struct outp_driver *d)
{
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
struct outp_driver *orig_d = d;
#endif
nalloc_func = reallocable ? pool_nmalloc : pool_nalloc;
alloc_func = reallocable ? pool_malloc : pool_alloc;
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
t->reallocable = reallocable;
#endif
int ro, co;
assert (t != NULL);
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
assert (t->reallocable);
#endif
ro = t->row_ofs;
assert (t != NULL);
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
if (x + t->col_ofs < 0 || x + t->col_ofs > t->nc
|| y1 + t->row_ofs < 0 || y1 + t->row_ofs >= t->nr
|| y2 + t->row_ofs < 0 || y2 + t->row_ofs >= t->nr)
{
assert (t != NULL);
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
if (x1 + t->col_ofs < 0 || x1 + t->col_ofs >= t->nc
|| x2 + t->col_ofs < 0 || x2 + t->col_ofs >= t->nc
|| y1 + t->row_ofs < 0 || y1 + t->row_ofs >= t->nr
if (width == 0)
{
width = d->prop_em_width * 8;
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
printf ("warning: table column %d contains no data.\n", c);
#endif
}
char *contents;
assert (table != NULL && v != NULL && f != NULL);
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
if (c + table->col_ofs < 0 || r + table->row_ofs < 0
|| c + table->col_ofs >= table->nc
|| r + table->row_ofs >= table->nr)
f = make_output_format (FMT_F, w, d);
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
if (c + table->col_ofs < 0 || r + table->row_ofs < 0
|| c + table->col_ofs >= table->nc
|| r + table->row_ofs >= table->nr)
assert (r < table->nr);
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
if (c + table->col_ofs < 0 || r + table->row_ofs < 0
|| c + table->col_ofs >= table->nc
|| r + table->row_ofs >= table->nr)
assert (y2 + table->row_ofs < table->nr);
assert (x2 + table->col_ofs < table->nc);
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
if (x1 + table->col_ofs < 0 || x1 + table->col_ofs >= table->nc
|| y1 + table->row_ofs < 0 || y1 + table->row_ofs >= table->nr
|| x2 < x1 || x2 + table->col_ofs >= table->nc
{
assert (table != NULL && string != NULL);
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
if (c + table->col_ofs < 0 || r + table->row_ofs < 0
|| c + table->col_ofs >= table->nc
|| r + table->row_ofs >= table->nr)
int diff = 0;
assert (t != NULL);
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
if (row < -1 || row >= t->nr)
{
printf ("tab_offset(): row=%d in %d-row table\n", row, t->nr);
for (t->vr_tot = i = 0; i <= t->nc; i++)
t->vr_tot += t->wrv[i] = d->vert_line_spacing[t->trv[i]];
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
for (i = 0; i < t->nr; i++)
t->h[i] = -1;
for (i = 0; i < t->nc; i++)
assert (t->dim != NULL);
t->dim (t, d);
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
{
int error = 0;
/* Editing info. */
int col_ofs, row_ofs; /* X and Y offsets. */
-#if GLOBAL_DEBUGGING
+#if DEBUGGING
int reallocable; /* Can table be reallocated? */
#endif
};