From c5187a1824b61add1cd216ef5c432d8abaab1222 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 14 Jun 2012 20:48:19 +0800 Subject: move everything to src/ subdirectory The code corresponds to commit a9aa4777cc1144897a77dfb6c5c3d7325705251e in openbts-p2.8.git (Tue Jun 12 18:14:49 2012 +0400) --- src/bitvector.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/bitvector.h (limited to 'src/bitvector.h') diff --git a/src/bitvector.h b/src/bitvector.h new file mode 100644 index 00000000..7409d551 --- /dev/null +++ b/src/bitvector.h @@ -0,0 +1,45 @@ +/* bitvector.h + * + * Copyright (C) 2012 Ivan Klyuchnikov + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef BITVECTOR_H +#define BITVECTOR_H + +/*! \defgroup bitvector Bit vectors + * @{ + */ + +/*! \file bitvector.h + * \brief Additional functions for Osmocom bit vector abstraction. + */ + +extern "C" { +#include +} + +struct bitvec *bitvec_alloc(unsigned size); +void bitvec_free(struct bitvec *bv); +int bitvec_unhex(struct bitvec *bv, const char* src); +int bitvec_pack(struct bitvec *bv, uint8_t *buffer); +int bitvec_unpack(struct bitvec *bv, uint8_t *buffer); +uint64_t bitvec_read_field(struct bitvec *bv, unsigned& read_index, unsigned len); +int bitvec_write_field(struct bitvec *bv, unsigned& write_index, uint64_t val, unsigned len); + +/*! }@ */ + +#endif // BITVECTOR_H -- cgit v1.2.3