aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/slist.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2015-12-23 19:53:04 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2015-12-23 21:02:33 +0100
commit950e6c9148eca244a89d18a21d4ae4e5c3d1c646 (patch)
tree8664cf3156b92e4083e0680a0a1f21e20a2b22c9 /src/utils/slist.c
parentb75293a565b6f319435516fe253bd61688ba3a1f (diff)
downloadblogc-950e6c9148eca244a89d18a21d4ae4e5c3d1c646.tar.gz
blogc-950e6c9148eca244a89d18a21d4ae4e5c3d1c646.tar.bz2
blogc-950e6c9148eca244a89d18a21d4ae4e5c3d1c646.zip
build: removing src/utils and replacing with squareball
squareball is a new general purpose library for C99, based on the code removed from src/utils
Diffstat (limited to 'src/utils/slist.c')
-rw-r--r--src/utils/slist.c68
1 files changed, 0 insertions, 68 deletions
diff --git a/src/utils/slist.c b/src/utils/slist.c
deleted file mode 100644
index 3d9b892..0000000
--- a/src/utils/slist.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * blogc: A blog compiler.
- * Copyright (C) 2014-2015 Rafael G. Martins <rafael@rafaelmartins.eng.br>
- *
- * This program can be distributed under the terms of the BSD License.
- * See the file LICENSE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif /* HAVE_CONFIG_H */
-
-#include <stdlib.h>
-#include "utils.h"
-
-
-b_slist_t*
-b_slist_append(b_slist_t *l, void *data)
-{
- b_slist_t *node = malloc(sizeof(b_slist_t));
- if (node == NULL) {
- l = NULL;
- return l;
- }
- node->data = data;
- node->next = NULL;
- if (l == NULL)
- l = node;
- else {
- b_slist_t *tmp;
- for (tmp = l; tmp->next != NULL; tmp = tmp->next);
- tmp->next = node;
- }
- return l;
-}
-
-
-void
-b_slist_free_full(b_slist_t *l, b_free_func_t free_func)
-{
- while (l != NULL) {
- b_slist_t *tmp = l->next;
- free_func(l->data);
- free(l);
- l = tmp;
- }
-}
-
-
-void
-b_slist_free(b_slist_t *l)
-{
- while (l != NULL) {
- b_slist_t *tmp = l->next;
- free(l);
- l = tmp;
- }
-}
-
-
-unsigned int
-b_slist_length(b_slist_t *l)
-{
- unsigned int i;
- b_slist_t *tmp;
- for (tmp = l, i = 0; tmp != NULL; tmp = tmp->next, i++);
- return i;
-}