• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/opkg-lede/libopkg/pkg_src_list.c

  1 /* pkg_src_list.c - the opkg 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 "pkg_src_list.h"
 19 #include "void_list.h"
 20 #include "libbb/libbb.h"
 21 
 22 void pkg_src_list_init(pkg_src_list_t * list)
 23 {
 24         void_list_init((void_list_t *) list);
 25 }
 26 
 27 void pkg_src_list_deinit(pkg_src_list_t * list)
 28 {
 29         pkg_src_list_elt_t *iter, *n;
 30         pkg_src_t *pkg_src;
 31 
 32         list_for_each_entry_safe(iter, n, &list->head, node) {
 33                 pkg_src = (pkg_src_t *) iter->data;
 34                 pkg_src_deinit(pkg_src);
 35 
 36                 /* malloced in pkg_src_list_append */
 37                 free(pkg_src);
 38                 iter->data = NULL;
 39         }
 40         void_list_deinit((void_list_t *) list);
 41 }
 42 
 43 pkg_src_t *pkg_src_list_append(pkg_src_list_t * list,
 44                                const char *name, const char *base_url,
 45                                int gzip)
 46 {
 47         /* freed in pkg_src_list_deinit */
 48         pkg_src_t *pkg_src = xcalloc(1, sizeof(pkg_src_t));
 49         pkg_src_init(pkg_src, name, base_url, gzip);
 50 
 51         void_list_append((void_list_t *) list, pkg_src);
 52 
 53         return pkg_src;
 54 }
 55 

This page was automatically generated by LXR 0.3.1.  •  OpenWrt