aboutsummaryrefslogtreecommitdiffstats
path: root/src/bitvector.h
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-06-14 20:48:19 +0800
committerHarald Welte <laforge@gnumonks.org>2012-06-14 20:48:42 +0800
commitc5187a1824b61add1cd216ef5c432d8abaab1222 (patch)
treec197bc24e9eae4f8d66a8c65d5102be9aca6b4ef /src/bitvector.h
parent634771173648acd39c44280e673563a53381b2f7 (diff)
move everything to src/ subdirectory
The code corresponds to commit a9aa4777cc1144897a77dfb6c5c3d7325705251e in openbts-p2.8.git (Tue Jun 12 18:14:49 2012 +0400)
Diffstat (limited to 'src/bitvector.h')
-rw-r--r--src/bitvector.h45
1 files changed, 45 insertions, 0 deletions
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 <osmocom/core/bitvec.h>
+}
+
+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