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