opkg: don't print "Successfully terminated." message
[oweals/opkg-lede.git] / str_list.c
1 /* str_list.c - the itsy package management system
2
3    Carl D. Worth
4
5    Copyright (C) 2001 University of Southern California
6
7    This program is free software; you can redistribute it and/or
8    modify it under the terms of the GNU General Public License as
9    published by the Free Software Foundation; either version 2, or (at
10    your option) any later version.
11
12    This program is distributed in the hope that it will be useful, but
13    WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15    General Public License for more details.
16 */
17
18 #include "opkg.h"
19
20 #include "str_list.h"
21
22 int str_list_elt_init(str_list_elt_t *elt, char *data)
23 {
24     return void_list_elt_init((void_list_elt_t *) elt, data);
25 }
26
27 void str_list_elt_deinit(str_list_elt_t *elt)
28 {
29     void_list_elt_deinit((void_list_elt_t *) elt);
30 }
31
32 str_list_t *str_list_alloc()
33 {
34      str_list_t *list = (str_list_t *)malloc(sizeof(str_list_t));
35      if (list)
36           str_list_init(list);
37      return list;
38 }
39
40 int str_list_init(str_list_t *list)
41 {
42     return void_list_init((void_list_t *) list);
43 }
44
45 void str_list_deinit(str_list_t *list)
46 {
47     void_list_deinit((void_list_t *) list);
48 }
49
50 int str_list_append(str_list_t *list, char *data)
51 {
52     return void_list_append((void_list_t *) list, data);
53 }
54
55 int str_list_push(str_list_t *list, char *data)
56 {
57     return void_list_push((void_list_t *) list, data);
58 }
59
60 str_list_elt_t *str_list_pop(str_list_t *list)
61 {
62     return (str_list_elt_t *) void_list_pop((void_list_t *) list);
63 }
64
65 str_list_elt_t *str_list_remove(str_list_t *list, str_list_elt_t **iter)
66 {
67     return (str_list_elt_t *) void_list_remove((void_list_t *) list,
68                                                (void_list_elt_t **) iter);
69 }
70
71 char *str_list_remove_elt(str_list_t *list, const char *target_str)
72 {
73      return (char *)void_list_remove_elt((void_list_t *) list,
74                                          (void *)target_str,
75                                          (void_list_cmp_t)strcmp);
76 }