[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patch 7/7] Implement support for "INTEGER LIST"-type subcommands in q2c
From: |
blp |
Subject: |
[patch 7/7] Implement support for "INTEGER LIST"-type subcommands in q2c. The documentation claimed these were supported, but actually they werent. |
Date: |
Sat, 02 Jun 2007 15:36:54 -0700 |
User-agent: |
quilt/0.45-1 |
Index: merge/src/language/lexer/subcommand-list.c
===================================================================
--- merge.orig/src/language/lexer/subcommand-list.c 2007-05-31
17:38:42.000000000 -0700
+++ merge/src/language/lexer/subcommand-list.c 2007-06-02 13:28:05.000000000
-0700
@@ -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);
+}
--
- [patch 0/7] some bits of simpler-proc ready for review, blp, 2007/06/03
- [patch 2/7] Add insert_range, insert_element functions., blp, 2007/06/03
- [patch 7/7] Implement support for "INTEGER LIST"-type subcommands in q2c. The documentation claimed these were supported, but actually they werent.,
blp <=
- [patch 5/7] Remove author. Fix compile-command., blp, 2007/06/03
- [patch 6/7] Use var_is_alpha., blp, 2007/06/03
- [patch 4/7] Remove next, prev, up node names from @node lines, to make structural changes to the manual easier. (These node names are not needed by makeinfo.), blp, 2007/06/03
- [patch 3/7] Ignore _ndebug, _profile directories that I use for -DNDEBUG and profiling builds., blp, 2007/06/03
- [patch 1/7] Insert some missing "#include <config.h>" lines., blp, 2007/06/03
- Re: [patch 0/7] some bits of simpler-proc ready for review, John Darrington, 2007/06/03