Changes to update Tomato RAF.
[tomato.git] / release / src / router / glib / docs / glib.texi
blob1bf23e191b5fe51789bc4db9fcfbebd8d2e6fdc8
1 \input texinfo @c -*-texinfo-*-
2 @c %**start of header
3 @setfilename glib.info
4 @settitle GLIB
5 @setchapternewpage odd
7 @set edition 1.0
8 @set update-date 3 Feburary 1998
9 @set update-month Feburary 1998
10 @c %**end of header
12 @ifinfo
13 This file documents GLIB, A library of useful routines for C programming
15 Copyright (C) 1998 Gregory A McLean
17 Permission is granted to make and distributed verbatim copies of this
18 manual, provided the copyright notice and this permission notice are
19 preserved on all copies. 
21 @ignore
22 Permission is granted to process this file throught TeX and print the 
23 results, provided the printed document carries copying permission notice 
24 identical to this one except for the removal of this paragraph (this 
25 paragraph not being relevant to the printed manual).
27 @end ignore
28 Permission is granted to copy and distribute modified versions of this
29 manual under the conditions for verbatim copying, provided that the
30 entire resulting derived work is distributed under the terms of a
31 permission notice identical to this one.
33 Permission is granted to copy and distribute translations of this manual
34 into another language, under the above conditions for modified versions,
35 except that this permission notice may be stated in a translation
36 approved by Gregory McLean.
37 @end ifinfo
39 @titlepage
40 @title GLIB, Useful routines for C programming 
41 @subtitle Version 1.0
42 @subtitle @value{update-month}
43 @author by Gregory McLean
45 @page
46 @vskip 0pt plus 1filll
47 Copyright @copyright{} 1998 Gregory McLean
49 Permission is granted to make and distribute verbatim copies of this
50 manual provided the copyright notice and this permission notice are
51 preserved on all copies.
53 Permission is granted to copy and distribute modified versions of this
54 manual under the conditions for verbatim copying, provided that the
55 entire resulting derived work is distributed under the terms of a
56 permission notice identical to this one.
58 Permission is granted to copy and distribute translations of this manual
59 into another language, under the above conditions for modified versions,
60 except that this permission notice may be stated in a translation
61 approved by Gregory McLean.
62 @end titlepage
64 @dircategory Library of useful routines for 'C' programing
65 @direntry
66 * GLIB: (glib).        useful routines for 'C' programming
67 @end direntry
69 @node Top, Copying, (dir), (dir)
70 @top useful routines for 'C' programming
71 @ifinfo
72 This is edition @value{edition} of the GLIB documentation,
73 @w{@value{update-date}}.
74 @end ifinfo
76 @menu
77 * Copying::                     Your rights.
78 * Overview::                    What is GLIB?
79 * Doubly linked lists::         Doubly linked lists
80 * Signly linked lists::         Singly linked lists
81 * List allocators::             List Allocators
82 * Hash tables::                 Hash tables
83 * Caches::                      Cache handling
84 * Trees::                       Tree handling
85 * Memory::                      Memory handling
86 * Timers::                      Timer functions
87 * Output::                      Output handling
88 * Utilities::                   Utilitiy functions
89 * Errors::                      Error handling
90 * String Chunks::               String Chunks
91 * Strings::                     String handling
92 * Resizable arrays::            Resizeable arrays
93 * GScanner::                    Flexible lexical scanner
94 * Miscellany::                  Other stuff
95 * Function Index::              Index of functions
96 * Concept Index::               Index of concepts
97 @end menu
99 @node Copying, Overview, Top, Top
100 @comment node-name, next, previous, up
101 @chapter Copying
103 @node Overview, Doubly linked lists, Copying, Top
104 @comment node-name, next, previous, up
105 @chapter What is GLIB
107 @node Doubly linked lists, Signly linked lists, Overview, Top
108 @comment node-name, next, previous, up
109 @chapter Doubly linked lists
111 @subsection Functions
113 @deftypefun GList* g_list_alloc (void)
114 @end deftypefun
116 @deftypefun void g_list_free (GList *@var{list})
117 @end deftypefun
119 @deftypefun void g_list_free_1 (GList *@var{list})
120 @end deftypefun
122 @deftypefun GList* g_list_append (GList *@var{list}, gpointer @var{data})
123 @end deftypefun
125 @deftypefun GList* g_list_prepend (GList *@var{list}, gpointer @var{data})
126 @end deftypefun
128 @deftypefun GList* g_list_insert (GList *@var{list}, gpointer @var{data}, gint @var{position})
129 @end deftypefun
131 @deftypefun GList* g_list_insert_sorted (GList *@var{list}, gpointer @var{data}, GCompareFunc @var{func})
132 @end deftypefun
134 @deftypefun GList* g_list_concat (GList *@var{list1}, GList *@var{list2})
135 @end deftypefun
137 @deftypefun GList* g_list_remove (GList *@var{list}, gpointer @var{data})
138 @end deftypefun
140 @deftypefun GList* g_list_remove_link (GList *@var{list}, GList *@var{link})
141 @end deftypefun
143 @deftypefun GList* g_list_reverse (GList *@var{list})
144 @end deftypefun
146 @deftypefun GList* g_list_nth (GList *@var{list}, gint @var{n})
147 @end deftypefun
149 @deftypefun GList* g_list_find (GList *@var{list}, gpointer @var{data})
150 @end deftypefun
152 @deftypefun GList* g_list_last (GList *@var{list})
153 @end deftypefun
155 @deftypefun GList* g_list_first (GList *@var{list})
156 @end deftypefun
158 @deftypefun gint g_list_length (GList *@var{list})
159 @end deftypefun
161 @deftypefun void g_list_foreach (GList *@var{list}, GFunc @var{func}, gpointer @var{user_data})
162 @end deftypefun
164 @node Signly linked lists, List allocators, Doubly linked lists, Top
165 @comment node-name, next, previous, up
166 @chapter Signly linked lists
168 @subsection Functions
169 @deftypefun GSList* g_slist_alloc (void)
170 @end deftypefun
172 @deftypefun void g_slist_free (GSList *@var{list})
173 @end deftypefun
175 @deftypefun void g_slist_free_1 (GSList *@var{list})
176 @end deftypefun
178 @deftypefun GSList* g_slist_append (GSList *@var{list}, gpointer @var{data})
179 @end deftypefun
181 @deftypefun GSList* g_slist_prepend (GSList *@var{list}, gpointer @var{data})
182 @end deftypefun
184 @deftypefun GSList* g_slist_insert (GSList *@var{list}, gpointer @var{data}, gint @var{position})
185 @end deftypefun
187 @deftypefun GSList* g_slist_insert_sorted (GSList *@var{list}, gpointer @var{data}, GCompareFunc @var{func})
188 @end deftypefun
190 @deftypefun GSList* g_slist_concat (GSList *@var{list1}, GSList *@var{list2})
191 @end deftypefun
193 @deftypefun GSList* g_slist_remove (GSList *@var{list}, gpointer @var{data})
194 @end deftypefun
196 @deftypefun GSList* g_slist_remove_link (GSList *@var{list}, GSList *@var{link})
197 @end deftypefun
199 @deftypefun GSList* g_slist_reverse (GSList *@var{list})
200 @end deftypefun
202 @deftypefun GSList* g_slist_nth (GSList *@var{list}, gint @var{n})
203 @end deftypefun
205 @deftypefun GSList* g_slist_find (GSList *@var{list}, gpointer @var{data})
206 @end deftypefun
208 @deftypefun GSList* g_slist_last (GSList *@var{list})
209 @end deftypefun
211 @deftypefun gint g_slist_length (GSList *@var{list})
212 @end deftypefun
214 @deftypefun void g_slist_foreach (GSList *@var{list}, GFunc @var{func}, gpointer @var{user_data})
215 @end deftypefun
217 @node List allocators, Hash tables, Signly linked lists, Top
218 @comment node-name, next, previous, up
219 @chapter List allocators
221 @subsection Functions
223 @deftypefun GListAllocator* g_list_allocator_new (void)
224 @end deftypefun
226 @deftypefun void g_list_allocator_free (GListAllocator *@var{allocator})
227 @end deftypefun
229 @deftypefun GListAllocator* g_slist_set_allocator (GListAllocator *@var{allocator})
230 @end deftypefun
232 @deftypefun GListAllocator* g_list_set_allocator (GListAllocator *@var{allocator})
233 @end deftypefun
235 @node Hash tables, Caches, List allocators, Top
236 @comment node-name, next, previous, up
237 @chapter Hash tables
239 @subsection Functions
241 @deftypefun GHashTable* g_hash_table_new (GHashFunc @var{hash_func}, GCompareFunc @var{key_compare_func})
242 @end deftypefun
244 @deftypefun void g_hash_table_destroy (GHashTable *@var{hash_table})
245 @end deftypefun
247 @deftypefun void g_hash_table_insert (GHashTable *@var{hash_table}, gpointer @var{key}, gpointer @var{value})
248 @end deftypefun
250 @deftypefun void g_hash_table_remove (GHashTable *@var{hash_table}, gpointer @var{key})
251 @end deftypefun
253 @deftypefun gpointer g_hash_table_lookup (GHashTable *@var{hash_table}, gpointer @var{key})
254 @end deftypefun
256 @deftypefun void g_hash_table_freeze (GHashTable *@var{hash_table})
257 @end deftypefun
259 @deftypefun void g_hash_table_thaw (GHashTable *@var{hash_table})
260 @end deftypefun
262 @deftypefun void g_hash_table_foreach (GHashTable *@var{hash_table}, GHFunc @var{func}, gpointer @var{user_data})
263 @end deftypefun
265 @node Caches, Trees, Hash tables, Top
266 @comment node-name, next, previous, up
267 @chapter Cache handling
269 @subsection Functions
271 @deftypefun GCache* g_cache_new (GCacheNewFunc @var{value_new_func}, GCacheDestroyFunc @var{value_destroy_func}, GCacheDupFunc @var{key_dup_func}, GCacheDestroyFunc @var{key_destroy_func}, GHashFunc @var{hash_key_func}, GHashFunc @var{hash_value_func}, GCompareFunc @var{key_compare_func})
272 @end deftypefun
274 @deftypefun void g_cache_destroy (GCache *@var{cache})
275 @end deftypefun
277 @deftypefun gpointer g_cache_insert (GCache *@var{cache}, gpointer @var{key})
278 @end deftypefun
280 @deftypefun void g_cache_remove (GCache *@var{cache}, gpointer @var{key})
281 @end deftypefun
283 @deftypefun void g_cache_key_foreach (GCache *@var{cache}, GHFunc @var{func}, gpointer @var{user_data})
284 @end deftypefun
286 @deftypefun void g_cache_value_foreach (GCache *@var{cache}, GHFunc @var{func}, gpointer @var{user_data})
287 @end deftypefun
289 @node Trees, Memory, Caches, Top
290 @comment node-name, next, previous, up
291 @chapter Tree handling
293 @subsection Functions
295 @deftypefun GTree* g_tree_new (GCompareFunc @var{key_compare_func})
296 @end deftypefun
298 @deftypefun void g_tree_destroy (GTree *@var{tree})
299 @end deftypefun
301 @deftypefun void g_tree_remove (GTree *@var{tree}, gpointer @var{key}, gpointer @var{value})
302 @end deftypefun
304 @deftypefun gpointer g_tree_lookup (GTree *@var{tree}, gpointer @var{key})
305 @end deftypefun
307 @deftypefun void g_tree_traverse (GTree *@var{tree}, GTraverseFunc @var{traverse_func}, GTraverseType @var{traverse_type}, gpointer @var{data}
308 @end deftypefun
310 @deftypefun gpointer g_tree_search (GTree *@var{tree}, GSearchFunc @var{search_func}, gpointer @var{data})
311 @end deftypefun
313 @deftypefun gint g_tree_height (GTree *@var{tree})
314 @end deftypefun
316 @deftypefun gint g_tree_nnodes (GTree *@var{tree})
317 @end deftypefun
319 @node Memory, Timers, Trees, Top
320 @comment node-name, next, previous, up
321 @chapter Memory handling
323 @subsection Functions
325 @deftypefun gpointer g_malloc (gulong @var{size})
326 @end deftypefun
328 @deftypefun gpointer g_malloc0 (gulong @var{size})
329 @end deftypefun
331 @deftypefun gpointer g_realloc (gpointer @var{mem}, gulong @var{size})
332 @end deftypefun
334 @deftypefun void g_mem_profile (void)
335 @end deftypefun
337 @deftypefun void g_mem_check (gpointer @var{mem})
338 @end deftypefun
340 @deftypefun GMemChunk* g_mem_chunk_new (gchar *@var{name}, gint @var{atom_size}, gulong @var{area_size}, gint @var{type})
341 @end deftypefun
343 @deftypefun void g_mem_chunk_destroy (GMemChunk *@var{mem_chunk})
344 @end deftypefun
346 @deftypefun gpointer g_mem_chunk_alloc (GMemChunk *@var{mem_chunk})
347 @end deftypefun
349 @deftypefun void g_mem_chunk_free (GMemChunk *@var{mem_chunk}, gpointer @var{mem})
350 @end deftypefun
352 @deftypefun void g_mem_chunk_clean (GMemChunk *@var{mem_chunk})
353 @end deftypefun
355 @deftypefun void g_mem_chunk_reset (GMemChunk *@var{mem_chunk})
356 @end deftypefun
358 @deftypefun void g_mem_chunk_print (GMemChunk *@var{mem_chunk})
359 @end deftypefun
361 @deftypefun void g_mem_chunk_info (void)
362 @end deftypefun
364 @deftypefun void g_blow_chunks (void)
365 Not what you might be thinking, @code{g_blow_chunks()} simply compresses all 
366 the chunks. This operation consists of freeing every memory area that should
367 be freed (but which we haven't gotten around to doing yet).
368 @end deftypefun
370 @node Timers, Output, Memory, Top
371 @comment node-name, next, previous, up
372 @chapter Timer functions
374 @subsection Functions
376 @deftypefun GTimer* g_timer_new (void)
377 @end deftypefun
379 @deftypefun void g_timer_destroy (GTimer *@var{timer})
380 @end deftypefun
382 @deftypefun void g_timer_start (GTimer *@var{timer})
383 @end deftypefun
385 @deftypefun void g_timer_stop (GTimer *@var{timer})
386 @end deftypefun
388 @deftypefun void g_timer_reset (GTimer *@var{timer})
389 @end deftypefun
391 @deftypefun gdouble g_timer_elapsed (GTimer *@var{timer}, gulong *@var{microseconds})
392 @end deftypefun
394 @node Output, Utilities, Timers, Top
395 @comment node-name, next, previous, up
396 @chapter Output functions
398 @subsection Functions
400 @deftypefun void g_error (gchar *@var{format}, @dots{})
401 @end deftypefun
403 @deftypefun void g_warning (gchar *@var{format}, @dots{})
404 @end deftypefun
406 @deftypefun void g_message (gchar *@var{format}, @dots{})
407 @end deftypefun
409 @deftypefun void g_print (gchar *@var{format}, @dots{})
410 @end deftypefun
412 @node Utilities, Errors, Output, Top
413 @comment node-name, next, previous, up
414 @chapter Utility functions
416 @node Errors, String Chunks, Utilities, Top
417 @comment node-name, next, previous, up
418 @chapter Error handling
420 @node String Chunks, Strings, Errors, Top
421 @comment node-name, next, previous, up
422 @chapter String chunks
424 @node Strings, Resizable arrays, String Chunks, Top
425 @comment node-name, next, previous, up
426 @chapter String handling
428 @node Resizable arrays, GScanner, Strings, Top
429 @comment node-name, next, previous, up
430 @chapter Resizable arrays
432 @node GScanner, Miscellany, Resizable arrays, Top
433 @comment node-name, next, previous, up
434 @chapter Flexible lexical scanner
436 @node Miscellany, Function Index, GScanner, Top
437 @comment node-name, next, previous, up
438 @chapter Other stuff
440 @node Function Index, Concept Index, Miscellany, Top
441 @comment node-name, next, previous, up
442 @unnumbered Function Index
444 @printindex fn
446 @node Concept Index, , Function Index, Top
447 @comment node-name, next, previous, up
448 @unnumbered Concept Index
450 @printindex cp
452 @summarycontents
453 @contents 
454 @bye