X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fprocedure.h;h=fd3af6042140fee4bdfd30740e944a3d5db8adb3;hb=81579d9e9f994fb2908f50af41c3eb033d216e58;hp=e6e707d3d47a2aa33311b443d6a46e9f15472cf8;hpb=244ade48f9c233532cc535d3233fdef53bf9266b;p=pspp-builds.git diff --git a/src/data/procedure.h b/src/data/procedure.h index e6e707d3..fd3af604 100644 --- a/src/data/procedure.h +++ b/src/data/procedure.h @@ -1,21 +1,18 @@ -/* PSPP - computes sample statistics. - Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc. - Written by Ben Pfaff . +/* PSPP - a program for statistical analysis. + Copyright (C) 1997-9, 2000, 2006, 2007, 2009, 2010, 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 the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + 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 3 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. + 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., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + along with this program. If not, see . */ #ifndef PROCEDURE_H #define PROCEDURE_H 1 @@ -23,31 +20,23 @@ #include #include -#include -#include - -struct ccase; -struct casefile; -struct case_sink; -struct case_source; +#include "data/transformations.h" +#include "libpspp/compiler.h" +struct casereader; struct dataset; - +struct dictionary; /* Transformations. */ -void add_transformation (struct dataset *ds, +void add_transformation (struct dataset *ds, trns_proc_func *, trns_free_func *, void *); -void add_transformation_with_finalizer (struct dataset *ds, +void add_transformation_with_finalizer (struct dataset *ds, trns_finalize_func *, trns_proc_func *, trns_free_func *, void *); size_t next_transformation (const struct dataset *ds); -void discard_variables (struct dataset *ds); - - - bool proc_cancel_all_transformations (struct dataset *ds); struct trns_chain *proc_capture_transformations (struct dataset *ds); @@ -58,54 +47,45 @@ bool proc_cancel_temporary_transformations (struct dataset *ds); /* Procedures. */ +struct dictionary ; +typedef void replace_source_callback (struct casereader *); +typedef void replace_dictionary_callback (struct dictionary *); -struct dataset *create_dataset (void); -void destroy_dataset (struct dataset *); - -void proc_set_source (struct dataset *ds, struct case_source *); -bool proc_has_source (const struct dataset *ds); - -void proc_set_sink (struct dataset *ds, struct case_sink *); -struct casefile *proc_capture_output (struct dataset *ds); - -typedef bool casefile_func (const struct casefile *, void *); -typedef bool case_func (const struct ccase *, void *, const struct dataset *); -typedef void begin_func (const struct ccase *, void *, const struct dataset*); +typedef void transformation_change_callback_func (bool non_empty, void *aux); -typedef bool end_func (void *, const struct dataset *); - -typedef bool split_func (const struct ccase *, const struct casefile *, - void *, const struct dataset *); +struct dataset * create_dataset (void); +void destroy_dataset (struct dataset *); +void dataset_add_transform_change_callback (struct dataset *, + transformation_change_callback_func *, void *); -bool procedure (struct dataset *ds, case_func *, void *aux) WARN_UNUSED_RESULT; +void proc_discard_active_file (struct dataset *); +void proc_set_active_file (struct dataset *, + struct casereader *, struct dictionary *); +bool proc_set_active_file_data (struct dataset *, struct casereader *); +bool proc_has_active_file (const struct dataset *ds); +struct casereader *proc_extract_active_file_data (struct dataset *); -bool procedure_with_splits (struct dataset *ds, - begin_func *, - case_func *, - end_func *, - void *aux) - WARN_UNUSED_RESULT; -bool multipass_procedure (struct dataset *ds, casefile_func *, void *aux) - WARN_UNUSED_RESULT; -bool multipass_procedure_with_splits (struct dataset *ds, - split_func *, - void *aux) - WARN_UNUSED_RESULT; +void proc_discard_output (struct dataset *ds); +bool proc_execute (struct dataset *ds); +time_t time_of_last_procedure (struct dataset *ds); +struct casereader *proc_open_filtering (struct dataset *, bool filter); +struct casereader *proc_open (struct dataset *); +bool proc_is_open (const struct dataset *); +bool proc_commit (struct dataset *); -time_t time_of_last_procedure (struct dataset *ds); +bool dataset_end_of_command (struct dataset *); +struct dictionary *dataset_dict (const struct dataset *ds); +const struct casereader *dataset_source (const struct dataset *ds); -struct ccase *lagged_case (const struct dataset *ds, int n_before); - -inline struct dictionary *dataset_dict (const struct dataset *ds); -inline void dataset_set_dict ( struct dataset *ds, struct dictionary *dict); -inline int dataset_n_lag (const struct dataset *ds); -inline void dataset_set_n_lag (struct dataset *ds, int n_lag); +const struct ccase *lagged_case (const struct dataset *ds, int n_before); +void dataset_need_lag (struct dataset *ds, int n_before); +void dataset_set_callback (struct dataset *ds, void (*cb) (void *), void *); #endif /* procedure.h */