/*
 * -- $Header: /cec/src/nestor/servers/R3/shXlib/XCopyCmap.c,v 1.1.1.1 90/04/23 09:54:13 spanachi Exp $
 */

#include "copyright.h"

/* $XConsortium: XCopyCmap.c,v 11.6 88/09/06 16:05:22 jim Exp $ */
/* Copyright    Massachusetts Institute of Technology    1986	*/

/* -- MULTIPLEX Extension -- */

#include "Xlibint.h"

/* -- additional includes -- */
#include "resources.h"

Colormap XCopyColormapAndFree(dpy, src_cmap)
register Display *dpy;
Colormap src_cmap;
{
    Colormap mid;
    register xCopyColormapAndFreeReq *req;

    LockDisplay(dpy);
    GetReq(CopyColormapAndFree, req);

    mid = req->mid = XAllocID(dpy);
    req->srcCmap = src_cmap;
    /*
     * -- Change the colormap info if necessary 
     */
    if( XmuXStoreResources( dpy ) )
	XmuXCopyColormap( dpy , src_cmap , mid ) ;

    UnlockDisplay(dpy);
    SyncHandle();
    return(mid);
}
