<?xml version="1.0"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "../index.ent">
%BOOK_ENTITIES;
<!ENTITY % RH_ENTITIES SYSTEM "Entities.ent">
%RH_ENTITIES;

]>
<section id="r-sn-code-conventions">
	<title>Code Presentation Conventions</title>

	<para>
		In addition to the standard document conventions covered in
		<xref
      linkend="sn-conventions" />, there are some additional
		conventions related specifically to discussing source code:
	</para>

	<variablelist>
		<varlistentry>
			<term><classname>classname</classname></term>
			<listitem>
				<para>
					This is the name of a class in an object-oriented
					(<firstterm>OO</firstterm>) programming language. For example, the
					class
					<classname>com.arsdigita.categorization.CategoryTreeNode</classname>
					.
				</para>
			</listitem>
		</varlistentry>

		<varlistentry>
			<term><methodname>method name</methodname></term>
			<listitem>
				<para>
					This is the name of a method in an OO programming language, e.g.
					the method
					<methodname>getBaseDataObjectType</methodname>
					.
				</para>
			</listitem>
		</varlistentry>

		<varlistentry>
			<term><function>function</function></term>
			<listitem>
				<para>
					The name of a function or subroutine, as in a programming language.
					For example, the function
					<function>SecurityLogger.warn()</function>
					.
				</para>
			</listitem>
		</varlistentry>

		<varlistentry>
			<term><varname>variable name</varname></term>
			<listitem>
				<para>
					The name of a variable. For example, the variable
					<varname>BASE_DATA_OBJECT_TYPE</varname>
					.
				</para>
			</listitem>
		</varlistentry>

		<varlistentry>
			<term><option>option</option></term>
			<listitem>
				<para>
					An option for a software command or
					<methodname>Method</methodname>
					. For example, a user has been granted <option>read</option>
					privileges on an object.
				</para>
			</listitem>
		</varlistentry>

		<varlistentry>
			<term><returnvalue>return value</returnvalue></term>
			<listitem>
				<para>
					The value returned by a function. For example, a method returns
					<returnvalue>null</returnvalue>
					.
				</para>
			</listitem>
		</varlistentry>

		<varlistentry>
			<term>program listing</term>
			<listitem>
				<para>
					A literal listing of all or part of a program:
				</para>
<programlisting>
<![CDATA[
extern void sem_exit (void);
extern struct task_struct *child_reaper;
 
int getrusage(struct task_struct *, int, struct rusage *);
 
static void __unhash_process(struct task_struct *p)
{
        nr_threads--;
        detach_pid(p, PIDTYPE_PID);
        detach_pid(p, PIDTYPE_TGID);
        if (thread_group_leader(p)) {
                detach_pid(p, PIDTYPE_PGID);
                detach_pid(p, PIDTYPE_SID);
        }
 
        REMOVE_LINKS(p);
        p->pid = 0;
}
]]>
</programlisting>
			</listitem>
		</varlistentry>

		<varlistentry>
			<term>first term</term>
			<listitem>
				<para>
					The first occurrence of a term, such as the first time we introduce
					a <firstterm>bulletin-board</firstterm> and note its abbreviated
					form, <firstterm>bboard</firstterm>.
				</para>
			</listitem>
		</varlistentry>
	</variablelist>
</section>
