mirror of
https://github.com/springzfx/cgproxy.git
synced 2026-01-07 13:07:56 +08:00
rename .h to .hpp
This commit is contained in:
@@ -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"); }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <nlohmann/json.hpp>
|
||||
#include "socket_client.h"
|
||||
#include "socket_client.hpp"
|
||||
using json = nlohmann::json;
|
||||
using namespace CGPROXY;
|
||||
|
||||
|
||||
10
cgproxy.cpp
10
cgproxy.cpp
@@ -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()){
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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{
|
||||
@@ -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");}
|
||||
@@ -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>
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/un.h>
|
||||
#include <unistd.h>
|
||||
#include "common.h"
|
||||
#include "common.hpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user