1 % Copyright 2006 Konstantin Korikov <lostclus@ua.fm>
3 % This work may be distributed and/or modified under the
4 % conditions of the LaTeX Project Public License, either version 1.3
5 % of this license or (at your option) any later version.
6 % The latest version of this license is in
7 % http://www.latex-project.org/lppl.txt
8 % and version 1.3 or later is part of all distributions of LaTeX
9 % version 2003/12/01 or later.
11 % This work has the LPPL maintenance status "maintained".
13 % This Current Maintainer of this work is Konstantin Korikov.
15 % This work consists of all files listed in manifest.txt.
19 \NeedsTeXFormat{LaTeX2e
}
20 \ProvidesPackage{eskdhash
}[m4_dnl
21 m4_FILE_ID(
[[$Date:: $
]]) Hash Routines
]
23 \newcommand{\ESKD@hash@new
}[1]{%
24 \global\expandafter\newcount\csname ESKD@hash@c@
#1\endcsname
25 \global\csname ESKD@hash@c@
#1\endcsname =
0
26 \global\expandafter\newcount\csname ESKD@hash@p@
#1\endcsname
27 \global\csname ESKD@hash@p@
#1\endcsname =
0\relax}
29 \newcommand{\ESKD@hash@set
}[3]{%
30 \expandafter\ifx\csname ESKD@hash@v@
#1@
#2\endcsname\relax
31 \expandafter\gdef\csname ESKD@hash@k@
#1@
\expandafter\number\csname
32 ESKD@hash@c@
#1\endcsname\endcsname{#2}
33 \expandafter\advance\csname ESKD@hash@c@
#1\endcsname 1
35 \expandafter\gdef\csname ESKD@hash@v@
#1@
#2\endcsname{#3}}
37 \newcommand{\ESKD@hash@get
}[2]{%
38 \csname ESKD@hash@v@
#1@
#2\endcsname}
40 \newcommand{\ESKD@hash@reset
}[1]{%
41 \csname ESKD@hash@p@
#1\endcsname =
0\relax}
43 \newcommand{\ESKD@hash@next@key
}[1]{%
44 \csname ESKD@hash@k@
#1@
\expandafter\number\csname
45 ESKD@hash@p@
#1\endcsname\endcsname
46 \expandafter\advance\csname ESKD@hash@p@
#1\endcsname 1\relax}
48 \newcommand{\ESKD@hash@next@value
}[1]{%
49 \csname ESKD@hash@v@
#1@
\csname ESKD@hash@k@
#1@
\expandafter\number\csname
50 ESKD@hash@p@
#1\endcsname\endcsname\endcsname
51 \expandafter\advance\csname ESKD@hash@p@
#1\endcsname 1\relax}
53 \newcommand{\ESKD@hash@count
}[1]{%
54 \expandafter\number\csname ESKD@hash@c@
#1\endcsname}
56 \newcommand{\ESKD@hash@pos
}[1]{%
57 \expandafter\number\csname ESKD@hash@p@
#1\endcsname}
59 m4_dnl vim:ft=tex:sw=
2:ai