From a619ccc300a00947207600e11fac848b7d37b26b Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 10 Jul 2009 09:59:41 +0000 Subject: Fieldname queries added macrotool. --- server/src/macrotool_dump.cc | 48 ++------------------------------------------ 1 file changed, 2 insertions(+), 46 deletions(-) (limited to 'server/src/macrotool_dump.cc') diff --git a/server/src/macrotool_dump.cc b/server/src/macrotool_dump.cc index 9248d03..370397a 100644 --- a/server/src/macrotool_dump.cc +++ b/server/src/macrotool_dump.cc @@ -27,6 +27,8 @@ */ #include "macrotool_dump.h" +#include "macrotool_util.h" + #include "debug.h" #include "macroparser.h" @@ -36,9 +38,6 @@ #include #include -#include -#include - #include #include "configuration.h" @@ -65,49 +64,6 @@ static const char usage_str[] = " templates Writes template names, versions, filenames, titles and macro references to stdout.\n" ; - -static std::vector listdir(std::string path) -{ - std::vector files; - - DIR* dir = opendir(path.c_str()); - if(!dir) { - PRACRO_ERR(dump, "Could not open directory: %s\n", path.c_str()); - return files; - } - - struct dirent *d; - while((d = readdir(dir)) != 0) { - //if(d->d_type == DT_DIR) { - std::string name = d->d_name; - if(name.length() >= 4 && name.substr(name.length() - 4) == ".xml") - files.push_back(name); - //} - } - closedir(dir); - - return files; -} - -static std::vector getMacros() -{ - std::vector macros = listdir(Conf::xml_basedir + "/macros"); - return macros; -} - -static std::vector getTemplates() -{ - std::vector templates = listdir(Conf::xml_basedir + "/templates"); - return templates; -} - -static void printcolumn(std::string text, size_t width) -{ - printf(text.c_str()); - for(size_t i = text.length(); i < width; i++) printf(" "); - printf("\t"); -} - static std::map macroList() { std::map macros; -- cgit v1.2.3