~ubuntu-branches/ubuntu/saucy/luatex/saucy

« back to all changes in this revision

Viewing changes to source/texk/web2c/luatexdir/managed-sa.h

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2009-12-25 09:47:05 UTC
  • mfrom: (1.1.9 upstream) (4.2.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091225094705-y33rpflo8t4u9nag
Tags: 0.50.0-1
* new upstream release
* disable fix-hurd-ftbfs patch, included upstream
* disable upstram-fixes, included upstream
* disable ubuntu_libpoppler-0.11, not needed anymore

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* managed-sa.h
2
 
   
3
 
   Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
4
 
 
5
 
   This file is part of LuaTeX.
6
 
 
7
 
   LuaTeX is free software; you can redistribute it and/or modify it under
8
 
   the terms of the GNU General Public License as published by the Free
9
 
   Software Foundation; either version 2 of the License, or (at your
10
 
   option) any later version.
11
 
 
12
 
   LuaTeX is distributed in the hope that it will be useful, but WITHOUT
13
 
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
 
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
15
 
   License for more details.
16
 
 
17
 
   You should have received a copy of the GNU General Public License along
18
 
   with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
19
 
 
20
 
/* $Id: managed-sa.h 2271 2009-04-12 23:42:21Z oneiros $ */
21
 
 
22
 
#ifndef MANAGED_SA_H
23
 
#  define MANAGED_SA_H 1
24
 
 
25
 
/* the next two sets of three had better match up exactly, but using bare numbers
26
 
  is easier on the C compiler */
27
 
 
28
 
#  define HIGHPART 128
29
 
#  define MIDPART 128
30
 
#  define LOWPART 128
31
 
 
32
 
#  define HIGHPART_PART(a) (((a)>>14)&127)
33
 
#  define MIDPART_PART(a)  (((a)>>7)&127)
34
 
#  define LOWPART_PART(a)  ((a)&127)
35
 
 
36
 
#  define Mxmalloc_array(a,b)  xmalloc((b)*sizeof(a))
37
 
#  define Mxrealloc_array(a,b,c)  xrealloc((a),(c)*sizeof(b))
38
 
#  define Mxfree(a) free(a); a=NULL
39
 
 
40
 
typedef unsigned int sa_tree_item;
41
 
 
42
 
typedef struct {
43
 
    int code;
44
 
    int level;
45
 
    sa_tree_item value;
46
 
} sa_stack_item;
47
 
 
48
 
 
49
 
typedef struct {
50
 
    int stack_size;             /* initial stack size   */
51
 
    int stack_step;             /* increment stack step */
52
 
    int stack_ptr;              /* current stack point  */
53
 
    int dflt;                   /* default item value   */
54
 
    sa_tree_item ***tree;       /* item tree head       */
55
 
    sa_stack_item *stack;       /* stack tree head      */
56
 
} sa_tree_head;
57
 
 
58
 
typedef sa_tree_head *sa_tree;
59
 
 
60
 
extern sa_tree_item get_sa_item(const sa_tree head, const integer n);
61
 
extern void set_sa_item(sa_tree head, integer n, sa_tree_item v, integer gl);
62
 
 
63
 
extern sa_tree new_sa_tree(integer size, sa_tree_item dflt);
64
 
 
65
 
extern sa_tree copy_sa_tree(sa_tree head);
66
 
extern void destroy_sa_tree(sa_tree head);
67
 
 
68
 
extern void dump_sa_tree(sa_tree a);
69
 
extern sa_tree undump_sa_tree(void);
70
 
 
71
 
extern void restore_sa_stack(sa_tree a, integer gl);
72
 
extern void clear_sa_stack(sa_tree a);
73
 
 
74
 
#endif