projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix typo in printed string
[pspp]
/
src
/
data
/
lazy-casereader.c
diff --git
a/src/data/lazy-casereader.c
b/src/data/lazy-casereader.c
index 71c1da6a64595cca06d48480bd03f3a4b8ea12d4..bc68b938d5b0169ad0278a8ca760060c5e2c931a 100644
(file)
--- a/
src/data/lazy-casereader.c
+++ b/
src/data/lazy-casereader.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007
, 2009, 2011
Free Software Foundation, Inc.
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
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
@@
-16,16
+16,16
@@
#include <config.h>
#include <config.h>
-#include
<data/lazy-casereader.h>
+#include
"data/lazy-casereader.h"
#include <stdlib.h>
#include <stdlib.h>
-#include
<data/case.h>
-#include
<data/casereader.h>
-#include
<data/casereader-provider.h>
-#include
<libpspp/assertion.h>
+#include
"data/case.h"
+#include
"data/casereader.h"
+#include
"data/casereader-provider.h"
+#include
"libpspp/assertion.h"
-#include "xalloc.h"
+#include "
gl/
xalloc.h"
/* A lazy casereader's auxiliary data. */
struct lazy_casereader
/* A lazy casereader's auxiliary data. */
struct lazy_casereader
@@
-35,7
+35,7
@@
struct lazy_casereader
void *aux;
};
void *aux;
};
-static struct casereader_class lazy_casereader_class;
+static
const
struct casereader_class lazy_casereader_class;
/* Creates and returns a new lazy casereader that will
instantiate its underlying casereader, if necessary, by
/* Creates and returns a new lazy casereader that will
instantiate its underlying casereader, if necessary, by
@@
-43,8
+43,8
@@
static struct casereader_class lazy_casereader_class;
to a "serial number" that uniquely identifies the new lazy
casereader, for use with lazy_casereader_destroy.
to a "serial number" that uniquely identifies the new lazy
casereader, for use with lazy_casereader_destroy.
- VALUE_CNT must be the number of struct values per case read
-
from the
casereader.
+ PROTO must be the format of the cases to be read from the
+ casereader.
CASE_CNT is an upper limit on the number of cases that
casereader_read will return from the casereader in successive
CASE_CNT is an upper limit on the number of cases that
casereader_read will return from the casereader in successive
@@
-52,7
+52,7
@@
static struct casereader_class lazy_casereader_class;
data source or CASENUMBER_MAX if the number of cases cannot be
predicted in advance. */
struct casereader *
data source or CASENUMBER_MAX if the number of cases cannot be
predicted in advance. */
struct casereader *
-lazy_casereader_create (
size_t value_cnt
, casenumber case_cnt,
+lazy_casereader_create (
const struct caseproto *proto
, casenumber case_cnt,
struct casereader *(*callback) (void *aux), void *aux,
unsigned long int *serial)
{
struct casereader *(*callback) (void *aux), void *aux,
unsigned long int *serial)
{
@@
-63,7
+63,7
@@
lazy_casereader_create (size_t value_cnt, casenumber case_cnt,
*serial = lc->serial = next_serial++;
lc->callback = callback;
lc->aux = aux;
*serial = lc->serial = next_serial++;
lc->callback = callback;
lc->aux = aux;
- return casereader_create_sequential (NULL,
value_cnt
, case_cnt,
+ return casereader_create_sequential (NULL,
proto
, case_cnt,
&lazy_casereader_class, lc);
}
&lazy_casereader_class, lc);
}
@@
-76,7
+76,7
@@
lazy_casereader_create (size_t value_cnt, casenumber case_cnt,
a serial number different from SERIAL, or if READER is a lazy
casereader that was instantiated.
a serial number different from SERIAL, or if READER is a lazy
casereader that was instantiated.
- When this function returns
fals
e, it necessarily indicates
+ When this function returns
tru
e, it necessarily indicates
that the lazy casereader was never cloned and never
destroyed. */
bool
that the lazy casereader was never cloned and never
destroyed. */
bool
@@
-117,13
+117,12
@@
instantiate_lazy_casereader (struct casereader *reader,
casereader_destroy (subreader);
}
casereader_destroy (subreader);
}
-static bool
-lazy_casereader_read (struct casereader *reader, void *lc_,
- struct ccase *c)
+static struct ccase *
+lazy_casereader_read (struct casereader *reader, void *lc_)
{
struct lazy_casereader *lc = lc_;
instantiate_lazy_casereader (reader, lc);
{
struct lazy_casereader *lc = lc_;
instantiate_lazy_casereader (reader, lc);
- return casereader_read (reader
, c
);
+ return casereader_read (reader);
}
static void
}
static void
@@
-143,16
+142,15
@@
lazy_casereader_clone (struct casereader *reader, void *lc_)
return casereader_clone (reader);
}
return casereader_clone (reader);
}
-static bool
-lazy_casereader_peek (struct casereader *reader, void *lc_,
- casenumber idx, struct ccase *c)
+static struct ccase *
+lazy_casereader_peek (struct casereader *reader, void *lc_, casenumber idx)
{
struct lazy_casereader *lc = lc_;
instantiate_lazy_casereader (reader, lc);
{
struct lazy_casereader *lc = lc_;
instantiate_lazy_casereader (reader, lc);
- return casereader_peek (reader, idx
, c
);
+ return casereader_peek (reader, idx);
}
}
-static struct casereader_class lazy_casereader_class =
+static
const
struct casereader_class lazy_casereader_class =
{
lazy_casereader_read,
lazy_casereader_do_destroy,
{
lazy_casereader_read,
lazy_casereader_do_destroy,