Alexander Afanasyev | 68f2a95 | 2013-01-08 14:34:16 -0800 | [diff] [blame^] | 1 | /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2012 University of California, Los Angeles |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License version 2 as |
| 7 | * published by the Free Software Foundation; |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | * |
| 18 | * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu> |
| 19 | * Alexander Afanasyev <alexander.afanasyev@ucla.edu> |
| 20 | */ |
| 21 | |
Zhenkai Zhu | 974c5a6 | 2012-12-28 14:15:30 -0800 | [diff] [blame] | 22 | #ifndef CCNX_COMMON_H |
| 23 | #define CCNX_COMMON_H |
| 24 | |
Zhenkai Zhu | f47109b | 2013-01-02 19:41:34 -0800 | [diff] [blame] | 25 | extern "C" { |
| 26 | #include <ccn/ccn.h> |
| 27 | #include <ccn/charbuf.h> |
| 28 | #include <ccn/keystore.h> |
| 29 | #include <ccn/uri.h> |
| 30 | #include <ccn/bloom.h> |
| 31 | #include <ccn/signing.h> |
| 32 | } |
Zhenkai Zhu | 974c5a6 | 2012-12-28 14:15:30 -0800 | [diff] [blame] | 33 | #include <vector> |
| 34 | #include <boost/shared_ptr.hpp> |
| 35 | #include <boost/exception/all.hpp> |
| 36 | #include <boost/function.hpp> |
| 37 | #include <string> |
| 38 | #include <sstream> |
| 39 | #include <map> |
| 40 | #include <utility> |
| 41 | |
| 42 | using namespace std; |
| 43 | namespace Ccnx { |
| 44 | typedef vector<unsigned char> Bytes; |
Zhenkai Zhu | 9bad2bf | 2012-12-28 15:31:46 -0800 | [diff] [blame] | 45 | typedef vector<string>Comps; |
Zhenkai Zhu | 974c5a6 | 2012-12-28 14:15:30 -0800 | [diff] [blame] | 46 | |
Alexander Afanasyev | 68f2a95 | 2013-01-08 14:34:16 -0800 | [diff] [blame^] | 47 | typedef boost::shared_ptr<Bytes> BytesPtr; |
| 48 | |
Zhenkai Zhu | 9bad2bf | 2012-12-28 15:31:46 -0800 | [diff] [blame] | 49 | // --- Bytes operations start --- |
Zhenkai Zhu | 974c5a6 | 2012-12-28 14:15:30 -0800 | [diff] [blame] | 50 | void |
| 51 | readRaw(Bytes &bytes, const unsigned char *src, size_t len); |
| 52 | |
| 53 | const unsigned char * |
| 54 | head(const Bytes &bytes); |
| 55 | |
Zhenkai Zhu | 9bad2bf | 2012-12-28 15:31:46 -0800 | [diff] [blame] | 56 | // --- Bytes operations end --- |
| 57 | |
Zhenkai Zhu | f47109b | 2013-01-02 19:41:34 -0800 | [diff] [blame] | 58 | // Exceptions |
| 59 | typedef boost::error_info<struct tag_errmsg, std::string> error_info_str; |
Zhenkai Zhu | 9bad2bf | 2012-12-28 15:31:46 -0800 | [diff] [blame] | 60 | |
Zhenkai Zhu | 974c5a6 | 2012-12-28 14:15:30 -0800 | [diff] [blame] | 61 | } // Ccnx |
| 62 | #endif // CCNX_COMMON_H |