indexbuf.h

Go to the documentation of this file.
00001 /**
00002  * @file ccn/indexbuf.h
00003  * 
00004  * Expandable buffer of non-negative values.
00005  *
00006  * Part of the CCNx C Library.
00007  *
00008  * Copyright (C) 2008, 2009 Palo Alto Research Center, Inc.
00009  *
00010  * This library is free software; you can redistribute it and/or modify it
00011  * under the terms of the GNU Lesser General Public License version 2.1
00012  * as published by the Free Software Foundation.
00013  * This library is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00016  * Lesser General Public License for more details. You should have received
00017  * a copy of the GNU Lesser General Public License along with this library;
00018  * if not, write to the Free Software Foundation, Inc., 51 Franklin Street,
00019  * Fifth Floor, Boston, MA 02110-1301 USA.
00020  */
00021 
00022 #ifndef CCN_INDEXBUF_DEFINED
00023 #define CCN_INDEXBUF_DEFINED
00024 
00025 #include <stddef.h>
00026 
00027 struct ccn_indexbuf {
00028     size_t n;
00029     size_t limit;
00030     size_t *buf;
00031 };
00032 
00033 struct ccn_indexbuf *ccn_indexbuf_create(void);
00034 void ccn_indexbuf_destroy(struct ccn_indexbuf **cbp);
00035 size_t *ccn_indexbuf_reserve(struct ccn_indexbuf *c, size_t n);
00036 int ccn_indexbuf_append(struct ccn_indexbuf *c, const size_t *p, size_t n);
00037 int ccn_indexbuf_append_element(struct ccn_indexbuf *c, size_t v);
00038 int ccn_indexbuf_member(struct ccn_indexbuf *x, size_t val);
00039 void ccn_indexbuf_remove_element(struct ccn_indexbuf *x, size_t val);
00040 int ccn_indexbuf_set_insert(struct ccn_indexbuf *x, size_t val);
00041 int ccn_indexbuf_remove_first_match(struct ccn_indexbuf *x, size_t val);
00042 void ccn_indexbuf_move_to_end(struct ccn_indexbuf *x, size_t val);
00043 void ccn_indexbuf_move_to_front(struct ccn_indexbuf *x, size_t val);
00044 
00045 #endif
Generated on Fri May 13 16:27:02 2011 for Content-Centric Networking in C by  doxygen 1.6.3