From ef646f0f7823e7be6f290297d1dac15f303d1947 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Mon, 9 Jun 2014 12:07:40 -0700 Subject: Removal of more fishd artifacts and headers --- env.cpp | 7 --- env_universal.cpp | 16 +------ env_universal_common.cpp | 96 +----------------------------------------- env_universal_common.h | 33 +++------------ fish.xcodeproj/project.pbxproj | 2 - 5 files changed, 9 insertions(+), 145 deletions(-) diff --git a/env.cpp b/env.cpp index 69e0dd11..21e0adee 100644 --- a/env.cpp +++ b/env.cpp @@ -345,13 +345,6 @@ static void universal_callback(fish_message_type_t type, str=L"SET"; break; } - - case ERASE: - { - str=L"ERASE"; - break; - } - default: break; } diff --git a/env_universal.cpp b/env_universal.cpp index 2d2bf304..eb23aff1 100644 --- a/env_universal.cpp +++ b/env_universal.cpp @@ -46,11 +46,6 @@ static bool s_env_univeral_inited = false; static void (*external_callback)(fish_message_type_t type, const wchar_t *name, const wchar_t *val); -/** - Flag set to 1 when a barrier reply is recieved -*/ -static int barrier_reply = 0; - void env_universal_barrier(); /** @@ -58,15 +53,8 @@ void env_universal_barrier(); */ static void callback(fish_message_type_t type, const wchar_t *name, const wchar_t *val) { - if (type == BARRIER_REPLY) - { - barrier_reply = 1; - } - else - { - if (external_callback) - external_callback(type, name, val); - } + if (external_callback) + external_callback(type, name, val); } void env_universal_init(void (*cb)(fish_message_type_t type, const wchar_t *name, const wchar_t *val)) diff --git a/env_universal_common.cpp b/env_universal_common.cpp index 0b73782d..baf94a19 100644 --- a/env_universal_common.cpp +++ b/env_universal_common.cpp @@ -7,32 +7,12 @@ */ #include "config.h" +#include "env_universal_common.h" -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include + #include -#include #ifdef HAVE_SYS_SELECT_H #include @@ -44,7 +24,6 @@ #include "common.h" #include "wutil.h" #include "utf8.h" -#include "env_universal_common.h" #include "path.h" #include "iothread.h" @@ -477,24 +456,6 @@ message_t *create_message(fish_message_type_t type, break; } - case ERASE: - { - set_body(msg, ERASE_MBS, " ", key, "\n", NULL); - break; - } - - case BARRIER: - { - set_body(msg, BARRIER_MBS, "\n", NULL); - break; - } - - case BARRIER_REPLY: - { - set_body(msg, BARRIER_REPLY_MBS, "\n", NULL); - break; - } - default: { debug(0, L"create_message: Unknown message type"); @@ -540,20 +501,6 @@ connection_t::connection_t(int input_fd) : { } -void connection_destroy(connection_t *c) -{ - /* - A connection need not always be open - we only try to close it - if it is open. - */ - if (c->fd >= 0) - { - if (close(c->fd)) - { - wperror(L"close"); - } - } -} env_universal_t::env_universal_t(const wcstring &path) : explicit_vars_path(path), tried_renaming(false), last_read_file(kInvalidFileID) { @@ -1201,45 +1148,6 @@ void env_universal_t::parse_message_internal(wchar_t *msg, connection_t *src, ca debug(1, PARSE_ERR, msg); } } - else if (match(msg, ERASE_STR)) - { - wchar_t *name, *tmp; - - name = msg+wcslen(ERASE_STR); - while (wcschr(L"\t ", *name)) - name++; - - tmp = name; - while (iswalnum(*tmp) || *tmp == L'_') - tmp++; - - *tmp = 0; - - if (!wcslen(name)) - { - debug(1, PARSE_ERR, msg); - } - - this->remove_internal(name, false); - if (callbacks != NULL) - { - callbacks->push_back(callback_data_t(ERASE, name, wcstring())); - } - } - else if (match(msg, BARRIER_STR)) - { - message_t *msg = create_message(BARRIER_REPLY, 0, 0); - msg->count = 1; - src->unsent.push(msg); - try_send_all(src); - } - else if (match(msg, BARRIER_REPLY_STR)) - { - if (callbacks != NULL) - { - callbacks->push_back(callback_data_t(BARRIER_REPLY, wcstring(), wcstring())); - } - } else { debug(1, PARSE_ERR, msg); diff --git a/env_universal_common.h b/env_universal_common.h index 1dcf6ed4..19e56986 100644 --- a/env_universal_common.h +++ b/env_universal_common.h @@ -5,6 +5,7 @@ #include #include #include +#include "wutil.h" #include "util.h" #include "env.h" @@ -19,40 +20,16 @@ #define SET_EXPORT_STR L"SET_EXPORT" /** - The erase command -*/ -#define ERASE_STR L"ERASE" - -/** - The barrier command -*/ -#define BARRIER_STR L"BARRIER" - -/** - The barrier_reply command -*/ -#define BARRIER_REPLY_STR L"BARRIER_REPLY" - - -/** - The filename to use for univeral variables. The username is appended -*/ -#define SOCK_FILENAME "fishd.socket." - -/** - The different types of commands that can be sent between client/server + The different types of messages found in the fishd file */ typedef enum { SET, - SET_EXPORT, - ERASE, - BARRIER, - BARRIER_REPLY, + SET_EXPORT } fish_message_type_t; /** - The size of the buffer used for reading from the socket + The size of the buffer used for reading from the file */ #define ENV_UNIVERSAL_BUFFER_SIZE 1024 @@ -67,7 +44,7 @@ typedef struct int count; /** - Message body. The message must be allocated using enough memory to actually contain the message. + Message body. */ std::string body; diff --git a/fish.xcodeproj/project.pbxproj b/fish.xcodeproj/project.pbxproj index aecda2bd..32ba442b 100644 --- a/fish.xcodeproj/project.pbxproj +++ b/fish.xcodeproj/project.pbxproj @@ -406,7 +406,6 @@ D0A0853F13B3ACEE0099B651 /* fish_indent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fish_indent.cpp; sourceTree = ""; }; D0A0854113B3ACEE0099B651 /* fish_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fish_tests.cpp; sourceTree = ""; }; D0A0854213B3ACEE0099B651 /* fish.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fish.cpp; sourceTree = ""; }; - D0A0854313B3ACEE0099B651 /* fishd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fishd.cpp; sourceTree = ""; }; D0A0854413B3ACEE0099B651 /* function.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = function.cpp; sourceTree = ""; }; D0A0854713B3ACEE0099B651 /* highlight.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = highlight.cpp; sourceTree = ""; }; D0A0854813B3ACEE0099B651 /* history.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = history.cpp; sourceTree = ""; }; @@ -600,7 +599,6 @@ D0A0853F13B3ACEE0099B651 /* fish_indent.cpp */, D0A0854113B3ACEE0099B651 /* fish_tests.cpp */, D0A0854213B3ACEE0099B651 /* fish.cpp */, - D0A0854313B3ACEE0099B651 /* fishd.cpp */, D00F63F019137E9D00FCCDEC /* fish_version.cpp */, D0A0851113B3ACEE0099B651 /* highlight.h */, D0A0854713B3ACEE0099B651 /* highlight.cpp */, -- cgit v1.2.3