open-src/app/cmap_compact/sun-src/cmcdealloc.c
author X gate hg captive account <xhg@xserver.us.oracle.com>
Wed, 19 Aug 2015 13:48:41 -0700
changeset 1484 bc8922b8e1d2
parent 943 294f64612d23
permissions -rw-r--r--
Added tag s11u3_30 for changeset 221e9d9cc9cb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
550
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
     1
/*
943
294f64612d23 6948254 Mass update of X gate sources to Oracle copyright format
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents: 919
diff changeset
     2
* Copyright (c) 1990, Oracle and/or its affiliates. All rights reserved.
550
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
     3
*
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
     4
* Permission is hereby granted, free of charge, to any person obtaining a
919
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
     5
* copy of this software and associated documentation files (the "Software"),
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
     6
* to deal in the Software without restriction, including without limitation
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
     7
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
     8
* and/or sell copies of the Software, and to permit persons to whom the
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
     9
* Software is furnished to do so, subject to the following conditions:
550
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    10
*
919
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    11
* The above copyright notice and this permission notice (including the next
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    12
* paragraph) shall be included in all copies or substantial portions of the
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    13
* Software.
550
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    14
*
919
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    15
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    16
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    17
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    18
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    19
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    20
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
425233ae7236 6931307 Standardize Sun copyright & license notices in X gate on current format
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents: 907
diff changeset
    21
* DEALINGS IN THE SOFTWARE.
550
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    22
*
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    23
*/
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    24
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    25
#include <X11/Xlib.h>
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    26
#include "cmc.h"
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    27
#include "cmcutil.h"
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    28
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    29
/*
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    30
** Deallocates the colors allocated by a previous cmc client.
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    31
*/
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    32
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    33
void
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    34
cmc_dealloc ()
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    35
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    36
{
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    37
	Display		*dpy;
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    38
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    39
	/* Open display */
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    40
	if (!(dpy = open_display(display_name))) 
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    41
		fatal_error("cannot open display '%s'\n", display_name);
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    42
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    43
	resource_discard(dpy);
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    44
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    45
	XCloseDisplay(dpy);
3b62053c3b77 6730028 Moving /usr/openwin/lib/mkcookie to /usr/X11/lib
Sam Lau <Sam.Lau@Sun.COM>
parents:
diff changeset
    46
}