]> git.sesse.net Git - rdpsrv/blob - Xserver/lib/Xdmcp/Alloc.c
Support RDP5 logon packets.
[rdpsrv] / Xserver / lib / Xdmcp / Alloc.c
1 /*
2  * $XConsortium: Alloc.c,v 1.2 94/04/17 20:16:29 keith Exp $
3  * $XFree86: xc/lib/Xdmcp/Alloc.c,v 3.0 1995/07/07 15:32:19 dawes Exp $
4  *
5  * 
6 Copyright (c) 1989  X Consortium
7
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
14
15 The above copyright notice and this permission notice shall be included in
16 all copies or substantial portions of the Software.
17
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
21 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
25 Except as contained in this notice, the name of the X Consortium shall not be
26 used in advertising or otherwise to promote the sale, use or other dealings
27 in this Software without prior written authorization from the X Consortium.
28  * *
29  * Author:  Keith Packard, MIT X Consortium
30  */
31
32 /* stubs for use when Xalloc, Xrealloc and Xfree are not defined */
33
34 extern char     *malloc (), *realloc ();
35
36 unsigned long *
37 Xalloc (amount)
38     unsigned    amount;
39 {
40     if (amount == 0)
41         amount = 1;
42     return (unsigned long *) malloc (amount);
43 }
44
45 unsigned long *
46 Xrealloc (old, amount)
47     unsigned long       *old;
48     unsigned            amount;
49 {
50     if (amount == 0)
51         amount = 1;
52     if (!old)
53         return (unsigned long *) malloc (amount);
54     return (unsigned long *) realloc ((char *) old, amount);
55 }
56
57 void
58 Xfree (old)
59     unsigned long    *old;
60 {
61     if (old)
62         free ((char *) old);
63 }