back to scratko.xyz
summaryrefslogtreecommitdiff
path: root/queue.c
diff options
context:
space:
mode:
Diffstat (limited to 'queue.c')
-rw-r--r--queue.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/queue.c b/queue.c
index 861f1e5..eed3cf8 100644
--- a/queue.c
+++ b/queue.c
@@ -33,6 +33,7 @@ void queue_clear(struct queue *q)
q->last = NULL;
}
+#if 0
void queue_processing(const struct queue *q, void (*callback)(char*))
{
struct word_item *tmp;
@@ -42,3 +43,22 @@ void queue_processing(const struct queue *q, void (*callback)(char*))
tmp = tmp->next;
}
}
+#endif
+
+int queue_get_word_count(const struct queue *q)
+{
+ struct word_item *tmp;
+ int counter;
+ for(counter = 0, tmp = q->first; tmp; tmp = tmp->next, ++counter)
+ {}
+ return counter;
+}
+
+void queue_copy_words_to_args(const struct queue *q, char **cmdline)
+{
+ struct word_item *tmp;
+ int mas_idx;
+ for(tmp = q->first, mas_idx = 0; tmp; tmp = tmp->next, ++mas_idx)
+ cmdline[mas_idx] = tmp->word;
+ cmdline[mas_idx] = NULL;
+}