blob: d5f89ee8a30e6d4ba37aac47a78244f35c586379 [file] [log] [blame]
Chengyu Faneb0422c2015-03-04 16:34:14 -07001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2015, Colorado State University.
4 *
5 * This file is part of ndn-atmos.
6 *
7 * ndn-atmos is free software: you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License as published by the Free Software
9 * Foundation, either version 3 of the License, or (at your option) any later version.
10 *
11 * ndn-atmos is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14 *
15 * You should have received copies of the GNU General Public License and GNU Lesser
16 * General Public License along with ndn-atmos, e.g., in COPYING.md file. If not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 * See AUTHORS.md for complete list of ndn-atmos authors and contributors.
20 */
21
22#include <ChronoSync/socket.hpp>
23#include <ndn-cxx/face.hpp>
Chengyu Fan8b92f122015-03-09 22:13:36 -060024#include <json/value.h>
25#include <libpq-fe.h>
Chengyu Faneb0422c2015-03-04 16:34:14 -070026
27using namespace std;
28using namespace ndn;
29
30int main()
31{
Chengyu Fan8b92f122015-03-09 22:13:36 -060032 Face face; // use ndn-cxx
33 shared_ptr<chronosync::Socket> socket; // use ChronoSync
34
35 Json::Value root; // use jsoncpp
36 PGconn *conn; // use libpq
37 // Make a connection to the database
38 conn = PQconnectdb("dbname=bedrock sslmode=disable");
39 if (PQstatus(conn) != CONNECTION_OK) {
40 cout << "Connection to database failed: "
41 << PQerrorMessage(conn) << endl;
42 }
43
Chengyu Faneb0422c2015-03-04 16:34:14 -070044 return 0;
45}