pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] pspp/src/language/lexer ChangeLog subcommand-li...


From: Ben Pfaff
Subject: [Pspp-cvs] pspp/src/language/lexer ChangeLog subcommand-li...
Date: Sun, 03 Jun 2007 22:07:48 +0000

CVSROOT:        /cvsroot/pspp
Module name:    pspp
Changes by:     Ben Pfaff <blp> 07/06/03 22:07:48

Modified files:
        src/language/lexer: ChangeLog subcommand-list.c 

Log message:
        Implement missing functions for subcommand integer lists.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/lexer/ChangeLog?cvsroot=pspp&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/pspp/src/language/lexer/subcommand-list.c?cvsroot=pspp&r1=1.3&r2=1.4

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/lexer/ChangeLog,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- ChangeLog   6 May 2007 22:05:22 -0000       1.26
+++ ChangeLog   3 Jun 2007 22:07:48 -0000       1.27
@@ -1,3 +1,13 @@
+2007-06-03  Ben Pfaff  <address@hidden>
+
+       Implement missing functions for subcommand integer lists.
+       
+       * subcommand-list.c (subc_list_int_create): New function.
+       (subc_list_int_push): New function.
+       (subc_list_int_count): New function.
+       (subc_list_int_at): New function.
+       (subc_list_int_destroy): New function.
+
 2007-05-06  Ben Pfaff  <address@hidden>
 
        Abstract the documents within a dictionary a little better.

Index: subcommand-list.c
===================================================================
RCS file: /cvsroot/pspp/pspp/src/language/lexer/subcommand-list.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- subcommand-list.c   16 Dec 2006 04:26:42 -0000      1.3
+++ subcommand-list.c   3 Jun 2007 22:07:48 -0000       1.4
@@ -38,6 +38,14 @@
   l->n_data = 0;
 }
 
+void
+subc_list_int_create(subc_list_int *l)
+{
+  l->data = xnmalloc (CHUNKSIZE, sizeof *l->data);
+  l->sz = CHUNKSIZE;
+  l->n_data = 0;
+}
+
 /* Push a value onto the list */
 void
 subc_list_double_push(subc_list_double *l, double d)
@@ -52,6 +60,19 @@
 
 }
 
+void
+subc_list_int_push(subc_list_int *l, int d)
+{
+  l->data[l->n_data++] = d;
+
+  if (l->n_data >= l->sz ) 
+    {
+      l->sz += CHUNKSIZE;
+      l->data = xnrealloc (l->data, l->sz, sizeof *l->data);
+    }
+
+}
+
 /* Return the number of items in the list */
 int 
 subc_list_double_count(const subc_list_double *l)
@@ -59,6 +80,12 @@
   return l->n_data;
 }
 
+int 
+subc_list_int_count(const subc_list_int *l)
+{
+  return l->n_data;
+}
+
 
 /* Index into the list (array) */
 double
@@ -67,9 +94,21 @@
   return l->data[idx];
 }
 
+int
+subc_list_int_at(const subc_list_int *l, int idx)
+{
+  return l->data[idx];
+}
+
 /* Free up the list */
 void
 subc_list_double_destroy(subc_list_double *l)
 {
   free(l->data);
 }
+
+void
+subc_list_int_destroy(subc_list_int *l)
+{
+  free(l->data);
+}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]