diff options
author | Daniel Sikeler <d.sikeler94@gmail.com> | 2014-11-03 11:29:48 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2014-11-11 09:36:52 +0000 |
commit | 2b442c1df48fce7a265e983a902f4a30e3edabf1 (patch) | |
tree | 85e445625c4b6bae93cd188e3539ddd6ea713db6 /editeng/CustomTarget_generated.mk | |
parent | b91d4776b6ef6f0479b6109cba4460140fe6ada2 (diff) |
fdo#80403: TokenHandler impl. FastTokenHandlerBase
getTokenFromUTF8: calls getTokenDirect
getTokenDirect: uses perfect hash
New makefile creates perfect hash table with perl-script gentoken.pl.
I found the script on https://wiki.openoffice.org/wiki/XFastTokenHandler and made some changes.
XMLTokens are defined in tokens.txt
Change-Id: Id04134a896ee082e2d0ba55a715fede19ff04928
Reviewed-on: https://gerrit.libreoffice.org/12335
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'editeng/CustomTarget_generated.mk')
-rw-r--r-- | editeng/CustomTarget_generated.mk | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/editeng/CustomTarget_generated.mk b/editeng/CustomTarget_generated.mk new file mode 100644 index 000000000000..f3329df5b79b --- /dev/null +++ b/editeng/CustomTarget_generated.mk @@ -0,0 +1,27 @@ +# -*- 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_CustomTarget_CustomTarget,editeng/generated)) + +SRC := $(SRCDIR)/editeng/source/misc +PL := $(SRCDIR)/solenv/bin/gentoken.pl +INC := $(call gb_CustomTarget_get_workdir,editeng/generated) + +$(INC)/tokens.hxx $(INC)/tokens.gperf : $(SRC)/tokens.txt $(PL) + mkdir -p $(INC) + $(PERL) $(PL) $(SRC)/tokens.txt $(INC)/tokens.gperf + +$(INC)/tokens.cxx : $(INC)/tokens.gperf + $(GPERF) --compare-strncmp --readonly-tables --output-file=$(INC)/tokens.cxx $(INC)/tokens.gperf + sed -i -e "s/(char\*)0/(char\*)0, XML_TOKEN_INVALID/g" $(INC)/tokens.cxx + sed -i -e "/^#line/d" $(INC)/tokens.cxx + +$(call gb_CustomTarget_get_target,editeng/generated) : $(INC)/tokens.cxx + +# vim: set noet sw=4 ts=4: |