/*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
#include <stdio.h>
#include "cmcutil.h"
#include "cmc.h"
/*
** Common utility routines shared by the Workspace Colors programs
** cmcsave, cmcshow, cmcinit.
*/
/*ARGSUSED*/
static int
{
}
/*
** Open display and handle any errors.
*/
Display *
char *dpyname;
{
/*
** Catch errors opening display so user doesn't
** get confusing 'XIOError: Broken Pipe' message.
*/
return NULL;
return dpy;
}
/*
** Return true if default visual of screen is dynamic.
*/
int
{
class == PseudoColor);
}
/*
** If file name is not already absolute, make absolute
** relative to home directory.
*/
static const char *
{
const char *homedir;
if (*relname == '/')
return relname;
homedir = "/";
return filename;
}
const char *
{
if (!basename)
return fn_absolutize(basename);
}
int
FILE *f,
int scr_num,
int ncolors,
{
return 1;
}
/*
** 0 is returned on EOF; 1 otherwise
*/
int
cmc_read (
FILE *f,
int *scr_num,
int *ncolors,
{
return 0;
fatal_error("cannot read number of saved colors");
}
fatal_error("not enough memory");
fatal_error("cannot read saved colors");
}
return 1;
}
void
FILE *f)
{
int value;
/* write magic number and version */
value = CMC_VERSION;
}
void
FILE *f)
{
int value;
/* check magic number */
fatal_error("Unrecognized colors file. Expected magic number = %x, \
/* check version number */
value != CMC_VERSION)
fatal_error("Unrecognized colors file. Expected version number = %x, \
}
void
Window w,
const char *name,
int format,
int data,
int nelem)
{
/* intern the property name */
/* create or replace the property */
}
/*
** Sets the close-down mode of the cmc client to 'RetainPermanent'
** so all client resources will be preserved after the client
** exits. Puts a property on the default root window containing
** an XID of the client so that the resources can later be killed.
*/
void
{
/* create dummy resource */
/* retain all client resources until explicitly killed */
}
/*
** Flushes any resources previously retained by a cmc client,
** if any exist.
*/
void
{
int format;
unsigned long nitems;
unsigned long bytes_after;
/* intern the property name */
/* look for existing resource allocation */
&& nitems == 1) {
/* blast it away */
} else if (actual_type != None) {
extern char *program;
}
}
}