Browse Source

Simplify threading model a bit.

pull/2/head
Jacob Dufault 8 years ago
parent
commit
7741991b72
  1. 924
      src/command_line.cc
  2. 6
      src/ipc.cc
  3. 19
      src/ipc.h
  4. 2
      src/platform_linux.cc
  5. 1
      src/platform_win.cc

924
src/command_line.cc

File diff suppressed because it is too large

6
src/ipc.cc

@ -43,12 +43,6 @@ const char* IpcIdToString(IpcId id) {
return "$cquery/freshenIndex";
}
case IpcId::Quit:
return "$quit";
case IpcId::IsAlive:
return "$isAlive";
case IpcId::OpenProject:
return "$openProject";
case IpcId::Cout:
return "$cout";
default:

19
src/ipc.h

@ -29,9 +29,6 @@ enum class IpcId : int {
CqueryFreshenIndex,
// Internal implementation detail.
Quit,
IsAlive,
OpenProject,
Cout
};
MAKE_ENUM_HASHABLE(IpcId)
@ -48,22 +45,6 @@ struct IpcMessage : public BaseIpcMessage {
IpcMessage() : BaseIpcMessage(T::kIpcId) {}
};
struct Ipc_Quit : public IpcMessage<Ipc_Quit> {
static constexpr IpcId kIpcId = IpcId::Quit;
};
MAKE_REFLECT_EMPTY_STRUCT(Ipc_Quit);
struct Ipc_IsAlive : public IpcMessage<Ipc_IsAlive> {
static constexpr IpcId kIpcId = IpcId::IsAlive;
};
MAKE_REFLECT_EMPTY_STRUCT(Ipc_IsAlive);
struct Ipc_OpenProject : public IpcMessage<Ipc_OpenProject> {
static constexpr IpcId kIpcId = IpcId::OpenProject;
std::string project_path;
};
MAKE_REFLECT_STRUCT(Ipc_OpenProject, project_path);
struct Ipc_Cout : public IpcMessage<Ipc_Cout> {
static constexpr IpcId kIpcId = IpcId::Cout;
std::string content;

2
src/platform_linux.cc

@ -149,8 +149,6 @@ std::string NormalizePath(const std::string& path) {
}
bool TryMakeDirectory(const std::string& absolute_path) {
std::cerr << "!! TryMakeDirectory " << absolute_path << std::endl;
const mode_t kMode = 0777; // UNIX style permissions
if (mkdir(absolute_path.c_str(), kMode) == -1) {
// Success if the directory exists.

1
src/platform_win.cc

@ -150,7 +150,6 @@ std::string NormalizePath(const std::string& path) {
}
bool TryMakeDirectory(const std::string& absolute_path) {
std::cerr << "!! TryMakeDirectory " << absolute_path << std::endl;
if (_mkdir(absolute_path.c_str()) == -1) {
// Success if the directory exists.
return errno == EEXIST;

Loading…
Cancel
Save