📄 ch-glib.html
字号:
<HTML><HEAD><TITLE>GLib</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.49"><LINKREL="HOME"TITLE="GTK+ 1.2 Tutorial"HREF="gtk-tut.html"><LINKREL="PREVIOUS"TITLE="Functions"HREF="sec-draganddropfunctions.html"><LINKREL="NEXT"TITLE="Doubly Linked Lists"HREF="sec-doublylinkedlists.html"></HEAD></head><body bgcolor="#FFFFFF" marginheight=0 marginwidth=0 width="100%"><table cellspacing=6 border=0 cellpadding=0 width="100%"> <tr> <td bgcolor="#FFFFFF" valign=top nowrap> <centeR><A HREF="/"><img src="/images/gtk-logo-rgb.gif" width=107 height=140 border=0></A> <font face="helvetica,lucidia" color="#000000"><BR><BR><b>GTK+<BR>The GIMP Toolkit</b></center><BR><table width=100% cellspacing=0 cellpadding=2 border=0><tr><td bgcolor="#000000"><table width=100% cellspacing=0 cellpadding=4 border=0><tr><td bgcolor="#AAAAEE" nowrap><B>General</B></td></tr><tr><td bgcolor="#FFFFFF" nowrap><A HREF="/">Introduction</A><BR><A HREF="/screenshots/">Screenshots</A><br><A HREF="/download/">Download</A><br><A HREF="/mailinglists.html">Mailing Lists</A><BR><A HREF="/bindings.html">Language Bindings</A><BR><A HREF="http://gtk.themes.org/">Themes</A><BR><A HREF="/bugs.html">Bug Tracker</A><BR></td></tr></table></td></tr></table><BR> <table width=100% cellspacing=0 cellpadding=2 border=0><tr><td bgcolor="#000000"><table width=100% cellspacing=0 cellpadding=4 border=0><tr><td bgcolor="#AAAAEE" nowrap><B>Documentation</B></td></tr><tr><td bgcolor="#FFFFFF" nowrap><A HREF="/faq/">FAQ</A><br><A HREF="/tutorial/">Tutorial</A><BR><A HREF="/api/">API Reference</A><br><A HREF="/books.html">Published Books</A><BR></td></tr></table></td></tr></table><BR> <table width=100% cellspacing=0 cellpadding=2 border=0><tr><td bgcolor="#000000"><table width=100% cellspacing=0 cellpadding=4 border=0><tr><td bgcolor="#AAAAEE" nowrap><B>Projects</B></td></tr><tr><td bgcolor="#FFFFFF" nowrap><A HREF="http://www.pango.org/">Pango</A><BR><A HREF="http://sources.redhat.com/inti/">Inti</A><BR><A HREF="http://www.gnome.org/">GNOME</A><BR><A HREF="http://user.sgic.fi/~tml/gimp/win32/">GTK+ for Win32</A><br><A HREF="http://people.redhat.com/sopwith/gtkfb/">GtkFB (Framebuffer)</A><br><A HREF="http://www.directfb.org/gtk.xml">GTK+ on DirectFB</A><BR><A HREF="/beos/">GTK+ for BeOS</A></td></tr></table></td></tr></table><BR> <table width=100% cellspacing=0 cellpadding=2 border=0><tr><td bgcolor="#000000"><table width=100% cellspacing=0 cellpadding=4 border=0><tr><td bgcolor="#AAAAEE" nowrap><B><B>Applications</B></B></td></tr><tr><td bgcolor="#FFFFFF" nowrap><A HREF="http://www.gimp.org/">GIMP</A><BR><A HREF="http://www.abiword.org/">Abiword</A><BR><A HREF="http://www.lysator.liu.se/~alla/dia/dia.html">Dia</A><BR><A HREF="http://glade.pn.org/">Glade</A><BR><A HREF="http://www.gnucash.org/">GnuCash</A><BR><A HREF="http://www.gnome.org/projects/gnumeric/">Gnumeric</A><BR><BR><A HREF="http://www.gnome.org/applist/">GNOME Software Map</A><br></td></tr></table></td></tr></table><BR> </td> <td bgcolor="#ffffff" valign=top width="99%"><font face="lucida,helvetica"><BODYCLASS="CHAPTER"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">GTK+ 1.2 Tutorial</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="sec-draganddropfunctions.html"><<< Previous</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="sec-doublylinkedlists.html">Next >>></A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="CHAPTER"><H1><ANAME="CH-GLIB">Chapter 22. GLib</A></H1><DIVCLASS="TOC"><DL><DT><B>Table of Contents</B></DT><DT>22.1. <AHREF="ch-glib.html#SEC-DEFINITIONS">Definitions</A></DT><DT>22.2. <AHREF="sec-doublylinkedlists.html">Doubly Linked Lists</A></DT><DT>22.3. <AHREF="sec-singlylinkedlists.html">Singly Linked Lists</A></DT><DT>22.4. <AHREF="sec-memorymanagement.html">Memory Management</A></DT><DT>22.5. <AHREF="sec-timers.html">Timers</A></DT><DT>22.6. <AHREF="sec-stringhandling.html">String Handling</A></DT><DT>22.7. <AHREF="sec-utilityanderrorfunctions.html">Utility and Error Functions</A></DT></DL></DIV><P>GLib is a lower-level library that provides many useful definitionsand functions available for use when creating GDK and GTKapplications. These include definitions for basic types and theirlimits, standard macros, type conversions, byte order, memoryallocation, warnings and assertions, message logging, timers, stringutilities, hook functions, a lexical scanner, dynamic loading ofmodules, and automatic string completion. A number of data structures(and their related operations) are also defined, including memorychunks, doubly-linked lists, singly-linked lists, hash tables, strings(which can grow dynamically), string chunks (groups of strings),arrays (which can grow in size as elements are added), balanced binarytrees, N-ary trees, quarks (a two-way association of a string and aunique integer identifier), keyed data lists (lists of data elementsaccessible by a string or integer id), relations and tuples (tables ofdata which can be indexed on any number of fields), and caches.</P><P>A summary of some of GLib's capabilities follows; not every function,data structure, or operation is covered here. For more completeinformation about the GLib routines, see the GLib documentation. Onesource of GLib documentation is <AHREF="http://www.gtk.org/"TARGET="_top">http://www.gtk.org/</A>.</P><P>If you are using a language other than C, you should consult yourlanguage's binding documentation. In some cases your language mayhave equivalent functionality built-in, while in other cases it maynot.</P><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="SEC-DEFINITIONS">22.1. Definitions</A></H1><P>Definitions for the extremes of many of the standard types are:</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">G_MINFLOATG_MAXFLOATG_MINDOUBLEG_MAXDOUBLEG_MINSHORTG_MAXSHORTG_MININTG_MAXINTG_MINLONGG_MAXLONG</PRE></TD></TR></TABLE><P>Also, the following typedefs. The ones left unspecified are dynamically setdepending on the architecture. Remember to avoid counting on the size of apointer if you want to be portable! E.g., a pointer on an Alpha is 8bytes, but 4 on Intel 80x86 family CPUs.</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">char gchar;short gshort;long glong;int gint;char gboolean;unsigned char guchar;unsigned short gushort;unsigned long gulong;unsigned int guint;float gfloat;double gdouble;long double gldouble;void* gpointer;gint8guint8gint16guint16gint32guint32</PRE></TD></TR></TABLE></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="sec-draganddropfunctions.html"><<< Previous</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="gtk-tut.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="sec-doublylinkedlists.html">Next >>></A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Functions</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"> </TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Doubly Linked Lists</TD></TR></TABLE></DIV> </td> </tr></table> </td> </tr></table></body></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -