Chengyu Fan | eb0422c | 2015-03-04 16:34:14 -0700 | [diff] [blame] | 1 | /* -*- 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 Fan | 8b92f12 | 2015-03-09 22:13:36 -0600 | [diff] [blame^] | 24 | #include <json/value.h> |
| 25 | #include <libpq-fe.h> |
Chengyu Fan | eb0422c | 2015-03-04 16:34:14 -0700 | [diff] [blame] | 26 | |
| 27 | using namespace std; |
| 28 | using namespace ndn; |
| 29 | |
| 30 | int main() |
| 31 | { |
Chengyu Fan | 8b92f12 | 2015-03-09 22:13:36 -0600 | [diff] [blame^] | 32 | 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 Fan | eb0422c | 2015-03-04 16:34:14 -0700 | [diff] [blame] | 44 | return 0; |
| 45 | } |