X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flibpspp%2Ftower.h;h=55184e51cdc54b0276a2a557950569221931309f;hb=60401d43dd6915c6eaa0fc6cf01fd361dcc323d1;hp=5a4c08e204f714aa334c054a73db8867518594f3;hpb=de0ea5739d1b303ae5a2066802c84eaf55b42500;p=pspp-builds.git diff --git a/src/libpspp/tower.h b/src/libpspp/tower.h index 5a4c08e2..55184e51 100644 --- a/src/libpspp/tower.h +++ b/src/libpspp/tower.h @@ -1,20 +1,18 @@ -/* PSPP - computes sample statistics. +/* PSPP - a program for statistical analysis. Copyright (C) 2007 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 . */ /* "Tower" data structure, implemented as an augmented binary tree. @@ -57,7 +55,7 @@ ((STRUCT *) ((char *) (NODE) - offsetof (STRUCT, MEMBER))) /* A node within a tower. */ -struct tower_node +struct tower_node { struct abt_node abt_node; /* ABT node. */ unsigned long int subtree_height; /* Node's plus descendants' heights. */ @@ -66,13 +64,13 @@ struct tower_node /* Returns the height of a tower node. */ static inline unsigned long -tower_node_get_height (const struct tower_node *node) +tower_node_get_height (const struct tower_node *node) { return node->height; } /* A tower. */ -struct tower +struct tower { struct abt abt; /* Tree. */ struct tower_node *cache; /* Cache node. */ @@ -97,7 +95,10 @@ struct tower_node *tower_lookup (const struct tower *, unsigned long int level, unsigned long int *node_start); struct tower_node *tower_first (const struct tower *); +struct tower_node *tower_last (const struct tower *); struct tower_node *tower_next (const struct tower *, const struct tower_node *); +struct tower_node *tower_prev (const struct tower *, + const struct tower_node *); #endif /* libpspp/tower.h */