~ubuntu-branches/ubuntu/precise/xorg-server/precise-updates

« back to all changes in this revision

Viewing changes to Xext/xf86bigfont.c

Tags: 2:1.10.1-2
* Build xserver-xorg-core-udeb on hurd-i386.  Thanks, Samuel Thibault!
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
#ifdef SVR4
51
51
#include <sys/sysmacros.h>
52
52
#endif
53
 
#if defined(__CYGWIN__) || defined(__SCO__)
 
53
#if defined(__CYGWIN__) 
54
54
#include <sys/param.h>
55
55
#include <sys/sysmacros.h>
56
56
#endif
80
80
    ExtensionEntry *    /* extEntry */
81
81
    );
82
82
 
83
 
static DISPATCH_PROC(ProcXF86BigfontDispatch);
84
 
static DISPATCH_PROC(ProcXF86BigfontQueryVersion);
85
 
static DISPATCH_PROC(ProcXF86BigfontQueryFont);
86
 
static DISPATCH_PROC(SProcXF86BigfontDispatch);
87
 
static DISPATCH_PROC(SProcXF86BigfontQueryVersion);
88
 
static DISPATCH_PROC(SProcXF86BigfontQueryFont);
89
83
 
90
84
#ifdef HAS_SHM
91
85
 
143
137
 
144
138
#endif
145
139
 
146
 
void
147
 
XFree86BigfontExtensionInit(void)
148
 
{
149
 
    if (AddExtension(XF86BIGFONTNAME,
150
 
                     XF86BigfontNumberEvents,
151
 
                     XF86BigfontNumberErrors,
152
 
                     ProcXF86BigfontDispatch,
153
 
                     SProcXF86BigfontDispatch,
154
 
                     XF86BigfontResetProc,
155
 
                     StandardMinorOpcode)) {
156
 
#ifdef HAS_SHM
157
 
#ifdef MUST_CHECK_FOR_SHM_SYSCALL
158
 
        /*
159
 
         * Note: Local-clients will not be optimized without shared memory
160
 
         * support. Remote-client optimization does not depend on shared
161
 
         * memory support.  Thus, the extension is still registered even
162
 
         * when shared memory support is not functional.  
163
 
         */
164
 
        if (!CheckForShmSyscall()) {
165
 
            ErrorF(XF86BIGFONTNAME " extension local-client optimization disabled due to lack of shared memory support in the kernel\n");
166
 
            return;
167
 
        }
168
 
#endif
169
 
 
170
 
        srand((unsigned int) time(NULL));
171
 
        signature = ((unsigned int) (65536.0/(RAND_MAX+1.0) * rand()) << 16)
172
 
                   + (unsigned int) (65536.0/(RAND_MAX+1.0) * rand());
173
 
        /* fprintf(stderr, "signature = 0x%08X\n", signature); */
174
 
 
175
 
        FontShmdescIndex = AllocateFontPrivateIndex();
176
 
 
177
 
#if !defined(CSRG_BASED) && !defined(__CYGWIN__)
178
 
        pagesize = SHMLBA;
179
 
#else
180
 
# ifdef _SC_PAGESIZE
181
 
        pagesize = sysconf(_SC_PAGESIZE);
182
 
# else
183
 
        pagesize = getpagesize();
184
 
# endif
185
 
#endif
186
 
#endif
187
 
    }
188
 
}
189
 
 
190
 
 
191
140
/* ========== Management of shared memory segments ========== */
192
141
 
193
142
#ifdef HAS_SHM
755
704
            return BadRequest;
756
705
    }
757
706
}
 
707
 
 
708
void
 
709
XFree86BigfontExtensionInit(void)
 
710
{
 
711
    if (AddExtension(XF86BIGFONTNAME,
 
712
                     XF86BigfontNumberEvents,
 
713
                     XF86BigfontNumberErrors,
 
714
                     ProcXF86BigfontDispatch,
 
715
                     SProcXF86BigfontDispatch,
 
716
                     XF86BigfontResetProc,
 
717
                     StandardMinorOpcode)) {
 
718
#ifdef HAS_SHM
 
719
#ifdef MUST_CHECK_FOR_SHM_SYSCALL
 
720
        /*
 
721
         * Note: Local-clients will not be optimized without shared memory
 
722
         * support. Remote-client optimization does not depend on shared
 
723
         * memory support.  Thus, the extension is still registered even
 
724
         * when shared memory support is not functional.
 
725
         */
 
726
        if (!CheckForShmSyscall()) {
 
727
            ErrorF(XF86BIGFONTNAME " extension local-client optimization disabled due to lack of shared memory support in the kernel\n");
 
728
            return;
 
729
        }
 
730
#endif
 
731
 
 
732
        srand((unsigned int) time(NULL));
 
733
        signature = ((unsigned int) (65536.0/(RAND_MAX+1.0) * rand()) << 16)
 
734
                   + (unsigned int) (65536.0/(RAND_MAX+1.0) * rand());
 
735
        /* fprintf(stderr, "signature = 0x%08X\n", signature); */
 
736
 
 
737
        FontShmdescIndex = AllocateFontPrivateIndex();
 
738
 
 
739
#if !defined(CSRG_BASED) && !defined(__CYGWIN__)
 
740
        pagesize = SHMLBA;
 
741
#else
 
742
# ifdef _SC_PAGESIZE
 
743
        pagesize = sysconf(_SC_PAGESIZE);
 
744
# else
 
745
        pagesize = getpagesize();
 
746
# endif
 
747
#endif
 
748
#endif
 
749
    }
 
750
}