X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fpsql-reader.c;h=a54b9f8b3888c58320623ea1d53086bc8650a155;hb=cc57a28ef6796ae9a64ef80d453f72126956d49d;hp=244248a20aeecdf34bcabedbbf188047e5c9b71c;hpb=9bf1c33953f7feff2a24a06293f6fe96b75cc41a;p=pspp-builds.git diff --git a/src/data/psql-reader.c b/src/data/psql-reader.c index 244248a2..a54b9f8b 100644 --- a/src/data/psql-reader.c +++ b/src/data/psql-reader.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008, 2009 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 @@ -75,8 +75,7 @@ psql_open_reader (struct psql_read_info *info UNUSED, struct dictionary **dict U static void psql_casereader_destroy (struct casereader *reader UNUSED, void *r_); -static bool psql_casereader_read (struct casereader *, void *, - struct ccase *); +static struct ccase *psql_casereader_read (struct casereader *, void *); static const struct casereader_class psql_casereader_class = { @@ -109,8 +108,7 @@ struct psql_reader }; -static bool set_value (struct psql_reader *r, - struct ccase *cc); +static struct ccase *set_value (struct psql_reader *r); @@ -546,9 +544,8 @@ psql_casereader_destroy (struct casereader *reader UNUSED, void *r_) -static bool -psql_casereader_read (struct casereader *reader UNUSED, void *r_, - struct ccase *cc) +static struct ccase * +psql_casereader_read (struct casereader *reader UNUSED, void *r_) { struct psql_reader *r = r_; @@ -558,24 +555,24 @@ psql_casereader_read (struct casereader *reader UNUSED, void *r_, return false; } - return set_value (r, cc); + return set_value (r); } -static bool -set_value (struct psql_reader *r, - struct ccase *c) +static struct ccase * +set_value (struct psql_reader *r) { - int i; + struct ccase *c; int n_vars; + int i; assert (r->res); n_vars = PQnfields (r->res); if ( r->tuple >= PQntuples (r->res)) - return false; + return NULL; - case_create (c, r->value_cnt); + c = case_create (r->value_cnt); memset (case_data_rw_idx (c, 0)->s, ' ', MAX_SHORT_STRING * r->value_cnt); @@ -870,7 +867,7 @@ set_value (struct psql_reader *r, r->tuple++; - return true; + return c; } #endif