2002-01-03 19:58:39 -05:00
|
|
|
/* Metacity X property convenience routines */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2001 Havoc Pennington
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
* 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
#include "xprops.h"
|
|
|
|
#include "errors.h"
|
|
|
|
#include "util.h"
|
|
|
|
#include <X11/Xatom.h>
|
2002-06-22 00:52:35 -04:00
|
|
|
#include <string.h>
|
2002-01-03 19:58:39 -05:00
|
|
|
|
|
|
|
static gboolean
|
|
|
|
check_type_and_format (MetaDisplay *display,
|
|
|
|
Window xwindow,
|
|
|
|
Atom xatom,
|
|
|
|
int expected_format,
|
2002-01-03 22:25:53 -05:00
|
|
|
Atom expected_type,
|
|
|
|
int n_items, /* -1 to not check this */
|
2002-01-03 19:58:39 -05:00
|
|
|
int format,
|
|
|
|
Atom type)
|
|
|
|
{
|
|
|
|
char *type_name;
|
|
|
|
char *expected_name;
|
|
|
|
char *prop_name;
|
|
|
|
|
|
|
|
if (expected_format == format &&
|
2002-01-03 22:25:53 -05:00
|
|
|
expected_type == type &&
|
|
|
|
(n_items < 0 || n_items > 0))
|
|
|
|
return TRUE;
|
2002-01-03 19:58:39 -05:00
|
|
|
|
|
|
|
meta_error_trap_push (display);
|
|
|
|
type_name = XGetAtomName (display->xdisplay, type);
|
|
|
|
expected_name = XGetAtomName (display->xdisplay, expected_type);
|
|
|
|
prop_name = XGetAtomName (display->xdisplay, xatom);
|
2002-10-21 17:44:35 -04:00
|
|
|
meta_error_trap_pop (display, TRUE);
|
2002-01-03 19:58:39 -05:00
|
|
|
|
2002-01-03 22:25:53 -05:00
|
|
|
meta_warning (_("Window 0x%lx has property %s that was expected to have type %s format %d and actually has type %s format %d n_items %d\n"),
|
2002-01-03 19:58:39 -05:00
|
|
|
xwindow,
|
|
|
|
prop_name ? prop_name : "(bad atom)",
|
|
|
|
expected_name ? expected_name : "(bad atom)",
|
|
|
|
expected_format,
|
|
|
|
type_name ? type_name : "(bad atom)",
|
2002-01-03 22:25:53 -05:00
|
|
|
format, n_items);
|
2002-01-03 19:58:39 -05:00
|
|
|
|
|
|
|
if (type_name)
|
|
|
|
XFree (type_name);
|
|
|
|
if (expected_name)
|
|
|
|
XFree (expected_name);
|
|
|
|
if (prop_name)
|
|
|
|
XFree (prop_name);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
meta_prop_get_atom_list (MetaDisplay *display,
|
|
|
|
Window xwindow,
|
|
|
|
Atom xatom,
|
|
|
|
Atom **atoms_p,
|
|
|
|
int *n_atoms_p)
|
|
|
|
{
|
|
|
|
Atom type;
|
|
|
|
int format;
|
|
|
|
gulong n_atoms;
|
|
|
|
gulong bytes_after;
|
|
|
|
Atom *atoms;
|
|
|
|
|
|
|
|
*atoms_p = NULL;
|
|
|
|
*n_atoms_p = 0;
|
|
|
|
|
2002-10-21 17:44:35 -04:00
|
|
|
meta_error_trap_push_with_return (display);
|
2002-01-03 19:58:39 -05:00
|
|
|
if (XGetWindowProperty (display->xdisplay, xwindow, xatom,
|
|
|
|
0, G_MAXLONG,
|
|
|
|
False, XA_ATOM, &type, &format, &n_atoms,
|
2002-01-03 22:25:53 -05:00
|
|
|
&bytes_after, (guchar **)&atoms) != Success ||
|
|
|
|
type == None)
|
2002-01-03 19:58:39 -05:00
|
|
|
{
|
2002-10-21 17:44:35 -04:00
|
|
|
meta_error_trap_pop_with_return (display, TRUE);
|
2002-01-03 19:58:39 -05:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2002-10-21 17:44:35 -04:00
|
|
|
if (meta_error_trap_pop_with_return (display, TRUE) != Success)
|
2002-01-03 19:58:39 -05:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (!check_type_and_format (display, xwindow, xatom, 32, XA_ATOM,
|
2002-01-03 22:25:53 -05:00
|
|
|
-1, format, type))
|
2002-01-03 19:58:39 -05:00
|
|
|
{
|
|
|
|
XFree (atoms);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
*atoms_p = atoms;
|
|
|
|
*n_atoms_p = n_atoms;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
meta_prop_get_cardinal_list (MetaDisplay *display,
|
|
|
|
Window xwindow,
|
|
|
|
Atom xatom,
|
|
|
|
gulong **cardinals_p,
|
|
|
|
int *n_cardinals_p)
|
|
|
|
{
|
|
|
|
Atom type;
|
|
|
|
int format;
|
|
|
|
gulong n_cardinals;
|
|
|
|
gulong bytes_after;
|
|
|
|
gulong *cardinals;
|
|
|
|
|
|
|
|
*cardinals_p = NULL;
|
|
|
|
*n_cardinals_p = 0;
|
|
|
|
|
2002-10-21 17:44:35 -04:00
|
|
|
meta_error_trap_push_with_return (display);
|
2002-01-03 19:58:39 -05:00
|
|
|
if (XGetWindowProperty (display->xdisplay, xwindow, xatom,
|
|
|
|
0, G_MAXLONG,
|
|
|
|
False, XA_CARDINAL, &type, &format, &n_cardinals,
|
2002-01-03 22:25:53 -05:00
|
|
|
&bytes_after, (guchar **)&cardinals) != Success ||
|
|
|
|
type == None)
|
2002-01-03 19:58:39 -05:00
|
|
|
{
|
2002-10-21 17:44:35 -04:00
|
|
|
meta_error_trap_pop_with_return (display, TRUE);
|
2002-01-03 19:58:39 -05:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2002-10-21 17:44:35 -04:00
|
|
|
if (meta_error_trap_pop_with_return (display, TRUE) != Success)
|
2002-01-03 19:58:39 -05:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (!check_type_and_format (display, xwindow, xatom, 32, XA_CARDINAL,
|
2002-01-03 22:25:53 -05:00
|
|
|
-1, format, type))
|
2002-01-03 19:58:39 -05:00
|
|
|
{
|
|
|
|
XFree (cardinals);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
*cardinals_p = cardinals;
|
|
|
|
*n_cardinals_p = n_cardinals;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
meta_prop_get_motif_hints (MetaDisplay *display,
|
|
|
|
Window xwindow,
|
|
|
|
Atom xatom,
|
|
|
|
MotifWmHints **hints_p)
|
|
|
|
{
|
|
|
|
Atom type;
|
|
|
|
int format;
|
|
|
|
gulong bytes_after;
|
|
|
|
MotifWmHints *hints;
|
|
|
|
gulong n_items;
|
2002-08-10 14:12:36 -04:00
|
|
|
int real_size, max_size;
|
2002-01-03 19:58:39 -05:00
|
|
|
|
2002-08-10 14:12:36 -04:00
|
|
|
#define MAX_ITEMS sizeof (MotifWmHints)/sizeof (gulong)
|
2002-01-03 19:58:39 -05:00
|
|
|
|
2002-08-10 14:12:36 -04:00
|
|
|
*hints_p = NULL;
|
|
|
|
|
|
|
|
hints = NULL;
|
|
|
|
n_items = 0;
|
2002-10-21 17:44:35 -04:00
|
|
|
meta_error_trap_push_with_return (display);
|
2002-01-03 19:58:39 -05:00
|
|
|
if (XGetWindowProperty (display->xdisplay, xwindow, xatom,
|
2002-08-10 14:12:36 -04:00
|
|
|
0, MAX_ITEMS,
|
2002-01-03 19:58:39 -05:00
|
|
|
False, AnyPropertyType, &type, &format, &n_items,
|
2002-01-03 22:25:53 -05:00
|
|
|
&bytes_after, (guchar **)&hints) != Success ||
|
|
|
|
type == None)
|
2002-01-03 19:58:39 -05:00
|
|
|
{
|
2002-10-21 17:44:35 -04:00
|
|
|
meta_error_trap_pop_with_return (display, TRUE);
|
2002-01-03 19:58:39 -05:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2002-10-21 17:44:35 -04:00
|
|
|
if (meta_error_trap_pop_with_return (display, TRUE) != Success)
|
2002-01-03 19:58:39 -05:00
|
|
|
return FALSE;
|
|
|
|
|
2002-08-10 14:12:36 -04:00
|
|
|
if (type == None || n_items <= 0)
|
2002-01-03 19:58:39 -05:00
|
|
|
{
|
|
|
|
meta_verbose ("Motif hints had unexpected type or n_items\n");
|
|
|
|
XFree (hints);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2002-08-10 14:12:36 -04:00
|
|
|
g_assert (hints != NULL);
|
|
|
|
|
|
|
|
/* The issue here is that some old crufty code will set a smaller
|
|
|
|
* MotifWmHints than the one we expect, apparently. I'm not sure of
|
|
|
|
* the history behind it. See bug #89841 for example.
|
|
|
|
*/
|
|
|
|
*hints_p = g_new0 (MotifWmHints, 1);
|
|
|
|
real_size = n_items * sizeof (gulong);
|
|
|
|
max_size = MAX_ITEMS * sizeof (gulong);
|
|
|
|
memcpy (*hints_p, hints, MIN (real_size, max_size));
|
|
|
|
|
|
|
|
XFree (hints);
|
2002-01-03 19:58:39 -05:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
2002-01-03 22:25:53 -05:00
|
|
|
|
|
|
|
gboolean
|
|
|
|
meta_prop_get_latin1_string (MetaDisplay *display,
|
|
|
|
Window xwindow,
|
|
|
|
Atom xatom,
|
|
|
|
char **str_p)
|
|
|
|
{
|
|
|
|
Atom type;
|
|
|
|
int format;
|
|
|
|
gulong bytes_after;
|
|
|
|
guchar *str;
|
|
|
|
gulong n_items;
|
|
|
|
|
|
|
|
*str_p = NULL;
|
|
|
|
|
2002-10-21 17:44:35 -04:00
|
|
|
meta_error_trap_push_with_return (display);
|
2002-01-03 22:25:53 -05:00
|
|
|
if (XGetWindowProperty (display->xdisplay, xwindow, xatom,
|
|
|
|
0, G_MAXLONG,
|
|
|
|
False, XA_STRING, &type, &format, &n_items,
|
|
|
|
&bytes_after, (guchar **)&str) != Success ||
|
|
|
|
type == None)
|
|
|
|
{
|
2002-10-21 17:44:35 -04:00
|
|
|
meta_error_trap_pop_with_return (display, TRUE);
|
2002-01-03 22:25:53 -05:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2002-10-21 17:44:35 -04:00
|
|
|
if (meta_error_trap_pop_with_return (display, TRUE) != Success)
|
2002-01-03 22:25:53 -05:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (!check_type_and_format (display, xwindow, xatom, 8, XA_STRING,
|
|
|
|
-1, format, type))
|
|
|
|
{
|
|
|
|
XFree (str);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
*str_p = str;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
meta_prop_get_utf8_string (MetaDisplay *display,
|
|
|
|
Window xwindow,
|
|
|
|
Atom xatom,
|
|
|
|
char **str_p)
|
|
|
|
{
|
|
|
|
Atom type;
|
|
|
|
int format;
|
|
|
|
gulong bytes_after;
|
|
|
|
guchar *str;
|
|
|
|
gulong n_items;
|
|
|
|
|
|
|
|
*str_p = NULL;
|
|
|
|
|
2002-10-21 17:44:35 -04:00
|
|
|
meta_error_trap_push_with_return (display);
|
2002-01-03 22:25:53 -05:00
|
|
|
if (XGetWindowProperty (display->xdisplay, xwindow, xatom,
|
|
|
|
0, G_MAXLONG,
|
|
|
|
False, display->atom_utf8_string,
|
|
|
|
&type, &format, &n_items,
|
|
|
|
&bytes_after, (guchar **)&str) != Success ||
|
|
|
|
type == None)
|
|
|
|
{
|
2002-10-21 17:44:35 -04:00
|
|
|
meta_error_trap_pop_with_return (display, TRUE);
|
2002-01-03 22:25:53 -05:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2002-10-21 17:44:35 -04:00
|
|
|
if (meta_error_trap_pop_with_return (display, TRUE) != Success)
|
2002-01-03 22:25:53 -05:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (!check_type_and_format (display, xwindow, xatom, 8,
|
|
|
|
display->atom_utf8_string,
|
|
|
|
-1, format, type))
|
|
|
|
{
|
|
|
|
XFree (str);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!g_utf8_validate (str, n_items, NULL))
|
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
name = XGetAtomName (display->xdisplay, xatom);
|
|
|
|
meta_warning (_("Property %s on window 0x%lx contained invalid UTF-8\n"),
|
|
|
|
name, xwindow);
|
2002-06-08 19:55:27 -04:00
|
|
|
meta_XFree (name);
|
2002-01-03 22:25:53 -05:00
|
|
|
XFree (str);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
*str_p = str;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2002-06-22 00:52:35 -04:00
|
|
|
gboolean
|
|
|
|
meta_prop_get_utf8_list (MetaDisplay *display,
|
|
|
|
Window xwindow,
|
|
|
|
Atom xatom,
|
|
|
|
char ***str_p,
|
|
|
|
int *n_str_p)
|
|
|
|
{
|
|
|
|
Atom type;
|
|
|
|
int format;
|
|
|
|
gulong bytes_after;
|
|
|
|
guchar *val;
|
|
|
|
gulong n_items;
|
|
|
|
int i;
|
|
|
|
int n_strings;
|
|
|
|
char **retval;
|
|
|
|
const char *p;
|
|
|
|
|
|
|
|
*str_p = NULL;
|
|
|
|
*n_str_p = 0;
|
|
|
|
|
2002-10-21 17:44:35 -04:00
|
|
|
meta_error_trap_push_with_return (display);
|
2002-06-22 00:52:35 -04:00
|
|
|
if (XGetWindowProperty (display->xdisplay, xwindow, xatom,
|
|
|
|
0, G_MAXLONG,
|
|
|
|
False, display->atom_utf8_string,
|
|
|
|
&type, &format, &n_items,
|
|
|
|
&bytes_after, (guchar **)&val) != Success ||
|
|
|
|
type == None)
|
|
|
|
{
|
2002-10-21 17:44:35 -04:00
|
|
|
meta_error_trap_pop_with_return (display, TRUE);
|
2002-06-22 00:52:35 -04:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2002-10-21 17:44:35 -04:00
|
|
|
if (meta_error_trap_pop_with_return (display, TRUE) != Success)
|
2002-06-22 00:52:35 -04:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (!check_type_and_format (display, xwindow, xatom, 8,
|
|
|
|
display->atom_utf8_string,
|
|
|
|
-1, format, type))
|
|
|
|
{
|
|
|
|
XFree (val);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* I'm not sure this is right, but I'm guessing the
|
|
|
|
* property is nul-separated
|
|
|
|
*/
|
|
|
|
i = 0;
|
|
|
|
n_strings = 1;
|
|
|
|
while (i < (int) n_items)
|
|
|
|
{
|
|
|
|
if (val[i] == '\0')
|
|
|
|
++n_strings;
|
|
|
|
++i;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* we're guaranteed that val has a nul on the end
|
|
|
|
* by XGetWindowProperty
|
|
|
|
*/
|
|
|
|
|
|
|
|
retval = g_new0 (char*, n_strings + 1);
|
|
|
|
|
|
|
|
p = val;
|
|
|
|
i = 0;
|
|
|
|
while (i < n_strings)
|
|
|
|
{
|
|
|
|
if (!g_utf8_validate (p, -1, NULL))
|
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
meta_error_trap_push (display);
|
|
|
|
name = XGetAtomName (display->xdisplay, xatom);
|
2002-10-21 17:44:35 -04:00
|
|
|
meta_error_trap_pop (display, TRUE);
|
2002-06-22 00:52:35 -04:00
|
|
|
meta_warning (_("Property %s on window 0x%lx contained invalid UTF-8 for item %d in the list\n"),
|
|
|
|
name, xwindow, i);
|
|
|
|
meta_XFree (name);
|
|
|
|
meta_XFree (val);
|
|
|
|
|
|
|
|
g_strfreev (retval);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
retval[i] = g_strdup (p);
|
|
|
|
|
|
|
|
p = p + strlen (p) + 1;
|
|
|
|
++i;
|
|
|
|
}
|
|
|
|
|
|
|
|
*str_p = retval;
|
|
|
|
*n_str_p = i;
|
|
|
|
|
|
|
|
meta_XFree (val);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2002-01-03 22:25:53 -05:00
|
|
|
gboolean
|
|
|
|
meta_prop_get_window (MetaDisplay *display,
|
|
|
|
Window xwindow,
|
|
|
|
Atom xatom,
|
|
|
|
Window *window_p)
|
|
|
|
{
|
|
|
|
Atom type;
|
|
|
|
int format;
|
|
|
|
gulong bytes_after;
|
|
|
|
Window *window;
|
|
|
|
gulong n_items;
|
|
|
|
|
|
|
|
*window_p = None;
|
|
|
|
|
2002-10-21 17:44:35 -04:00
|
|
|
meta_error_trap_push_with_return (display);
|
2002-01-03 22:25:53 -05:00
|
|
|
if (XGetWindowProperty (display->xdisplay, xwindow, xatom,
|
|
|
|
0, G_MAXLONG,
|
|
|
|
False, XA_WINDOW, &type, &format, &n_items,
|
|
|
|
&bytes_after, (guchar **)&window) != Success ||
|
|
|
|
type == None)
|
|
|
|
{
|
2002-10-21 17:44:35 -04:00
|
|
|
meta_error_trap_pop_with_return (display, TRUE);
|
2002-01-03 22:25:53 -05:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2002-10-21 17:44:35 -04:00
|
|
|
if (meta_error_trap_pop_with_return (display, TRUE) != Success)
|
2002-01-03 22:25:53 -05:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (!check_type_and_format (display, xwindow, xatom, 32, XA_WINDOW,
|
|
|
|
-1, format, type))
|
|
|
|
{
|
|
|
|
XFree (window);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
*window_p = *window;
|
|
|
|
|
|
|
|
XFree (window);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
meta_prop_get_cardinal (MetaDisplay *display,
|
|
|
|
Window xwindow,
|
|
|
|
Atom xatom,
|
|
|
|
gulong *cardinal_p)
|
|
|
|
|
|
|
|
{
|
|
|
|
return meta_prop_get_cardinal_with_atom_type (display, xwindow, xatom,
|
|
|
|
XA_CARDINAL, cardinal_p);
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
meta_prop_get_cardinal_with_atom_type (MetaDisplay *display,
|
|
|
|
Window xwindow,
|
|
|
|
Atom xatom,
|
|
|
|
Atom prop_type,
|
|
|
|
gulong *cardinal_p)
|
|
|
|
{
|
|
|
|
Atom type;
|
|
|
|
int format;
|
|
|
|
gulong bytes_after;
|
|
|
|
gulong *cardinal;
|
|
|
|
gulong n_items;
|
|
|
|
|
|
|
|
*cardinal_p = 0;
|
|
|
|
|
2002-10-21 17:44:35 -04:00
|
|
|
meta_error_trap_push_with_return (display);
|
2002-01-03 22:25:53 -05:00
|
|
|
if (XGetWindowProperty (display->xdisplay, xwindow, xatom,
|
|
|
|
0, G_MAXLONG,
|
|
|
|
False, prop_type, &type, &format, &n_items,
|
|
|
|
&bytes_after, (guchar **)&cardinal) != Success ||
|
|
|
|
type == None)
|
|
|
|
{
|
2002-10-21 17:44:35 -04:00
|
|
|
meta_error_trap_pop_with_return (display, TRUE);
|
2002-01-03 22:25:53 -05:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2002-10-21 17:44:35 -04:00
|
|
|
if (meta_error_trap_pop_with_return (display, TRUE) != Success)
|
2002-01-03 22:25:53 -05:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (!check_type_and_format (display, xwindow, xatom, 32, prop_type,
|
|
|
|
-1, format, type))
|
|
|
|
{
|
|
|
|
XFree (cardinal);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
*cardinal_p = *cardinal;
|
|
|
|
|
|
|
|
XFree (cardinal);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|