~ubuntu-branches/debian/squeeze/nas/squeeze

« back to all changes in this revision

Viewing changes to server/include/misc.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve McIntyre
  • Date: 2008-10-08 01:18:19 UTC
  • mfrom: (4.1.7 intrepid)
  • Revision ID: james.westby@ubuntu.com-20081008011819-wmr4h2w0298k8t7z
Tags: 1.9.1-5
* Fix pending l10n issues. Debconf translations:
* Swedish. Closes: #491766 (thanks to brother@bsnet.se)
* Arabic. Closes: #500437 (thanks to Ossama Khayat)
* Basque. Closes: #500533 (thanks to Piarres Beobide)
* Brazilian Portuguese. Closes: #500973 (thanks to Felipe
  Augusto van de Wiel)
* Many thanks again to Christian Perrier for his i18n efforts,
  co-ordinating the above.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 */
31
31
 
32
32
 
33
 
extern unsigned long globalSerialNumber;
34
33
extern unsigned long serverGeneration;
35
34
 
36
35
#include <X11/Xosdefs.h>
43
42
#endif
44
43
#endif
45
44
 
46
 
#define MAXSCREENS      3
47
 
#define MAXCLIENTS      128
48
 
#define MAXFORMATS      8
49
 
#define MAXVISUALS_PER_SCREEN 50
 
45
#define MAXSCREENS      3
 
46
#define MAXCLIENTS      128
 
47
#define MAXFORMATS      8
50
48
 
51
49
typedef unsigned char *pointer;
52
50
typedef int Bool;
53
 
typedef unsigned long PIXEL;
54
 
typedef unsigned long ATOM;
55
51
 
56
52
 
57
53
#ifndef TRUE
58
54
#define TRUE 1
59
55
#define FALSE 0
60
56
#endif
61
 
#include "os.h"         /* for ALLOCATE_LOCAL and DEALLOCATE_LOCAL */
62
 
#include <X11/Xfuncs.h> /* for bcopy, bzero, and bcmp */
 
57
#include "os.h"                 /* for ALLOCATE_LOCAL and DEALLOCATE_LOCAL */
 
58
#include <X11/Xfuncs.h>         /* for bcopy, bzero, and bcmp */
63
59
 
64
 
#define NullBox ((BoxPtr)0)
65
 
#define MILLI_PER_MIN (1000 * 60)
66
60
#define MILLI_PER_SECOND (1000)
67
61
 
68
 
    /* this next is used with None and ParentRelative to tell
69
 
       PaintWin() what to use to paint the background. Also used
70
 
       in the macro IS_VALID_PIXMAP */
71
 
 
72
 
#define USE_BACKGROUND_PIXEL 3
73
 
#define USE_BORDER_PIXEL 3
74
 
 
75
62
 
76
63
/* byte swap a long literal */
77
64
#define lswapl(x) ((((x) & 0xff) << 24) |\
78
 
                   (((x) & 0xff00) << 8) |\
79
 
                   (((x) & 0xff0000) >> 8) |\
80
 
                   (((x) >> 24) & 0xff))
 
65
                   (((x) & 0xff00) << 8) |\
 
66
                   (((x) & 0xff0000) >> 8) |\
 
67
                   (((x) >> 24) & 0xff))
81
68
 
82
69
/* byte swap a short literal */
83
70
#define lswaps(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff))
88
75
#define abs(a) ((a) > 0 ? (a) : -(a))
89
76
#endif
90
77
#ifndef fabs
91
 
#define fabs(a) ((a) > 0.0 ? (a) : -(a))        /* floating absolute value */
 
78
#define fabs(a) ((a) > 0.0 ? (a) : -(a))        /* floating absolute value */
92
79
#endif
93
80
#define sign(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0))
94
81
/* this assumes b > 0 */
103
90
#define lowbit(x) ((x) & (~(x) + 1))
104
91
 
105
92
#define MAXSHORT 32767
106
 
#define MINSHORT -MAXSHORT 
 
93
#define MINSHORT -MAXSHORT
107
94
 
108
95
 
109
96
/* some macros to help swap requests, replies, and events */
125
112
 
126
113
/* byte swap a long */
127
114
#define swapl(x, n) n = ((char *) (x))[0];\
128
 
                 ((char *) (x))[0] = ((char *) (x))[3];\
129
 
                 ((char *) (x))[3] = n;\
130
 
                 n = ((char *) (x))[1];\
131
 
                 ((char *) (x))[1] = ((char *) (x))[2];\
132
 
                 ((char *) (x))[2] = n;
 
115
                 ((char *) (x))[0] = ((char *) (x))[3];\
 
116
                 ((char *) (x))[3] = n;\
 
117
                 n = ((char *) (x))[1];\
 
118
                 ((char *) (x))[1] = ((char *) (x))[2];\
 
119
                 ((char *) (x))[2] = n;
133
120
 
134
121
/* byte swap a short */
135
122
#define swaps(x, n) n = ((char *) (x))[0];\
136
 
                 ((char *) (x))[0] = ((char *) (x))[1];\
137
 
                 ((char *) (x))[1] = n
 
123
                 ((char *) (x))[0] = ((char *) (x))[1];\
 
124
                 ((char *) (x))[1] = n
138
125
 
139
126
/* copy long from src to dst byteswapping on the way */
140
127
#define cpswapl(src, dst) \
145
132
 
146
133
/* copy short from src to dst byteswapping on the way */
147
134
#define cpswaps(src, dst)\
148
 
                 ((char *) &(dst))[0] = ((char *) &(src))[1];\
149
 
                 ((char *) &(dst))[1] = ((char *) &(src))[0];
 
135
                 ((char *) &(dst))[0] = ((char *) &(src))[1];\
 
136
                 ((char *) &(dst))[1] = ((char *) &(src))[0];
150
137
 
151
138
extern void SwapLongs();
152
139
extern void SwapShorts();
153
140
 
154
 
typedef struct _DDXPoint *DDXPointPtr;
155
 
typedef struct _Box *BoxPtr;
156
 
 
157
141
#endif /* MISC_H */