summaryrefslogtreecommitdiff
path: root/dviware/epson/eps-0.2/h/types.h
blob: 1d38f45db9f9eafb6c23d9c8d208a388f8372a93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*
 * Copyright (c) 1987, 1989 University of Maryland
 * Department of Computer Science.  All rights reserved.
 * Permission to copy for any purpose is hereby granted
 * so long as this copyright notice remains intact.
 */

/*
 * MC-TeX types and macros (system dependent).
 * Check to make sure they are correct for your system.
 */

#ifndef _MCTEX_TYPES_
#define _MCTEX_TYPES_

/*
 * Define void as int if your compiler does not support void,
 * or if there are bugs in its support (e.g., 4.1BSD).
 */
/* #define void int */

/*
 * Define the following if and only if vfprintf is in your C library.
 * If not, lib/error.c will make assumptions about the implementation
 * of stdio.  If neither works, you may have to come up with something
 * yourself.
 */
#define HAVE_VPRINTF

/*
 * Define BSD_FILE_SYSTEM if you have the BSD file system `stat'
 * structure (with the st_blksize field).  Otherwise, MakeSeekable()
 * will be slower than necessary.
 */
/* #define BSD_FILE_SYSTEM */

/*
 * Define this as the name of a routine that handles overlapping block
 * copies, if there is such a routine.  Usually it will be called memmove()
 * but on 4.3BSD it is called bcopy().  Note that the 4.2BSD bcopy() does
 * not handle overlap, and must not be used here.  If there is no routine,
 * or if its overlap handling is uncertain, leave BLOCK_COPY undefined.
 *
 * (The bcopy provided in lib/bcopy.c does handle overlap.)
 */
#include <strings.h> /* for bcopy */
#define BLOCK_COPY(from, to, len) bcopy(from, to, len)

/*
 * If you have memcpy/memmove, but not bcopy, use the definition below.
 * If you have neither, try the bcopy provided in lib/bcopy.c.
 */
/* #define bcopy(from, to, len) memcpy(to, from, len) */

/*
 * If you have memcmp, but not bcmp, use the definition below.
 * If you have neither, try the bcmp provided in lib/bcmp.c.
 */
/* #define bcmp(s1, s2, len) memcmp(s1, s2, len) */

/* #define bzero(addr, count) memset(addr, 0, count) */

/*
 * Define the following types and macros as required by your system.
 */

typedef short i16;		/* a 16 bit integer (signed) */

typedef long i32;		/* a 32 bit integer (signed) */
typedef unsigned long ui32;	/* a 32 bit integer (unsigned) */

/* macros to sign extend quantities that are less than 32 bits long */

/* these compilers mishandle (int)(char)(constant), but a subterfuge works */
#if defined(sun) || defined(hp300)
#define Sign8(n)	((i32)(char)(int)(n))
#endif

/* these have signed characters and (int)(char)(constant) works */
#if defined(vax) || defined(mips)
#define	Sign8(n)	((i32)(char)(n))
#endif

/* this works everywhere, but may be slow */
#ifndef	Sign8
#define Sign8(n)	((n) & 0x80 ? ((n) | ~0xff) : (n))
#endif

/* this should work everywhere */
#ifndef Sign16
#define Sign16(n)	((i32)(i16)(n))
#endif

/* this works where int is 32 bits, and >> sign extents and is fast */
#if defined(vax) || defined(mips)
#define	Sign24(n)	(((n) << 8) >> 8)
#endif

/* this works everywhere, but may be slow */
#ifndef	Sign24
#define	Sign24(n)	((n) & 0x800000L ? ((n) | ~0xffffffL) : (n))
#endif

/* macros to truncate quantites that may be signed */
#define UnSign8(n)	((i32)(n) & 0xffL)
#define UnSign16(n)	((i32)(n) & 0xffffL)
#define UnSign24(n)	((i32)(n) & 0xffffffL)

#endif /* _MCTEX_TYPES_ */