<HTML> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!-- Created on December, 22 2009 by texi2html 1.64 --> <!-- Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author) Karl Berry <karl@freefriends.org> Olaf Bachmann <obachman@mathematik.uni-kl.de> and many others. Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de> Send bugs and suggestions to <texi2html@mathematik.uni-kl.de> --> <HEAD> <TITLE>APRON 0.9.10: C Naming conventions</TITLE> <META NAME="description" CONTENT="APRON 0.9.10: C Naming conventions"> <META NAME="keywords" CONTENT="APRON 0.9.10: C Naming conventions"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META NAME="Generator" CONTENT="texi2html 1.64"> </HEAD> <BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000"> <A NAME="SEC42"></A> <TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0> <TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="apron_10.html#SEC41"> < </A>]</TD> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="apron_12.html#SEC43"> > </A>]</TD> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="apron_8.html#SEC39"> << </A>]</TD> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="apron_9.html#SEC40"> Up </A>]</TD> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="apron_15.html#SEC46"> >> </A>]</TD> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="apron.html#SEC_Top">Top</A>]</TD> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="apron_toc.html#SEC_Contents">Contents</A>]</TD> <TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="apron_abt.html#SEC_About"> ? </A>]</TD> </TR></TABLE> <HR SIZE=1> <H3> Naming conventions and Allocation/Deallocation schemes </H3> <!--docid::SEC42::--> <P> The general rule is that all type and function names defined by the library are prefixed with <CODE>ap_</CODE>, in order to prevent name conflicts with other libraries. Moreover, functions operating on objects of type <CODE>ap_typ_t</CODE> are usually prefixed with <CODE>ap_typ_op</CODE>. </P><P> Given an object of datatype <CODE>ap_typ_t*</CODE>, two kinds of allocation/deallocation pairs of functions may be defined: </P><P> <OL> <LI> variable declaration: <CODE>ap_typ_t obj;</CODE> <UL> <LI>Initialization: <CODE>void typ_init(ap_typ_t* arg, ...)</CODE> or <CODE>ap_typ_t ap_typ_make(...)</CODE> <LI>Finalization: <CODE>void ap_typ_clear(ap_typ_t* arg)</CODE> </UL> this pair of functions follows the semantics used in the GMP library. The first function initializes the object of type <CODE>ap_typ_t</CODE> pointed to by <VAR>arg</VAR>, and fills it with a valid content. The second function deallocates the memory possibly pointed to by fields of the object <CODE>*arg</CODE>, but do not attempt to deallocate the memory pointed by <VAR>arg</VAR>. <LI> variable declaration: <CODE>ap_typ_t* obj;</CODE> <UL> <LI>Allocation <CODE>ap_typ_t* ap_typ_alloc(...)</CODE> <LI>Deallocation <CODE>void ap_typ_free(ap_typ_t* arg)</CODE> </UL> the first function allocates an object of type <CODE>typ_t</CODE> and then calls a <CODE>ap_typ_init</CODE>-like function on the result; the second functions first call a <CODE>ap_typ_clear</CODE>-like function and then deallocate the memory pointed by <VAR>arg</VAR>. </OL> <P> <A NAME="Allocating managers and setting options"></A> <HR SIZE=1> <BR> <FONT SIZE="-1"> This document was generated by <I>Bertrand Jeannet</I> on <I>December, 22 2009</I> using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html "><I>texi2html</I></A> </BODY> </HTML>