blob: 031d27de60f12cdd4061bd23a1918ac28ff21763 [file] [log] [blame]
Alexander Afanasyev68f2a952013-01-08 14:34:16 -08001/* -*- 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 Zhu974c5a62012-12-28 14:15:30 -080022#ifndef CCNX_COMMON_H
23#define CCNX_COMMON_H
24
Zhenkai Zhuf47109b2013-01-02 19:41:34 -080025extern "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 Zhu974c5a62012-12-28 14:15:30 -080033#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
42using namespace std;
43namespace Ccnx {
44typedef vector<unsigned char> Bytes;
Zhenkai Zhu9bad2bf2012-12-28 15:31:46 -080045typedef vector<string>Comps;
Zhenkai Zhu974c5a62012-12-28 14:15:30 -080046
Alexander Afanasyev68f2a952013-01-08 14:34:16 -080047typedef boost::shared_ptr<Bytes> BytesPtr;
48
Zhenkai Zhu9bad2bf2012-12-28 15:31:46 -080049// --- Bytes operations start ---
Zhenkai Zhu974c5a62012-12-28 14:15:30 -080050void
51readRaw(Bytes &bytes, const unsigned char *src, size_t len);
52
53const unsigned char *
54head(const Bytes &bytes);
55
Zhenkai Zhu9bad2bf2012-12-28 15:31:46 -080056// --- Bytes operations end ---
57
Zhenkai Zhuf47109b2013-01-02 19:41:34 -080058// Exceptions
59typedef boost::error_info<struct tag_errmsg, std::string> error_info_str;
Zhenkai Zhu9bad2bf2012-12-28 15:31:46 -080060
Zhenkai Zhu974c5a62012-12-28 14:15:30 -080061} // Ccnx
62#endif // CCNX_COMMON_H