4 /* subclist - lists for PSPP subcommands
6 Copyright (C) 2004 Free Software Foundation, Inc.
8 Written by John Darrington <john@darrington.wattle.id.au>
11 This program is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License as
13 published by the Free Software Foundation; either version 2 of the
14 License, or (at your option) any later version.
16 This program is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
28 #include <sys/types.h>
30 /* This module provides a rudimentary list class
31 It is intended for use by the command line parser for list subcommands
35 struct subc_list_double {
41 struct subc_list_int {
48 typedef struct subc_list_double subc_list_double ;
49 typedef struct subc_list_int subc_list_int ;
52 void subc_list_double_create(subc_list_double *l) ;
53 void subc_list_int_create(subc_list_int *l) ;
55 /* Push a value onto the list */
56 void subc_list_double_push(subc_list_double *l, double d) ;
57 void subc_list_int_push(subc_list_int *l, int i) ;
59 /* Index into the list */
60 double subc_list_double_at(const subc_list_double *l, int idx);
61 int subc_list_int_at(const subc_list_int *l, int idx);
63 /* Return the number of values in the list */
64 int subc_list_double_count(const subc_list_double *l);
65 int subc_list_int_count(const subc_list_int *l);
67 /* Destroy the list */
68 void subc_list_double_destroy(subc_list_double *l) ;
69 void subc_list_int_destroy(subc_list_int *l) ;