diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-09-14 17:26:17 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-06-10 17:15:49 +0200 |
commit | a8485d558fab53291e2530fd9a1be581c1628deb (patch) | |
tree | dff1f2885f954b9da2d3d2dbb9adc20b5b69c69c /registry | |
parent | 611fe67394820e589e86f543c614632fc273eb5e (diff) |
[API CHANGE] Remove deprecated idlc and regmerge from the SDK
* Client code must replace uses of idlc and regmerge with uses of unoidl-write,
see the changes to odk/examples/ and ure/source/uretext/ in
40f2aee6584eafcf4cd1d95fcf1f775e5435440d "Provide unoidl-write also for the
SDK" for examples.
* The new types.rdb format is not compatible with LibreOffice < 4.1. Clients
generating extensions containing such files are advised to use appropriate
LibreOffice-minimal-version elements.
* For compatibility with old extensions, reading the legacy types.rdb format is
still supported.
* The SDK no longer ships an idl/ sub-directory containing the udkap and offapi
.idl files (as, unlike idlc, unoidl-write does not need them).
odk/config/cfgWin.js had to be adapted to look (somewhat arbitrarily) for an
examples/ sub-directory instead of idl/ when checking for "an sdk folder".
gb_UnoApi_package_idlfiles became unused and has been removed.
* The idlc and regmerge executables have been removed. Module idlc has been
removed except for idlc/test/parser/, which is also used by
CustomTarget_unoidl/unoidl-write_test, and which may eventually be moved into
module unoidl. Module external/ucpp and the corresponding configure options
have also been removed.
Change-Id: I42a0231699b863b5ebe2bee63bc32c8f79278cc1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122363
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'registry')
-rw-r--r-- | registry/Executable_regmerge.mk | 29 | ||||
-rw-r--r-- | registry/Module_registry.mk | 1 | ||||
-rw-r--r-- | registry/StaticLibrary_registry_helper.mk | 1 | ||||
-rw-r--r-- | registry/tools/options.cxx | 144 | ||||
-rw-r--r-- | registry/tools/options.hxx | 57 | ||||
-rw-r--r-- | registry/tools/regmerge.cxx | 183 |
6 files changed, 0 insertions, 415 deletions
diff --git a/registry/Executable_regmerge.mk b/registry/Executable_regmerge.mk deleted file mode 100644 index a55acf885f12..000000000000 --- a/registry/Executable_regmerge.mk +++ /dev/null @@ -1,29 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# - -$(eval $(call gb_Executable_Executable,regmerge)) - -$(eval $(call gb_Executable_use_libraries,regmerge,\ - reg \ - $(if $(filter TRUE,$(DISABLE_DYNLOADING)),store) \ - $(if $(filter TRUE,$(DISABLE_DYNLOADING)),salhelper) \ - sal \ -)) - -$(eval $(call gb_Executable_use_static_libraries,regmerge,\ - registry_helper \ -)) - -$(eval $(call gb_Executable_add_exception_objects,regmerge,\ - registry/tools/regmerge \ -)) - -$(eval $(call gb_Executable_add_default_nativeres,regmerge)) - -# vim:set noet sw=4 ts=4: diff --git a/registry/Module_registry.mk b/registry/Module_registry.mk index 40f7230bbb73..45c23bd617e3 100644 --- a/registry/Module_registry.mk +++ b/registry/Module_registry.mk @@ -12,7 +12,6 @@ $(eval $(call gb_Module_Module,registry)) $(eval $(call gb_Module_add_targets,registry,\ Library_reg \ $(call gb_CondExeRegistryTools, \ - Executable_regmerge \ Executable_regview \ StaticLibrary_registry_helper \ ) \ diff --git a/registry/StaticLibrary_registry_helper.mk b/registry/StaticLibrary_registry_helper.mk index a0c11428ef0f..cffd7a22da16 100644 --- a/registry/StaticLibrary_registry_helper.mk +++ b/registry/StaticLibrary_registry_helper.mk @@ -12,7 +12,6 @@ $(eval $(call gb_StaticLibrary_StaticLibrary,registry_helper)) $(eval $(call gb_StaticLibrary_add_exception_objects,registry_helper,\ registry/tools/fileurl \ - registry/tools/options \ )) # vim: set noet sw=4 ts=4: diff --git a/registry/tools/options.cxx b/registry/tools/options.cxx deleted file mode 100644 index 0212c94e9f55..000000000000 --- a/registry/tools/options.cxx +++ /dev/null @@ -1,144 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "options.hxx" - -#include <osl/diagnose.h> - -#include <stdio.h> - -namespace registry::tools -{ - -Options::Options (char const * program) - : m_program (program) -{} - -Options::~Options() -{} - -// static -bool Options::checkArgument(std::vector< std::string> & rArgs, char const * arg, size_t len) -{ - bool result = ((arg != nullptr) && (len > 0)); - OSL_PRECOND(result, "registry::tools::Options::checkArgument(): invalid arguments"); - if (!result) - return false; - - switch (arg[0]) - { - case '@': - result = len > 1; - if (result) - { - // "@<cmdfile>" - result = Options::checkCommandFile(rArgs, &(arg[1])); - } - break; - case '-': - result = len > 1; - if (result) - { - // "-<option>" - std::string option (&(arg[0]), 2); - rArgs.push_back(option); - if (len > 2) - { - // "-<option><param>" - std::string param(&(arg[2]), len - 2); - rArgs.push_back(param); - } - } - break; - default: - rArgs.push_back(std::string(arg, len)); - break; - } - return result; -} - -// static -bool Options::checkCommandFile(std::vector< std::string > & rArgs, char const * filename) -{ - FILE * fp = fopen(filename, "r"); - if (fp == nullptr) - { - fprintf(stderr, "ERROR: Can't open command file \"%s\"\n", filename); - return false; - } - - std::string buffer; - buffer.reserve(256); - - bool quoted = false; - int c = EOF; - while ((c = fgetc(fp)) != EOF) - { - switch(c) - { - case '\"': - quoted = !quoted; - break; - case ' ': - case '\t': - case '\r': - case '\n': - if (!quoted) - { - if (!buffer.empty()) - { - if (!checkArgument(rArgs, buffer.c_str(), buffer.size())) - { - // failure. - (void) fclose(fp); - return false; - } - buffer.clear(); - } - break; - } - [[fallthrough]]; - default: - buffer.push_back(sal::static_int_cast<char>(c)); - break; - } - } - return fclose(fp) == 0; -} - -bool Options::initOptions (std::vector< std::string > & rArgs) -{ - return initOptions_Impl (rArgs); -} - -bool Options::badOption (char const * reason, char const * option) const -{ - (void) fprintf(stderr, "%s: %s option '%s'\n", m_program.c_str(), reason, option); - return printUsage(); -} - -bool Options::printUsage() const -{ - printUsage_Impl(); - return false; -} - -} // namespace registry::tools - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/registry/tools/options.hxx b/registry/tools/options.hxx deleted file mode 100644 index 6813d21fc930..000000000000 --- a/registry/tools/options.hxx +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_REGISTRY_TOOLS_OPTIONS_HXX -#define INCLUDED_REGISTRY_TOOLS_OPTIONS_HXX - -#include <string> -#include <vector> - -namespace registry::tools -{ -class Options -{ - std::string m_program; - - Options (Options const &) = delete; - Options & operator= (Options const &) = delete; - -public: - explicit Options (char const * program); - virtual ~Options(); - - static bool checkArgument (std::vector< std::string > & rArgs, char const * arg, size_t len); - - bool initOptions (std::vector< std::string > & rArgs); - bool badOption (char const * reason, char const * option) const; - - bool printUsage() const; - -protected: - static bool checkCommandFile(std::vector< std::string > & rArgs, char const * filename); - - virtual bool initOptions_Impl(std::vector< std::string > & rArgs) = 0; - virtual void printUsage_Impl() const = 0; -}; - -} // namespace registry::tools - -#endif /* INCLUDED_REGISTRY_TOOLS_OPTIONS_HXX */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/registry/tools/regmerge.cxx b/registry/tools/regmerge.cxx deleted file mode 100644 index 409773a7017d..000000000000 --- a/registry/tools/regmerge.cxx +++ /dev/null @@ -1,183 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - - -#include <registry/registry.hxx> -#include "fileurl.hxx" -#include "options.hxx" - -#include <rtl/ustring.hxx> -#include <sal/log.hxx> - -#include <stdio.h> -#include <string.h> - -using namespace registry::tools; - -namespace { - -class Options_Impl : public Options -{ - bool m_bVerbose; - -public: - explicit Options_Impl (char const * program) - : Options(program), m_bVerbose(false) - {} - bool isVerbose() const { return m_bVerbose; } - -protected: - virtual void printUsage_Impl() const override; - virtual bool initOptions_Impl(std::vector< std::string > & rArgs) override; -}; - -} - -void Options_Impl::printUsage_Impl() const -{ - fprintf(stderr, "using: regmerge [-v|--verbose] mergefile mergeKeyName regfile_1 ... regfile_n\n"); - fprintf(stderr, " regmerge @regcmds\nOptions:\n"); - fprintf(stderr, " -v, --verbose : verbose output on stdout.\n"); - fprintf(stderr, " mergefile : specifies the merged registry file. If this file doesn't exists,\n"); - fprintf(stderr, " it is created.\n"); - fprintf(stderr, " mergeKeyName : specifies the merge key, everything is merged under this key.\n"); - fprintf(stderr, " If this key doesn't exists, it is created.\n"); - fprintf(stderr, " regfile_1..n : specifies one or more registry files which are merged.\n"); -} - -bool Options_Impl::initOptions_Impl (std::vector< std::string > & rArgs) -{ - std::vector< std::string >::iterator first = rArgs.begin(), last = rArgs.end(); - if ((first != last) && ((*first)[0] == '-')) - { - std::string option(*first); - if ((option.compare("-v") == 0) || (option.compare("--verbose") == 0)) - { - m_bVerbose = true; - } - else if ((option.compare("-h") == 0) || (option.compare("-?") == 0)) - { - return printUsage(); - } - else - { - return badOption("unknown", option.c_str()); - } - (void) rArgs.erase(first); - } - return true; -} - -#if (defined UNX) -int main( int argc, char * argv[] ) -#else -int __cdecl main( int argc, char * argv[] ) -#endif -{ - try - { - Options_Impl options(argv[0]); - - std::vector< std::string > args; - for (int i = 1; i < argc; i++) - { - if (!Options::checkArgument(args, argv[i], strlen(argv[i]))) - { - options.printUsage(); - return 1; - } - } - if (!options.initOptions(args)) - { - return 1; - } - if (args.size() < 3) - { - options.printUsage(); - return 1; - } - - Registry reg; - OUString regName( convertToFileUrl(args[0].c_str(), args[0].size()) ); - if (reg.open(regName, RegAccessMode::READWRITE) != RegError::NO_ERROR) - { - if (reg.create(regName) != RegError::NO_ERROR) - { - if (options.isVerbose()) - fprintf(stderr, "open registry \"%s\" failed\n", args[0].c_str()); - return -1; - } - } - - RegistryKey rootKey; - if (reg.openRootKey(rootKey) != RegError::NO_ERROR) - { - if (options.isVerbose()) - fprintf(stderr, "open root key of registry \"%s\" failed\n", args[0].c_str()); - return -4; - } - - OUString mergeKeyName( OUString::createFromAscii(args[1].c_str()) ); - for (size_t i = 2; i < args.size(); i++) - { - OUString targetRegName( convertToFileUrl(args[i].c_str(), args[i].size()) ); - RegError _ret = reg.mergeKey(rootKey, mergeKeyName, targetRegName, options.isVerbose()); - if (_ret != RegError::NO_ERROR) - { - if (_ret == RegError::MERGE_CONFLICT) - { - if (options.isVerbose()) - fprintf(stderr, "merging registry \"%s\" under key \"%s\" in registry \"%s\".\n", - args[i].c_str(), args[1].c_str(), args[0].c_str()); - } - else - { - if (options.isVerbose()) - fprintf(stderr, "ERROR: merging registry \"%s\" under key \"%s\" in registry \"%s\" failed.\n", - args[i].c_str(), args[1].c_str(), args[0].c_str()); - return -2; - } - } - else - { - if (options.isVerbose()) - fprintf(stderr, "merging registry \"%s\" under key \"%s\" in registry \"%s\".\n", - args[i].c_str(), args[1].c_str(), args[0].c_str()); - } - } - - rootKey.releaseKey(); - if (reg.close() != RegError::NO_ERROR) - { - if (options.isVerbose()) - fprintf(stderr, "closing registry \"%s\" failed\n", args[0].c_str()); - return -5; - } - } - catch (const std::exception &e) - { - SAL_WARN("registry", "Fatal exception: " << e.what()); - return -5; - } - - - return 0; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |