diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2015-03-20 07:59:58 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2015-03-20 07:59:58 +0000 |
commit | 1c4d9737a17683a411b60f40cada6490e39d2b2c (patch) | |
tree | cb1682fccccf5d174a925337e76a267ac9a02489 /Build/source/texk/web2c/luatexdir/tex/texnodes.w | |
parent | 49256ac120db7b7f06e54a931701fe8b3d2b4bdb (diff) |
texk/web2c/luatexdir: Sync with luatex beta-0.80.0
git-svn-id: svn://tug.org/texlive/trunk@36570 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/tex/texnodes.w')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/tex/texnodes.w | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/Build/source/texk/web2c/luatexdir/tex/texnodes.w b/Build/source/texk/web2c/luatexdir/tex/texnodes.w index dc1279baa67..04c2c5fee58 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texnodes.w +++ b/Build/source/texk/web2c/luatexdir/tex/texnodes.w @@ -18,9 +18,7 @@ % with LuaTeX; if not, see <http://www.gnu.org/licenses/>. @ @c -static const char _svn_version[] = - "$Id: texnodes.w 5112 2014-12-20 08:21:53Z luigi $" - "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/texnodes.w $"; + #include "ptexlib.h" #include "lua/luatex-api.h" @@ -2199,7 +2197,7 @@ void update_attribute_cache(void) void build_attribute_list(halfword b) { if (max_used_attr >= 0) { - if (attr_list_cache == cache_disabled) { + if (attr_list_cache == cache_disabled|| attr_list_cache == null) { update_attribute_cache(); if (attr_list_cache == null) return; @@ -2213,6 +2211,43 @@ void build_attribute_list(halfword b) } } + +@ @c +halfword current_attribute_list(void) +{ + if (max_used_attr >= 0) { + if (attr_list_cache == cache_disabled) { + update_attribute_cache(); + } + return attr_list_cache ; + } + return null ; +} + + +@ @c +void reassign_attribute(halfword n, halfword new) +{ + halfword old; + old = node_attr(n); + if (new == null) { + /* there is nothing to assign but we need to check for an old value */ + if (old != null) + delete_attribute_ref(old); /* also nulls attr field of n */ + } else if (old == null) { + /* nothing is assigned so we just do that now */ + assign_attribute_ref(n,new); + } else if (old != new) { + /* something is assigned so we need to clean up and assign then */ + delete_attribute_ref(old); + assign_attribute_ref(n,new); + } + /* else: same value so there is no need to assign and change the refcount */ + node_attr(n) = new ; +} + + + @ @c void delete_attribute_ref(halfword b) { |