nsChardetModule.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "mozilla/ModuleUtils.h"
  6. #include "nsCharDetConstructors.h"
  7. NS_DEFINE_NAMED_CID(NS_RU_PROBDETECTOR_CID);
  8. NS_DEFINE_NAMED_CID(NS_UK_PROBDETECTOR_CID);
  9. NS_DEFINE_NAMED_CID(NS_RU_STRING_PROBDETECTOR_CID);
  10. NS_DEFINE_NAMED_CID(NS_UK_STRING_PROBDETECTOR_CID);
  11. static const mozilla::Module::CIDEntry kChardetCIDs[] = {
  12. { &kNS_RU_PROBDETECTOR_CID, false, nullptr, nsRUProbDetectorConstructor },
  13. { &kNS_UK_PROBDETECTOR_CID, false, nullptr, nsUKProbDetectorConstructor },
  14. { &kNS_RU_STRING_PROBDETECTOR_CID, false, nullptr, nsRUStringProbDetectorConstructor },
  15. { &kNS_UK_STRING_PROBDETECTOR_CID, false, nullptr, nsUKStringProbDetectorConstructor },
  16. { nullptr }
  17. };
  18. static const mozilla::Module::ContractIDEntry kChardetContracts[] = {
  19. { NS_CHARSET_DETECTOR_CONTRACTID_BASE "ruprob", &kNS_RU_PROBDETECTOR_CID },
  20. { NS_CHARSET_DETECTOR_CONTRACTID_BASE "ukprob", &kNS_UK_PROBDETECTOR_CID },
  21. { NS_STRCDETECTOR_CONTRACTID_BASE "ruprob", &kNS_RU_STRING_PROBDETECTOR_CID },
  22. { NS_STRCDETECTOR_CONTRACTID_BASE "ukprob", &kNS_UK_STRING_PROBDETECTOR_CID },
  23. { nullptr }
  24. };
  25. static const mozilla::Module::CategoryEntry kChardetCategories[] = {
  26. { NS_CHARSET_DETECTOR_CATEGORY, "off", "off" },
  27. { NS_CHARSET_DETECTOR_CATEGORY, "ruprob", NS_CHARSET_DETECTOR_CONTRACTID_BASE "ruprob" },
  28. { NS_CHARSET_DETECTOR_CATEGORY, "ukprob", NS_CHARSET_DETECTOR_CONTRACTID_BASE "ukprob" },
  29. { nullptr }
  30. };
  31. static const mozilla::Module kChardetModule = {
  32. mozilla::Module::kVersion,
  33. kChardetCIDs,
  34. kChardetContracts,
  35. kChardetCategories
  36. };
  37. NSMODULE_DEFN(nsChardetModule) = &kChardetModule;