rename .h to .hpp

This commit is contained in:
fancy
2020-05-16 10:49:47 +08:00
parent 1c16f57193
commit fbcc499ba8
9 changed files with 18 additions and 18 deletions

View File

@@ -1,4 +1,4 @@
#include "cgroup_attach.h"
#include "cgroup_attach.hpp"
using namespace std;
void print_usage() { fprintf(stdout, "usage: cgattach <pid> <cgroup>\n"); }

View File

@@ -1,5 +1,5 @@
#include <nlohmann/json.hpp>
#include "socket_client.h"
#include "socket_client.hpp"
using json = nlohmann::json;
using namespace CGPROXY;

View File

@@ -1,5 +1,5 @@
#include <nlohmann/json.hpp>
#include "socket_client.h"
#include "socket_client.hpp"
using json = nlohmann::json;
using namespace CGPROXY;
@@ -15,10 +15,10 @@ bool attach2cgproxy(){
int main(int argc, char *argv[]){
int shift=1;
// if (argc==1){
// error("usage: cgproxy [--debug] <CMD>\nexample: cgroxy curl -I https://www.google.com");
// exit(EXIT_FAILURE);
// }
if (argc==1){
error("usage: cgproxy [--debug] <CMD>\nexample: cgroxy curl -I https://www.google.com");
exit(EXIT_FAILURE);
}
processArgs(argc,argv,shift);
if (!attach2cgproxy()){

View File

@@ -1,5 +1,5 @@
#include "common.h"
#include "socket_server.h"
#include "common.hpp"
#include "socket_server.hpp"
#include <fstream>
#include <iostream>
#include <libconfig.h++>
@@ -9,8 +9,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include "config.h"
#include "cgroup_attach.h"
#include "config.hpp"
#include "cgroup_attach.hpp"
using namespace std;
using json = nlohmann::json;

View File

@@ -11,7 +11,7 @@
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include "common.h"
#include "common.hpp"
using namespace std;
namespace CGPROXY::CGROUP{

View File

@@ -31,8 +31,8 @@
#include <regex>
using namespace std;
extern bool enable_debug=false;
extern bool print_help=false;
static bool enable_debug=false;
static bool print_help=false;
#define error(...) {fprintf(stderr, __VA_ARGS__);fprintf(stderr, "\n");}
#define debug(...) if (enable_debug) {fprintf(stdout, __VA_ARGS__);fprintf(stdout, "\n");}

View File

@@ -1,7 +1,7 @@
#ifndef CONFIG_H
#define CONFIG_H
#include "common.h"
#include "socket_server.h"
#include "common.hpp"
#include "socket_server.hpp"
#include <fstream>
#include <iostream>
#include <nlohmann/json.hpp>

View File

@@ -9,7 +9,7 @@
#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>
#include "common.h"
#include "common.hpp"
using namespace std;

View File

@@ -13,7 +13,7 @@
#include <unistd.h>
#include <sys/stat.h>
#include <filesystem>
#include "common.h"
#include "common.hpp"
using namespace std;
namespace fs = std::filesystem;