blob: d5f89ee8a30e6d4ba37aac47a78244f35c586379 [file] [log] [blame]
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2015, Colorado State University.
*
* This file is part of ndn-atmos.
*
* ndn-atmos is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later version.
*
* ndn-atmos 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 Lesser General Public License for more details.
*
* You should have received copies of the GNU General Public License and GNU Lesser
* General Public License along with ndn-atmos, e.g., in COPYING.md file. If not, see
* <http://www.gnu.org/licenses/>.
*
* See AUTHORS.md for complete list of ndn-atmos authors and contributors.
*/
#include <ChronoSync/socket.hpp>
#include <ndn-cxx/face.hpp>
#include <json/value.h>
#include <libpq-fe.h>
using namespace std;
using namespace ndn;
int main()
{
Face face; // use ndn-cxx
shared_ptr<chronosync::Socket> socket; // use ChronoSync
Json::Value root; // use jsoncpp
PGconn *conn; // use libpq
// Make a connection to the database
conn = PQconnectdb("dbname=bedrock sslmode=disable");
if (PQstatus(conn) != CONNECTION_OK) {
cout << "Connection to database failed: "
<< PQerrorMessage(conn) << endl;
}
return 0;
}