<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<!-- lifted from troff+man by doclifter -->
<refentry id='xinternaman'>
<!--  Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium -->

<!--  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, and/or sell copies of the Software, and to -->
<!--  permit persons to whom the Software is furnished to do so, subject to -->
<!--  the following conditions: -->

<!--  The above copyright notice and this permission notice 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 X CONSORTIUM 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. -->

<!--  Except as contained in this notice, the name of the X Consortium shall -->
<!--  not be used in advertising or otherwise to promote the sale, use or -->
<!--  other dealings in this Software without prior written authorization -->
<!--  from the X Consortium. -->

<!--  Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991 by -->
<!--  Digital Equipment Corporation -->

<!--  Portions Copyright \(co 1990, 1991 by -->
<!--  Tektronix, Inc. -->

<!--  Permission to use, copy, modify and distribute this documentation for -->
<!--  any purpose and without fee is hereby granted, provided that the above -->
<!--  copyright notice appears in all copies and that both that copyright notice -->
<!--  and this permission notice appear in all copies, and that the names of -->
<!--  Digital and Tektronix not be used in in advertising or publicity pertaining -->
<!--  to this documentation without specific, written prior permission. -->
<!--  Digital and Tektronix makes no representations about the suitability -->
<!--  of this documentation for any purpose. -->
<!--  It is provided ``as is'' without express or implied warranty. -->
<!--   -->
<!--  $XFree86: xc/doc/man/X11/XInternA.man,v 1.3 2003/04/28 22:17:55 herrb Exp $ -->

<!-- .na -->
<!-- Ds listing suppressed (not used) -->
<!-- De listing suppressed (not used) -->
<!-- FD listing suppressed (not used) -->
<!-- FN listing suppressed (not used) -->
<!-- IN listing suppressed (not used) -->
<!-- C{ listing suppressed (not used) -->
<!-- C} listing suppressed (not used) -->
<!-- Pn listing suppressed (not used) -->
<!-- hN listing suppressed (not used) -->
<!-- NT listing suppressed (not used) -->
<!-- .		\" Note End \-\- doug kraft 3/85 -->
<!-- NE listing suppressed (not used) -->
<!-- .ny0 -->
<refmeta>
<refentrytitle>XInternAtom</refentrytitle>
<manvolnum>3X11</manvolnum>
<refmiscinfo class='date'>__xorgversion__</refmiscinfo>
<refmiscinfo class='source'>XLIB FUNCTIONS</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>XInternAtom</refname>
<refname>XInternAtoms</refname>
<refname>XGetAtomName</refname>
<refname>XGetAtomNames</refname>
<refpurpose>create or return atom names</refpurpose>
</refnamediv>
<!-- body begins here -->

<refsect1 id='syntax'><title>SYNTAX</title>

<para>Atom XInternAtom&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, char *<emphasis remap='I'>atom_name</emphasis>&hairsp;, Bool
<emphasis remap='I'>only_if_exists</emphasis>&hairsp;);</para> 

<para>Status XInternAtoms&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, char **<emphasis remap='I'>names</emphasis>&hairsp;, int
<emphasis remap='I'>count</emphasis>&hairsp;, Bool <emphasis remap='I'>only_if_exists</emphasis>&hairsp;, Atom *<emphasis remap='I'>atoms_return</emphasis>&hairsp;);</para> 

<para>char *XGetAtomName&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, Atom <emphasis remap='I'>atom</emphasis>&hairsp;);</para> 

<para>Status XGetAtomNames&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, Atom *<emphasis remap='I'>atoms</emphasis>&hairsp;, int
<emphasis remap='I'>count</emphasis>&hairsp;, char **<emphasis remap='I'>names_return</emphasis>&hairsp;);</para> 
</refsect1>

<refsect1 id='arguments'><title>ARGUMENTS</title>
<variablelist remap='IP'>
  <varlistentry>
  <term><emphasis remap='I'>atom</emphasis></term>
  <listitem>
<para>Specifies the atom for the property name you want returned.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>atoms</emphasis></term>
  <listitem>
<para>Specifies the array of atoms.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>atom_name</emphasis></term>
  <listitem>
<para>Specifies the name associated with the atom you want returned.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>atoms_return</emphasis></term>
  <listitem>
<para>Returns the atoms.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>count</emphasis></term>
  <listitem>
<para>Specifies the number of atom names in the array.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>count</emphasis></term>
  <listitem>
<para>Specifies the number of atoms in the array.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>display</emphasis></term>
  <listitem>
<para>Specifies the connection to the X server.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>names</emphasis></term>
  <listitem>
<para>Specifies the array of atom names.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>names_return</emphasis></term>
  <listitem>
<para>Returns the atom names.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>only_if_exists</emphasis></term>
  <listitem>
<para>Specifies a Boolean value that indicates whether the atom must be created.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='description'><title>DESCRIPTION</title>
<para>The
<emphasis remap='I'>&hairsp;XInternAtom&hairsp;</emphasis>
function returns the atom identifier associated with the specified atom_name
string.
If only_if_exists is 
<emphasis remap='I'>&hairsp;False&hairsp;</emphasis>,
the atom is created if it does not exist.
Therefore,
<emphasis remap='I'>&hairsp;XInternAtom&hairsp;</emphasis>
can return
<emphasis remap='I'>&hairsp;None&hairsp;</emphasis>.
If the atom name is not in the Host Portable Character Encoding, 
the result is implementation-dependent.
Uppercase and lowercase matter;
the strings &ldquo;thing&rdquo;, &ldquo;Thing&rdquo;, and &ldquo;thinG&rdquo; 
all designate different atoms.  
The atom will remain defined even after the client's connection closes.
It will become undefined only when the last connection to
the X server closes.</para>

<para><emphasis remap='I'>&hairsp;XInternAtom&hairsp;</emphasis>
can generate
<emphasis remap='I'>&hairsp;BadAlloc&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;BadValue&hairsp;</emphasis>
errors.</para>

<para>The
<emphasis remap='I'>&hairsp;XInternAtoms&hairsp;</emphasis>
function returns the atom identifiers associated with the specified names.
The atoms are stored in the atoms_return array supplied by the caller.
Calling this function is equivalent to calling
<emphasis remap='I'>&hairsp;XInternAtom&hairsp;</emphasis>
for each of the names in turn with the specified value of only_if_exists,
but this function minimizes the number of round-trip protocol exchanges
between the client and the X server.</para>

<para>This function returns a nonzero status if atoms are returned for
all of the names;
otherwise, it returns zero.</para>

<para><emphasis remap='I'>&hairsp;XInternAtoms&hairsp;</emphasis>
can generate
<emphasis remap='I'>&hairsp;BadAlloc&hairsp;</emphasis>
and
<emphasis remap='I'>&hairsp;BadValue&hairsp;</emphasis>
errors.</para>

<para>The
<emphasis remap='I'>&hairsp;XGetAtomName&hairsp;</emphasis>
function returns the name associated with the specified atom.
If the data returned by the server is in the Latin Portable Character Encoding,
then the returned string is in the Host Portable Character Encoding.
Otherwise, the result is implementation-dependent.
To free the resulting string,
call
<emphasis remap='I'>&hairsp;XFree&hairsp;</emphasis>.</para>

<para><emphasis remap='I'>&hairsp;XGetAtomName&hairsp;</emphasis>
can generate a
<emphasis remap='I'>&hairsp;BadAtom&hairsp;</emphasis>
error.</para>

<para>The
<emphasis remap='I'>&hairsp;XGetAtomNames&hairsp;</emphasis>
function returns the names associated with the specified atoms.
The names are stored in the names_return array supplied by the caller.
Calling this function is equivalent to calling
<emphasis remap='I'>&hairsp;XGetAtomName&hairsp;</emphasis>
for each of the atoms in turn,
but this function minimizes the number of round-trip protocol exchanges
between the client and the X server.</para>

<para>This function returns a nonzero status if names are returned for
all of the atoms;
otherwise, it returns zero.</para>

<para><emphasis remap='I'>&hairsp;XGetAtomNames&hairsp;</emphasis>
can generate a
<emphasis remap='I'>&hairsp;BadAtom&hairsp;</emphasis>
error.</para>
</refsect1>

<refsect1 id='diagnostics'><title>DIAGNOSTICS</title>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadAlloc&hairsp;</emphasis></term>
  <listitem>
<para>The server failed to allocate the requested resource or server memory.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadAtom&hairsp;</emphasis></term>
  <listitem>
<para>A value for an Atom argument does not name a defined Atom.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&hairsp;BadValue&hairsp;</emphasis></term>
  <listitem>
<para>Some numeric value falls outside the range of values accepted by the request.
Unless a specific range is specified for an argument, the full range defined
by the argument's type is accepted.  Any argument defined as a set of
alternatives can generate this error.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='see_also'><title>SEE ALSO</title>
<para>XFree(3X11),
XGetWindowProperty(3X11)
<!-- .br -->
<userinput>Xlib - C Language X Interface</userinput></para>
</refsect1>
</refentry>

