2 Bacula(R) - The Network Backup Solution
4 Copyright (C) 2000-2018 Kern Sibbald
6 The original author of Bacula is Kern Sibbald, with contributions
7 from many others, a complete list can be found in the file AUTHORS.
9 You may use this file and others of this release according to the
10 license defined in the LICENSE file, which includes the Affero General
11 Public License, v3.0 ("AGPLv3") and some additional permissions and
12 terms pursuant to its AGPLv3 Section 7.
14 This notice must be preserved when any source code is
15 conveyed and/or propagated.
17 Bacula(R) is a registered trademark of Kern Sibbald.
20 * Written by James Harper, July 2010
22 * Used only in "old Exchange plugin" now deprecated.
25 #include "exchange-fd.h"
27 node_t::node_t(char *name, int type)
32 this->name = bstrdup(name);
33 full_path = make_full_path();
38 node_t::node_t(char *name, int type, node_t *parent_node)
43 this->name = bstrdup(name);
44 full_path = make_full_path();
46 level = parent->level + 1;
52 safe_delete(full_path);
56 node_t::make_full_path()
62 for (len = 0, curr_node = this; curr_node != NULL; curr_node = curr_node->parent)
64 len += strlen(curr_node->name) + 1;
66 if (type == NODE_TYPE_FILE || type == NODE_TYPE_DATABASE_INFO)
68 retval = new char[len + 1];
73 retval = new char[len + 2];
77 for (curr_node = this; curr_node != NULL; curr_node = curr_node->parent)
79 len -= strlen(curr_node->name);
80 memcpy(retval + len, curr_node->name, strlen(curr_node->name));
87 node_t::pluginIoOpen(exchange_fd_context_t *context, struct io_pkt *io)
89 _DebugMessage(100, "pluginIoOpen_Node\n");
96 node_t::pluginIoRead(exchange_fd_context_t *context, struct io_pkt *io)
98 _DebugMessage(100, "pluginIoRead_Node\n");
105 node_t::pluginIoWrite(exchange_fd_context_t *context, struct io_pkt *io)
107 _DebugMessage(100, "pluginIoWrite_Node\n");
114 node_t::pluginIoClose(exchange_fd_context_t *context, struct io_pkt *io)
116 _DebugMessage(100, "pluginIoClose_Node\n");